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
 

 

Copy two files of different record lengths

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
thala_ds

New User


Joined: 05 Jun 2012
Posts: 18
Location: India

PostPosted: Fri Oct 12, 2012 11:05 am    Post subject: Copy two files of different record lengths
Reply with quote

Hi,

I have a requirement of copying 2 files having different lrecls. We are taking a daily backup of files. We need to add the date at the beginning of the file before taking a backup. The date will be received in another file. I need to merge both the files so that the date will be added at the beginning of the backup file.

I have to do this for 5 files which has different lrecls ie, 550,650,717,800 etc.

I tried the below SYNCTOOL and it worked fine. But i need a generic sort tool so that i don't need to specify the lrecls everytime i copy the files.

Code:
//S010     EXEC PGM=SYNCTOOL
//DFSMSG   DD SYSOUT=*
//TOOLMSG  DD SYSOUT=*
//IN         DD DSN=FILE1.DATE,DISP=SHR   ====> Input date file
//T1         DD DSN=&T1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)
//CON      DD DSN=&T1,DISP=(OLD,PASS),VOL=REF=*.T1
//            DD DSN=FILE2.DATA,DISP=SHR ====> Input data file
//OUT      DD  DSN=FILE.OUTPUT, ====> Merged Output file
//             DISP=(,CATLG),SPACE=(CYL,(1,1),RLSE)
//TOOLIN   DD *
  COPY FROM(IN)  USING(CTL1)
  COPY FROM(CON) TO(OUT)
//CTL1CNTL DD *
  OUTFIL FNAMES=T1,
  OUTREC=(C'PROCESSING DATE :',1,10,600:X) === > Here 600 is the LRECL .
/*

Hope i explained clearly. Please advise .

Thanks.

Code'd
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7255

PostPosted: Fri Oct 12, 2012 11:49 am    Post subject: Reply to: Copy two files of different record lengths
Reply with quote

SyncSort questions live in the JCL forum, not the DFSORT forum.

If you search the JCL forum for SYMNAMES you will find several examples of using a symbol to get data (often a date) from a single-record file.

The technique uses two steps, one being very tiny which generates a symbol-name with the value from the file. This goes to a, typically temporary, dataset and can be used in the main processing step.

If you use HEADER1 on OUTFIL (with REMOVECC) you should be able to get the correct record-length without having to "know" it. Thus the same two steps will suffice for all your datasets.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm


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