title: Use Stored Procedure OUT Parameter in Unix Script
body: <p>I have a ksh script that is directly Selecting a count from the database.  I am replacing this with a call with a stored procedure. My Stored Procedure selects into an OUT variable.</p>
  
  <p>How do I capture the OUT value into my data file as declared in my script?</p>
  
  <pre><code>    bteq &lt;&lt;EOF
  .RUN FILE $DBENV/1logon.txt
  .export data file=$PMRootDir/$FOLDER_NME/SessLogs/pdbasis_count.txt
  .set recordmode OFF;
  .set sidetitles OFF;
  .set titledashes off;
  
  #This Select Statement is being replaced by the Stored Procedure Call
  SELECT trim(COUNT(*))
  FROM [Removed]
  WHERE [Removed]
  
  .IF ERRORCODE &lt;&gt; 0 THEN .QUIT 11;
  
  .export reset;
  .logoff;
  .quit   
  </code></pre>
  
  <p>EOF</p>