Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Join multi Records by key

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
kregen

New User


Joined: 16 Mar 2006
Posts: 18

PostPosted: Tue Jul 01, 2008 6:02 pm    Post subject: Join multi Records by key
Reply with quote

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

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Jul 01, 2008 6:09 pm    Post subject:
Reply with quote

What happened to
Code:
"VSSZZZ6KZXR423833G   PH1"
?
Back to top
View user's profile Send private message
kregen

New User


Joined: 16 Mar 2006
Posts: 18

PostPosted: Tue Jul 01, 2008 6:11 pm    Post subject: Re: Join multi Records by key
Reply with quote

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

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Jul 01, 2008 10:46 pm    Post subject:
Reply with quote

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

New User


Joined: 16 Mar 2006
Posts: 18

PostPosted: Wed Jul 02, 2008 12:30 pm    Post subject: Reply to: Join multi Records by key
Reply with quote

very big thanks for your help...

it works as i like it....

have a nice day

kregen
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us