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

Join multi Records by key


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kregen

New User


Joined: 16 Mar 2006
Posts: 21

PostPosted: Tue Jul 01, 2008 6:02 pm
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
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: 21

PostPosted: Tue Jul 01, 2008 6:11 pm
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
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: 21

PostPosted: Wed Jul 02, 2008 12:30 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top