Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Predefine Function or Verb in COBOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Vineet

New User


Joined: 14 Sep 2005
Posts: 18

PostPosted: Fri Jun 15, 2007 12:42 pm    Post subject: Predefine Function or Verb in COBOL
Reply with quote

Hi All,

I am having a query. Is there any Predefine function or Verb in COBOL which can bring the control out of any construct i.e. If Statement. For Example I am having following condition, its for COBOL/DB2 Pgm.

Main-Processing-Para
If (Some Condition)
Para-1
Para-2
Else
Para-3
Para-4
Para-5
Para-6
Para-7
End-if.
Para-8
Para-9.

I want that if from Para3 To Para7, if SQLCODE = +100 is encountered in any Para then remaning Paras should get skipped i.e. If SQLCODE=+100 in Para4 then Para5 To Para7 to get Skipped & Control to set at Para8. One Solution is 'Go To'. I want t to Know any Function or Verb.

Thanks

Vineet Anand
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Jun 15, 2007 12:48 pm    Post subject:
Reply with quote

Hello,

I believe not - you must control the process flow in your code.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Fri Jun 15, 2007 2:11 pm    Post subject:
Reply with quote

Adding another condition statement should help you in such case. If there are to many nested Ifs then cosider using EVALUATE. Please let us know if I missed something..
Back to top
View user's profile Send private message
Pons

New User


Joined: 25 May 2007
Posts: 61
Location: Coimbatore

PostPosted: Fri Jun 15, 2007 3:21 pm    Post subject: Re: Predefine Function or Verb in COBOL
Reply with quote

I think you may use the Next Sentense verb.

If SQLCODE = +100
NEXT SENTENCE
end-if

you must code this for each para except last para.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Jun 16, 2007 5:06 am    Post subject:
Reply with quote

Hello,

There are several simple ways to code to get the desired result.

I still believe there is no builtin-in function that will let you "bail out" in the middle of a process. All of the suggestions above are ways to implement such code.

Maybe that is what the original request is asking for, but i did not think so icon_confused.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Submit job from Cobol with input data abdulrafi COBOL Programming 4 Wed Feb 01, 2017 12:41 pm
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us