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

Is there any option of RESTART in COBOL


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

New User


Joined: 06 May 2005
Posts: 20
Location: Bangalore

PostPosted: Thu Sep 01, 2005 7:21 pm
Reply with quote

Hi all,

Is there any option of RESTART in COBOL?

Please clarify me

Thanks in advance
Back to top
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 463

PostPosted: Thu Sep 01, 2005 7:26 pm
Reply with quote

Hi Praneethgoku,

Please explain your requirement.

Regards
Rupesh
Back to top
View user's profile Send private message
radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 435
Location: chennai, India

PostPosted: Thu Sep 01, 2005 7:57 pm
Reply with quote

Restart what?
Back to top
View user's profile Send private message
praneethgokul

New User


Joined: 06 May 2005
Posts: 20
Location: Bangalore

PostPosted: Fri Sep 02, 2005 4:12 pm
Reply with quote

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
View user's profile Send private message
radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 435
Location: chennai, India

PostPosted: Fri Sep 02, 2005 4:28 pm
Reply with quote

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
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 463

PostPosted: Fri Sep 02, 2005 4:35 pm
Reply with quote

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
View user's profile Send private message
michaelraj

New User


Joined: 01 Sep 2005
Posts: 43
Location: Bangalore

PostPosted: Fri Sep 02, 2005 4:40 pm
Reply with quote

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
View user's profile Send private message
michaelraj

New User


Joined: 01 Sep 2005
Posts: 43
Location: Bangalore

PostPosted: Fri Sep 02, 2005 4:45 pm
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Sep 06, 2005 12:14 am
Reply with quote

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
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 SCOPE PENDING option -check data DB2 2
Search our Forums:

Back to Top