View previous topic :: View next topic
|
Author |
Message |
arnab
New User
Joined: 13 Mar 2006 Posts: 59 Location: UK
|
|
|
|
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 |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
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 |
|
|
arnab
New User
Joined: 13 Mar 2006 Posts: 59 Location: UK
|
|
|
|
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 |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Code: |
SELECT CURRENT DATE,DAYOFWEEK(CURRENT DATE)
FROM SYSIBM.SYSDUMMY1; |
Regards,
Priyesh. |
|
Back to top |
|
|
martijn
New User
Joined: 09 Mar 2006 Posts: 14 Location: The Netherlands
|
|
|
|
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 |
|
|
teevijay
New User
Joined: 20 Mar 2006 Posts: 22
|
|
|
|
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 |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
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 |
|
|
arnab
New User
Joined: 13 Mar 2006 Posts: 59 Location: UK
|
|
|
|
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 |
|
|
|