Page 1 of 1

Combine multiple record on key to single record

PostPosted: Wed Nov 06, 2013 5:17 pm
by mfnme
Hi All,

I have requirement to combine record on keys and make it a single record. The file can have either repeated record on key ( position 1 - 10) or record can be there without repeat also. When not repeated i need to retain record as it. There can only be maximum of 2 record per key. If repeated , then I need few fields from record2 to be taken to record1 and have a single record per key.

File size : 1000
Key position: 1 - 10
Out put files field : position 1 to 577 byte ----> retain from record 1
position 578 to 137 byte ----> from position 71 to 137 bytes from Record2
position 715 to 21 byte ----> retain from record 1
position 736 to 14 byte ----> from position 258 to 14 bytes from Record2
position 750 to 250 byte ----> retain from record 1

PLease help on this

Re: Combine multiple record on key to single record

PostPosted: Wed Nov 06, 2013 5:40 pm
by NicC
Please help us to help you by providing relevant information. If you read through several topics you will see the kind of information required.

Re: Combine multiple record on key to single record

PostPosted: Wed Nov 06, 2013 6:46 pm
by BillyBoyo
Can you please run this, and post the sysout from the step?

//S1 EXEC PGM=
//SYSOUT   DD SYSOUT=*
//SORTIN DD *
the value here does not matter, just want to see the sysout to determine your SORT level
/*
//SORTOUT DD DUMMY
//SYSIN   DD   *
  OPTION COPY
/*