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
 

 

DFSORT - Combine two records to One record

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

Active User


Joined: 13 Jul 2005
Posts: 136

PostPosted: Fri Oct 29, 2010 2:51 pm    Post subject: DFSORT - Combine two records to One record
Reply with quote

Hi All,

I need to combine first record(Odd) and second record(even) to One record in entrie file. As mentoned below example

Here's below format

Input File:
AAAAAAAAAAAAAAAAAAAAAAA...(Length- 100)
BBBBBBBBBBBBBBBBBBBBBBB...(length -100)
CCCCCCCCCCCCCCCCCCCCC..(length -100)
DDDDDDDDDDDDDDDDDDDDD..(length -100)
-------------------------------------
-------------------------------------
Output file

AAAAAAAAAAAAAAAAAAAAAAA...BBBBBBBBBBBBBBBBBBBBBBB(Len-200)
CCCCCCCCCCCCCCCCCCCCC..DDDDDDDDDDDDDDDDDDDDD..(Len-200)
------------------------------------------
-----------------------------
Could you please help me
Back to top
View user's profile Send private message

sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Fri Oct 29, 2010 7:14 pm    Post subject:
Reply with quote

vicky10001,

If you have the Oct, 2010 DFSORT PTF available (which I don't have), you can use below:

Code:

//STEP01   EXEC PGM=ICETOOL                       
//FB100     DD DSN=...  input file (FB/100)                                 
//FB200     DD DSN=...  output file (FB/200)                         
//TOOLIN    DD *                                 
 RESIZE FROM(FB100) TO(FB200) TOLEN(200)         
/*                                               
//TOOLMSG   DD  SYSOUT=*                         
//DFSMSG    DD  SYSOUT=*                         


If you don't have latest PTF installed, then use below...
Code:

//STEP01   EXEC  PGM=ICETOOL                                           
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*     
//IN     DD DSN=...  input file (FB/100)                                 
//OUT   DD DSN=...  output file  (FB/200)                                                 
//TOOLIN   DD *                                                         
SPLICE FROM(IN) TO(OUT) ON(102,1,CH) WITHANY KEEPNODUPS -               
    WITH(103,100) USING(CTL1)                                           
/*                                                                     
//CTL1CNTL DD *                                                         
 INREC IFTHEN=(WHEN=INIT,OVERLAY=(100:X)),                             
       IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(101:SEQ=1,102:ID=1)),         
       IFTHEN=(WHEN=(101,1,ZD,EQ,2),OVERLAY=(103:1,100))               
 OUTFIL FNAMES=OUT,REMOVECC,                                           
     BUILD=(1,100,103,100)                                             
/*                                                                     


Thanks,
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Oct 29, 2010 11:58 pm    Post subject:
Reply with quote

The RESIZE operator is the best way, but if you don't have the Oct, 2010 PTF, you can do it with WHEN=GROUP like this (you don't need SPLICE):

Code:

//STEP01   EXEC  PGM=SORT                                       
//SYSOUT  DD SYSOUT=*                                           
//SORTIN     DD DSN=...  input file (FB/100)                       
//OUT DD DSN=...  output file (FB/200)     
//SYSIN  DD *                                                   
 OPTION COPY                                                   
 INREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(101:1,100,201:SEQ=1))
 OUTFIL FNAMES=OUT,INCLUDE=(201,1,ZD,EQ,2),                     
     BUILD=(101,100,1,100)                                     
/*                                                     
Back to top
View user's profile Send private message
vicky10001
Warnings : 1

Active User


Joined: 13 Jul 2005
Posts: 136

PostPosted: Mon Nov 01, 2010 11:40 am    Post subject: Reply to: DFSORT - Combine two records to One record
Reply with quote

Yes. Its working find. Thank You very much!!!!!!!!!!
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 Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 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


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