Display output of RPG program in physical file

15 pts.
Tags:
Physical File
RPG
I want to display output of my RPG program in a new physical file. How can I do that?

Answer Wiki

Thanks. We'll let you know when a new response is added.
If you are referring to printed output, create a flat file with a length equal to your spool file definition. Then when you job is done you can use CPYSPLF and copy it to the flat file   ex.  CPYSPLF    FILE(QSYSPRT) TOFILE(QTEMP/WORK132).  If you want to do it the had way, eliminate the spool from your program and replace it with the flat file. Then you need to define each printed line as a data structure, then move that to the filed name in your flat file.
Or just override the spooled file directly to the flat file.

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.
  • azohawk
    Create the physical file with all of the fields that need. In your RPG program, specify the file for output. Copy the generated data into the fields of the physical file and write to the file.
    2,565 pointsBadges:
    report
  • ToddN2000
    You mentioned a "new physical file". If that is the case and you want the output going to 2 data files, just add the new file to the F specs, and everywhere you are currently outputting the date to the original, add a secondwrite command. If this new file is to replace the old one temporarily, try using the OVRDBF as long as the record and field names are the same.
    82,110 pointsBadges:
    report
  • bvining
    "display output of my RPG program" is way too broad/vague. What type of output is the RPG program currently generating (as it could be to a display, to a spool file, to a database file, to a communications session, etc)?
    7,070 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.

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

Following

Share this item with your network: