****************************************************************                              
      * Defined Constants                                            *                              
      ****************************************************************                              
     D READ_ERROR      C                   CONST('[::ReadError::]')                                 
      ****************************************************************                              
      *//////////////////////////////////////////////////////////////*                              
      * #openStmf - Open Stream File                                 *                              
      *                                                              *                              
      * Path (Input) - Qualified path of stream file to open         *                              
      * InOpenMode (Optional) - Open mode                            *                              
      *   0 = Read Only (default)                                    *                              
      *   1 = Write Only                                             *                              
      *   2 = Read/Write                                             *                              
      *                                                              *                              
      * InTextData (Optional) - Open file as text file               *                              
      *   *OFF - Binary Data                                         *                              
      *   *ON - Text Data (default)                                  *                              
      *                                                              *                              
      * InAppend (Optional) - Open file in append mode               *                              
      *   *OFF - Overwrite (default)                                 *                              
      *   *ON - Append                                               *                              
      *                                                              *                              
      * InPublic (Optional) - Public file creation mode              *                              
      *   *OFF - Not Public (default)                                *                              
      *   *ON - Public                                               *                              
      *                                                              *                              
      * InInherit:                                                   *                              
      *   *OFF - Don't inherit authority                             *                              
      *   *ON - inherit authority (default)                          *                              
      *                                                              *                              
      * InCCSID:                                                     *                              
      * CCSID of the file if it's created or the CCSID of the file   *                              
      *  if just reading data.                                       *                              
      *                                                              *                              
      * InDtaCCSID:                                                  *                              
      * CCSID of data to fill file with.  0 is job CCSID.            *                              
      *                                                              *                              
      * Returns - File descriptor                                    *                              
      *//////////////////////////////////////////////////////////////*                              
     D #openStmf       PR            10i 0                                                          
     D  InPath                      256    Const                                                    
     D  InOpenMode                   10i 0 Const Options(*NOPASS)                                   
     D  InTextData                     N   Const Options(*NOPASS)                                   
     D  InAppend                       N   Const Options(*NOPASS)                                   
     D  InPublic                       N   Const Options(*NOPASS)                                   
     D  InInherit                      N   Const Options(*NOPASS)                                   
     D  InCCSID                      10i 0 Const Options(*NOPASS)                                   
     D  InDtaCCSID                   10i 0 Const Options(*NOPASS)                                   
      *                                                                                             
      *//////////////////////////////////////////////////////////////*                              
      * #closeStmf - Close Stream File                               *                              
      *                                                              *                              
      * InFD (Input) - File descriptor of file to close              *                              
      *//////////////////////////////////////////////////////////////*                              
     D #closeStmf      PR                                                                           
     D  InFD                         10i 0 Const                                                    
      *                                                                                             
      *//////////////////////////////////////////////////////////////*                              
      * #getStmfSize - Get Stream File Size                          *                              
      *                                                              *                              
      * InPath (Input) - Qualified path of file                      *                              
      * Returns - Size of File.  -1 if Error.                        *                              
      *//////////////////////////////////////////////////////////////*                              
     D #getStmfSize    PR            20i 0                                                          
     D  InPath                      256    Const                                                    
      *                                                                                             
      *//////////////////////////////////////////////////////////////*                              
      * #getStmfCP - Get Stream File Code Page                       *                              
      *                                                              *                              
      * InPath (Input) - Qualified path of file                      *                              
      * Returns - Code page of File.  -1 if Error.                   *                              
      *//////////////////////////////////////////////////////////////*                              
     D #getStmfCP      PR            10i 0                                                          
     D  InPath                      256    Const                                                    
      *                                                                                             
      *//////////////////////////////////////////////////////////////*                              
      * #getStmfCCSID - Get Stream File CCSID                        *                              
      *                                                              *                              
      * InPath (Input) - Qualified path of file                      *                              
      * Returns - Code page of File.  -1 if Error.                   *                              
      *//////////////////////////////////////////////////////////////*                              
     D #getStmfCCSID   PR            10i 0                                                          
     D  InPath                      256    Const                                                    
      *                                                                                             
      *//////////////////////////////////////////////////////////////*                              
      * #readStmf - Read Stream File                                 *                              
      *                                                              *                              
      * InFD (Input) - File descriptor of file to read               *                              
      * Buff@ (Input) - Pointer to buffer that will hold data read   *                              
      * BuffLen (Input) - Length of data availble in Buffer          *                              
      * Returns - Bytes Read                                         *                              
      *//////////////////////////////////////////////////////////////*                              
     D #readStmf       PR            10i 0                                                          
     D  InFD                         10i 0 Const                                                    
     D  Buff@                          *   Const                                                    
     D  BuffLen                      10i 0 Const                                                    
      *                                                                                             
      *//////////////////////////////////////////////////////////////*                              
      * #writeStmf - Write to Stream File                            *                              
      *                                                              *                              
      * InFD (Input) - File descriptor of file to write to           *                              
      * Buff@ (Input) - Pointer to buffer of data to write           *                              
      * BuffLen (Input) - Length of data to write                    *                              
      * Returns - Bytes Written                                      *                              
      *//////////////////////////////////////////////////////////////*                              
     D #writeStmf      PR            10i 0                                                          
     D  InFD                         10i 0 Const                                                    
     D  Buff@                          *   Const                                                    
     D  BuffLen                      10i 0 Const                                                    
      *                                                                                             
      *//////////////////////////////////////////////////////////////*                              
      * (#getStmf) Get Data From Stream File                         *                              
      *                                                              *                              
      * Notes: This will return a maximum of 64k bytes.              *                              
      *                                                              *                              
      * InFD (Input) - File descriptor of file to get data from      *                              
      * StmfData (Output) - Data read from stream file               *                              
      *//////////////////////////////////////////////////////////////*                              
     D #getStmf        PR                                                                           
     D  InFD                         10i 0 Const                                                    
     D  StmfData                  65535    Varying                                                  
      *//////////////////////////////////////////////////////////////*                              
      * (#getStmf2) Get Data From Stream File                        *                              
      *                                                              *                              
      * Notes: This will return a maximum of 102k bytes.             *                              
      *                                                              *                              
      * InFD (Input) - File descriptor of file to get data from      *                              
      * StmfData (Output) - Data read from stream file               *                              
      *//////////////////////////////////////////////////////////////*                              
     D #getStmf2       PR                                                                           
     D  InFD                         10i 0 Const                                                    
     D  StmfData                 102400    Varying                                                  
      *//////////////////////////////////////////////////////////////*                              
      * (#stmf_fileExists) Does the File exist?                      *                              
      *                                                              *                              
      * InPath - The fully qualified path to the file                *                              
      * Returns Boolean                                              *                              
      *//////////////////////////////////////////////////////////////*                              
     D #stmf_fileExists...                                                                          
     D                 PR              N                                                            
     D  InPath                      256    Const                                                    
      *//////////////////////////////////////////////////////////////*                              
      * #stmf_getAtt - Get Stream File Atribute                      *                              
      *//////////////////////////////////////////////////////////////*                              
     D #stmf_getAtt...                                                                              
     D                 PR          1024                                                             
     D  InPath                      256    Const                                                    
     D  attribute                   256    Varying Value