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
 

 

VS COBOL ON condition. How it works? how is it converted to?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Sasi Kiran Patha
Warnings : 2

New User


Joined: 19 Nov 2006
Posts: 73
Location: Hyederabad

PostPosted: Fri Dec 29, 2006 9:45 am    Post subject: VS COBOL ON condition. How it works? how is it converted to?
Reply with quote

Hi,
Would anyone let me know how ON condition works in VSCOBOL.
How do we convert a code using ON condition into a code that uses
IF condition.
Regards,
Sasi Patha.
Back to top
View user's profile Send private message

Sasi Kiran Patha
Warnings : 2

New User


Joined: 19 Nov 2006
Posts: 73
Location: Hyederabad

PostPosted: Fri Dec 29, 2006 10:38 am    Post subject: I got the solution...
Reply with quote

hi,

here is the info i got about about ON condition .

its a part of "Converted COBOL Language Elements"...


The ON statement is not supported by the target languages.

The statement:
ON integer
imperative statement
is converted to:
ADD 1 TO LCP-ONCTR-nn
IF LCP-ONCTR-nn = integer
imperative statement
The statement:
ON integer-1 until integer-2
imperative statement
is converted to:
ADD 1 TO LCP-ONCTR-nn
IF LCP-ONCTR-nn > (integer-1 - 1) & < integer-2
imperative statement
A data item with the dataname LCP-ONCTR-nn (where nn is a sequence number) is added into the WORKING-STORAGE section with an initial value of zero.
More complex ON statements are flagged.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Jan 02, 2007 12:11 am    Post subject:
Reply with quote

The most poular use of the ON stmt when it was supported was as a 1st time switch.

Very handy; I miss it.
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 Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm


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