user99999991
user99999991

Reputation: 1421

COBOL 85 END PROGRAM Error

PROCEDURE DIVISION USING Input Cipher Temp.
   INSPECT Input
       CONVERTING Alpha-String(1) TO Alpha-String(Cipher)
       MOVE Input TO Temp.
EXIT PROGRAM.

COBOL 85 is not taking EXIT PROGRAM. at the end of my program. Whether I use STOP RUN. or not.

prog.cbl:    75: error: syntax error, on or before '.'
prog.cbl:    75: error: unknown or wrong statement, on or before '.' 

Upvotes: 0

Views: 688

Answers (3)

Bill Woodger
Bill Woodger

Reputation: 13076

It is going to depend on what you are trying to do.

In the IBM World, "EXIT PROGRAM" means leave this program and return to the CALLer. Since your program is a CALLed program (your have PROCEDURE DIVISION USING) your intent is probably to return to CALLer (although you do mention STOP RUN, which will stop the processing then and there) you either need to shift it to the right, as Bruce has said, if that is what your (unknown) compiler has for returning to the CALLer. Otherwise try GOBACK, in column 12. Otherwise consult your documentation for the compiler. Otherwise tell us which compiler you are using.

Upvotes: 0

Joe Zitzelberger
Joe Zitzelberger

Reputation: 4263

Isn't it "End Program", not "Exit Program."?

I think what you actually want is:

End Program YourProgramNameHereThatAgreesWithIdentificationDivisionName.

Upvotes: 0

Bruce Martin
Bruce Martin

Reputation: 10543

Try moving the Exit to the right inline with the move. Cobol is not a free format language the columns on the right are reserved for 01's Section / Divisions

Upvotes: 1

Related Questions