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: 1226
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 TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Customizing the ISPF HILITE Command Pedro TSO/ISPF 3 Fri Mar 03, 2017 11:49 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm


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