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.
Software/Hardware used:
ASKED:
December 16, 2011 2:34 PM
UPDATED:
February 28, 2012 2:56 PM
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.
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
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.
Then you can simply Read the Data from Database Files to Output file.
Basic Read & Write Operation will be fine.
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.
Do i need to indicators for reading the files?
Do i need to add indicators for reading the files?
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.
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
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
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
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