Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 query to fetch record which has only ... maxsubrat DB2 8 Mon Dec 11, 2017 5:03 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 1 Wed Dec 06, 2017 1:50 am
No new posts Can we combine the rows with same key... V S Amarendra Reddy DB2 12 Fri Dec 01, 2017 10:29 pm
No new posts Formatting using DFsort Guru Nandu DFSORT/ICETOOL 5 Thu Nov 30, 2017 7:33 am
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us