How to create an output file

45 pts.
Tags:
AS400 iseries
AS400 output file
I have 5 DB files and i need to create an output file(RPG) which will contain all the reports present in DB files.Can you pls xplain me the logic and if possible an sample code.

Answer Wiki

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

Thank you for visiting ITKE.

We are happy to help you with solving specific IT questions, but need as
much information as possible to do so. Let us know about the problem you
are trying to solve, how you are approaching it and what work you’ve
done so far, and we can help guide you in the right direction.

Discuss This Question: 11  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
  • deepu9321
    Pinky, I would like to know what you exactly mean for 'Output File'. Would you like to write the records from 5 Database file to One File(Printer File)? If you would like to write to Printer file and if you are making any calculations before writing to Output file, You will need to Read the DB files and do the required Operations and write into Output File. More Description of the problem will be helpful for getting the Detailed answer. Pradeep.
    3,870 pointsBadges:
    report
  • philpl1jb
    We help you, we don't do it for you. 1. Answers to Charlie Brows questions 2. Please provide us with an outline of your plan 3. Please provide the code you have to-date. Phil
    50,415 pointsBadges:
    report
  • Copinky
    No, I am new to this field All the 5 files are relational they contain different fields. I just need to create an output file using RPG which will retrive all the fields data present in the files.
    45 pointsBadges:
    report
  • deepu9321
    Then you can simply Read the Data from Database Files to Output file. Basic Read & Write Operation will be fine.
    READ FILE1
    DOW NOT %EOF()
    //Move Required fields
    WRITE OUTFILE
    READ FILE1
    ENDDO
    You can repeat the same for 5 Database files. Hope, this info will help you in making the program. As, you are new, If you need more info, let us know. Pradeep.
    3,870 pointsBadges:
    report
  • Copinky
    Do i need to indicators for reading the files?
    45 pointsBadges:
    report
  • Copinky
    Do i need to add indicators for reading the files?
    45 pointsBadges:
    report
  • deepu9321
    Indicators are mainly used for identifying the EOF(End of File). If you are using RPG, You will need to use Indicators for identification of End Of File. If you are using RPGILE, There will be no need to use indicators. You can use %EOF() Built-In-Function for identifying End of File. Pradeep.
    3,870 pointsBadges:
    report
  • philpl1jb
    All the 5 files are relational they contain different fields relational, ok, arre the files related Should you be creating a row from one followed by rows from other files? Phil
    50,415 pointsBadges:
    report
  • philpl1jb
    You will need to create an output file with fields for the stuff coming from the 5 input files. What would that look like? You could either create the output file by creating a pf member in QDDSSRC or with an SQL Create Table command. Phil
    50,415 pointsBadges:
    report
  • TomLiotta
    All the 5 files are relational they contain different fields. If the input contains different fields in different files, how are you intending to define a single file that contains each of those fields? This doesn't seem appropriate for RPG at all. Why are you wanting to use RPG? Why not use a tool that can do the job? In fact, what exactly is the task that needs to be done? It doesn't make much sense to just take records from five different files and put them all into a single file. Much more info needs to be given. Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    We've been getting a lot of really poorly planned requests. Sometimes they seem so technically challenging we've offered up extraordinary solutions. It doesn't help that these requests come from time zones that make chatting difficult. A critical part of our real jobs is generating/clarifying/verifying the real issue. Isn't this a skill that we should be teaching? Phil
    50,415 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