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 

Merging files stored in a file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
kris_mf
Beginner


Joined: 07 Feb 2005
Posts: 8
Topics: 6
Location: Chennai

PostPosted: Thu Feb 10, 2005 4:18 am    Post subject: Merging files stored in a file Reply with quote

Hi,
We have requirement to merge all the input files to a single PS file.The input files are stored in a PS file like:
TST.CTS.SAMPLE.DATA1 has the input files :

HSI.RQ32251.AA001.CMF
HSI.RQ32251.AA002.CMF...... these are the input files.

Client requesting not to use a rexx program to concatenate these data sets.

Pls suggest me how can acheive this . Can we do it in SORT..?


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


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

PostPosted: Thu Feb 10, 2005 8:38 am    Post subject: Reply with quote

kris_mf,

The following JCL will give you the desired results. I assumed that all the files to be copied as a single dataset are of the same lrecl. A brief explanation of the job. The first step reads in your pds member with dsnames to be copied and creates a concatenation list to copied.

The second step creates a dynamic job and submits it to the INTRDR.


Code:

//STEP0100 EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD DSN=YOUR.PDS(DSNAME LIST),
//            DISP=SHR
//T1       DD DSN=&T1,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)
//T2       DD DSN=&T2,DISP=(,PASS),SPACE=(CYL,(X,Y),RLSE)
//SYSIN    DD *                                         
  SORT FIELDS=COPY                                       
  OUTFIL FNAMES=T1,ENDREC=1,                             
  OUTREC=(C'//SORTIN',2X,C' DD DISP=SHR,DSN=',           
          1,44,                                         
          80:X)                                         
  OUTFIL FNAMES=T2,STARTREC=2,                           
  OUTREC=(C'//',8X,C' DD DISP=SHR,DSN=',                 
          1,44,                                         
          80:X)                                         
/*                                                       
//STEP0200 EXEC  PGM=SORT                   
//SYSOUT   DD SYSOUT=*                     
//SYSIN    DD *                             
  SORT FIELDS=COPY                         
//SORTOUT  DD SYSOUT=(*,INTRDR)                     
//SORTIN   DD DATA,DLM=$$                   
//TIDXXXXA JOB 'COPY',                     
//             CLASS=A,                     
//             MSGCLASS=Y,                 
//             MSGLEVEL=(1,1),             
//             NOTIFY=TID                   
//*                                         
//COPYSTEP EXEC  PGM=SORT                   
//SYSOUT   DD SYSOUT=*                     
//SORTOUT  DD DSN=YOUR MERGE OF ALL FILE,       
//            DISP=(NEW,CATLG,DELETE),     
//            UNIT=SYSDA,                   
//            SPACE=(CYL,(X,Y),RLSE)       
//SYSIN    DD *                             
 SORT FIELDS=COPY                           
/*                                         
$$                                         
//         DD DSN=&T1,DISP=(OLD,PASS)       
//         DD DSN=&T2,DISP=(OLD,PASS)       
/*                                         


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 -> Job Control Language(JCL) 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