after udatingg first 110 rows, my job abends. now how do i
change my cobol program so that when i restart the Job it
will start updating from 111th row ( i.e in next run I
di=ont want to update those 110 rows which are already been
updated in the first run before job abend)

Answer Posted / kapil arya

For this situation, we must use the Check Point and Restart
Logic in COBOL program wherever you are reading or modifing
the Record from a file or a Db2 Tables.

For this you have to define one counter variable in working
storage section which contains your Recod Key.
01 WS-EMP-REC-KEY PIC X(8).
01 WS-SVE-CNT-KEY PIC X(8).
And after that first time when you will start reading the
file you have to check it
If WS-SVE-CNT-KEY = SPACES then start reading the record
from first record and as per you requirement you can save
you record key in this counter variable after 500 (for E.g)
and increase you counter variable by 1 after reading each
record when the counter variable will reach on 500 then
move this value to save variable.
Move WS-EMP-REC-KEY TO WS-SVE-CNT-KEY.
And then Write your 500 record in a file. And using the
COMMIT save this status. and after that set the counter
value to 0 again and start it from top...
And suppose You job abends after reading 1055 records that
means 1000 records has been written in your o/p file. and
when you restart your job again it will match again
If WS-SVE-CNT-KEY = SPACES then this variable will have the
record key of 1000th record then it will start readind the
record from 1001..

Is This Answer Correct ?    0 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

1.Is it possible to move the data from 99.99 to 99v99? 2.What is the CICS-vsam Compilation process? 3.In My GDG 5 generation will be there GDG3 got an abend what will happen? 4.In my GDG first generation is +1 And I want to add the new generation what will happen previous generation? 5.How can you give the PIC clause below conditions A). s9 (reddy), B). s9 (5) occurs 5 times? 6.How override the proc from a particular step? and what is symbolic and override Procs?

5385


What is the difference between structured cobol programming and object alternativelyiented cobol programming?

718


Which is not true about evaluate statement

1630


How do you define a variable of comp-1 and comp-2?

711


How do you get the data to code the BMS macro?

1482






i have 10 names in an array and my name is one of them also array is not in sorted order i need to display my name using index how will i do this

1007


System Testing for Mainframe Developers What is System Testing? integration testing ? what's the procedure ..

1600


what is the use of outrecord?

1777


What is the difference between PIC 9.99 and PIC9v99?

790


Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?

639


What is the utilization of copybook in cobol? Could we utilize a similar copybook?

725


What are the different rules to perform a Search?

623


Mention the guidelines to write a structured cobol program?

626


Write the code to count the sum of n natural numbers.

705


) How do u handle errors in BMS macro

1514