View previous topic :: View next topic
|
Author |
Message |
praneethgokul
New User
Joined: 06 May 2005 Posts: 20 Location: Bangalore
|
|
|
|
Hi all,
Is there any option of RESTART in COBOL?
Please clarify me
Thanks in advance |
|
Back to top |
|
|
Rupesh.Kothari
Member of the Month
Joined: 27 Apr 2005 Posts: 463
|
|
|
|
Hi Praneethgoku,
Please explain your requirement.
Regards
Rupesh |
|
Back to top |
|
|
radhakrishnan82
Active User
Joined: 31 Mar 2005 Posts: 435 Location: chennai, India
|
|
|
|
Restart what? |
|
Back to top |
|
|
praneethgokul
New User
Joined: 06 May 2005 Posts: 20 Location: Bangalore
|
|
|
|
hi everybody
Suppose I have a file of 1000 records. While reading it if it has an error at 95th record. Then I want to read the file again from 96th.
I dont want to read it again from 1st record. Is there any chance?
Please clarify me |
|
Back to top |
|
|
radhakrishnan82
Active User
Joined: 31 Mar 2005 Posts: 435 Location: chennai, India
|
|
|
|
Assuming that you are reading vsam file records.
Implement restart logic so that it will skip all the records till the error record and read from 96th record. |
|
Back to top |
|
|
Rupesh.Kothari
Member of the Month
Joined: 27 Apr 2005 Posts: 463
|
|
|
|
Hi Praneethgokul,
I guess there is no Restart command as you want in COBOL. You have to implement logic in Cobol program.
Regards
Rupesh |
|
Back to top |
|
|
michaelraj
New User
Joined: 01 Sep 2005 Posts: 43 Location: Bangalore
|
|
|
|
Hi Praneeth,
There is no such option like Restart in cobol. If at all required we can have database variable like db_count which indicates how many records read and it will updates as soon as it read a record. If you got an error, then you can retrieve the value from DB and from there you can read again.
If at all you are reading and writing into another file, then you have to read the last record and from there you have to point to next record with START in read file and then proceed further.
I think this is the only possible way, if there are other ways let me know.
Regards,
Mike. |
|
Back to top |
|
|
michaelraj
New User
Joined: 01 Sep 2005 Posts: 43 Location: Bangalore
|
|
|
|
Hi praneeth,
We need Database variable if the program is abended and then again if you want to restart and perform at that point while reading the file. If the program is not abended then working storage variable is enough.
Regards,
Mike. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Praneeth,
Have you looked in the manuals? There are 2 that you should search as a matter of course: The Reference manual and the Pgmr's Guide.
I looked and found more info than I care to read. Perhaps you will because you have the problem.
If you are not aware oof it, the manuals here at this site can be found by clicking "manuals" at the very to of the page. Click the manual that applies, scroll down to the index, click then scroll down to the "R"a and look for something like "restart" or "restarting" and get to work.
P.S. Checkpoint/Restart has been around for a looooooong time. By the way, this is a hint. More info can be found using "Checkpoint" as a search arg. |
|
Back to top |
|
|
|