View previous topic :: View next topic
|
Author |
Message |
Vinay N.G
New User
Joined: 15 Sep 2008 Posts: 36 Location: Bangalore
|
|
|
|
Hi Can anybody please tell me a logic to overcome this issue.
I have two gdg files getting processed in each run, but when one of the gdg file is not created on any particular day the other is getting processed with the old version of another gdg file. This should be avoided.
I mean to say that if a GDG file is not created on any particular day the other file should be processed with the empty file and not the old version of that file. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Step 1 - processes the whole GDG base
Step 2 - Copies the whole GDG base to a backup file
Step 3 - deletes all entries in the GDG base
Step 4 - Setup a null +1 generation of the GDG base |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Vinay N.G
Pre allocate empty generations and use those in your job.
BTW, are both the generations getting created in the same job? can you mention the possible scenarios where the gdg is not getting created at all.
Thanks,
Arun |
|
Back to top |
|
|
Vinay N.G
New User
Joined: 15 Sep 2008 Posts: 36 Location: Bangalore
|
|
|
|
Hi Arcvns,
No both GDG files are not getting created in the same job.
one of the file comes frm business infact... if they dnt provide tht file at any particular day old generation is being processed. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Vinay,
Quote: |
one of the file comes frm business infact |
What about the other file? Still I m not clear how you are creating these 2 generations daily.
You can always follow the steps pointed out by expat
Thanks,
Arun |
|
Back to top |
|
|
Vinay N.G
New User
Joined: 15 Sep 2008 Posts: 36 Location: Bangalore
|
|
|
|
Ok consider both the files are being sent from Business and sometimes they send only one file |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
This might be a rare experience to take advantage of the version rather than the generation.
Process the generation by explicit name (HLQ.WHATEVER.GnnnnV00). When finished, rename the generation by changing the version number (RENAME HLQ.WHATEVER.GnnnnV00 to HLQ.WHATEVER.GnnnnV01). This will indicate to your application that the generation has already been processed and to not use it again.
Or, can you just create a log of the last generation processed and have your application automatically skip any generation already in the log file? |
|
Back to top |
|
|
Vinay N.G
New User
Joined: 15 Sep 2008 Posts: 36 Location: Bangalore
|
|
|
|
Hi Superk,
Can you please tell me how the application will come to know that it has already been processed, do we need to chnage the logic in application also. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I don't know if I can answer your question, since I don't know anything about your application. If it was me, I would:
- List all of the generations cataloged to the GDG base.
- Exclude all of the GDG's in the list that have a version of V00.
- If the resulting list is empty, then exit and stop any further processing.
- If there are still entries in the list, then select the name of the first GDG from the list, and pass that on the the rest of the application. Repeat until there are no more generations left to be processed. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Sorry Kevin, but your solution seems more complicated than is required. Renanimg absolute generations then working on logic to include/exclude unrenamed files.
What is wrong with processing the whole GDG base and then deleting the entries, to then set up a null +1 ready for the next cycle. A few simple JCL additions and there you go. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
I am not giving a solution
/venting on
I am just making a consideration about a generalized very poor application design
there are too many posts asking on how to skip a step in case the input dataset is empty
( seen it done it ) such approach will fail any serious application quality auditing
the main paradigm is that all the steps of a procedure should run succesfully
even if the input datasets are empty...
it is easier to allocate all the datsets needed and prime them with an end of file
rather then checking the datasets for existance or emptyness and skip some steps
the issue is evident when using gdg' s and not preallocating the current datasets
/venting off
the issue is evident for ledger applications ( legal isues )
the procedure should run even with an empty transaction dataset
and show on the daily journal 0 transactions and unchanged balances |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
1. create 2 empty GDG's so files are available for 1st run.
2. run job reading 0 & -1 files and once processed, initialise 2 files +1 & +2.
Now you will never process an old GDG.
Gerry |
|
Back to top |
|
|
Bharath Bhat
Active User
Joined: 20 Mar 2008 Posts: 283 Location: chennai
|
|
|
|
expat wrote: |
Step 1 - processes the whole GDG base
Step 2 - Copies the whole GDG base to a backup file
Step 3 - deletes all entries in the GDG base
Step 4 - Setup a null +1 generation of the GDG base |
We did the same thing when we had a similiar issue....
And it is working fine..... |
|
Back to top |
|
|
|