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

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


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
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
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: 1448
Location: Chicago, IL

PostPosted: Tue Mar 21, 2006 9:55 am
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
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: 1448
Location: Chicago, IL

PostPosted: Tue Mar 21, 2006 2:17 pm
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
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
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: 1448
Location: Chicago, IL

PostPosted: Tue Mar 21, 2006 5:23 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Sysplex System won't IPL at DR site I... All Other Mainframe Topics 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts How to delete a user's alias from the... JCL & VSAM 11
Search our Forums:

Back to Top