|
|
| Author |
Message |
kregen
New User
Joined: 16 Mar 2006 Posts: 14
|
|
|
|
Hello,
i want to merge the data of multi records in one dataset by key.
input dataset
RECL = 24
RECFM = FB
KEYL = 17 max Records per Key 400
Datalen = 7
inputdata
| Code: |
VSSZZZ6KZXR423833G PE2
VSSZZZ6KZXR423833G PH1
VSSZZZ6KZXR423833LAAUE0A
VSSZZZ6KZXR423833LABR1PA
VSSZZZ6KZXR423833LABV0Q0
WVWZZZ3BZYE190021LAED0DE
WVWZZZ3BZYE190021LAGM0GF
WVWZZZ3BZYE190021LAHV1D0
WVWZZZ3BZYE190032LGAB0L2
WVWZZZ3BZYE190032LGEN8GL
WVWZZZ3BZYE190032IGSPG0C
|
output dataset
RECL = 2833
RECFM = FB
1 record per key
outputdata
| Code: |
VSSZZZ6KZXR423833G PE2LAAUE0ALABR1PALABV0Q0
WVWZZZ3BZYE190021LAED0DELAGM0GFLAHV1D0
WVWZZZ3BZYE190032LGAB0L2LGEN8GLIGSPG0C
|
Is there a way to do this with DFSORT?
thanks for help
kregen |
|
| Back to top |
|
 |
References
|
Posted: Tue Jul 01, 2008 6:02 pm Post subject: Re: Join multi Records by key |
 |
|
|
 |
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 970 Location: Virginia, USA
|
|
|
|
What happened to
| Code: |
| "VSSZZZ6KZXR423833G PH1" |
? |
|
| Back to top |
|
 |
kregen
New User
Joined: 16 Mar 2006 Posts: 14
|
|
|
|
little correction for the outputdata
Hello,
i want to merge the data of multi records in one dataset by key.
input dataset
RECL = 24
RECFM = FB
KEYL = 17 max Records per Key 400
Datalen = 7
inputdata
| Code: |
VSSZZZ6KZXR423833G PE2
VSSZZZ6KZXR423833G PH1
VSSZZZ6KZXR423833LAAUE0A
VSSZZZ6KZXR423833LABR1PA
VSSZZZ6KZXR423833LABV0Q0
WVWZZZ3BZYE190021LAED0DE
WVWZZZ3BZYE190021LAGM0GF
WVWZZZ3BZYE190021LAHV1D0
WVWZZZ3BZYE190032LGAB0L2
WVWZZZ3BZYE190032LGEN8GL
WVWZZZ3BZYE190032IGSPG0C
|
output dataset
RECL = 2833
RECFM = FB
1 record per key
outputdata
| Code: |
VSSZZZ6KZXR423833G PE2G PH1LAAUE0ALABR1PALABV0Q0
WVWZZZ3BZYE190021LAED0DELAGM0GFLAHV1D0
WVWZZZ3BZYE190032LGAB0L2LGEN8GLIGSPG0C
|
Is there a way to do tis with ICETOOTL or DFSORT?
thanks for help
kregen |
|
| Back to top |
|
 |
Skolusu
DFSORT Developer
Joined: 07 Dec 2007 Posts: 242 Location: San Jose
|
|
|
|
kregen,
The following DFSORT JCL will give you the desired results. i just showed for a max of 8 records per key and you can adjust that to 400 records per key
| Code: |
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
VSSZZZ6KZXR423833G PE2
VSSZZZ6KZXR423833G PH1
VSSZZZ6KZXR423833LAAUE0A
VSSZZZ6KZXR423833LABR1PA
VSSZZZ6KZXR423833LABV0Q0
WVWZZZ3BZYE190021LAED0DE
WVWZZZ3BZYE190021LAGM0GF
WVWZZZ3BZYE190021LAHV1D0
WVWZZZ3BZYE190032LGAB0L2
WVWZZZ3BZYE190032LGEN8GL
WVWZZZ3BZYE190032IGSPG0C
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INREC IFTHEN=(WHEN=INIT,
OVERLAY=(25:SEQNUM,3,ZD,RESTART=(1,17),30:2800Z)),
IFTHEN=(WHEN=(25,3,ZD,EQ,001),OVERLAY=(0030:18,7)),
IFTHEN=(WHEN=(25,3,ZD,EQ,002),OVERLAY=(0037:18,7)),
IFTHEN=(WHEN=(25,3,ZD,EQ,003),OVERLAY=(0044:18,7)),
IFTHEN=(WHEN=(25,3,ZD,EQ,004),OVERLAY=(0051:18,7)),
IFTHEN=(WHEN=(25,3,ZD,EQ,005),OVERLAY=(0058:18,7)),
IFTHEN=(WHEN=(25,3,ZD,EQ,006),OVERLAY=(0065:18,7)),
IFTHEN=(WHEN=(25,3,ZD,EQ,007),OVERLAY=(0072:18,7)),
IFTHEN=(WHEN=(25,3,ZD,EQ,008),OVERLAY=(0079:18,7))
SORT FIELDS=(1,17,CH,A)
SUM FIELDS=(30,8,38,8,46,8,54,8,62,8,70,8,78,8),FORMAT=BI
OUTREC BUILD=(1,17,30,56,TRAN=ALTSEQ)
ALTSEQ CODE=(0040)
|
The output from this job is
| Code: |
VSSZZZ6KZXR423833G PE2G PH1LAAUE0ALABR1PALABV0Q0
WVWZZZ3BZYE190021LAED0DELAGM0GFLAHV1D0
WVWZZZ3BZYE190032LGAB0L2LGEN8GLIGSPG0C
|
|
|
| Back to top |
|
 |
kregen
New User
Joined: 16 Mar 2006 Posts: 14
|
|
|
|
very big thanks for your help...
it works as i like it....
have a nice day
kregen |
|
| Back to top |
|
 |
|
|
|