RE: COBOL Perform? - VMS

This is a discussion on RE: COBOL Perform? - VMS ; Urk - as soon as I got up and walked away, it because obvious. This is not a called program and really needs a STOP RUN in the VMS environment. Lack of sleep caught me on this one again. Not ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: RE: COBOL Perform?

  1. RE: COBOL Perform?

    Urk - as soon as I got up and walked away, it because obvious.
    This is not a called program and really needs a STOP RUN in
    the VMS environment. Lack of sleep caught me on this one
    again. Not an excuse, but in the IBM world, *everything* is a
    called program, so GOBACK works everywhere. In my head I had
    done a :EXIT PROGRAM = GOBACK: thing.

    -Paul


    > -----Original Message-----
    > From: Paul Raulerson [mailtoaul@raulersons.com]
    > Sent: Saturday, August 25, 2007 12:47 PM
    > To: (Info-VAX@Mvb.Saic.Com)
    > Subject: COBOL Perform?
    >
    > Can someone explain this little bit of COBOL behavior (Alpha VMS 8.3)
    > please?
    >
    > I expected the EXIT PROGRAM to terminate the program at the end of
    > the mainline, but it seems to fall through and go execute the
    > paragraphs below it. EXIT PROGRAM does appear to be working this
    > way elsewhere in code. Huh. maybe I am just too tired right now
    > and am missing something utterly simple. I'm used to using GOBACK.
    >
    > I did stay up wayyyy to late last night.
    >
    > The below is a condensed sample program to illustrate what I mean,
    > and the output is reproduced below it.
    >
    > Thanks
    > -Paul
    >
    > ************************************************** *************
    > * .MC80-A
    > * SAMPLE CODE FOR PERFORM ISSUE
    > ************************************************** *************
    >
    > IDENTIFICATION DIVISION.
    > PROGRAM-ID. MC80 INITIAL.
    >
    > DATA DIVISION.
    > WORKING-STORAGE SECTION.
    > 01 WS-EOF-FLAG PIC X(1) VALUE 'N'.
    >
    > PROCEDURE DIVISION.
    > START-PROGRAM.
    > DISPLAY '**** FIRST LINE OF MAINLINE CODE ****'
    > MOVE 'N' TO WS-EOF-FLAG
    > PERFORM WRITE-TEXT1
    > PERFORM UNTIL WS-EOF-FLAG = 'Y'
    > DISPLAY ' TEXT FROM PERFORM UNTIL'
    > MOVE 'Y' TO WS-EOF-FLAG
    > END-PERFORM
    > PERFORM WRITE-TEXT2
    > DISPLAY '**** LAST LINE OF MAINLINE CODE ****'
    > EXIT PROGRAM
    > .
    >
    > WRITE-TEXT1.
    > DISPLAY ' TEXT FROM PERFORM WRITE-TEXT1'
    > .
    >
    > WRITE-TEXT2.
    > DISPLAY ' TEXT FROM PERFORM WRITE-TEXT2'
    > .
    >
    >
    > ===== output from above program is =====
    >
    > $ link mc80
    > $ r mc80
    > **** FIRST LINE OF MAINLINE CODE ****
    > TEXT FROM PERFORM WRITE-TEXT1
    > TEXT FROM PERFORM UNTIL
    > TEXT FROM PERFORM WRITE-TEXT2
    > **** LAST LINE OF MAINLINE CODE ****
    > TEXT FROM PERFORM WRITE-TEXT1
    > TEXT FROM PERFORM WRITE-TEXT2
    > $



  2. Re: COBOL Perform?

    Hi Paul,

    This was a standards thing.

    The code used to work as you expected (and will work that way again if you
    compile with /standards=v3 or whatever)
    but was changed to comply with something else.

    I believe that people used to use it to pass a return status back to DCL.

    Cheers Richard Maher

    PS. Uppercase is also not compulsory on VMS and can give us COBOL guys a bad
    name :-)

    "Paul Raulerson" wrote in message
    news:000001c7e741$261b43c0$7251cb40$@com...
    > Urk - as soon as I got up and walked away, it because obvious.
    > This is not a called program and really needs a STOP RUN in
    > the VMS environment. Lack of sleep caught me on this one
    > again. Not an excuse, but in the IBM world, *everything* is a
    > called program, so GOBACK works everywhere. In my head I had
    > done a :EXIT PROGRAM = GOBACK: thing.
    >
    > -Paul
    >
    >
    > > -----Original Message-----
    > > From: Paul Raulerson [mailtoaul@raulersons.com]
    > > Sent: Saturday, August 25, 2007 12:47 PM
    > > To: (Info-VAX@Mvb.Saic.Com)
    > > Subject: COBOL Perform?
    > >
    > > Can someone explain this little bit of COBOL behavior (Alpha VMS 8.3)
    > > please?
    > >
    > > I expected the EXIT PROGRAM to terminate the program at the end of
    > > the mainline, but it seems to fall through and go execute the
    > > paragraphs below it. EXIT PROGRAM does appear to be working this
    > > way elsewhere in code. Huh. maybe I am just too tired right now
    > > and am missing something utterly simple. I'm used to using GOBACK.
    > >
    > > I did stay up wayyyy to late last night.
    > >
    > > The below is a condensed sample program to illustrate what I mean,
    > > and the output is reproduced below it.
    > >
    > > Thanks
    > > -Paul
    > >
    > > ************************************************** *************
    > > * .MC80-A
    > > * SAMPLE CODE FOR PERFORM ISSUE
    > > ************************************************** *************
    > >
    > > IDENTIFICATION DIVISION.
    > > PROGRAM-ID. MC80 INITIAL.
    > >
    > > DATA DIVISION.
    > > WORKING-STORAGE SECTION.
    > > 01 WS-EOF-FLAG PIC X(1) VALUE 'N'.
    > >
    > > PROCEDURE DIVISION.
    > > START-PROGRAM.
    > > DISPLAY '**** FIRST LINE OF MAINLINE CODE ****'
    > > MOVE 'N' TO WS-EOF-FLAG
    > > PERFORM WRITE-TEXT1
    > > PERFORM UNTIL WS-EOF-FLAG = 'Y'
    > > DISPLAY ' TEXT FROM PERFORM UNTIL'
    > > MOVE 'Y' TO WS-EOF-FLAG
    > > END-PERFORM
    > > PERFORM WRITE-TEXT2
    > > DISPLAY '**** LAST LINE OF MAINLINE CODE ****'
    > > EXIT PROGRAM
    > > .
    > >
    > > WRITE-TEXT1.
    > > DISPLAY ' TEXT FROM PERFORM WRITE-TEXT1'
    > > .
    > >
    > > WRITE-TEXT2.
    > > DISPLAY ' TEXT FROM PERFORM WRITE-TEXT2'
    > > .
    > >
    > >
    > > ===== output from above program is =====
    > >
    > > $ link mc80
    > > $ r mc80
    > > **** FIRST LINE OF MAINLINE CODE ****
    > > TEXT FROM PERFORM WRITE-TEXT1
    > > TEXT FROM PERFORM UNTIL
    > > TEXT FROM PERFORM WRITE-TEXT2
    > > **** LAST LINE OF MAINLINE CODE ****
    > > TEXT FROM PERFORM WRITE-TEXT1
    > > TEXT FROM PERFORM WRITE-TEXT2
    > > $

    >




+ Reply to Thread