Obtain current date and name a date set with it



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

Obtain current date and name a date set with it

Postby billy » Thu Feb 17, 2011 11:07 am

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)
billy
 
Posts: 5
Joined: Fri Dec 03, 2010 1:19 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby dick scherrer » Thu Feb 17, 2011 11:20 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

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

Postby billy » Thu Feb 17, 2011 11:35 am

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
billy
 
Posts: 5
Joined: Fri Dec 03, 2010 1:19 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby steve-myers » Thu Feb 17, 2011 11:59 am

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.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

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

Postby NicC » Thu Feb 17, 2011 12:17 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

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

Postby billy » Thu Feb 17, 2011 1:18 pm

hi dick/steve/Nicc.

Many thanks for your attention/help.
billy
 
Posts: 5
Joined: Fri Dec 03, 2010 1:19 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby dick scherrer » Thu Feb 17, 2011 1:25 pm

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                                   
@@   
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

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

Postby prino » Thu Feb 17, 2011 2:07 pm

Let the program dynamically allocate the data set, PL/I has built-in support for it, for COBOL I'd suggest you use Google.
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 635
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 28 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post