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: 1276
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 How to display offset thru cobol prog... tvinodkumar7 CICS 2 Sun Apr 22, 2018 8:42 pm
No new posts Linkage editor is part of COBOL, z/OS... ankit.jain COBOL Programming 4 Fri Apr 20, 2018 4:17 pm
This topic is locked: you cannot edit posts or make replies. Difference between EQUAL and EQUAL TO... jithinraghavan COBOL Programming 3 Thu Apr 19, 2018 2:22 am
No new posts Call COBOL or PLI with a click from w... vaibhav gs All Other Mainframe Topics 1 Mon Apr 16, 2018 7:29 pm
No new posts COBOL MVS options BiswajitDG COBOL Programming 8 Fri Apr 06, 2018 12:35 am

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