Runqry on Multi format LF

0 pts.
Tags:
RPG
If I do a runqry on multi format logical file, will it only show me the records from the first physical file and not the combilned records??
ASKED: June 29, 2005  6:44 AM
UPDATED: June 29, 2005  9:03 AM

Answer Wiki

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

If you specify the file within the QRYFILE parameter on the RUNQRY command then you have to define the member that you want to use. The default value is *FIRST which will pick up the first created member in the file.

If you are only specifying the QRY parameter on the RUNQRY command then the file used will be that defined in the query definition, again the member name is picked up at definition time and defaults to *FIRST.

As an aside, one other thing to be aware of when defining files in queries is that if during the query creation you specify *LIBL as the library name, the system will replace *LIBL with the name of the library in the library list containing the file. When you later run the query, the query will look for that occurrence of the file, and not the version in the library list.

This is usually of concern where you develop a query over, say, FILEA in DEVDTALIB and then try to run the query over a production library list that has FILEA in PRDDTALIB. Unless the QRYFILE(*LIBL/FILEA) is specified on the RUNQRY command the data returned will be from DEVDTALIB.

All the best

Jonathan

Discuss This Question: 2  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
  • AS400programmer
    Yes, one format at a time for each file, however you can list the file again with a different format name joining by a common field between the two formats. You could all use the physicals behind the logical. File . . . . . . . . . SHOPORD Name, F4 for list Library . . . . . . BPCSUSRF Name, *LIBL, F4 for list Member . . . . . . . . *FIRST Name, *FIRST, F4 for list Format . . . . . . . . RSOHEAD Name, *FIRST, F4 for list File ID . . . . . . . T01 A-Z99, *ID File . . . . . . . . . SHOPORD Name, F4 for list Library . . . . . . BPCSUSRF Name, *LIBL, F4 for list Member . . . . . . . . *FIRST Name, *FIRST, F4 for list Format . . . . . . . . RSONOTE Name, *FIRST, F4 for list File ID . . . . . . . T02 A-Z99, *ID
    0 pointsBadges:
    report
  • WaltZ400
    If you are using only the RUNQQY command using QRYFILE without specifying a named query, unfortunately this will only display the first format (or PF) in the logical. You can define a query in WRKQRY and specify a format to use from the logical file, but again you will be reading only one of the formats you specify. If you are expecting to read all formats in a combined fashion from this logical file, the only way I know to do this is in an RPG program.
    655 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