Page 1 of 1

DSName Manipulation

PostPosted: Tue Jul 12, 2011 11:14 pm
by gmosley
We’re trying to set up a batch job that will append a datestamp to a dataset name.
For example:

//S0 EXEC PGM=EMCSRDF
//SYSPRINT DD DSN=STRG.SRDF.INVTRKS.JUL09.@1408,
// STORCLAS=BASE,MGMTCLAS=MEDIUM,
// DISP=(,CATLG),
// SPACE=(TRK,(15,15),RLSE),
// DCB=(RECFM=FBA,LRECL=133,BLKSIZE=0)
//SYSIN DD *
EMC-SQ VOL,44FA,INV_TRKS
/*

When we run this job, we hard code JUL09.@1408 to the end of the SYSPRINT dataset.
Is there a way to have the JCL automatically add the datestamp name? Any special techniques anyone can suggest?

Re: DSName Manipulation

PostPosted: Tue Jul 12, 2011 11:37 pm
by MrSpock
gmosley wrote:Any special techniques anyone can suggest?


- Have your job scheduling system add the value(s) as it submits the job.
- Pass your JCL through a pre-processor of some sort to add the value(s) before it gets submitted.
- Use a possible combination of a JCL INCLUDE and/or SET statement to set the value(s) as variables.
- Programatically dynamically allocate the dataset name and call your process.
- Create a follow-up step that uses the RENAME (TSO) command or ALTER (IDCAMS) command to rename a static dataset to a new name with the value(s) specified.

Beyond these, it would really help to know what is an acceptable method for both your and your shop's expectations and standards. I'd think that using scheduler variables would be the most ideal solution, but since you haven't stated why you're not doing that process already .... ?

Re: DSName Manipulation

PostPosted: Wed Jul 13, 2011 12:15 am
by Peter_Mann
gmosley wrote:We’re trying to set up a batch job that will append a datestamp to a dataset name.
For example:

//S0 EXEC PGM=EMCSRDF
//SYSPRINT DD DSN=STRG.SRDF.INVTRKS.JUL09.@1408,
// STORCLAS=BASE,MGMTCLAS=MEDIUM,
// DISP=(,CATLG),
// SPACE=(TRK,(15,15),RLSE),
// DCB=(RECFM=FBA,LRECL=133,BLKSIZE=0)
//SYSIN DD *
EMC-SQ VOL,44FA,INV_TRKS
/*

When we run this job, we hard code JUL09.@1408 to the end of the SYSPRINT dataset.
Is there a way to have the JCL automatically add the datestamp name? Any special techniques anyone can suggest?



George, I think you can find one suggestion back on IBM-L where you posted the question there..
also, if you have a scheduling package, we use ESP, you can substitue symbols, static or otherwise
here is what I've done with ESP

%ESPSMM%ESPSDD%ESPSYY..%ESPATIME..TXT
to create a file date stamped 071211.144500.txt
Peter