MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Checkpoint-Commit-Restart

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> IMS
View previous topic :: View next topic  
Author Message
Jai
Beginner


Joined: 06 Jun 2003
Posts: 57
Topics: 20

PostPosted: Wed Oct 15, 2003 10:52 am    Post subject: Checkpoint-Commit-Restart Reply with quote

Hi Friends,

Thanks a lot! Kolusu for your great answers for my previous questions.

Please provide me the code for Checkpoint-Commit Restart for Cobol-Db2 Program.
Whether I need to create separate table for storing the values of the counter which I am incrementing and storing after each commit.
Or else Storing in a File will do. Some persons told that it is not advisable to store it in File. But here, Creating a Separate table will be a big task it seems and will be done only when required and if there is no other option.
Please let me also know the required fields to be put in that.
I thought of adding following Columns:
Counter, Program-Name, Para-Name, Timestamp

This Counter will be used to start the Program next time when it abends in between.

Previously the programs where taking very less time.So I never used the Commit-Retart logic and now this Checkpoint needs to be implemented as this Program is taking long time.

I got some Cobol-Db2-IMS Program which I tried to implement and I was not able to understand the IMS but compiled, binded my program with that properly but run time(S04C ERROR)error was there(I created similar PSB and all).
As I was not knowing much about IMS and there are IMS input file in that and I was using Flat Files for my Program. So it might be the problem.

For Restarting the Program from the abend,
I also want to know how to avoid the read (Input /Output Operation) till that pointer for which I have read already and inserted, if it is PS File as it is not indexed one.

and also for the table, I am using the cursor to take the records from the table but next time when it is restarted I want to avoid fetching the n no. of records which I already have fetched and updated.

Please let me know.
Thanks in advance.
_________________
Have a Great Day.
Thanks & Regards,
Jai
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Oct 15, 2003 1:42 pm    Post subject: Reply with quote

Jai,

The checkpoint-restart logic can be best explained in person rather than over the internet. I suggest you get a copy of IMS book and read it.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DFSP30F3/CCONTENTS?DT=20020906093406

Since you are using IMS for check point restarting, there are some things which need to be done before you run your program.

1.Create the PSB and it should be gened by your local-dba.The DBA will also do the ACBGEN.
PSB is a control block that contains all database program communication blocks (DB PCB) that exist for a single application program. DB PCBs define which segments in a database an application can access.

In your case you will GSAM databases since your input file is a flat file.In PSB definition you will define your GSAM databases as follows

Code:

PCB    TYPE=GSAM,DBDNAME=INPUT1,PROCOPT=GS
....

PCB    TYPE=GSAM,DBDNAME=OUTPUT1,PROCOPT=LS 
...


Notice the PROCOPT on the definition , GS is used for input files so as to read sequentially LS is used for output files so as to load sequentially

Now the programming part.

There will be checkpoint-save-area in the program. so you include all your variables in that area.If your input file is the driver file for the program then I would recommend that you
declare the file in there.
Code:

01  CHECKPOINT-RESTART-ID       PIC X(12)       VALUE SPACES.
01  CHECKPOINT-MAX-SEG-LENGTH   PIC S9(8) COMP  VALUE +2000.
01  CHECKPOINT-LENGTH           PIC S9(8) COMP.             
                                                             
01  CHECKPOINT-START-AREA       PIC X(32) VALUE             
    'XXXX CHECKPOINT START AREA XXXX'.                       
                                                             
01  CHECKPOINT-START            PIC X(08) VALUE 'XXXXXXXX'. 
                                                             
01  CHECKPOINT-ID.                                           
    03  CHECKPOINT-SYSTEM       PIC X(03) VALUE '???'.       
    03  CHECKPOINT-INCREMENT    PIC 9(05) VALUE ZERO.       
                                                             
01  CHECKPOINT-COUNT            PIC 9(05) VALUE ZERO.       
01  CHECKPOINT-COUNT-TOT        PIC 9(05) VALUE ZERO.       
                                                             
01  CHECKPOINT-SAVE-DATA.                                   
    03  CHECKPOINT-DATE         PIC X(08).                   
    03  CHECKPOINT-TIME.                                     
        05  CHECKPOINT-TIME-HH  PIC X(02).                   
        05  CHECKPOINT-TIME-MM  PIC X(02).                   
        05  CHECKPOINT-TIME-SS  PIC X(02).                   
        05  FILLER              PIC X(02).                   
                                                             
******************************************************************
* CHECKPOINT SAVE VARIABLES                                      *
******************************************************************
                                                                 
 01 A-CP-COUNTERS.                                               
    05 A-CP-INPUT-RECS-READ      PIC S9(09) VALUE ZEROES.         
    05 A-CP-OUTPUT-RECS-WRITTEN  PIC S9(09) VALUE ZEROES.         

******************************************************************
* CHECKPOINT FILE LAYOUTS                                        *
******************************************************************
01 INPUT-DRIVER-REC.
   05 INPUT-KEY                  PIC X(10).
  ....



Cursor declaration.

Code:

EXEC SQL DECLARE SPLAN-CSR CURSOR FOR               
     SELECT *                               
       FROM TABLE                               
      WHERE PRIMARY_KEY       >= :W-INPUT-KEY
      WITH UR                                       
END-EXEC.                                           


Define your GSAM databases in the linkage section
Code:

01  INPUT1-PCB.                                             
    03  INPUT1-DBD-NAME        PIC X(08 ).                   
    03  INPUT1-SEG-LEVEL       PIC X(02).                   
    03  INPUT1-STATUS          PIC X(02).                   
        88  INPUT1-CALL-SUCCESSFUL                           
                                VALUE '  '.                   
        88  INPUT1-END-OF-FILE                               
                                VALUE 'GB'.                   
    03  INPUT1-PROC-OPTIONS    PIC X(04).                   
    03  FILLER                  PIC S9(5)  COMP.             
    03  INPUT1-SEG-NAME        PIC X(08 ).                   
    03  INPUT1-KEY-LENGTH      PIC S9(5)  COMP.             
    03  INPUT1-SEN-SEG-NUMBER  PIC S9(5)  COMP.             
    03  INPUT1-KEY-FEEDBACK    PIC X(08 ).                   


01  OUTPUT1-PCB.                                     
    03  OUTPUT1-DBD-NAME        PIC X(08 ).           
    03  OUTPUT1-SEG-LEVEL       PIC X(02).           
    03  OUTPUT1-STATUS          PIC X(02).           
        88  OUTPUT1-CALL-SUCCESSFUL                 
                                VALUE '  '.         
        88  OUTPUT1-END-OF-FILE                     
                                VALUE 'GB'.         
    03  OUTPUT1-PROC-OPTIONS    PIC X(04).           
    03  FILLER                  PIC S9(5)  COMP.     
    03  OUTPUT1-SEG-NAME        PIC X(08 ).           
    03  OUTPUT1-KEY-LENGTH      PIC S9(5)  COMP.     
    03  OUTPUT1-SEN-SEG-NUMBER  PIC S9(5)  COMP.     
    03  OUTPUT1-KEY-FEEDBACK    PIC X(08 ).           




Main logic:


Code:

PROCEDURE DIVISION  USING PCB-IO           
                          PCB-IO-ALT       
                          D02PCHKP-PCB     
                          INPUT1-PCB     
                          OUTPUT1-PCB

      PERFORM 5000-GET-RESTART-ID
 
      IF CHECKPOINT-RESTART-ID = SPACES             
         PERFORM 10000-START-FROM-BEGINNING         
      ELSE                                           
         PERFORM 15000-RESTART-FROM-CHECKPOINT     
      END-IF     
       
      PERFORM 20000-MAIN-PROCESS UNTIL S-INPUT1-EOF = 'Y'
      .

05000-GET-RESTART-ID.
***************************************************************
**  THE FOLLOWING PROCESS GETS THE RESTART-ID                **
***************************************************************
                                                               
    CALL 'TSIMSLEN' USING CHECKPOINT-START                     
                          CHECKPOINT-END                       
                          CHECKPOINT-LENGTH                   
                                                               
    MOVE SPACES                 TO CHECKPOINT-RESTART-ID       
                                                               
    CALL 'CBLTDLI'  USING XRST                                 
                          PCB-IO                               
                          CHECKPOINT-MAX-SEG-LENGTH           
                          CHECKPOINT-RESTART-ID               
                          CHECKPOINT-LENGTH                   
                          CHECKPOINT-START                     
                                                               
    EVALUATE PCB-IO-STATUS                                     
        WHEN '  '                                             
            CONTINUE                                           
        WHEN OTHER                                             
            MOVE '05000'                  TO WS-ABEND-PARAGRAPH
            MOVE XRST                     TO DLI-ERROR-FUNCTION
            MOVE PCB-IO-LTERM-NAME        TO DLI-ERROR-DBD     
            MOVE PCB-IO-STATUS            TO DLI-ERROR-STATUS 
            MOVE PCB-IO-USERID            TO DLI-ERROR-SEG     
            PERFORM ABEND                               
    END-EVALUATE                                               
    .
10000-START-FROM-BEGINNING.
***************************************************************
**  THE FOLLOWING PROCESS '10000-START-FROM-BEGINNING'       **
**  WILL BE EXECUTED AT NORMAL START.                        **
***************************************************************
     
      DISPLAY    'STARTING FROM BEGNINNING'                       
                                                 
      MOVE FUNCTION CURRENT-DATE (1: 8)    TO CHECKPOINT-DATE   
      ACCEPT CHECKPOINT-TIME    FROM TIME             
       
      PERFORM 50000-READ-INPUT-FILE
      .

15000-RESTART-FROM-CHECKPOINT.       
***************************************************************
*   THE FOLLOWING PROCESS '16000-RESTART-FROM-CHECKPOINT'    **
*   WILL BE EXECUTED AT RESTART.                             **
***************************************************************

    DISPLAY 'THE PROGRAM RESTARING FROM CHECKPOINT ID:' CHECKPOINT-RESTART-ID 
    PERFORM 50000-READ-INPUT-FILE
    .

20000-MAIN-PROCESS.       
***************************************************************
*   THE FOLLOWING PROCESS IS BUSINESS PROCESSING SECTION     **
***************************************************************
     
       PERFORM 60000-OPEN-CURSOR
       PERFORM 65000-FETCH-CURSOR
       PERFORM UNTIL S-EOF-CURSOR = 'Y'
               PERFORM 30000-BUSINEESS-PROCESS
               PEFORM  55000-WRITE-OUTPUT-RECORD
               PERFORM 65000-FETCH-CURSOR
       END-PERFORM
       PERFORM 70000-CLOSE-CURSOR
       PERFORM 75000-TAKE-A-CHECKPOINT 
       PERFORM 80000-INIT-WORKING-AREAS
       PERFORM 50000-READ-INPUT-FILE 
       .
50000-READ-INPUT-FILE.                                         
*****************************************************************
* THIS PARAGRAPH IS PERFORMED TO READ A RECORD FROM THE INPUT   *
* DRIVER FILE.                                                  *
*****************************************************************
                                                                 
     CALL 'CBLTDLI' USING GN                                     
                          INPUT1-PCB                           
                          INPUT-DRIVER-REC
                                                                 
     EVALUATE INPUT1-STATUS                                     
         WHEN SPACES                                             
           MOVE INPUT-KEY        TO W-INPUT-KEY             
           ADD +1                TO A-CP-INPUT-RECS-READ           
         WHEN  'GB'                                             
           MOVE 'Y'  E           TO S-INPUT-EOF             
         WHEN OTHER                                             
           MOVE 'IMS'            TO WS-ABEND-TYPE               
           MOVE '50000'          TO WS-ABEND-PARAGRAPH           
           MOVE 'GN'             TO DLI-ERROR-FUNCTION           
           MOVE INPUT1-STATUS    TO DLI-ERROR-STATUS             
           MOVE INPUT1-DBD-NAME  TO DLI-ERROR-DBD               
           MOVE INPUT1-SEG-NAME  TO DLI-ERROR-SEG               
           MOVE INPUT1-SEG-LEVEL                               
                                 TO DLI-ERROR-LEVEL             
           MOVE INPUT1-KEY-FEEDBACK                             
                                 TO DLI-ERROR-KEY               
           PERFORM ABEND                                   
     END-EVALUATE                                               
     .                               



Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Jai
Beginner


Joined: 06 Jun 2003
Posts: 57
Topics: 20

PostPosted: Thu Oct 16, 2003 2:50 am    Post subject: Reply with quote

Hi Kolusu,

Thanks a lot! for such a detailed explanation.
Your Code seems to be somewhat similar to the code which I got, so didn't changed that as it would take time for me to change again.
But PSB part is different as the code which I got involves input from GSAM FIle and inserting into the DB2 Table.
It is like below:


***************************** Top of Data ******************************
TITLE 'ASSEMBLE OF PSBNAME=CMTBL '
* DSNAME=IMSVS.IMSN.PSBLIB
* VOL=ITSA01
***********************************************************************
* PCB NUMBER 1 GSAM NUMBER 1
***********************************************************************
PCB TYPE=GSAM, C
NAME=GSM0601, C
PROCOPT=GS
PSBGEN PSBNAME=CMTBL, C
LANG=ASSEM, C
CMPAT=YES
END
**************************** Bottom of Data ****************************

What I did for my Program is just changed the name of PSBNAME
But as I have input as Flat Files , I think I am getting S04C error. I couldn't proceed further.
You also suggested the code for PSB as
ode:

PCB TYPE=GSAM,DBDNAME=INPUT1,PROCOPT=GS
....

PCB TYPE=GSAM,DBDNAME=OUTPUT1,PROCOPT=LS
...

I am confused here as all are Type=GSAM
and mine is Flat File.
Whether this is necessary for just including Commit-Restart Logic.
Or please send me the code for Normal Cobol-DB2 Program's Checkpoint-commit-restart.
Please let me know.
Thanks in advance.
_________________
Have a Great Day.
Thanks & Regards,
Jai
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Oct 16, 2003 4:49 am    Post subject: Reply with quote

Jai,

Please read the manual listed in my previous post, especially the chapter 1.10 which explains about GSAM databases.

check this direct link for Processing GSAM Databases

GSAM is a very much similar to a regular sequential file which has no segments, no keys, and no parentage.

so you can give your flat file to the ddname GSM0601 and to read it follow 50000 paragraph in my example.Since you do not have any output file you don't need the GSAM DATABASE declaration OUTPUT1.

Before you run your program, you need to make changes to your PSB.You need to change your the 3rd line from bottom to refer cobol as language.once you change it your DBA must re-gen the psb.You can remove the reference to C language if you are not using it.

Code:

LANG=COBOL



Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Jai
Beginner


Joined: 06 Jun 2003
Posts: 57
Topics: 20

PostPosted: Mon Oct 27, 2003 5:09 am    Post subject: Reply with quote

Hi Kolusu,

I thought to implement the cobol or DB2 stuff for commit - restart but some body told that in IMS it takes care of positioning the cursor to the record where it abended (for input Flat Files)so suggested to follow that. But getting stuck up at run time. Please help me.

That is not the reference to C language but the Continuation Character at end, While Copying it just merged with the other characters.

I am getting the User Abend U3057.
Code:

**************
CEE3250C The system or user abend U3057 R=NULL     was issued.                 
         From compile unit CMTBL1 at entry point CMTBL1 at statement 1640 at compile unit offset +00002EAA at address
         3F05E67A.                                                             
**************

And at statement 1640 the sentence is as follwos:
001640 1 CALL 'DSNHLI' USING SQL-PLIST2

This abend mainly tells for the IMS-DB2 Connection Problem.
Compiling and binding is fine and while running it is giving this error.
While Compiling, I gave IMS Attach as 'Y' in changeman.

Ravikumar,


Please find below the JCL
**********************
*****
JOB
*****
Code:

//PP4141AC JOB (@),'RUN-CMTBL1',MSGCLASS=R,CLASS=0,NOTIFY=&SYSUID,     
//             TIME=120                                               
/*ROUTE XEQ DB2D                                                       
/*OUTPUT DUMP DEST=LOCAL                                               
//     JCLLIB ORDER='PP4141A.VDR.JCLS'                                 
//***************************************************************     
//*                  STEP010 (CMTBL1P)                                 
//*           THIS STEP IS UCC11 RESTARTABLE                           
//***************************************************************     
//STEP010  EXEC PROCCMTB                                               
//*                                                                   
//***************************************************************     
//STEP020  EXEC PGM=IKJEFT01,DYNAMNBR=20,REGION=5M                     
//*SINFIL1  DD DSN=WXX262.AP.AP850850.CAP.FILE.TO.WEB.PH1,DISP=SHR     
//*SINFIL2  DD DSN=WXX262.AP.AP850850.MAP.FILE.TO.WEB.PH1,DISP=SHR     
//*                                                                   
//SYSTSIN  DD *                                                       
  DSN SYSTEM(DB2D)                                                     
  RUN PROGRAM(CMTBL1) PLAN(CMTBL12)-   
  LIB('CHGMAN.GMS1.#009888.LO2')       
  END                                   
/*                                     
//*                                     
//SYSTSPRT DD SYSOUT=*                 
//SYSPRINT DD SYSOUT=*                 
//SYSOUT   DD SYSOUT=*                 
//*                                     

*****
PROC PROCCMTB
*****

//PROCCMTB PROC JOBNM='CMTBL1',                                     
//*            SOUTQ='(Q,,DUMP)',                                   
//*            SOUTJ=*,                                             
//             SYSDA=SYSDA,                                         
//*            ENV=TEST,                                             
//             LOGDD0='DUMMY,',                                     
//             DDITV=PP4141A.VDR.DATALIB,                           
//*            DDITV=WXX262.SEWOL.DATALIB,                           
//*            DATALIB=WXX262.SEWOL.DATALIB,                         
//             STAT='PP4141A',                                       
//             CHKPTID1=,                                           
//             DBRC=N                                               
//***************************************************************   
//*                  STEP010 (CMTBL1P)                               
//*           THIS STEP IS UCC11 RESTARTABLE                         
//***************************************************************   
//*STEP1  EXEC UCC11RMS                                             
//STEP010  EXEC PGM=DFSRRC00,REGION=5M,                             
//         PARM=(DLI,CMTBL1,CMTBL1,,,,,&CHKPTID1,,,,,,&DBRC)     
//STEPLIB  DD DSN=CHGMAN.GMS1.#009888.LO2,DISP=SHR               
//         DD DSN=IMSVS.IMSN.RESLIB,DISP=SHR                     
//         DD DSN=IMSVS.IMSN.USERLIB,DISP=SHR                     
//*        DD DSN=PP4141A.PSB1.JCLS,DISP=SHR                     
//         DD DSN=IMSVS.IMSN.PGMLIB,DISP=SHR                     
//         DD DSN=DB2DP.DEVL.PGMLIB,DISP=SHR                     
//*        DD DSN=WXX262.SEWOL.PGMLIB,DISP=SHR                   
//         DD DSN=CHGMAN.GMSE.PGMLIBO,DISP=SHR                   
//         DD DSN=ADC1.TEST.PGMLIB,DISP=SHR                       
//         DD DSN=SYS1.HG2000.LOADLIB,DISP=SHR                   
//         DD DSN=ADC1.IPCW.PROD.PGMLIB,DISP=SHR                 
//         DD DSN=ADC1.IPCW.PROD.LINKLIB,DISP=SHR                 
//         DD DSN=IMSVS.TEST.PRODUCTS,DISP=SHR                   
//         DD DSN=DB2SYS1.VEND.LOADLIB,DISP=SHR                   
//*                                                               
//IMS      DD DSN=IMSVS.IMSN.PSBLIB,DISP=SHR                     
//         DD DSN=IMSVS.IMSN.DBDLIB,DISP=SHR                     
//         DD DSN=PP4141A.PSB.JCLS,DISP=SHR                       
//*                                                             
//DFSRESLB DD DSN=IMSVS.IMSN.RESLIB,DISP=SHR                   
//*                                                             
//*                                                             
//IMSLOGR  DD &LOGDD0.DSN=&STAT..&JOBNM..CMTBL1P.INQ.LOG,       
//            DISP=(OLD,KEEP,KEEP)                             
//*                                                             
//IEFRDER  DD DSN=&STAT..&JOBNM..CMTBL1.INQ.LOG,               
//            DISP=(NEW,DELETE,DELETE),                         
//            DCB=IM.LOG.MODLDSCB,                             
//            DATACLAS=STANDARD,                               
//            TRTCH=NOCOMP,                                     
//            UNIT=&SYSDA                                       
//*                                                             
//DDITV02  DD DSN=&DDITV(CMTBL1),                               
//            DISP=SHR                                         
//*                                                             
//*                                                             
//*  DB2D,,DSNMIN10,,R,,,UHW0006S,UHW0006S                     
//*                                                       
//*DDOTV02  DD DSN=PP4141A.DB2.CMTBL1P.INQ,               
//*            DISP=(NEW,DELETE,CATLG),UNIT=&SYSDA,       
//*            DCB=(LRECL=4092,RECFM=V,BLKSIZE=0),       
//*            DATACLAS=STANDARD                         
//*                                                       
//CHEKFREQ DD DSN=PP4141A.JCL(CMTBL1),                   
//            DISP=SHR                                   
//*                                                       
//GSM0601I DD DSN=PP4141A.CAP.FL1,DISP=SHR               
//GSM0602I DD DSN=PP4141A.MAP.FL1,DISP=SHR               
//*                                                       
//SYSPRINT DD SYSOUT=*                                   
//SYSOUT   DD SYSOUT=*                                   
//SYSABOUT DD SYSOUT=*                                   
//SYSUDUMP DD SYSOUT=*                                   
//*                                                       
**********************

Thanks in advance.
_________________
Have a Great Day.
Thanks & Regards,
Jai
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Mon Oct 27, 2003 5:51 am    Post subject: Reply with quote

Jai,

check if you binding the program to the correct region.If you are indeed binding to the correct region , then check CLASS=0 in your job card is attached to DB2.

Also shouldn't you be running the program in BMP mode? i.e
Code:

//         PARM=(DLI,CMTBL1,CMTBL1,,,,,&CHKPTID1,,,,,,&DBRC)   



it should be
Code:

//         PARM=(BMP,CMTBL1,CMTBL1,,,,,&CHKPTID1,,,,,,&DBRC)


By coding like that you are running a IMS program named CMTBLI with a plan named CMTBLI in a Batch mode[BMP).

Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ramu_mohan21
Beginner


Joined: 29 Jun 2004
Posts: 106
Topics: 41
Location: Bangalore, INDIA

PostPosted: Tue Nov 09, 2004 4:49 am    Post subject: Reply with quote

Hi Board,
Thanks to Kolusu for giving his strong support for updating our skills. In our Installation we are having BMP jobs to insert the Data into IMS Database. The data will be supplied through the GDG Version File. CHECKPOINT and RESTART Logic have been implemented in these UPLOADING COBOL Programs.

If there is any abend occurs while uploading the data then while restarting the JOB again we will take the last checkpoint and pass it to the DFSRRC00 as a PARM and restart it.

But here I have doubt that when HALF of the File have been read and it has been uploaded to IMS Database. Then it is abended. When we are restarting it again is that file needs to Re-read again to reach to the point where it is abended. Otherwise automatically it will be handled through IMS itself. Please clarify.
_________________
Best Regards,
----------------
Rammohan Pabba
Software Engineer
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Tue Nov 09, 2004 5:52 am    Post subject: Reply with quote

Ramu_mohan21,

Quote:

But here I have doubt that when HALF of the File have been read and it has been uploaded to IMS Database. Then it is abended. When we are restarting it again is that file needs to Re-read again to reach to the point where it is abended. Otherwise automatically it will be handled through IMS itself. Please clarify


Are you reading the GDG as a GSAM database or a normal sequential file? If it is GSAM database then IMS automatically maintains pointers and subsquent reads will result in reading the key after the last checkpoint.

Check this link for a better understanding of Processing GSAM Databases

If you are reading the GDG as a flat file then you need to code yourself the logic to store the checkpoint key and re-position your file after the abend, while restarting.

Hope this helps....

Cheers

Kolusu

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ramu_mohan21
Beginner


Joined: 29 Jun 2004
Posts: 106
Topics: 41
Location: Bangalore, INDIA

PostPosted: Tue Nov 09, 2004 6:46 am    Post subject: Reply with quote

Hi Kolusu,
Quote:

Are you reading the GDG as a GSAM database or a normal sequential file?


Please can you tell me that How can we distinguish Reading GDG as a GSAM Database (or) Normal Sequential File. (Please don't mind if it is a fundamental doubt)

I feel that in our installaction we are using GDG as a normal sequential file. But I am not sure. I will let you know very soon.
_________________
Best Regards,
----------------
Rammohan Pabba
Software Engineer
Back to top
View user's profile Send private message Send e-mail
ramu_mohan21
Beginner


Joined: 29 Jun 2004
Posts: 106
Topics: 41
Location: Bangalore, INDIA

PostPosted: Tue Nov 09, 2004 6:50 am    Post subject: Reply with quote

Hi Kolusu,
Quote:

If you are reading the GDG as a flat file then you need to code yourself the logic to store the checkpoint key and re-position your file after the abend, while restarting.


If programmer explicitly using this logic within in the program itself what is the use of Checkpoint-Restart Logic. I mean this logic can be utilized ONLY to store the required working storage section variable to the log file(In the case of flat file). Am I Right?
_________________
Best Regards,
----------------
Rammohan Pabba
Software Engineer
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Tue Nov 09, 2004 9:01 am    Post subject: Reply with quote

ramu_mohan21,

Quote:

Please can you tell me that How can we distinguish Reading GDG as a GSAM Database (or) Normal Sequential File. (Please don't mind if it is a fundamental doubt)


Look at the read statement for the file in question. If it is using an IMS call then, it is a GSAM database

EX:
Code:

CALL 'CBLTDLI' USING GN               
                     JCL-DDNAME-PCB     
                     RECORD-LAYOUT


If the program is reading the file using the regular cobol read as shown below then you are reading the file as a flat file

Code:

READ INPUT-FILE
    AT END                                       
        MOVE C-TRUE         TO S-EOF-INPUT-FILE       
END-READ                                         


Quote:

If programmer explicitly using this logic within in the program itself what is the use of Checkpoint-Restart Logic. I mean this logic can be utilized ONLY to store the required working storage section variable to the log file(In the case of flat file). Am I Right?


Well the programmer can code the checkpoint-restart logic and store the variables. But you will have a lot of overhead.

Ex: program is reading 4 files with 5 million in each file and writting out another 5 files.

Now let us say the program abended after processing 4.5 million. Now since you stored the last key read you need to open all the files once again and just keep on reading the 4.5 million records once again from the beginning.

Handling the output files is much more difficult. you need to delete the output records which are written from the last checkpoint to the record where your program abended. Let us say your commit is set for every 1000 records read. Now your program reads in a record and does some calculations and writes out the record. Now your program abended in record # 1800, you need to delete all the records from 1001 to 1799 at the time of restart as you saved the key after commiting for every 1000 records.

Hope this helps...

Cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ramu_mohan21
Beginner


Joined: 29 Jun 2004
Posts: 106
Topics: 41
Location: Bangalore, INDIA

PostPosted: Wed Nov 10, 2004 8:03 am    Post subject: Reply with quote

Hi Kolusu,
Thank you very much for giving clear explanation. I have got very good concept. I checked in our installaction that we are using the GDG Version as a GSAM file.
_________________
Best Regards,
----------------
Rammohan Pabba
Software Engineer
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> IMS All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group