write in a PF file

20 pts.
Tags:
CLP
RPG
RPG ILE
RPGLE
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi

In your RPGLE program you need to specify the file as program described and include the keyword USROPN on the File spec.

After you have created the file you can then open it using the OPEN operation and write to it as normal.

All the best

Jonathan

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • JPPLOU
    can't you use output (O) specications of RPG?
    125 pointsBadges:
    report
  • RickMe
    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
    110 pointsBadges:
    report
  • RussK1
    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
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following