Restrictions on input and output procedures
Several restrictions apply
to each input or output procedure
called by SORT
and to each output procedure called
by MERGE
.
Observe these restrictions:
- The
procedure must not contain any
SORT
orMERGE
statements. - You can use
ALTER
,GO TO
, andPERFORM
statements in the procedure to refer to procedure-names outside the input or output procedure. However, control must return to the input or output procedure after aGO TO
orPERFORM
statement. - The remainder of the
PROCEDURE DIVISION
must not contain any transfers of control to points inside the input or output procedure (with the exception of the return of control from a declarative section). - In an input or output
procedure, you can call a
program. However, the called program cannot issue a
SORT
orMERGE
statement, and the called program must return to the caller. - During a
SORT
orMERGE
operation, theSD
data item is used. You must not use it in the output procedure before the firstRETURN
executes. If you move data into this record area before the firstRETURN
statement, the first record to be returned will be overwritten.