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

ON command in COBOL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 1353
Location: Israel

PostPosted: Mon Mar 01, 2010 6:57 pm
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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Mar 01, 2010 9:05 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
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 Routing command Address SDSF to other... TSO/ISPF 2
Search our Forums:

Back to Top