Page 1 of 1

Obtain current date and name a date set with it

PostPosted: Thu Feb 17, 2011 11:07 am
by billy
hi Guys,

hope someone can help,thanks in advance.

description:
allocate a new data set in the daily job, and name this date set with current date , e.g: "svrb.msi.20110217.SEQ"
here is my question:
how to get the current date and name the new date set with this date?


//STEP010 EXEC PGM=IEFBR14,COND=(0,NE)
//DD1 DD DSN=SVRB.MSI.YYYYMMDD.SEQ,
// DISP=(NEW,CATELG,DELETE),
// DCB=(LREC=80,RECFM=FB,BLKSIZE=0),
// SPACE=(TRK,(50,100),RLSE)

Re: how to obtain the current date and name a date set with

PostPosted: Thu Feb 17, 2011 11:20 am
by dick scherrer
Hello,

Suggest you start over with a valid dataset name. . . The one posted is a JCL error.

Then you might use EZACFSM1 to obtain the info you want. As one of your system support if you may use this and they will possibly also have sample jcl that works on your system.

Re: how to obtain the current date and name a date set with

PostPosted: Thu Feb 17, 2011 11:35 am
by billy
hi D.S,

could you pls provide a sample for EZACFSM1 ? I never used it before, and can't find it in my manual.

thanks
billy

Re: how to obtain the current date and name a date set with

PostPosted: Thu Feb 17, 2011 11:59 am
by steve-myers
As Dick Scherrer says, your proposed dataset name is not valid: each index level in a dataset name must start with an alphabetic or "national" character: something like Dyymmdd would work, though that dataset name is not Y2K compliant.

Like you, I'm not familiar with EZACFSM1. I recall finding its documentation a couple of years ago, something I'm not about to repeat now. If I were doing this task I'd write a small Rexx exec to build the dataset name and use the TSO ALLOCATE command to allocate the dataset.

Inserting a date into a dataset name has never been part of mainframe culture. Mainframe types tend to use generation data groups for this type of dataset processing, though that does not work well when FTP is being used.

Re: how to obtain the current date and name a date set with

PostPosted: Thu Feb 17, 2011 12:17 pm
by NicC
I believe EZACFSM1 is part of OPC/TWS - but I could well be wrong here! However, I believe most, if not all, scheduling systems can do the substitution that you want but you still have to decide on the format of the date within your dataset name so that it is valid.

Re: how to obtain the current date and name a date set with

PostPosted: Thu Feb 17, 2011 1:18 pm
by billy
hi dick/steve/Nicc.

Many thanks for your attention/help.

Re: how to obtain the current date and name a date set with

PostPosted: Thu Feb 17, 2011 1:25 pm
by dick scherrer
Hello,

Read here:
http://publib.boulder.ibm.com/infocente ... /head6.htm

The following retrieves JOB info (and was run tonight):
//* ********************************************************
//STEP0001 EXEC PGM=EZACFSM1                               
//SYSIN    DD   *                                           
STATUS (&JOBNAME)                                           
/*            SPACE=(TRK,0)                                 
//SYSOUT   DD   DSN=&&T1,DISP=(,PASS),UNIT=VIO             
//* ********************************************************
//STEP0002 EXEC PGM=IKJEFT01                               
//SYSTSPRT DD   SYSOUT=*                                   
//SYSTSIN  DD   DSN=&&T1,DISP=(OLD,DELETE)                 
//   


I just found this on the internet but have not tested it. It looks similar to what you want (not counting the chopped date). . .
//STEP0100 EXEC PGM=EZACFSM1                                         
//SYSOUT    DD SYSOUT=(*,INTRDR)                                     
//SYSIN     DD DATA,DLM=@@                                           
//ABAB77V2 JOB (0400,PT,PES),                                       
//             'VIJAY',                                             
//             CLASS=C,                                             
//             MSGCLASS=X,                                           
//             NOTIFY=&SYSUID                                       
//STEPK1   EXEC PGM=IEBGENER                                         
//SYSPRINT DD SYSOUT=*                                               
//SYSUT1   DD DSN=ABAB.TX.SND.SQUS0001.SI,DISP=SHR                   
//SYSUT2   DD DSN=ABAB.TX.SND.SQUS0001.SI.D&LYYMMDD..T&LHHMMSS,     
//            DISP=(,CATLG,DELETE),                               
//            SPACE=(CYL,(2,2),RLSE)               
//SYSIN   DD  DUMMY                                   
@@   

Re: how to obtain the current date and name a date set with

PostPosted: Thu Feb 17, 2011 2:07 pm
by prino
Let the program dynamically allocate the data set, PL/I has built-in support for it, for COBOL I'd suggest you use Google.