IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to get date in Jcl automatically as Jun10 in sysin card.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Tue Nov 04, 2008 7:55 pm
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
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

Global Moderator


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

PostPosted: Tue Nov 04, 2008 9:58 pm
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Nov 05, 2008 1:16 am
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

Moderator Emeritus


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

PostPosted: Wed Nov 05, 2008 1:16 am
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Nov 05, 2008 1:19 am
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
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

Moderator Emeritus


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

PostPosted: Wed Nov 05, 2008 2:48 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
Search our Forums:

Back to Top