Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to get date in Jcl automatically as Jun10 in sysin card.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
nkreddy5

New User


Joined: 06 May 2008
Posts: 7
Location: BANGALORE

PostPosted: Tue Nov 04, 2008 7:36 pm    Post subject: How to get date in Jcl automatically as Jun10 in sysin card.
Reply with quote

Hi! This is your First post in our Forums! So please be sure to 1) Use meaningful and descriptive Topic Title 2) Try to post your query in the relevant forum category 3) Make sure your query is not already posted and solved in our forums, Use the Search facility and avoid Reposts! If you are following the above rules, delete this message and post your query here!
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Tue Nov 04, 2008 7:55 pm    Post subject: Reply to: How to get date in Jcl automatically as Jun10 in s
Reply with quote

I have no idea what you're asking. Do you want the date to be Jun10 if the current system date is also June 10th? If not, where would this value come from?
Back to top
View user's profile Send private message
nkreddy5

New User


Joined: 06 May 2008
Posts: 7
Location: BANGALORE

PostPosted: Tue Nov 04, 2008 9:30 pm    Post subject: Reply to: How to get date in Jcl automatically as Jun10 in s
Reply with quote

Thanks for your responding.

In Production ,if we code any JCL , inside JCL i want to create a dataset with test.jun10 in that jcl & and also i want t0 get jun10 in sysin card to create the vsam datasets.

Yes your assumption is correct if today date is june 10th then it should take jun10.

Please let us know if any additional information should i need to provide in order to clear the description of question.

Thanks,
Karthik Reddy
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Tue Nov 04, 2008 9:58 pm    Post subject: Reply to: How to get date in Jcl automatically as Jun10 in s
Reply with quote

Well, obviously you'll need a program to convert a raw system date into the format you wish to use. It really doesn't matter what you use as long as it works for you.

I worked out a quick example using sort:

Code:

//STEP0001 EXEC PGM=SORT
//SORTIN   DD   *
YYYYMMDD
/*
//SORTOUT  DD   SYSOUT=*
//SYSOUT   DD   SYSOUT=*
//SYSIN    DD   *
  OPTION COPY
  INREC FIELDS=(1:DATE1)
  OUTREC IFTHEN=(WHEN=(5,2,CH,EQ,C'01'),
    BUILD=(1:C'JAN',7,2,80:X)),
         IFTHEN=(WHEN=(5,2,CH,EQ,C'02'),
    BUILD=(1:C'FEB',7,2,80:X)),
         IFTHEN=(WHEN=(5,2,CH,EQ,C'03'),
    BUILD=(1:C'MAR',7,2,80:X)),
         IFTHEN=(WHEN=(5,2,CH,EQ,C'04'),
    BUILD=(1:C'APR',7,2,80:X)),
         IFTHEN=(WHEN=(5,2,CH,EQ,C'05'),
    BUILD=(1:C'MAY',7,2,80:X)),
         IFTHEN=(WHEN=(5,2,CH,EQ,C'06'),
    BUILD=(1:C'JUN',7,2,80:X)),
         IFTHEN=(WHEN=(5,2,CH,EQ,C'07'),
    BUILD=(1:C'JUL',7,2,80:X)),
         IFTHEN=(WHEN=(5,2,CH,EQ,C'08'),
    BUILD=(1:C'AUG',7,2,80:X)),
         IFTHEN=(WHEN=(5,2,CH,EQ,C'09'),
    BUILD=(1:C'SEP',7,2,80:X)),
         IFTHEN=(WHEN=(5,2,CH,EQ,C'10'),
    BUILD=(1:C'OCT',7,2,80:X)),
         IFTHEN=(WHEN=(5,2,CH,EQ,C'11'),
    BUILD=(1:C'NOV',7,2,80:X)),
         IFTHEN=(WHEN=(5,2,CH,EQ,C'12'),
    BUILD=(1:C'DEC',7,2,80:X))
/*
Back to top
View user's profile Send private message
nkreddy5

New User


Joined: 06 May 2008
Posts: 7
Location: BANGALORE

PostPosted: Wed Nov 05, 2008 1:06 am    Post subject: Reply to: How to get date in Jcl automatically as Jun10 in s
Reply with quote

Thanks ,it is working and it is givng NOV04 date ..i ran this for todays date.

But it have one more doubt.

I have written the jcl...in this jcl i am tryig to create VSAM datasets in which DATE i want as NOV04.

Code:
// SET DATE='SEP01'                                                 
//*******************************************************************
//*                                                                 
//STEP010  EXEC PGM=IDCAMS                                           
//SYSPRINT DD  SYSOUT=*                                             
//*                                                                 
//SYSIN  DD *
   I am trying to create here VSAM DSN with
   DESRN.DATABASE.ZCMDDBD1.&DATE
//PASO010  EXEC PGM=IDCAMS,                                       
//             COND=(0,NE),                                       
//             REGION=2048K                                       
//SYSPRINT DD  SYSOUT=*                                           
//ARTXNI2  DD  DSN=test.DATABASE.ZCMDDBD.BATCH,                   
//             DISP=SHR                                           
//ARTXNO2  DD  DSN=test.DATABASE.ZCMDDBD.&DATE,                   
//             DISP=SHR                                           
//*                                                               
//SYSIN    DD  *                                                   
   REPRO IFILE(ARTXNI2)   OFILE(ARTXNO2)                           
   IF MAXCC = 12 THEN SET MAXCC = 0                               
      END                                                         
//*                                                         



How can i relate the above date which u have given jcl above to my requirement.

And please let me is there any way to get the system date into jcl.

Thanks,
Karthik
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8201
Location: Dubuque, Iowa, USA

PostPosted: Wed Nov 05, 2008 1:16 am    Post subject:
Reply with quote

You can write a program to generate the JCL you want and submit it into the internal reader, however there is no system data parameter available in JCL the way your JCL attempts to use it. And I don't believe you can pass symbolic parameters into IDCAMS to define the VSAM file, either.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Nov 05, 2008 1:16 am    Post subject:
Reply with quote

Hello Karthik and welcome to the forum,

Quote:
And please let me is there any way to get the system date into jcl.
Amper-variables can be resolved in JCL, but not within instream data.

Instead of being in the DD *, you could create the control statement in a dataset with the date resolved as you want it and concatenate this dataset behind the instream data.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10375
Location: italy

PostPosted: Wed Nov 05, 2008 1:19 am    Post subject: Reply to: How to get date in Jcl automatically as Jun10 in s
Reply with quote

Usually for this kind of task, scheduler variables are used,
the scheduler while submitting the job will take care of variable substitution
why not speak with the scheduler support ??
Back to top
View user's profile Send private message
nkreddy5

New User


Joined: 06 May 2008
Posts: 7
Location: BANGALORE

PostPosted: Wed Nov 05, 2008 1:43 am    Post subject: Reply to: How to get date in Jcl automatically as Jun10 in s
Reply with quote

Hi Dick ,

Thanks for your response.
Could you please explain in detail. I am not getting exactly your sentencess.

Hi Enricio,

How can i use the scheduler, we are using CA-7 Scheduler to load jobs

My questions might be silly,please help me to learn as many as concepts involved in JCL.

Thanks,
karthik
Bangalore
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Nov 05, 2008 2:48 am    Post subject:
Reply with quote

Hello,

Currently, you have:
Code:

//SYSIN  DD *
   I am trying to create here VSAM DSN with
   DESRN.DATABASE.ZCMDDBD1.&DATE
and the &DATE cannot be resolved because it is part of instream data (the DD *).

You could create this:
Code:
DESRN.DATABASE.ZCMDDBD1.NOV04
and write it into some file. Then you could use:
Code:
//SYSIN  DD *
   I am trying to create here VSAM DSN with
//   DD DSN=SOME.FILE,DISP=OLD
which would concatenate the resolved dataset name behind your instream statements.

Having said that - it would be better to use CA-7 as has been suggested. . .
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Date in where clause - Windows Karthikeyan Subbarayan DB2 9 Wed Nov 15, 2017 9:07 pm
This topic is locked: you cannot edit posts or make replies. Need help how to pass the ESP variabl... Venkichaitu JCL & VSAM 12 Thu Nov 02, 2017 3:53 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us