Hi everyone!
I have an RPGLE program that creates four physical files (using the QCMDEXC program). These physical files have no DDS. In the same program, I read another physical file (that's a copy of a spool file). If the line (s) read met some specified criteria, it needs to be written to one of the four PF I've already created.
The question is: how can I write this line(s) to those PF, without using SQL?
Thanx in advance,
Meli
Software/Hardware used:
ASKED:
November 25, 2005 10:03 AM
UPDATED:
November 28, 2005 10:44 AM
can’t you use output (O) specications of RPG?
Yes, the F spec for the output files should look like:
Ffilename o f 132 disk usropn
You’ll also need to create the 4 files temporary so you can compile the program. Then your program logic should roughly look like this:
call qcmdexc to create file 1
call qcmdexc to create file 2
call qcmdexc to create file 3
call qcmdexc to create file 4
open file1
open file2
open file3
open file4
read inputfile
write file1 or file2 or file3 or file4
close file1
close file2
close file3
close file4
set on *inlr
I believe in order to use WRITE opcode with a pgm-described file, you must specify a data structure as the result field. Or if using free-format, its:
/free
write file1 dsfile1;
/end-free