View previous topic :: View next topic
|
Author |
Message |
Amolondhe007 Warnings : 1 New User
Joined: 16 Apr 2007 Posts: 49 Location: Pune
|
|
|
|
Hi All,
I had one question asked in inteview.
If i have 10 to 12 steps in my JOB and my target is that i have execute each step on one day...like 1st step on 1 day,2nd step on 2nd Day....
So how should i write the JCL steps?
Thanks. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Fortunately a situation I have never encountered, nor hope to.
I believe this may be yet another example of an interviewer talking out of his/her a**e
Are we to understand that the execution cycle in days is equal to the number of steps involved. |
|
Back to top |
|
|
Amolondhe007 Warnings : 1 New User
Joined: 16 Apr 2007 Posts: 49 Location: Pune
|
|
|
|
Hi
Interviewer was expecting this answer for Production support cases.
Thanks. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Using scheduling software it is possible to include differing parts of a job given different days/schids/situations.
That is the only way that I can think of get around this, unless you write a small REXX or program to issue different return codes for whatever day of the week it is. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
since it' s raining here is a rexx snippet to compute an offset or an index into a cycle
Code: |
cystar cycle starting date
cydays number of days in the cycle
cyoffs 0 to retur an offset 1 to return an index |
I' ll let somebody else explain the logic
Code: |
cystar = date("S")
cystar = 20090720
cydays = 10
cydays = 7
cyoffs = 0
cyoffs = 1
say cycle(date("S"), cystar, cydays, cyoffs)
exit
cycle: procedure
parse arg cycurr, cystar, cydays, cyoffs
return ( date("B",cycurr,"S") - date("B",cystar,"S") ) // cydays + cyoffs
|
|
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Expat,
Can SLEEP be coded in all the steps to make it wait? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
why would You want to keep an initiator busy ?? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
anyway that' what schedulers are built for ...
manage execution cycles ...
write a job for each step and create the appropriate schedule definition |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Did not think from that angle !
Thanks Enrico. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Aaru - have you not ever seen any of my responses to people who want to use SLEEP
Although, it would work. Just imagine hogging an initiator for a whole week to process just one job The type of response it needs really.
I'd just love to interview the a***hole that asked that one in an interview. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
but for a weekly cycle, based on the day of the week a simple
date("B") // 7 will return 0 for monday ... 6 for sunday
see the rexx manual for the date function |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Amolondhe007 wrote: |
If i have 10 to 12 steps in my JOB and my target is that i have execute each step on one day...like 1st step on 1 day,2nd step on 2nd Day.... |
You should have asked the interviewer -- Should the step repeat after one week? 1st and 8th step should be executed on 8th day or just the 8th step? and for a year should I code "365 steps".. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
you can always create a number of jobs, then schedule each job on the designated day or as already mentioned, most scheduling tools will allow you to place code around each step of the job and schedule it according to it's criteria.
Gerry |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Expat,
Quote: |
Aaru - have you not ever seen any of my responses to people who want to use SLEEP
|
Nope, I did not
Quote: |
Although, it would work. Just imagine hogging an initiator for a whole week to process just one job |
very true. |
|
Back to top |
|
|
|