× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I have the following code that is an attempt to read a physical file and
output the contents into a temporary PF. The temporary file doesn't
exist and when I try to open the second file (in hopes that it will
create the file) the return code is -1. Can a PF be created like this? 

D OpenFlag        S             10I 0
D OpenFlag2       S             10I 0
D FilNamPath      S            200A   VARYING
D FilNamPath2     S            200A   VARYING
D TempStmfFile    S            300A   VARYING
D RC              S             10I 0 
D RC2             S             10I 0
D RC3             S             10I 0
D StringVal       S           5000A

 /Free

  FilNamPath ='QSYS.LIB/'+ %Trim(inLibrary)+'.LIB/'+
                           %TRIM(inFile) +'.FILE/' +
                           %TRIM(inFile) +'.MBR' + x'00';
  OpenFlag = O_RDONLY;
  RC = Open(%Trim(FilNamPath):OpenFlag);

  TempStmfFile = 'QSYS.LIB/GGPRD.LIB/TMPSTMF.FILE/TMPSTMF.MBR' + x'00';
  OpenFlag2 = O_CREAT + O_RDWR + O_APPEND + O_TEXTDATA + O_CODEPAGE +
              S_IWUSR+S_IRUSR+S_IRGRP+S_IROTH;

  RC2=unlink(TempStmfFile);

  RC2 = Open(%Trim(TempStmfFile):OpenFlag2);

  RC3 = Read(RC:%Addr(StringVal):%Size(StringVal));




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.