Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multi Member

Status
Not open for further replies.

loonybin

Programmer
Dec 12, 2002
38
US
I've never dealt with a lot of multi-member files. I was given a task to read 2 members of the same file and from there do the selection. What I have in mind is to copy both members into 1 file and then access it. But that would mean doing it for both header and item files. Does anybody have any suggestions on how to deal with this a better way. Any advice is greatly appreciated. Thanks again.
 
Why do you say header and file items? Is this in a CL job that gets process frequently, or is this a run even now and then job? You could always do 2 cpyf statement to another summary file, and have both members in that one file, if that makes everything easier..
 
loonybin,

You could also just override the file to MBR(*ALL) and the file will process as if there were no seperate members. I too am curious about why you say "header" and "item" files. What are you trying to do?

MdnghtPgmr
 
On the F-specs, you can use the EXTMBR keyword. If you have two logicals over the same file with the same keys, put those in the F-specs with the EXTMBR keyword (rename one of the record formats, aso, with the RENAME keyword).

Then you can have both "members" in your RPG program as different files.

Me transmitte sursum, Caledoni!

 
On the F-specs, you can use the EXTMBR keyword. If you have two logicals over the same file with the same keys, put those in the F-specs with the EXTMBR keyword (rename one of the record formats, also, with the RENAME keyword).

Then you can have both "members" in your RPG program as different files.

Me transmitte sursum, Caledoni!

 
It would really helps if you can be more specific as to what you want to accomplish. Are you trying to separate the records into two files by record type?
 
Sorry for the confusion. I have a header and a detail files that are both multi-member. I tried copying both members of the header into 1 separate summary file and also did the same thing with the detail into a separate file also. Then I did my opnqry selection. That works. But now I found out about ADDLFM. This does let you define 2 or more members of the physical file into 1 view so I'm trying this command because it looks like this is a better way than copying the members into 1 summary file. Thanks for your responses.

Btw, I'm just curious with the EXTMBR keyword. I guess you can only specify 1 member then? that's going to be helpful for me too. Thanks that's good to know.

Happy Valentine's to you all!

 
With EXTMBR, you could use a variable as the parameter for the EXTMBR keyword, and close the file/change the member name/re-open the file, if you want, but I suspect it would be easier to just use two files and rename one of the record formats.

Sorry about the double post above - TT gave me an error when I submitted the post, and when I went to look at the thread to see if the post took, it was there twice!

Me transmitte sursum, Caledoni!

 
very interesting. Thank you for this. The software that my new job is using manages a lot of multimember files. I am not too familiar with ways of handling it.

Thank you again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top