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 

Multiple dataset copy into a single dataset using sort

 
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
KM
Beginner


Joined: 22 Jul 2004
Posts: 18
Topics: 8

PostPosted: Thu Apr 28, 2005 10:34 am    Post subject: Multiple dataset copy into a single dataset using sort Reply with quote

Have searched for anything similar to this, but with no luck.
Is it possible to copy a bunch of datasets that all have similar names like this:
AAA.I.LIA850.A1
Only difference is the ending (not sure what it is technically called)

They could look like this:
AAA.I.LIA850.A1.A001
AAA.I.LIA850.A1.A002
AAA.I.LIA850.A1.B222
AAA.I.LIA850.A1.A112

Can you copy these datasets to one dataset (using regular SORT) by using an asterisk instead of e.g. A001 in the first example, so dataset would look like this AAA.I.LIA850.A1.* ?

I don't know whether I am way out on a limb here, so your input is much appreciated....

Thanks,

/KM
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Apr 28, 2005 1:21 pm    Post subject: Reply with quote

KM,

The following JCL will give you the desired results.

Code:

//*****************************************************************
//* THE FOLLOWING STEP GIVES A LISTCAT INFO OF THE LEVEL          *
//*****************************************************************
//STEP0100 EXEC PGM=IKJEFT01                                       
//SYSTSPRT DD DSN=&L,DISP=(,PASS),SPACE=(CYL,(1,2),RLSE),         
//            RECFM=FB,LRECL=80                                   
//SYSPRINT DD SYSOUT=*                                             
//SYSIN    DD DUMMY                                               
//SYSTSIN  DD *                                                   
   LISTCAT LEVEL('AAA.I.LIA850.A1') NAME                           
/*                               
//******************************************************************
//* THE FOLLOWING STEP CREATES THE DYNAMIC SORTIN  STATEMENTS      *
//******************************************************************
//STEP0200 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DSN=&L,DISP=(OLD,DELETE)                     
//T1       DD DSN=&T1,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE) 
//T2       DD DSN=&T2,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE) 
//SYSIN    DD *                                           
  SORT FIELDS=COPY                                         
  INCLUDE COND=(1,7,CH,EQ,C'NONVSAM')                     
  OUTFIL FNAMES=T1,ENDREC=1,                               
  OUTREC=(C'//SORTIN',2X,C' DD DISP=SHR,DSN=',             
          17,44,                                           
          80:X)                                           
  OUTFIL FNAMES=T2,STARTREC=2,                             
  OUTREC=(C'//',8X,C' DD DISP=SHR,DSN=',                   
          17,44,                                           
          80:X)                                           
/*       
//******************************************************************
//* THE FOLLOWING STEP CREATES THE DYNAMIC JCL                     *
//******************************************************************
//STEP0300 EXEC  PGM=ICEMAN                             
//SYSOUT   DD SYSOUT=*                                   
//SYSIN    DD *                                         
  OPTION COPY                                           
//SORTOUT  DD SYSOUT=*                                   
//SORTIN   DD DATA,DLM=$$                               
//YOUR-TID JOB 'COPY',                                   
//             CLASS=A,                                 
//             MSGCLASS=Y,                               
//             MSGLEVEL=(1,1),                           
//             NOTIFY=&SYSUID                           
//*                                                     
//STEP0100 EXEC  PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                   
//SORTOUT  DD DSN=YOUR OUTPUT ALL DSNCOPY,                       
//            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)                   
/*


Run the above JCL and a take a look at the output from step0300. Once you are satisfied that you have generated the right JCL, change the following line ste0300

Code:

//SORTOUT  DD SYSOUT=*   


To
Code:

//SORTOUT  DD SYSOUT=(*,INTRDR)


This will once again submit the generated JCL

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
KM
Beginner


Joined: 22 Jul 2004
Posts: 18
Topics: 8

PostPosted: Fri Apr 29, 2005 1:32 pm    Post subject: Reply with quote

Advanced stuff !
Thanks a lot !

/KM
Back to top
View user's profile Send private message
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