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

How to combine two records to a single records


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

New User


Joined: 17 Jun 2009
Posts: 38
Location: Denver

PostPosted: Thu Sep 23, 2010 11:11 pm
Reply with quote

I have a file with even number records.
I want to combine every two lines to a single records

eg.

Input
-----
111111
222222
333333
444444

Output
--------
111111222222
333333444444

Can you please let me know how this can ebe done easily with SORT
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Thu Sep 23, 2010 11:24 pm
Reply with quote

manugeorge2004,
Please refer to Smart DFSort Tricks (Combine multiple records into one record)
ftp.software.ibm.com/storage/dfsort/mvs/sorttrck.pdf

For completion, assuming input file of FB 06.
Code:
//STEP01   EXEC  PGM=ICETOOL                                     
//TOOLMSG  DD SYSOUT=*                                           
//DFSMSG   DD SYSOUT=*                                           
//IN     DD *                                                   
111111                                                           
222222                                                           
333333                                                           
444444                                                           
//OUT DD SYSOUT=*                                               
//TOOLIN   DD *                                                 
SPLICE FROM(IN) TO(OUT) ON(13,8,ZD) WITHEACH KEEPNODUPS -       
    WITH(7,6) USING(CTL1)                                       
/*                                                               
//CTL1CNTL DD *                                                 
 INREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(13:ID=8,21:SEQ=2)),   
       IFTHEN=(WHEN=(21,2,ZD,EQ,2),OVERLAY=(7:1,6))             
 OUTFIL FNAMES=OUT,BUILD=(1,12)                                 
/*                                                               

OUTPUT
Code:
111111222222
333333444444


Thanks,
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 only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top