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 ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts What is the Extract Function in JCL dharmaraok JCL & VSAM 3 Wed Jun 14, 2017 9:12 am
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm


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