yes, we can use GOBACK in main progam also.
Normally, in many shops main programs contain STOP RUN.
GOBACK used in main program behave like a STOP RUN. GOBACK issued from a
subprogram behaves like a EXIT PROGRAM, it does not change status of any files in that run unit. _________________ Natarajan
Joined: 09 Aug 2008 Posts: 1631 Location: Mumbai, India
Posted: Wed Feb 10, 2010 4:47 pm Post subject:
From the syntactic perspctive, a COBOL subprogram is nearly identical to that of a COBOL program; in particular, it has the same four divisions: IDENTIFICATION, ENVIRONMENT, DATA, and PROCEDURE.
However, in a sub-program DATA DIVISION includes a LINKAGE section, in addition to the FILE and WORKING-STORAGE sections. in LINKAGE section programmer describes the subprogram's formal arguments.
Another syntactic difference is that, in a subprogram, the PROCEDURE DIVISION header includes a USING clause that lists the names of the formal arguments and, in so doing, indicates the order in which the corresponding actual arguments must be listed by the caller in making a call to the subprogram.
Finally, to terminate execution of a subprogram (and return control to its caller), the statement GO-BACK is used, rather than STOP RUN. STOP-RUN statement will, as usual, have the effect of terminating execution of the whole logical unit of work; in other words, if it is executed within a subprogram, control will not return to its caller. _________________ Regards,
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum