Override with database file ovrdbf
There may be others ways, but I am going to describe:. This is the most common way I have seen people coping with multiple members. Line 1: If am writing RPG you know it is going to be totally free format.
I use the RENAME keyword record formats of the two files as they cannot have the same name, and to make the member names more descriptive of the file they belong to. I am using the PREFIX keyword to make the fields from each file have unique names, if I did not the fields from both of the files would have the same names which could lead to confusion.
If you want to learn more about these keywords see the post Useful keywords for file definitions. Lines 4 — 6: This section of code is very simple, move values to the fields and write to the record format for the fifth member. If I had to define the files in fixed format RPG they would look like:. Lines 2 and 3: If you notice that are two keywords in the definition that were not in the previous example:. I cannot stipulate the member I want to use in the common SQL statements.
Once the Alias is created I can use it as I would any other table or file. Line 2: Here I define my Alias. If you are on an interview and you asked this question now you can offer these three solutions to the interviewer to show that you know more than one way to handle multi member files. With "Define the member in the files' definition", it's not practical to hard-code the member name in the RPG program's file specifications.
People will want to pass the member name as a parameter. It might be worth a try creating a logical file over the source file by pretending that the source file is an ordinary physical file with three fields in it. It's a miracle of modern technology that some of these fsckwits still draw breath, much less a paycheck.
Must admit multiformatted logical was first thought, but no access to check if feasible I'm afraid. Just create each source physical file from the same DDS source; e.
There is no function of common data management to override the external format name, because the different name suggests a different [possibly incompatible] format. When the operating system is called on to run a program, it has to go through certain preliminary steps, one of which is resolving all file references.
Does anybody use C for report generation? Call your program. You should see the output from your program. Check the output produced by your job. If one or more overrides are in effect for the file NAME, the operating system will apply them. The system used the database override to direct printer output to a printer file. The reason David found this oddity was that he needed to make a change to the override.
Click here to contact Ted Holt by e-mail. All rights reserved. Covered by US Patent. Come for the solution, stay for everything else. Welcome to our community! Now this jobs runs sice months with no problem What happened today is when it ran it took 45 min against 1 min which it takes everyday.
Regards Prashant Patel.
0コメント