On my systems, I use the ADRDSSU utility to back-up my file systems daily, and I put a date in the output file name. Now, putting the current date or time in an output dataset name is not an intuitive option on a z/OS system....but there is a TCP/IP installation and configuration utility that can be used for system symbol substitution, EZACFSM1.
This utility, EZACFSM1, can be placed as a surrounding job for your backup JCL
//STEP0100 EXEC PGM=EZACFSM1
//SYSOUT DD SYSOUT=(A,INTRDR),DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD DATA,DLM=@@
all your ADRDSSU jobs can go between STEP0100 and the end delimiter of @@
@@
So what we have is basically a shell where we can enter our backup JCL. I put every file system to be backed up in a separate job so that they all run at the same time. The jobs entered between the SYSIN DD DATA,DLM=@@ and the ending @@ will have system symbols substituted for variables in the JCL. See example below:
//BUSYSAS JOB (XXXX,9350),'J LANG',
// CLASS=S,
// MSGCLASS=G,SCHENV=SYSA,
// NOTIFY=JLANG1
//STEP0100 EXEC PGM=EZACFSM1
//SYSOUT DD SYSOUT=(A,INTRDR),DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD DATA,DLM=@@
//BUSYSAD JOB (DDC06),'JLANG1 ',CLASS=S,MSGCLASS=G,NOTIFY=&SYSUID,
// SCHENV=SYSA
//*
//DUMP1 EXEC PGM=ADRDSSU
//SYSPRINT DD SYSOUT=*
//OUT DD DSN=&&TEMP,DISP=(,PASS),
// SPACE=(CYL,(800,10),RLSE)
DUMP OUTDD(OUT) ALLDATA(*) SHARE OPT(4) TOL(ENQF) -
DATASET (INCLUDE(OMVS.SYSA.WAS71.SYSADM.CONFIG.HFS))
/*
//REST1 EXEC PGM=ADRDSSU
//SYSPRINT DD SYSOUT=*
//IN DD DSN=&&TEMP,DISP=(OLD,DELETE)
RESTORE DATASET (INCLUDE(OMVS.SYSA.WAS71.SYSADM.CONFIG.HFS)) INDD(IN) -
TOL(ENQF) -
RENAMEU(OMVS.SYSA.WAS71.SYSADM.CONFIG.HFS, -
OMVS.SYSA.WAS71.SYSADM.CONFIG.HFS.D&LYYMMDD)
/*
//DUMP2 EXEC PGM=ADRDSSU
//SYSPRINT DD SYSOUT=*
//OUT DD DSN=&&TEMP,DISP=(,PASS),
// SPACE=(CYL,(800,10),RLSE)
DUMP OUTDD(OUT) ALLDATA(*) SHARE OPT(4) TOL(ENQF) -
DATASET (INCLUDE(OMVS.SYSA.WAS71.SYSADM.CONFIG.HFS.D&LYYMMDD))
/*
//* DELETE THE 'COPYTO' (NEWNAMED) FILE
//DELETE1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE OMVS.SYSA.WAS71.SYSADM.CONFIG.HFS.D&LYYMMDD
/*
//*
//REST2 EXEC PGM=ADRDSSU
//SYSPRINT DD SYSOUT=*
//IN DD DSN=&&TEMP,DISP=(OLD,DELETE)
//OUT DD DSN=OMVS.SYSA.WAS71.SYSADM.CONFIG.HFS.D&LYYMMDD,
// SPACE=(CYL,(800,10,1),RLSE,CONTIG),DISP=(,CATLG),
// DSNTYPE=HFS
RESTORE -
DATASET (INCLUDE(OMVS.SYSA.WAS71.SYSADM.CONFIG.HFS.D&LYYMMDD)) -
INDD(IN) TOL(ENQF) REPLACE
/*
@@
In the JCL listed above......2 jobs will be submitted.....the first, BUSYSAS (In Blue) will prepare the JCL for BUSYSAD by replacing the &LYYMMDD symbol with the current local date. The symbols table can be displayed so you can see what options you have available for use. In order to display the system symbols....you can add a REXX script, SYMDEF to your system REXX library (see below)
SYMDEF:
/* REXX *** */
SAY 'JOBNAME = 'MVSVAR('SYMDEF','JOBNAME')
/* GMT TIME */
SAY 'YYMMDD = 'MVSVAR('SYMDEF','YYMMDD')
SAY 'DAY = 'MVSVAR('SYMDEF','DAY')
SAY 'HR = 'MVSVAR('SYMDEF','HR')
SAY 'JDAY = 'MVSVAR('SYMDEF','JDAY')
SAY 'MIN = 'MVSVAR('SYMDEF','MIN')
SAY 'MON = 'MVSVAR('SYMDEF','MON')
SAY 'SEC = 'MVSVAR('SYMDEF','SEC')
SAY 'HHMMSS = 'MVSVAR('SYMDEF','HHMMSS')
SAY 'WDAY = 'MVSVAR('SYMDEF','WDAY')
SAY 'YR2 = 'MVSVAR('SYMDEF','YR2')
SAY 'YR4 = 'MVSVAR('SYMDEF','YR4')
/* LOCAL TIME */
SAY 'LYYMMDD = 'MVSVAR('SYMDEF','LYYMMDD')
SAY 'LDAY = 'MVSVAR('SYMDEF','LDAY')
SAY 'LHR = 'MVSVAR('SYMDEF','LHR')
SAY 'LJDAY = 'MVSVAR('SYMDEF','LJDAY')
SAY 'LMIN = 'MVSVAR('SYMDEF','LMIN')
SAY 'LMON = 'MVSVAR('SYMDEF','LMON')
SAY 'LSEC = 'MVSVAR('SYMDEF','LSEC')
SAY 'LHHMMSS = 'MVSVAR('SYMDEF','LHHMMSS')
SAY 'LWDAY = 'MVSVAR('SYMDEF','LWDAY')
SAY 'LYR2 = 'MVSVAR('SYMDEF','LYR2')
SAY 'LYR4 = 'MVSVAR('SYMDEF','LYR4')
/* ADD YOUR OWN SYMBOLIC VARIABLES HERE */
SAY 'SYSR2 = 'MVSVAR('SYMDEF','SYSR2')
EXIT 0
Now, executing the SYMDEF REXX script will produce a symbols report:
Note: If local date and time are needed,
these are preceded by an “L”.
JOBNAME = JLANG1
YYMMDD =
070627
DAY = 27
HR = 14
JDAY = 178
MIN = 12
MON = 06
SEC = 52
HHMMSS = 141252
WDAY = WED
YR2 = 07
YR4 = 2007
LYYMMDD = 070627
LDAY = 27
LHR = 09
LJDAY = 178
LMIN = 12
LMON = 06
LSEC = 52
LHHMMSS = 091252
LWDAY = WED
LYR2 = 07
LYR4 = 2007
SYSR2 = T7YTA2This technique can be used for any job where you would like to have a date/time included in the output dataset name without having to change it every time......the substitution is done automatically by the EZACFSM1 utility.
Happy programming!!!
No comments:
Post a Comment