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
 

 

How to combine two records to a single records

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

New User


Joined: 17 Jun 2009
Posts: 35
Location: Denver

PostPosted: Thu Sep 23, 2010 11:11 pm    Post subject: How to combine two records to a single records
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: 578
Location: USA

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

manugeorge2004,
Please refer to Smart DFSort Tricks (Combine multiple records into one record)
ftp://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    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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Two Selects in a single select query Rohit Umarjikar DB2 1 Fri Nov 04, 2016 8:46 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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