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

Why occurs cannot be used in 01 level in COBOL?

707


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

697


What is amode(31)

714


i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?

885


What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?

707






Can a Search can be done on a table with or without Index?

798


Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?

809


Can you please let me know the centre name of INS certification in Kolkata.

1708


What is rmode(any) ?

676


What is the Purpose of Pointer in the string?

636


What happens when we move a comp-3 field to an edited (say z (9). Zz-)?

764


What is a SSRANGE and NOSSRANGE?

809


which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad

1015


What is the difference between external and global variables in COBOL?

806


What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?

667