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

Logic to solve this issue


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Vinay N.G

New User


Joined: 15 Sep 2008
Posts: 36
Location: Bangalore

PostPosted: Wed Sep 17, 2008 7:37 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Sep 17, 2008 7:47 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Sep 17, 2008 7:49 pm
Reply with quote

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
View user's profile Send private message
Vinay N.G

New User


Joined: 15 Sep 2008
Posts: 36
Location: Bangalore

PostPosted: Wed Sep 17, 2008 8:04 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Sep 17, 2008 8:20 pm
Reply with quote

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
View user's profile Send private message
Vinay N.G

New User


Joined: 15 Sep 2008
Posts: 36
Location: Bangalore

PostPosted: Wed Sep 17, 2008 8:40 pm
Reply with quote

Ok consider both the files are being sent from Business and sometimes they send only one file
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Sep 17, 2008 8:51 pm
Reply with quote

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
View user's profile Send private message
Vinay N.G

New User


Joined: 15 Sep 2008
Posts: 36
Location: Bangalore

PostPosted: Wed Sep 17, 2008 8:59 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Sep 17, 2008 10:03 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Sep 17, 2008 10:21 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Sep 17, 2008 10:30 pm
Reply with quote

I am not giving a solution icon_sad.gif

/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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Sep 18, 2008 4:20 am
Reply with quote

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
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Thu Sep 18, 2008 11:09 am
Reply with quote

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..... icon_cool.gif
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts Facing ABM3 issue! CICS 3
No new posts Panvalet - 9 Character name - Issue c... CA Products 6
No new posts Issue with EXEC CICS QUERY SECURITY c... CICS 6
Search our Forums:

Back to Top