Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us