View previous topic :: View next topic
|
Author |
Message |
ARIVUMR
New User
Joined: 21 Apr 2006 Posts: 11 Location: Chennai
|
|
|
|
I need to extract data from header record and insert in each trailer record till next header record comes.
eg
header record SSN
XXXXXXXdetail record ....
XXXXXXX details record...
trailer record
header record SSN
XXXXXXXdetail record
.......
....
i need to take SSN number from header and insert into in-front (XXXXXXX) of every detail record till next header record.
each header record has different ssn number so i need to insert ssn number in detail record from corresponding header record ssn.
finally remove all the header and trailer record.
Can any one please tell me the solution in ICETOOL or SORT?
advance thanks.
Thanks
Hari |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
You ask for an ICETOOL / SORT solution, but have posted in the JCL forum which is for SYNCSORT.
Please run the code below and post all of the SYSOUT JES segment to let us see the sort product and release level that you are using.
Code: |
//SORTSTEP EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABC
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY |
Also tell us the RECFM and LRECL of the input / output files, and the position, length and data format of the key fields. |
|
Back to top |
|
|
ARIVUMR
New User
Joined: 21 Apr 2006 Posts: 11 Location: Chennai
|
|
|
|
Thank you for immediate response..
My version of sort product is Z/OS DFSORT V1R10 .
input file is flat file and length is 200. extract data position from header record is 8 & length is 5 ( 8 to 12 ) its numeric character.
output file length 205 (flat file) and insert SSN in to detail record in first 5 position. totally 205 length of output file ( 5 (SSN) + 200 bytes of detail record).
Both are fixed block only.
Thanks
Hari |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
The reason I asked for the SYSOUT was that the DFSORT guys really like to see this line to show the release level
Code: |
ICE201I G RECORD TYPE IS F - DATA STARTS IN POSITION 1 |
|
|
Back to top |
|
|
ARIVUMR
New User
Joined: 21 Apr 2006 Posts: 11 Location: Chennai
|
|
|
|
Yes i submitted that code , its abend but when i see the sysout same msg displayed there like this :
ICE201I G RECORD TYPE IS F - DATA STARTS IN POSITION 1
do you want me to post that screen , i will do if you need ...
thanks hari |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
How do you identify a header record (e.g. it has 'H' in position 1)?
How do you identify a trailer record (e.g. it has 'T' in position 1)?
How do you identify a detail record (e.g. it has 'D' in position 1)? |
|
Back to top |
|
|
ARIVUMR
New User
Joined: 21 Apr 2006 Posts: 11 Location: Chennai
|
|
|
|
Thanks
header record identified by STATE starting first position length 5 after tat SSN number
detail record starting from 1 st position..
Trailer record starting with END from 1st position & length is 3 then noting...
Thanks
hari |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Your description of how to identify the different types of records is unclear. Please show an example and give a description that correspond to each other. |
|
Back to top |
|
|
|