I have two files. A one to many relationship. I need to have an merge the files so that the output file has one record with the record for the 'many' concatdacted.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
robert, galambos,
Please ALL of the following questions
1. What is the LRECL and RECFM of File1?
2. What is the LRECL and RECFM of File2?
3. What is the position,length and format of the key in file1?
4. What is the position,length and format of the key in file2?
5. What is the position, length and format of the name field you want to merge in file1?
6. What is the position, length and format of the name field you want to merge in file2?
7. What is the max number of duplicates you expect for each key?
8. Last but not least , please run the following job and show us the entire sysout so that we can determine the level of DFSORT your shop has
I can say that there is ICEman at the site but cAn only provide the information on tuesday as its a holiday in the UK on monday
File 1 repersents customer record
File two reoersents type of accounts the customer has
Thanks for your help
robert, galambos,
Something doesn't make sense here. You said the FILE 2 Key position is 49 PS length 13 and the position, length and format of the name field you want to merge in file2 is 53,2,C
They are overlapping fields. Please post the correct positions and also sample data from both input files and desired output.
And there are no duplicates in file one. Only one customer record/number. The key on both files
File 1
Code:
0001 aaaaa
0003 bbbbb
0006 cccccc
File 2
Code:
0001 vv
0001 ff
0001 gg
0006 vv
Output
Code:
0001 aaaaa vv ff gg
0006 cccccc vv
One to many
No dups in file 1
If no records in file 2 then no output record
For every file one, customer record, will have at least one record in file 2 (account type record) however not the other way around. You can not have a account type record without an customer record. And this is the type of records I am working on.
It does not need to be exact as I can take the ball and run with it. But an idea/direction would be great.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Use the following DFSORT JCL which will give you the desired results. Since your file2 is a VB file , you need to accound the RDW making the positions you mentioned 4 bytes greater. So the key in VB file actually starts in position 53 and the values you want are in position 77.