View previous topic :: View next topic
|
Author |
Message |
Som_TCS
New User
Joined: 09 Jan 2009 Posts: 7 Location: Chennai / Kolkata
|
|
|
|
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 |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
"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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|