Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Check point/Restart logic for GSAM files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> IMS DB/DC
View previous topic :: :: View next topic  
Author Message
hemanthj642

New User


Joined: 14 Sep 2005
Posts: 21

PostPosted: Mon Nov 07, 2011 5:04 pm    Post subject: Check point/Restart logic for GSAM files
Reply with quote

Hi Friends,

I am trying to learn about GSAM file as I have got to work on it.
Eariler I wrote a programs using check point /Restart logic for sequential files. Now I got a requirement to write a logic by using GSAM files.

After going thru the forum I understand that,basically GSAM files are used to do a check point/restart.
It would be helpful for me if some one clarify the below things.

For normal IMS data base when we issue a check point call position in the data base is lost. Application program need to be make sure that Repostioning the data base.

I saw the code for input GSAM files ..Code was written to go to GSAM(GN CALL) read if it is a restart call after successful restart.

how IMS make sure that file is read from a next record from previous check point ?

While Restart how IMS make sure that output GSAM file not write the duplicates?

Thanks in advance..

Regards,
Hemanth
Back to top
View user's profile Send private message

don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 658
Location: Whitby, ON, Canada

PostPosted: Mon Nov 07, 2011 6:15 pm    Post subject:
Reply with quote

IMS keeps track of the relative byte address associated with each GSAM read and write. The RBAs are stored in the log along with other checkpoint information. On restart, IMS uses the RBAs to automatically reposition the GSAM files in the right place.

An RBA can depend on the physical characteristics of the file, which is why you have to be very careful not to reblock a GSAM file when a restart is needed.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Nov 07, 2011 9:42 pm    Post subject:
Reply with quote

Hello,

Quote:
Eariler I wrote a programs using check point /Restart logic for sequential files.
Interesting. As far as i know there is no checkpoint/rollback functionality for "sequential files".

Possibly there is something i misunderstand.

Also, if an organization permits/supports checkpoint/rollback, it is usually not done for a program or an individual application. There are standards concerning how this will be done and applications needing checkpoint/rollback must follow the standard(s).
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Mon Nov 07, 2011 11:19 pm    Post subject:
Reply with quote

To me, the weird thing about GSAMs is that you will see all the records in the file after an abend. So if you write 100 records, then takea checkpoint, then write 50 records, then have an abend, the output file will have 150 records in it.

When the restart call (XRST) runs, it moves the records pointer back to where the checkpoint was. So in essence, those last 50 records disappear.

Three things to be SUPER careful about:
1) Make sure that on a restart, you change the disposition of the output GSAMs from NEW to SHR.

2) Make sure that on a restart, you do NOT reopen the GSAM files with an OPEN call. That would put the record pointer back to beginning of the file.

3) Make double-damn CERTAIN that your program picks up the correct record during a restart. Think about where the record pointer was when the checkpoint was taken, then make sure that's the data you want.

For example, your logic reads the 100th GSAM record, then takes a checkpoint. The pointer is AFTER the 100th record. If you do a restart, then read a record, you are getting the 101st record.

I like it when programs take the checkpoint at the TOP of the logical loop. So you take a checkpoint, THEN read that 100th record to process it. That way, when you restart, you can simply drop into your logical loop and the first read picks up the 100th record.

A big advantage to that method is that if the 100th record is the problem, you can delete it from the input file and still do a successful restart. If you do it the other way, with the checkpoint after the read, the RBA for the restart is now invalid if you delete the record.
Back to top
View user's profile Send private message
hemanthj642

New User


Joined: 14 Sep 2005
Posts: 21

PostPosted: Tue Nov 08, 2011 7:53 am    Post subject:
Reply with quote

Hi Don,Ed,

Thank you for the info,it helped me a lot.

Hi Dick,

Sorry If I confuse you about sequential files checkpoint/Restart..

I meant... I used sequential file as an input instead of GSAM ... Read the sequential file for key value,used this key value to access the IMS data base.

Thanks,
Hemanth
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Nov 08, 2011 8:29 am    Post subject:
Reply with quote

Hello,

Quote:
Sorry If I confuse you about sequential files checkpoint/Restart..
Not to worry - i've been "confused" many times icon_smile.gif

If you are reading a sequential file and making updates to a database, the process likely creates one or more reports and/or output sequentikal files. If this process is interrupted and is to be restarted "in the moiddle", consideration must also be given to getting the non-db output files back in sync.
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 -> IMS DB/DC All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 21 Sun Aug 27, 2017 10:35 pm
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us