View previous topic :: View next topic
|
Author |
Message |
bibek24
New User
Joined: 14 Aug 2007 Posts: 35 Location: Hyderabad
|
|
|
|
Hi All,
I have a requirement to check if a new version of a GDG is available by a particular time say 7:00 AM.
For the time factor, I could schedule the job at 7:00 AM but how to check if it is already created for a particular day?
Based on the availbility/no-availbility, I have some other functions to perform.
Just wanted to know if there is any JCL steps for this requirement.
Hope the requirement is clear! |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Well, let us start off in the right direction. Do you mean GDS version or GDS generation. As both are perfectly valid for use with GDS but have completely different meanings and implications, may I suggest that you and us actually do know we are talking about here. |
|
Back to top |
|
|
Ajay Baghel
Active User
Joined: 25 Apr 2007 Posts: 206 Location: Bangalore
|
|
|
|
we use LISTCAT ALL LVL(GDG-BASE-NAME) in IDCAMS control card to check for the existence of any generations of the GDG. If no GDG generation is present (only base is present), or the base itself is not present, it gives RC 4. |
|
Back to top |
|
|
bibek24
New User
Joined: 14 Aug 2007 Posts: 35 Location: Hyderabad
|
|
|
|
I mean the generation of a GDG base.
Exp - If the GDG base name is HLQ.XXXX.YYYY, and the yesterday's generation let's say HLQ.XXXX.YYYY.G0141V00 , I need to check if HLQ.XXXX.YYYY.G0142V00 is availble today or not. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Well, the use of a GDS for a trigger or having to check to see if a new generation has been created, IMHO, is not the best thought out practice.
Usually for things like this I would use a plain old fixed dataset name which when created can be used to trigger an event in the schedule process which will then, and only then create a new GDS generation.
Also testing for a fixed dataset name is easier to do, if the dataset does not exist the return code is 12, but can be set to another value as a lot of sites will not accept RC 8 or above as an acceptable return code. This way you can test in the same job if the dataset exists and if it does, is it populated.
By using a GDS generation the code has to be updated every run, but using a fixed dataset name makes life oh so easier.
I know that this doesn't help much, but at least it gives you something to think about to improve the current situation and to prevent the same problem occuring in the future.
However, on the plus side, I do believe that this has been discussed on the forum before and a solution was found. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
Back to top |
|
|
Mathiv Anan
Active User
Joined: 23 Jul 2008 Posts: 106 Location: USA
|
|
|
|
Similar type of checks were there in one of our previous sites.
It was a kind of tedious process to check for new generation based on generation number. Please see if this helps.
1. LISTCAT the GDG into a PS file
2. Using a COBOL program, compare the previous and current day's generation number. (need to have one PS file with previous day's listing and one with current day's listing)
3. And do the function based on your requirement. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Mathiv Anan wrote: |
Similar type of checks were there in one of our previous sites.
It was a kind of tedious process to check for new generation based on generation number. Please see if this helps.
1. LISTCAT the GDG into a PS file
2. Using a COBOL program, compare the previous and current day's generation number. (need to have one PS file with previous day's listing and one with current day's listing)
3. And do the function based on your requirement. |
Looks complicated.. you need to always store what is last generation you have processed... |
|
Back to top |
|
|
Mathiv Anan
Active User
Joined: 23 Jul 2008 Posts: 106 Location: USA
|
|
|
|
Agreed |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
I also vote-in for the fixed-data-set name as expat has suggested. However, if GDS is your choice - best bet would be to preocess the GDS, (take the back-up if needed) and delete it - new day new generation to deal with. And yes, ofcourse you need an IDCAMS step to check if generation exists or not. Look for the RC from IDCAMS and do whatever next you want... |
|
Back to top |
|
|
bibek24
New User
Joined: 14 Aug 2007 Posts: 35 Location: Hyderabad
|
|
|
|
I thought of another approach to meet the requirement.
I want to run a new job based on the completion status of another job on the same day.
Let's say jobs X and Y are scheduled on jobtrac on a particular day. Job Y needs to run at 7:30 AM. The steps in the job Y will only be executed if job X has completed sucessfully, meaning with a RC=0 to 4.
How to check for the RC of a job scheduled on jobtrac? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Suggest you speak with the scheduling people to set this up in the scheduling system. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
bibek24 wrote: |
Let's say jobs X and Y are scheduled on jobtrac on a particular day. Job Y needs to run at 7:30 AM. The steps in the job Y will only be executed if job X has completed sucessfully, meaning with a RC=0 to 4. |
I may be interpreting it wrong, however, statement in bold-text is bit ambiguous - schedulers can schedule the jobs but not the steps inside them. If you want to execute couple of steps based upon the RC from some other job, I doubt it can be done as worded.
If you mean to execute the Job-Y, yep, can be done with the hlp of scheduling people, as Dick has suggested. |
|
Back to top |
|
|
Rupesh.Kothari
Member of the Month
Joined: 27 Apr 2005 Posts: 463
|
|
|
|
Hello
If possible below is one suggesstion for the Requirment.
1) EOD, Create one Empty Version of GDS data
2) On Morning 7:00, Check whether the Latest GDS version contain the data. If it contains the data it means the GDS version creation on that dat else it is not.
Else in Some mainframes there are some utility which are given the creation date of file. and if Creation date is todays then it is created today. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Rupesh.Kothari wrote: |
If possible below is one suggesstion for the Requirment.
1) EOD, Create one Empty Version of GDS data
2) On Morning 7:00, Check whether the Latest GDS version contain the data. If it contains the data it means the GDS version creation on that dat else it is not. |
Keeping in mind that you actually meant respective "Generation" and not the "version" - this might be true only if empty-generation means "no-processing" for the original requirement. OP wants to check the presence of generation - empty or full of data, is not yet mentioned. |
|
Back to top |
|
|
|