View previous topic :: View next topic
|
Author |
Message |
pshongal
New User
Joined: 14 Jun 2012 Posts: 96 Location: India
|
|
|
|
Hi,
I have a requirement to split records in 3 files, but problem is I need to get Detail and Trailer record in the same file after splitting
E.g: Say I have a file as below.
Code: |
115892150 20181109REF1 13 $10.00
115892168 20181109REF2 13 $11.00
115892176 20181109REF3 13 $12.00
ID 0111 <<-Trailer rec
115892184 20181109REF4 13 $13.00
115892192 20181109REF5 13 $14.00
ID 0012 <<-Trailer rec
115892200 20181109REF6 13 $15.00
115892218 20181109REF7 13 $16.00
115892226 20181109REF8 13 $17.00
115892234 20181109REF9 13 $18.00
115892242 20181109REF10 13 $19.10
ID 1223 <<-Trailer rec
|
If I am splitting the file with 5 records in each file, file contain records as below
File-1
Code: |
115892150 20181109REF1 13 $10.00
115892168 20181109REF2 13 $11.00
115892176 20181109REF3 13 $12.00
ID 0111 <<-Trailer rec
115892184 20181109REF4 13 $13.00
|
File-2
Code: |
115892192 20181109REF5 13 $14.00
ID 0012 <<-Trailer rec
115892200 20181109REF6 13 $15.00
115892218 20181109REF7 13 $16.00
115892226 20181109REF8 13 $17.00
|
File-3
Code: |
115892234 20181109REF9 13 $18.00
115892242 20181109REF10 13 $19.10
ID 1223 <<-Trailer rec
|
Here the trailer record of a corresponding detail records is not in same file. I am flexible with number of records in each file, But I need trailer rec in same file.
Thanks a lot. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
If I remember correctly, you would need to read the DFSORT smart tricks document. I think what you want will be in there - it usually is in one guise or another
ftp.software.ibm.com/storage/dfsort/mvs/sorttrck.pdf
The article starting on page 46 will give some help in grouping records with trailers as it happens from the example.
Or maybe page 60 - 5 ways to split a dataset.
The document is must read for DFSORT hints, tips and solutions.
So ..... let us know what you have tried, showing us your code, and the results and I am sure that our sort wizards will help you on from there if you have any problems |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
Back to top |
|
|
|