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

COBOL Abend recovery using check-point's


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
yuvrajdutta

New User


Joined: 13 Jul 2009
Posts: 40
Location: India

PostPosted: Fri Apr 15, 2011 6:15 pm
Reply with quote

This is purely for an educational purpose.

I've been trying to figure out how the RERUN clause in COBOL works but have been unsuccessful till now.

As of now I have a COBOL program reading a variable list of 2 digit numbers from a VB file with a sum of all the numbers as the output and want to employ abend recovery using a check-point in particular with a RERUN.

Code:

FILE-CONTROL.                                                 
    SELECT INPUT-FILE ASSIGN TO READER                       
    ORGANIZATION IS SEQUENTIAL                               
    ACCESS MODE IS SEQUENTIAL                                 
    FILE STATUS IS FILE-STATUS.                               
I-O-CONTROL.                                                 
    RERUN ON RESCUE EVERY 2 RECORDS OF INPUT-FILE.           
DATA DIVISION.                                               
FILE SECTION.                                                 
FD INPUT-FILE                                                 
    BLOCK CONTAINS 27703 TO 27998 CHARACTERS                 
    RECORD IS VARYING IN SIZE FROM 2 TO 296 CHARACTERS       
    DEPENDING ON SIZE-VAR                                     
    LABEL RECORDS ARE STANDARD                               
    DATA RECORD IS INPUT-REC                                 
    RECORDING MODE IS V.                                     
01 INPUT-REC.                                                 
   88  END-OF-FILE VALUE HIGH-VALUES.                         
   05  STRING-IN OCCURS 1 TO 148 TIMES DEPENDING ON DSIZE-VAR.
       10 NUM-IN PIC 9(2).                                   


Code:

//RUN##PGM EXEC PGM=ADDFIELD,COND=(4,LE)         
//READER   DD   DSN=R01029.COBOL.INPUT.VB,DISP=SHR
//RESCUE   DD   DSN=R01029.COBOL.CHKPOINT,       
//            VOLUME=(PRIVATE,RETAIN),           
//            DISP=(MOD,PASS)                     
//STEPLIB  DD   DSN=R01029.COBOL.LOADLIB,DISP=SHR
//SYSPRINT DD   SYSOUT=*                         
//SYSOUT   DD   SYSOUT=*                         


I assumed(presumably wrong) that the DCB of a check point dataset would be similar to the DCB of the SYS1.HASPCKPT which is incidentally the JES2 check-point dataset.

At the outset I have been through the Enterprise Cobol manual and have been searching several forums but the DCB of a check point dataset aint mentioned anywhere.

In my JOB Log all I am prompted for is:

Code:

*IEC254D SHOULD COBOLCOM USE (RESCUE,D313,ETRU04) FOR CREATING A NEW CHECKPOINT DATA SET
*59 IEC254D REPLY 'YES' OR 'NO'                                                 


But I am not sure how I am supposed to reply and my program execution step remains active till I forcibly CANCEL my job off.

Now as per publib.boulder.ibm.com/infocenter/zos/v1r9/index.jsp?topic=/com.ibm.zos.r9.idac700/laext.htm I am supposed to

Quote:

Return code 4 and the TEPACHKPT bit set off results in the system assuming the tape is secure. This is like a reply of "YES" to the messages.


But DFSMS is overkill for me..

I did find a good document for CHECKPOINT restart though and am attaching it in this post.
Back to top
View user's profile Send private message
yuvrajdutta

New User


Joined: 13 Jul 2009
Posts: 40
Location: India

PostPosted: Mon Apr 18, 2011 11:07 am
Reply with quote

Can anyone please help me out with this.. icon_smile.gif
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon Apr 18, 2011 11:26 am
Reply with quote

Well, you posted on Friday afternoon - it is now early Monday morning. What are you expecting - people not to have weekends? And, as has been mentioned several times - do not post attachments. Some people cannot see them and I, for one, do not bother to even try to look at them.
Back to top
View user's profile Send private message
yuvrajdutta

New User


Joined: 13 Jul 2009
Posts: 40
Location: India

PostPosted: Mon Apr 18, 2011 12:05 pm
Reply with quote

Ok Nic.. will avoid attachments from now.. icon_smile.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Apr 18, 2011 4:30 pm
Reply with quote

    1. Check-point restart are specific to your shop, if you want to use it in some Prod-application - you need to use the method which is in use at your shop. You should not invent your own check-point logic.

    2. The document you attach, describes the check-point logic for some shop - it it's not for Your shop -- don't use it!

    3. Checkpoint- restart for a Batch-COBOL program and JES2-checkpoint restart has got nothig to do with each other from an Application Programmer per se. Check-Point/restart for a COBOL program is a user written method. For most of the shop, which use this, it has been devised by someone (may be more than one meembers) and others just follow that.

    4. You said, it's only for learning purpose, so to get you started --tell me, if you know using GSAMs?
Back to top
View user's profile Send private message
don.leahy

Active Member


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

PostPosted: Mon Apr 18, 2011 5:37 pm
Reply with quote

Message IEC254D appears on the console and can only be responded to by an Operator. I strongly suggest that you cease this line of research until you have checked with your local support folks. Most shops do not want application programs to issue messages to the console, particularly those that require operator intervention. It is generally regarded as an archaic technique that is highly disruptive.

BTW, in 30 years of working with Cobol I have never seen a program that used the RERUN clause or native MVS checkpoint facilities.
Back to top
View user's profile Send private message
yuvrajdutta

New User


Joined: 13 Jul 2009
Posts: 40
Location: India

PostPosted: Mon Apr 18, 2011 11:22 pm
Reply with quote

Anuj,

Before you mentioned GSAM in the post above.. I had no idea on them to be very frank.. but have some preliminary IDEA about them now.

Seems they are similar to QSAM files but rather than the TOP-DOWN approach mandatory for a QSAM file we can perform DYNAMIC(If i may use it in this context) extraction of data.

And it seems its somewhat related to IMS.. and I have no idea of IMS.

And the said query has nothing related to my professional work.. just plain curiosity and "if its there, there must be some purpose.. so better to write up something using it and exploit it"

Bill,

Seems the situation is more grim than I anticipated.. icon_eek.gif
Back to top
View user's profile Send private message
don.leahy

Active Member


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

PostPosted: Tue Apr 19, 2011 2:46 am
Reply with quote

The main purpose of GSAM is to facilitate IMS checkpoint restart; you have to be running under IMS in order to use GSAM. Physically, a GSAM file is indistinguishable from QSAM, but IMS manages it differently. Most notably, IMS automatically keeps track of where you are in the file so that in the event of an abend and subsequent restart, it repositions the file in the right place. This applies to both input and output files.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Apr 19, 2011 5:13 am
Reply with quote

yuvrajdutta wrote:

...

Bill,

Seems the situation is more grim than I anticipated.. icon_eek.gif


Is this for me? I'll answer anyway. I commend your spirit and initiative. Don't hold back on them, even if sometimes they lead you up a blind alley. You'll learn things on the journey, anyway.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Apr 19, 2011 6:48 pm
Reply with quote

yuvrajdutta wrote:

...

Bill,

Seems the situation is more grim than I anticipated..
Or is it for Don?

Only on this very Forum, I've seen people calling others as "Bill" instead of their actual names? I was in U.S. for quite time and never waved a hand to someone with a salaution "Bill" while he had a real name - is it a norm and I don't know!
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Apr 19, 2011 8:00 pm
Reply with quote

yuvrajdutta wrote:
Before you mentioned GSAM in the post above.. I had no idea on them to be very frank.. but have some preliminary IDEA about them now.
GSAMs, by it's very definkition are, Generalized Sequential Access Method - As Don has mentioned, in IMS, it is a database access method providing accessing support for simple physical sequential data sets, such as tape files, SYSIN, SYSOUT, and other files that are not hierarchic in nature. You can consider it as one occureacne of IMS Segement and only one!

Look here:

publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.ims9.doc.adb/dba497.htm
publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.ims9.doc.apdb/xf5082.htm

I strongly recommend to get in touch with someone friendly (most of are not though) at your shop or search through the base-line source libraries and check how they are doing it already -- and try to learn that.
Back to top
View user's profile Send private message
yuvrajdutta

New User


Joined: 13 Jul 2009
Posts: 40
Location: India

PostPosted: Tue Apr 19, 2011 9:56 pm
Reply with quote

Anuj.

Will do as you said..

And I had mistakenly referred to Bill instead of Don in my earlier post(Bill had recently helped me out in another KSDS AIX issue and his name was lingering at the back of my mind)

Thanks everyone icon_smile.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Apr 20, 2011 1:04 am
Reply with quote

You're welcome and Good Luck!icon_smile.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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts ISAM and abend S03B JCL & VSAM 10
Search our Forums:

Back to Top