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 

Can someone share a utility to stack files to tape?

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


Joined: 29 Oct 2003
Posts: 9
Topics: 7

PostPosted: Wed Feb 04, 2004 11:35 am    Post subject: Can someone share a utility to stack files to tape? Reply with quote

Hello ,
We have lot of sequential files with the naming convention starting with LAV.BUP.*.MAT and we want to backkup these files to tape to reclaim some space. We have no tool to generate the JCL such that the datasets will be stacked on Tapes.

Is there any method for doing this and be able to stack datasets?
Can anybody help me on this..THis has to be done soon

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


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

PostPosted: Wed Feb 04, 2004 12:11 pm    Post subject: Reply with quote

Okonita,

What exactly do you mean stacking? Let us say you have 3 files

Contents of : LAV.BUP.FILE1.MAT
Code:

AAAA
BBBB


Contents of : LAV.BUP.FILE2.MAT
Code:

CCCC
DDDD


Contents of : LAV.BUP.FILE3.MAT
Code:

EEEE
FFFF


Now do you want to stack these 3 files into a single file like this?

Code:

AAAA
BBBB
CCCC
DDDD
EEEE
FFFF


For the above case all you need is to concatenate all the files to a DD and just use an utility ( sort, file-aid, iebgener, idcams...)

or

Do you want each indivual file copied to a file onto a tape, and have all files stacked to a volume?

ex:
Code:

//STEP0100 EXEC PGM=IEBGENER                               
//SYSUT1   DD DSN=LAV.BUP.FILE1.MAT,
//            DISP=SHR                                     
//SYSUT2   DD DSN=Tape.LAV.BUP.FILE1.MAT,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=TAPE,               
//            LABEL=(01,SL),VOL=(,RETAIN)                   
//SYSIN    DD DUMMY                                         
//SYSPRINT DD SYSOUT=*                                     
//*                                                         
//STEP0200 EXEC PGM=IEBGENER                               
//SYSUT1   DD DSN=LAV.BUP.FILE2.MAT,
//            DISP=SHR                                     
//SYSUT2   DD DSN=Tape.LAV.BUP.FILE2.MAT,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=TAPE,               
//            LABEL=(02,SL),VOL=(,,REF=*.STEP0100.SYSUT2)
//SYSIN    DD DUMMY                                         
//SYSPRINT DD SYSOUT=*                                     
//*                                                         
//STEP0300 EXEC PGM=IEBGENER                               
//SYSUT1   DD DSN=LAV.BUP.FILE3.MAT,
//            DISP=SHR                                     
//SYSUT2   DD DSN=Tape.LAV.BUP.FILE3.MAT,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=TAPE,               
//            LABEL=(03,SL),VOL=(,,REF=*.STEP0200.SYSUT2)
//SYSIN    DD DUMMY                                         
//SYSPRINT DD SYSOUT=*                                     
//*                                           


In the above case each file will be stacked to the volume.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Okonita
Beginner


Joined: 29 Oct 2003
Posts: 9
Topics: 7

PostPosted: Wed Feb 04, 2004 2:53 pm    Post subject: Reply with quote

Yes, Kolosu, I want to copy the files to tape and stack it to a volume, which is the second example you gave. I could (and may well have to) manually do that if I didn't to do it for over 200 datasets.

I am interested in a utility that can generate the JCL as you have showed it including especially the Labe= and Vol= parameters.

I hope someone can help.

Thanks again
Back to top
View user's profile Send private message
Mike
Beginner


Joined: 03 Dec 2002
Posts: 114
Topics: 0
Location: Sydney, Australia

PostPosted: Wed Feb 04, 2004 3:39 pm    Post subject: Reply with quote

Another alternative would be to utilise one of the backup utilities such as DFSDSS. This has the advantage of not requireing labels, seperate steps, perhaps speed, and ease of use.

Here's an example :-

Code:

//DMI021XX JOB UD228542026,'?????????',CLASS=A,                         
//             MSGCLASS=X,NOTIFY=&SYSUID                               
//S010     EXEC PGM=ADRDSSU                                             
//SYSPRINT  DD SYSOUT=*                                                 
//OUT01     DD DSN=TS99G.MITRE.BACKUP(+1),DISP=(,CATLG),UNIT=TAPEC,     
//             EXPDT=99000                                             
//SYSIN     DD *                                                       
  DUMP DS( -                                                           
  INCLUDE(DPRD#G.TSC.MIT%TABS,DPRD#G.TSC.ISP%LIB,DPRD#G.TSC.LOADLIB) - 
  ) OUTDD(OUT01) TOL(ENQF)                                             


This example will backup all datasets that are named DPRD#G.TSC.MIT?TABS (where ? can be any character) and all datasets that are named DPRD#G.TSC.ISP?LIB (again where ? represents any character) and finally the dataset DPRD#G.TSC.LOADLIB).

In your case the control statements may be :-

DUMP DS( -
INCLUDE(LAV.BUP.*.MAT ) -
) OUTDD(OUT01) TOL(ENQF)


You use the restore utility to recover the datasets, again an example (based upon the backups taken in the first example :-

Code:

//MITHK999 JOB UD228542026,'?????????',CLASS=A,                       
//             MSGCLASS=X,NOTIFY=&SYSUID                               
//*--------------------------------------------------------------------
//ST010    EXEC PGM=ADRDSSU                                           
//*                                                                   
//*        RECOVER A MITRE DATASET                                     
//*                                                                   
//SYSPRINT  DD SYSOUT=*                                               
//INDD      DD DSN=TS99G.MITRE.BACKUP(0),DISP=SHR                     
//SYSIN     DD *                                                       
  RESTORE DATASET(INCLUDE(DPRD#G.TSC.ISPCLIB)) IDD(INDD) -             
   RENUNC(DPRD#G.TSC.*,DMI021.OLD.*)                                   
//*--------------------------------------------------------------------


This example recovers the dataset DPRD#G.TSC.ISPCLIB, however it recovers it with the name DMI021.OLD.ISPCLIB.
_________________
Regards,
Mike.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Feb 04, 2004 3:41 pm    Post subject: Reply with quote

Okonita,
The following JCl will give you the desired results. I am assuming that all your output tape files will have the following naming convention.
Code:

TAPE.LAV.BUP.*.MAT


A brief explanation of the job.

Step0100 creates the listcat info for the datasets matching the pattern LAV.BUP.*.MAT
Step0200 takes in the listcat info and creates a dynamic jcl steps for all the file names.

Step0300 just creates a job which will submitted via INTRDR to copy all the datasets stacking them on to a single volume.

Code:

//STEP0100 EXEC PGM=IKJEFT01                         
//*                                                   
//SYSTSPRT DD DSN=&L,                                 
//            DISP=(,PASS),                           
//            SPACE=(CYL,(1,1),RLSE),                 
//            DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)       
//SYSTSIN  DD *                                       
  LISTCAT ENT('USERID.*.TEST') NAME                 
//*
//STEP0200 EXEC  PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD DSN=&L,DISP=(OLD,DELETE)                             
//T1       DD DSN=&T1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)         
//T2       DD DSN=&T2,DISP=(,PASS),SPACE=(CYL,(5,5),RLSE)         
//SYSIN    DD *                                                   
  SORT FIELDS=COPY                                                 
  INCLUDE COND=(1,7,CH,EQ,C'NONVSAM')                             
  OUTFIL FNAMES=T1,ENDREC=1,                                       
  OUTREC=(C'//STEP0000 EXEC PGM=IEBGENER',/,                       
          C'//SYSUT1   DD DISP=SHR,DSN=',17,44,/,                 
          C'//SYSUT2   DD DISP=(NEW,CATLG,DELETE),'/,             
          C'//            UNIT=TAPE,',/,                           
          C'//            LABEL=(01,SL),VOL=(,RETAIN),',/,         
          C'//            DSN=TAPE.',17,44,/,                     
          C'//SYSIN    DD DUMMY',/,                               
          C'//SYSPRINT DD SYSOUT=*',/,                             
          C'//*',80:X)                                             
  OUTFIL FNAMES=T2,STARTREC=2,                                     
  OUTREC=(C'//STEP',SEQNUM,4,ZD,C' EXEC PGM=IEBGENER',/,           
          C'//SYSUT1   DD DISP=SHR,DSN=',17,44,/,                 
          C'//SYSUT2   DD DISP=(NEW,CATLG,DELETE),'/,             
          C'//            UNIT=TAPE,',/,                           
          C'//            LABEL=(',SEQNUM,3,ZD,START=2,C',SL),',   
          C'VOL=(,,REF=*.STEP',SEQNUM,4,ZD,START=0,C'.SYSUT2),',/,
          C'//            DSN=TAPE.',17,44,/,                     
          C'//SYSIN    DD DUMMY',/,                               
          C'//SYSPRINT DD SYSOUT=*',/,                             
          C'//*',80:X)                                             
//*                                                               
//STEP0300 EXEC  PGM=SORT                 
//SYSOUT   DD SYSOUT=*                   
//SYSIN    DD *                           
   SORT FIELDS=COPY                       
/*                                       
//SORTOUT  DD SYSOUT=*                   
//SORTIN   DD DATA,DLM=$$                 
//TIDXXXXA JOB 'COPY',                   
//             CLASS=A,                   
//             MSGCLASS=Y,               
//             MSGLEVEL=(1,1),           
//             NOTIFY=TID                 
//*                                       
$$                                       
//         DD DSN=&T1,DISP=(OLD,PASS)     
//         DD DSN=&T2,DISP=(OLD,PASS)     
//*                                       

Now take a look at the output from Step0300 and you will see the JCL which is generated.

Change the sortout statement in step0300 to the following which will actually submit the job.
Code:

//SORTOUT  DD SYSOUT=(*,INTRDR)             


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
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Feb 04, 2004 3:42 pm    Post subject: Reply with quote

Okonita,

I prefer's Mike solution as it is very simple

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Okonita
Beginner


Joined: 29 Oct 2003
Posts: 9
Topics: 7

PostPosted: Wed Feb 04, 2004 8:50 pm    Post subject: Reply with quote

To you all good people, I thank you for the invaluable suggestions. I now know what to do...again, thanks

Okonita
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