MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Merge different LRECL files to a single file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
deepeshk79
Beginner


Joined: 20 Jun 2003
Posts: 112
Topics: 48
Location: Bangalore

PostPosted: Tue Jul 27, 2004 2:43 am    Post subject: Merge different LRECL files to a single file Reply with quote

Hi All,

I have 3 files, one with lrecl 20, the 2nd one with lrecl 65 the third with lrecl = 30. I need to merge all these files into one with lrecl = 65.

This can be done by first converting lrecl 20 file to lrecl =65 by padding spaces in the end of each record and so on...but then this involves multiple steps.

Can we do this in one single sort step??

Something like

Code:


//STEP01   EXEC PGM=SORT                             
//SYSOUT   DD SYSOUT=*                               
//SYSPRINT DD SYSOUT=*                               
//SORTIN   DD DSN=file1,DISP=SHR  (lrecl=20)     
//         DD DSN=file2,DISP=SHR       (lrecl=65)
//         DD DSN=file3,DISP=SHR       (lrecl=30)
//SORTOUT  DD DSN=output file,                   
//     DISP=(NEW,CATLG,DELETE),                       
//     SPACE=(CYL,(3,5),RLSE),                       
//     DCB=(LRECL=65,RECFM=VB,BLKSIZE=0)             
//SYSIN    DD *                                       
  SORT FIELDS=COPY   
 Some other parameters.....                               
/*                                               
     




Thanks,
Deepesh
Back to top
View user's profile Send private message AIM Address
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue Jul 27, 2004 4:45 am    Post subject: Reply with quote

Deepesh,

The following DFSORT/ICETOOL JCL will give you desired results. If you syncsort at your shop then change the pgm name to synctool.Make sure that you have DISP=MOD for the Output dataset.

Code:

//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*                               
//DFSMSG   DD SYSOUT=*                               
//IN1      DD DSN=YOUR LRECL OF 20 FILE,
//            DISP=SHR
//IN2      DD DSN=YOUR LRECL OF 30 FILE,
//            DISP=SHR
//IN3      DD DSN=YOUR LRECL OF 65 FILE,
//            DISP=SHR
//OUT      DD DSN=output file,                   
//            DISP=(MOD,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
//TOOLIN   DD *
  COPY FROM(IN1) TO(OUT) USING(CTL1)
  COPY FROM(IN2) TO(OUT) USING(CTL2)
  COPY FROM(IN3) TO(OUT)
//CTL1CNTL DD *
  OUTREC FIELDS=(1,20,     $ COPY 20 BYTES AS IS FROM IN1
                 65:X)     $ PAD SPACES UPTO 65 BYTES
//CTL2CNTL DD *
  OUTREC FIELDS=(1,30,     $ COPY 30 BYTES AS IS FROM IN2
                 65:X)     $ PAD SPACES UPTO 65 BYTES
/*                             


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group