Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : All available storage is assigned to the job or jobstep, If REGION is coded 0K or 0M

Google
 
Web mainframegurukul.com

How to assign System Date/Time to a parameter in a JCL pgm?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> JCL
  View previous topic :: View next topic  
Author Message
narinder4075
Member


Joined: 14 Apr 2009
Posts: 7
Location: Kolkata

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Apr 14, 2009 9:16 pm    Post subject: How to assign System Date/Time to a parameter in a JCL pgm? Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.

Anuj Dhawan
Moderator


Joined: 09 Aug 2008
Posts: 1631
Location: Mumbai, India

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
1 salutes

PostPosted: Wed Apr 15, 2009 2:32 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Natarajan
Moderator


Joined: 10 Oct 2008
Posts: 537
Location: chennai

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
2 salutes

PostPosted: Wed Apr 15, 2009 6:05 pm    Post subject: Creating the PS with current date as a qualifier Reply with quote

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

Code:

//CURDATE JOB (XXXX,XXX),'RUNJCL',CLASS=S,MSGCLASS=S,       
//         NOTIFY=&SYSUID,REGION=4096K                         
//STEP00   EXEC PGM=EZACFSM1                                   
//SYSOUT   DD SYSOUT=(*,INTRDR)                                 
//SYSIN    DD DATA,DLM=@@                                       
//CURDATEC1 JOB (xxxx,xxxx),'RUNJCL',CLASS=S,MSGCLASS=S,       
//         NOTIFY=&SYSUID,REGION=4096K                         
//STEP01   EXEC PGM=IEFBR14
//SYSUT2   DD  DSN=XXX.XXX.XXX.DATE&LYYMMDD,       
//             DISP=(NEW,CATLG,DELETE),                         
//             UNIT=SYSDA,RECFM=FB,LRECL=80,                   
//             SPACE=(CYL,(1,1),RLSE)                           
@@                                                       


-> File XXX.XXX.XXX.DATE080205 will get created
_________________
Natarajan
Chennai


Last edited by Natarajan on Fri Apr 17, 2009 10:21 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
dbzTHEdinosauer
Moderator


Joined: 02 Oct 2006
Posts: 975

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
1 salutes

PostPosted: Wed Apr 15, 2009 6:32 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
narinder4075
Member


Joined: 14 Apr 2009
Posts: 7
Location: Kolkata

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Apr 15, 2009 9:11 pm    Post subject: Reply with quote

Hi Anuj,

Yes!!! I want that whenever this kind of job run, then it generates a PS with a timestamp as LLQ.
_________________
Thanks,
Narinder.
Back to top
View user's profile Send private message Send e-mail
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Anuj Dhawan
Moderator


Joined: 09 Aug 2008
Posts: 1631
Location: Mumbai, India

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Apr 16, 2009 2:21 pm    Post subject: Reply with quote

Hi Narinder,

If so then you can use the job from Natarajan after changing this
Code:
//SYSUT2   DD  DSN=XXX.XXX.XXX.DATE&LYYMMDD,
to
Code:
//SYSUT2   DD  DSN=XXX.XXX.XXX.D&LYYMMDD,

_________________
Regards,
Anuj
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Anuj Dhawan
Moderator


Joined: 09 Aug 2008
Posts: 1631
Location: Mumbai, India

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Apr 16, 2009 2:29 pm    Post subject: Re: Creating the PS with current date as a qualifier Reply with quote

Natarajan wrote:
File DRAL.CP000000.FFB.DATE080205 will get created
I would like to believe it was written mistakenly... Smile
_________________
Regards,
Anuj
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Natarajan
Moderator


Joined: 10 Oct 2008
Posts: 537
Location: chennai

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Apr 16, 2009 3:57 pm    Post subject: Reply with quote

You are correct anuj. it was a typo. it will place the current date.
_________________
Natarajan
Chennai
Back to top
View user's profile Send private message Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Anuj Dhawan
Moderator


Joined: 09 Aug 2008
Posts: 1631
Location: Mumbai, India

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Apr 16, 2009 6:11 pm    Post subject: Reply with quote

Natarajan wrote:
it will place the current date.
We are not on same track I think - this
Quote:
DRAL.CP000000.FFB.DATE080205
is an invalid DSN name. Nodes of a(n) DSN can not be of more than 8-characters.
_________________
Regards,
Anuj
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Natarajan
Moderator


Joined: 10 Oct 2008
Posts: 537
Location: chennai

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri Apr 17, 2009 10:16 am    Post subject: Reply with quote

ok
_________________
Natarajan
Chennai
Back to top
View user's profile Send private message Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Anuj Dhawan
Moderator


Joined: 09 Aug 2008
Posts: 1631
Location: Mumbai, India

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri Apr 17, 2009 10:26 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
arch
Member


Joined: 09 Jul 2010
Posts: 2

Answer was approved by Question owner.
Useful Post
1 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri Jul 09, 2010 9:08 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Anuj Dhawan
Moderator


Joined: 09 Aug 2008
Posts: 1631
Location: Mumbai, India

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Sun Jul 11, 2010 7:00 pm    Post subject: Reply with quote

What are the "few things" which you've tried and how you are not "getting it"?
_________________
Regards,
Anuj
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
arch
Member


Joined: 09 Jul 2010
Posts: 2

Answer was approved by Question owner.
Useful Post
1 votes
Not an useful post
Greate Post!! Salute Author
1 salutes

PostPosted: Mon Jul 12, 2010 7:10 pm    Post subject: Reply with quote

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')
/*
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Anuj Dhawan
Moderator


Joined: 09 Aug 2008
Posts: 1631
Location: Mumbai, India

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Jul 13, 2010 2:25 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> JCL All times are GMT + 5 Hours
Goto page 1, 2  Next
Page 1 of 2



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts comp and comp3 3 padmapriya7 11071 Mon Feb 01, 2016 10:44 pm
academyindia4 View latest post
No new posts delete a record in ps file. 4 white-shadow 5685 Tue Jul 20, 2010 3:22 pm
Anuj Dhawan View latest post
No new posts Need JCL for the file prg-to copy content from 1 ps to other 4 sukamal 6037 Tue Dec 29, 2009 7:44 pm
Anuj Dhawan View latest post
No new posts Deleting a PS when the higher qualifier is mentioned 2 samrat.ganguly 3084 Wed Mar 04, 2009 11:06 pm
Anuj Dhawan View latest post
No new posts Formatting in PS using DFSORT utility 2 udhay 6537 Fri Sep 05, 2008 4:45 pm
udhay View latest post
 


Cobol Tutorial
This cobol tutorial covers most of the important topics like STRING, UNSTRING, COMP, COMP-3.....
DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. Explains in simple language. Some Chapters are locked, Forum members have free access to these chapters
CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming...
JCL Tutorial
This is most popular JCL tutorial from mainframegurukul. It does contain important jcl ....
SORT Tutorial
This Tutorial covers all important aspects of DFSORT. Has more SORT examples
INTERVIEW Questions
This page covers important interview questions
Mainframe Jobs
Mainframe Jobs posted by members of mainframegurukul forum
FaceBook Page
MainframeGurukul FaceBook Page
LinkedIn Page
MainframeGurkul Linkedin Page

This widget requires Flash Player 9 or better







Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials || Mainframe CICS tutorial|| Mainframe COBOL Tutorial

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB

mainframetopic-3993.html