Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to know the system date and day of the week thru JCL?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
arnab

New User


Joined: 13 Mar 2006
Posts: 59
Location: UK

PostPosted: Tue Mar 21, 2006 9:19 am    Post subject: How to know the system date and day of the week thru JCL?
Reply with quote

Hi ,

My requirement is:

I need to code modify an existing JOB (which executes on Sat and MOn) , such that when it runs on Mon it will bypass certain steps in the JCL.
I know that the system date and dayof the week can be found using a Cobol pgm but I want to know if there is way by using the JCL alone..ie by using some inbuilt utility pgms( like IEBGENER etc) or system defined procs or some other way.

thanks a lot in advance
regards,
Arnab
Back to top
View user's profile Send private message

priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Tue Mar 21, 2006 9:55 am    Post subject: Re: How to know the system date and day of the week thru JCL
Reply with quote

Arnab,

If that is finally decided that you want to run a modified code on every Monday, I would suggest to code a separate job itself or take a schedular help.

Well, finding day of the week in JCL canbe done via running a SQL Query in a STEP.

Let the EXPERTS come in.. you'll get more solutions...

Regards,
Priyesh.
Back to top
View user's profile Send private message
arnab

New User


Joined: 13 Mar 2006
Posts: 59
Location: UK

PostPosted: Tue Mar 21, 2006 2:03 pm    Post subject: Re: How to know the system date and day of the week thru JCL
Reply with quote

Priyesh,

Thanks.
I can make another JCL but for that I need many permissions from the client side..so I want to make the changes in the existing JCL itself.
Neways can u give me the SQL query that will give me the current day.

thanks,
Arnab
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Tue Mar 21, 2006 2:17 pm    Post subject: Re: How to know the system date and day of the week thru JCL
Reply with quote

Code:
SELECT CURRENT DATE,DAYOFWEEK(CURRENT DATE)
   FROM SYSIBM.SYSDUMMY1;                 


Regards,
Priyesh.
Back to top
View user's profile Send private message
martijn

New User


Joined: 09 Mar 2006
Posts: 14
Location: The Netherlands

PostPosted: Tue Mar 21, 2006 2:46 pm    Post subject:
Reply with quote

Hi,

first of all; I'm assuming you use scheduling-software to schedule your batch work. Which Scheduler do you use? If it's OPC, I can show you many way to work with 'day-of-the-week', and how to use it to select/deselect certain steps. I have never worked with any other scheduler, but I expect any decent scheduler to be able to assist!!

Now, Priyesh,
I'm very interested to learn about your SQL-query method to select 'day-of-the-week', but I must admit I'm not to familiar with it! What do I run it against? Is there a standard program/system tool/utility I should use? Can you please give me the complete JCL-step I should use?

Regards,
Martijn
Back to top
View user's profile Send private message
teevijay

New User


Joined: 20 Mar 2006
Posts: 22

PostPosted: Tue Mar 21, 2006 3:24 pm    Post subject: How to know the system date and day of the week thru JCL
Reply with quote

hi priyesh,
please let me know the complete code snippet using the SQL-querry.
Is there a standard program/system tool/utility that I should use?

have fun
vijay
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Tue Mar 21, 2006 5:23 pm    Post subject: Re: How to know the system date and day of the week thru JCL
Reply with quote

Hi Martjin/Vijay,

I dont have a Full-Fledged Code ready to show you this time.

But if this step is executed it'll produce an O/p file with specific format.
For me it is giving Day-of-week at 75th Col in 10th Row.

Code:
//STEP1   EXEC PGM=IKJEFT01                             
//STEPLIB  DD DSN=STEP.LIB,DISP=SHR         
//SYSTSPRT DD SYSOUT=*                                   
//SYSPRINT DD DSN=HLQ.DSN.NAME,DISP=(,CATLG,DELETE),     
//            LRECL=80,BLKSIZE=800,RECFM=FB               
//SYSTSIN  DD *                                           
  DSN SYSTEM(DB2P)                                       
  RUN PROGRAM(DSNTEP2)                                   
  END                                                     
//SYSIN    DD *                                           
SELECT DAYOFWEEK(CURRENT DATE)                           
   FROM SYSIBM.SYSDUMMY1                                 
   ;                                                     
//


Now That 10th line of the record at 75th Col# have the integer representing DAY-OF-WEEK.

Regards,
Priyesh.
Back to top
View user's profile Send private message
arnab

New User


Joined: 13 Mar 2006
Posts: 59
Location: UK

PostPosted: Wed Mar 22, 2006 10:13 am    Post subject: Re: How to know the system date and day of the week thru JCL
Reply with quote

Hi Priyesh/Martin,
Thanks for your help.

Martin,
I am not sure on the scheduler side..(Some ESP scheduler is used I guess)..It can be done in the JOB scheduler, I guess.

Priyesh,
Thanks for the code.I will test it and see if it works for me.

regards,
Arnab
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts Overlay the system date Danielle.Filteau SYNCSORT 4 Fri Mar 03, 2017 1:16 am
No new posts Checking Current date vickey_dw DFSORT/ICETOOL 1 Wed Feb 08, 2017 11:14 pm
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us