A detail statement is used with a function statement for certain
applications, such as deleting or renumbering selected logical records.
The NUMBER detail statement specifies, when coded with a CHANGE function
statement, that the sequence number of one or more logical records
is changed. It specifies, when coded with an ADD or REPL function
statement, the sequence numbers to be assigned to the records within
new or replacement members or data sets. When used with an ADD or
REPL function statement, no more than one NUMBER detail statement
is permitted for each ADD or REPL function statement.
The DELETE detail statement specifies, when coded with a CHANGE
function statement, that one or more logical records are to be deleted
from a member or data set.
Logical records cannot be deleted in part; that is, a COLUMN parameter
specification in a function statement is not applicable to records
that are to be deleted. Each specific sequence number is handled only
once in any single operation.
The syntax of the DETAIL statement is:
Label |
Statement |
Parameters |
---|
./[label]
|
{NUMBER|
DELETE}
|
[SEQ1={cccccccc|ALL}]
[,SEQ2=cccccccc]
[,NEW1=cccccccc]
[,INCR=cccccccc]
[,INSERT=YES]
|
Note: NEW1, INCR and INSERT can only be used with NUMBER
|
where:
- SEQ1={cccccccc|ALL}
- specifies records to be renumbered, deleted, or assigned sequence
numbers. These values can be coded:
- cccccccc
- specifies the sequence number of the first logical record to
be renumbered or deleted. This value is not coded in a NUMBER detail
statement that is used with an ADD or REPL function statement. When
this value is used in an insert operation, it specifies the existing
logical record after which an insertion is to be made. It must not
equal the number of a statement just replaced or added. Refer to the
INSERT parameter for additional discussion.
- ALL
- specifies a renumbering operation for the entire member or data
set. ALL is used only when a CHANGE function statement and a NUMBER
detail statement are used. ALL must be coded if sequence numbers are
to be assigned to existing logical records having blank sequence numbers.
If ALL is not coded, all existing logical records having blank sequence
numbers are copied directly to the output master data set. When ALL
is coded, SEQ2 need not be coded and one NUMBER detail statement is
permitted per function statement. Refer to the INSERT parameter for
additional discussion.
- SEQ2=cccccccc
- specifies the sequence number of the last logical record to
be renumbered or deleted. SEQ2 is required on all DELETE detail statements.
If only one record is to be deleted, the SEQ1 and SEQ2 specifications
must be identical. SEQ2 is not coded in a NUMBER detail statement
that is used with an ADD or REPL function statement.
- NEW1=cccccccc
- specifies the first sequence number assigned to new or replacement
data, or specifies the first sequence number assigned in a renumbering
operation. A value specified in NEW1 must be greater than a value
specified in SEQ1 (unless SEQ1=ALL is specified, in which case this
rule does not apply).
- INCR=cccccccc
- specifies an increment value used for assigning successive sequence
numbers to new or replacement logical records, or specifies an increment
value used for renumbering existing logical records.
- INSERT=YES
- specifies the insertion of a block of logical records. The records,
which are data statements containing blank sequence numbers, are numbered
and inserted in the output master data set. INSERT is valid only when
coded with both a CHANGE function statement and a NUMBER detail statement.
SEQ1, NEW1 and INCR are required on the first NUMBER detail statement.
When INSERT=YES is coded:
- The SEQ1 parameter specifies the existing logical record after
which the insertion is made. SEQ1=ALL cannot be coded.
- The SEQ2 parameter need not be coded.
- The NEW1 parameter assigns a sequence number to the first logical
record to be inserted. If the parameter is alphanumeric, the SEQFLD=(ddl,ddl) parameter should be coded on the function
statement.
- The INCR parameter is used to renumber as much as is necessary
of the member or data set from the point of the first insertion; the
member or data set is renumbered until an existing logical record
is found whose sequence number is equal to or greater than the next
sequence number to be assigned. If no such logical record is found,
the entire member or data set is renumbered.
- Additional NUMBER detail statements, if any, must specify INSERT=YES.
If a prior numbering operation renumbers the logical record specified
in the SEQ1 parameter of a subsequent NUMBER detail statement, any
NEW1 or INCR parameter specifications in the latter NUMBER detail
statement are overridden. The prior increment value is used to assign
the next successive sequence numbers. If a prior numbering operation
does not renumber the logical record specified in the SEQ1 parameter
of a subsequent NUMBER detail statement, the latter statement must
contain NEW1 and INCR specifications.
- The block of data statements to be inserted must contain blank
sequence numbers.
- The insert operation is stopped when a function statement, a detail
statement, an end-of-file indication, or a data statement containing
a sequence number is encountered.