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
 
ON command in COBOL

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

New User


Joined: 09 Jan 2009
Posts: 7
Location: Chennai / Kolkata

PostPosted: Mon Mar 01, 2010 4:51 pm    Post subject: ON command in COBOL
Reply with quote

Hi I just came accross ON command in COBOL like

ON 1

PERFORM 1000-PARA

ELSE

NEXT SENTENCE.

Can anyone tell me what does it mean?

I have convert this COBOL module to New version of COBOL VS-COBOL -II ...what will be syntax in new version of COBOL - as while compiling it is givig error ?

Thanks
Somenath
Back to top
View user's profile Send private message

Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1243
Location: Israel

PostPosted: Mon Mar 01, 2010 6:57 pm    Post subject: Reply to: ON command in COBOL
Reply with quote

"ON 1" is now obsolete. It is more or less equivalent to the following:
Code:
WORKING-STORAGE SECTION.
01  FLAG-ON1     PIC 9(4) COMP VALUE 1.

PROCEDURE DIVISION.
    IF FLAG-ON1 = 1 THEN
        PERFORM 1000-PARA
        MOVE 99 TO FLAG-ON1
    END-IF
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: Mon Mar 01, 2010 9:05 pm    Post subject:
Reply with quote

Hello,

"ON" was removed years ago.

Quote:
Can anyone tell me what does it mean?
ON was often used for a "first-time" switch/indicator.

It was also used when testing to limit the amount of volume without needing to add the code to define/increment/test a counter (i.e. process only 100 records rather than an entire file).

If my memory is working, it will generate a compile error with the current compiler.
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 MQ command in option 6 of ISPF! Vignesh Sid All Other Mainframe Topics 3 Tue Sep 26, 2017 6:01 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
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 How to change a string containing the... chong.zhou TSO/ISPF 6 Tue Aug 29, 2017 4:54 pm

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