How to assign System Date/Time to a parameter in a JCL pgm?

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

narinder4075
Member
Posts: 7
Joined: Tue Apr 14, 2009 9:01 pm
Location: Kolkata

How to assign System Date/Time to a parameter in a JCL pgm?

Post by narinder4075 » Tue Apr 14, 2009 9:16 pm

How to assign System Date/Time to a parameter in a JCL program?

Example:

// SET TSTAMP=<system date/time>
// EXEC PGM=IEFBR14
// DD DSN=MY.PS.&TSTAMP,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=800),
// SPACE=(TRK,(1,1))

How to assign system date/time to TSTAMP in this JCL?

Thanks in Advance!!!

Narinder.

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Wed Apr 15, 2009 2:32 pm

Hi Narinder and welcome to the Forums,

If I understood correctly - you want to add the "system data/time" as LLQ to your DSN?
Regards,
Anuj

User avatar
Natarajan
Moderator
Posts: 537
Joined: Fri Oct 10, 2008 12:57 pm
Location: chennai
Contact:

Creating the PS with current date as a qualifier

Post by Natarajan » Wed Apr 15, 2009 6:05 pm

Following code will generate a sequential file (PS) with current date as a qualifier.

Code: Select all

//CURDATE JOB &#40;XXXX,XXX&#41;,'RUNJCL',CLASS=S,MSGCLASS=S,       
//         NOTIFY=&SYSUID,REGION=4096K                          
//STEP00   EXEC PGM=EZACFSM1                                   
//SYSOUT   DD SYSOUT=&#40;*,INTRDR&#41;                                 
//SYSIN    DD DATA,DLM=@@                                       
//CURDATEC1 JOB &#40;xxxx,xxxx&#41;,'RUNJCL',CLASS=S,MSGCLASS=S,        
//         NOTIFY=&SYSUID,REGION=4096K                          
//STEP01   EXEC PGM=IEFBR14
//SYSUT2   DD  DSN=XXX.XXX.XXX.DATE&LYYMMDD,       
//             DISP=&#40;NEW,CATLG,DELETE&#41;,                         
//             UNIT=SYSDA,RECFM=FB,LRECL=80,                    
//             SPACE=&#40;CYL,&#40;1,1&#41;,RLSE&#41;                           
@@                                                       
-> File XXX.XXX.XXX.DATE080205 will get created
Last edited by Natarajan on Fri Apr 17, 2009 10:21 am, edited 1 time in total.
Natarajan
Chennai

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Wed Apr 15, 2009 6:32 pm

golly, learn something new everyday.
the nodes of a DSN can be greater than 8 char.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

narinder4075
Member
Posts: 7
Joined: Tue Apr 14, 2009 9:01 pm
Location: Kolkata

Post by narinder4075 » Wed Apr 15, 2009 9:11 pm

Hi Anuj,

Yes!!! I want that whenever this kind of job run, then it generates a PS with a timestamp as LLQ.
Thanks,
Narinder.

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Thu Apr 16, 2009 2:21 pm

Hi Narinder,

If so then you can use the job from Natarajan after changing this

Code: Select all

//SYSUT2   DD  DSN=XXX.XXX.XXX.DATE&LYYMMDD,
to

Code: Select all

//SYSUT2   DD  DSN=XXX.XXX.XXX.D&LYYMMDD,
Regards,
Anuj

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Re: Creating the PS with current date as a qualifier

Post by Anuj Dhawan » Thu Apr 16, 2009 2:29 pm

Natarajan wrote:File DRAL.CP000000.FFB.DATE080205 will get created
I would like to believe it was written mistakenly... :)
Regards,
Anuj

User avatar
Natarajan
Moderator
Posts: 537
Joined: Fri Oct 10, 2008 12:57 pm
Location: chennai
Contact:

Post by Natarajan » Thu Apr 16, 2009 3:57 pm

You are correct anuj. it was a typo. it will place the current date.
Natarajan
Chennai

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Thu Apr 16, 2009 6:11 pm

Natarajan wrote: it will place the current date.
We are not on same track I think - this
DRAL.CP000000.FFB.DATE080205
is an invalid DSN name. Nodes of a(n) DSN can not be of more than 8-characters.
Regards,
Anuj

User avatar
Natarajan
Moderator
Posts: 537
Joined: Fri Oct 10, 2008 12:57 pm
Location: chennai
Contact:

Post by Natarajan » Fri Apr 17, 2009 10:16 am

ok
Natarajan
Chennai

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Fri Apr 17, 2009 10:26 am

Actually, "Date" is not responsible for the "date" to get appeneded as LLQ in DSN. The symbol translator utility, EZACFSM1, is the one used to translate the symbols. EZACFSM1 reads an input file and writes to an output file, translating any symbols in the process.
Regards,
Anuj

arch
Member
Posts: 2
Joined: Fri Jul 09, 2010 9:04 pm

Post by arch » Fri Jul 09, 2010 9:08 pm

Hi, I see this JCL has two jobs. Can I obtain the same output by having only one job? I tried few things by altering this JCL, but I am not getting. plz help

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Sun Jul 11, 2010 7:00 pm

What are the "few things" which you've tried and how you are not "getting it"?
Regards,
Anuj

arch
Member
Posts: 2
Joined: Fri Jul 09, 2010 9:04 pm

Post by arch » Mon Jul 12, 2010 7:10 pm

I tried this.. but didnt work..

//CPAXLDT1 JOB (MR760,00,P),'TEST1',CLASS=X,MSGCLASS=X,
// MSGLEVEL=(1,1),NOTIFY=CPAXL,REGION=0M
//STEP0100 EXEC PGM=EZACFSM1
//SYSOUT DD SYSOUT=(*,INTRDR)
//SYSIN DD *
ALTER 'CPAXL.TEST.DATA'
NEWNAME('CPAXL.TEST.DATA.D&LYYMMDD..T&LHHMMSS')
/*

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Tue Jul 13, 2010 2:25 pm

Your Job won't work the way you have coded it, you are missing the basic "needs" of INTRDR - The INTRDR statement specifies the characteristics of all JES2 internal readers that are used to submit batch jobs. An internal reader is a special SYSOUT data set that other programs can use to submit jobs, control statements, and commands to JES2. Jobs that allocate internal reader and time-sharing users use the internal readers to submit jobs.

Suggest yousearch a bit on INTRDR.
Regards,
Anuj

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others