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

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


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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 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 Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top