| IBM MAINFRAME HELP & SUPPORT FORUMS Technical Forums for IBM Mainframe Applications like COBOL, JCL, CICS, DB2, FileAid, DFSORT, Endevor, Xpediter, CoolGen, CA-7&11, AbendAid, IMS, IDMS, PL/I, MqSeries, SyncSort, Assembler, ChangeMan, Easytrieve, InterTest, REXX, CLIST etc...
|
| View previous topic :: View next topic |
| Author |
Message |
kregen
Joined: 16 Mar 2006
Posts: 14
|
| Posted: Tue Jul 01, 2008 6:02 pm Post subject: Join multi Records by key |
|
|
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 |
|
Craq Giegerich
Joined: 19 May 2007
Posts: 1001
Location: Virginia, USA
|
| Posted: Tue Jul 01, 2008 6:09 pm Post subject: |
|
|
| What happened to Code: "VSSZZZ6KZXR423833G PH1" ? |
|
| Back to top |
|
kregen
Joined: 16 Mar 2006
Posts: 14
|
| Posted: Tue Jul 01, 2008 6:11 pm Post subject: Re: Join multi Records by key |
|
|
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
Joined: 07 Dec 2007
Posts: 357
Location: San Jose
|
| Posted: Tue Jul 01, 2008 10:46 pm Post subject: |
|
|
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
Joined: 16 Mar 2006
Posts: 14
|
| Posted: Wed Jul 02, 2008 12:30 pm Post subject: Reply to: Join multi Records by key |
|
|
very big thanks for your help...
it works as i like it....
have a nice day
kregen |
|
| Back to top |
|
| |
THIS IS AN ARCIVE FORUM IN READ ONLY MODE. IF YOU WANT TO ASK YOUR DOUBTS USE THE ACTUAL FORUM
|