No, There is not GOTO statement in Natural.
There is a Perform statement which is used to call a
A subroutine is a a block of code which is to be executed
several times within an object.
Flat - sequential or VSAM files
We use File aid for sequential files for the following
1. Copy from one file to another only selected amount of
2. To browse or edit through the file using a copybook.
3. For impact analysis on a particular file.
Yes, it is possible. The below JCL can list the source of
the Natural program to a dataset and it can be very well
downloaded using option 6.
//STEP1 EXEC NATBATT
//SYSOUT DD SYSOUT=*
//CMPRINT DD DSN=USERID.MYNATPGM,
//SYSIN DD *
NATLIB = YOUR NATURAL LIBRARY
MYNATPGM = YOUR NATURAL PROGRAM
Parameters can be passed with the PERFORM statement from
the invoking object to the
external subroutine. These parameters must be defined
either in the DEFINE DATA PARAMETER
statement of the subroutine, or in a parameter data area
used by the subroutine.
An external subroutine can access the global data area used
by the invoking object.
In addition, an external subroutine can have its own local
data area, in which the fields that are to be used
only within the subroutine are defined.
However, an external subroutine cannot have its own global
Escape Routine is generally used to interupt the processing
of Subprogram or Subroutine to return Control back to the
next statement from where this subprogram or routine was
This statement will return an error if not placed within a
subprogram, subroutine or processing loop.
You use the following steps to check whether the input file
Step A. Read work file #WK-Number once #WK-Record
Step B. At End of File
Write "Input file is Empty"
The first step will read the first record in the file and
the next step will see the End of File condition. If the
File is empty, the program will write that we have an Empty
input file to spool.
An External Subroutine has got access to the Caller's GDA
where in the subprogram does not have.
The subprogram is like blackboxes as they are not aware of
the caller's environemnt. They take only the parameters and
process it and return the values. e.g. One natural
subprogram can be called through middle tiers like Entirex
and Vitria from a different environment(Lets say a dot net
or java developed web interface).However a similar
interface can not call a natural external subroutine.
As far as calling is concerned you use callnat for
subprogram and perform for external subroutine.
CALL statement can have max 128 parameter
1-6 sequence numbers.
7 (*) for comment (-) for continue (D) for debugging.
8-11 called as Area-A in this Area we can write
12-72 called as Area-B in this area we can write cobol
executable statements like select,accept,display.
73-80 is ignored area by compiler but we can see in source