DSName Manipulation



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

DSName Manipulation

Postby gmosley » Tue Jul 12, 2011 11:14 pm

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?
gmosley
 
Posts: 15
Joined: Thu Sep 13, 2007 10:52 pm
Has thanked: 0 time
Been thanked: 0 time

Re: DSName Manipulation

Postby MrSpock » Tue Jul 12, 2011 11:37 pm

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 .... ?
User avatar
MrSpock
Global moderator
 
Posts: 807
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: DSName Manipulation

Postby Peter_Mann » Wed Jul 13, 2011 12:15 am

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
Peter
Peter_Mann
 
Posts: 145
Joined: Fri Jun 24, 2011 7:37 pm
Location: Lowell,AR
Has thanked: 15 times
Been thanked: 3 times


Return to JCL