IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

extract data from header record


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ARIVUMR

New User


Joined: 21 Apr 2006
Posts: 11
Location: Chennai

PostPosted: Fri Oct 22, 2010 1:32 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Oct 22, 2010 1:46 pm
Reply with quote

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
View user's profile Send private message
ARIVUMR

New User


Joined: 21 Apr 2006
Posts: 11
Location: Chennai

PostPosted: Fri Oct 22, 2010 2:30 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Oct 22, 2010 2:45 pm
Reply with quote

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
View user's profile Send private message
ARIVUMR

New User


Joined: 21 Apr 2006
Posts: 11
Location: Chennai

PostPosted: Fri Oct 22, 2010 3:09 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Oct 22, 2010 11:19 pm
Reply with quote

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
View user's profile Send private message
ARIVUMR

New User


Joined: 21 Apr 2006
Posts: 11
Location: Chennai

PostPosted: Tue Oct 26, 2010 2:26 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Oct 26, 2010 8:27 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
Search our Forums:

Back to Top