Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

TRICKY GDG QUERY

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
useit

Active User


Joined: 05 Oct 2006
Posts: 144

PostPosted: Tue Aug 30, 2011 3:05 pm    Post subject: TRICKY GDG QUERY
Reply with quote

hi,
is there any way we can find out what was the last generation(generation number). and we can start reading from the next generation number?

say example

before my execution (first run) of job gdg had 2 generation.

g001
g002

in the next run say other jobs created 2 more generations.

g001
g002
g003
g004

so in my job i just have to process only g003, g004, since g001 and g002 i have proceseed before the first run.

i, e
some point of time i have to find out what was the latest generation number. and next time onwards i have to process from the next generation number onwards.

note: i cant delete the genearation numbers.

i would be really thankful to you if you can help me on this.

Regds,
useit
Back to top
View user's profile Send private message

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Aug 30, 2011 3:21 pm    Post subject:
Reply with quote

I would have done like this...

Create two GDG bases.. like

HLQ.GBASE.MAIN and
HLQ.GBASE.TEMP

Whenever your job adds new generation to MAIN would have added to TEMP also...

While you want to process generation... process only generations from TEMP and delete all once processing is done.
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 144

PostPosted: Tue Aug 30, 2011 4:19 pm    Post subject:
Reply with quote

escapa,

i dont think your solution would work for me.

in my case.


my gdg file creation jobs run at 4pm, 5pm, 6pm,7pm

and my new file creation job run can vary from 4pm to 6pm

suppose if my new file creation job runs at 5.30. then whatever the gdgs created before 5.30 shouldnt be considered
for processing.(should consider only the generation created from 6pm, 7pm jobs)


if it runs at 6.30pm.(then process only generation created by 7pm job)

please help me regarding the same.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Aug 30, 2011 4:28 pm    Post subject:
Reply with quote

Clear as mud.... + confusing

Quote:
if it runs at 6.30pm.(then process only generation created by 7pm job)

What does this mean??? how new file creation job running at 6:30 will be able to copy data from job which is going to run at 7 pm???
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 144

PostPosted: Tue Aug 30, 2011 4:40 pm    Post subject:
Reply with quote

hi,

sorry for bothering you again

actually there is one more update job which would run at around 8.30.

here i have to see which all generations needs to be processed.


suppose if new file creation jobs run at 4.30. my 8.30 update job should use(generation created by 5pm, 6pm, 7pm job)

Regds,
useit
Back to top
View user's profile Send private message
superk

Moderator Team Head


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

PostPosted: Tue Aug 30, 2011 4:47 pm    Post subject: Reply to: TRICKY GDG QUERY
Reply with quote

I've used two approaches in the past:

- Maintain a logfile. When you use a generation, log it to the log file. On the next batch cycle, check the current existing generations against the log file. If you find a new one, process it, add it to the log file, and continue the processing cycles.

- Rename the used GDG. I'd rename the version number (V00) to (V01) as the indicator that it has been processed. This can really be handy if you have a need to re-process an older generation. Just rename it back to (V00) and let the batch process pick it up on the next cycle.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7989
Location: Bellevue, IA

PostPosted: Tue Aug 30, 2011 4:52 pm    Post subject:
Reply with quote

Either set up individual files for each time the job creating the file can run, or have your job process AND DELETE all members of the GDG . If you need to retain data, you would need a second generation data group defined to retain the data.

Quote:
suppose if my new file creation job runs at 5.30. then whatever the gdgs created before 5.30 shouldnt be considered
for processing.(should consider only the generation created from 6pm, 7pm jobs)
The last I heard, time travel was still considered not possible by the laws of physics. If YOUR job runs at 5:30, how is it going to know about the generations created at 6 or 7 without time travel? If you say your job is going to wait until they are created, that is what data set triggers in job schedulers are for.

My conclusion is that either you cannot describe your situation adequately for us to help you, or you are attempting to subvert the laws of physics for some reason.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Omegamon for DB2 query ashek15 DB2 0 Wed Feb 15, 2017 11:25 am
No new posts Query on DB2 WLM stored procedures ashek15 DB2 8 Sun Feb 12, 2017 11:13 pm
No new posts GETMAIN/FREEMAIN query Suja.Sai CICS 9 Tue Jan 31, 2017 12:01 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us