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 Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm
No new posts Splitting of single report to seperat... abdulrafi TSO/ISPF 7 Mon Mar 27, 2017 3:59 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm


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