Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 1228
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
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts COBOL Programming Sandpit? jodrisco COBOL Programming 6 Wed Apr 12, 2017 3:47 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us