The PUNCH instruction creates a record containing a source or other
statement, or an object record, to be written to the object file.
>>-+-----------------+--PUNCH--string--------------------------><
'-sequence_symbol-'
- sequence_symbol
- Is a sequence symbol.
- string
- Is a character string of up to 80 characters, enclosed in apostrophes.
All 256 characters in the EBCDIC character set are allowed in the
character string. Variable symbols are also allowed.
Double-byte data
is permissible in the operand field when the DBCS assembler option
is specified. However, the following rules apply to double-byte data:
- The DBCS ampersand and the apostrophe are not recognized as delimiters.
- A double-byte character that contains the value of an EBCDIC ampersand
or an apostrophe in either byte is not recognized as a delimiter when
enclosed by SO and SI.
The position of each character
specified in the PUNCH statement corresponds to a column in the record
to be punched. However, the following rules apply to ampersands and
apostrophes:
- A single ampersand initiates an attempt to identify a variable
symbol and to substitute its current value.
- A pair of ampersands is punched as one ampersand.
- A pair of apostrophes is punched as one apostrophe.
- An unpaired apostrophe followed by one or more spaces ends the
string of characters punched. If a non-space character follows an
unpaired apostrophe, an error message is issued and nothing is punched.
Only the characters punched,
including spaces, count toward the maximum of 80 allowed.
The PUNCH instruction causes the data in its operand to be punched
(copied) into a record. One PUNCH instruction produces one record,
but as many PUNCH instructions as necessary can be used.
You can code PUNCH statements in:
- A source module to produce control statements for the linker.
The linker uses these control statements to process the object module.
- Macro definitions to produce, for example, source statements in
other computer languages or for other processing phases.
The assembler writes the record produced by a PUNCH statement when
it writes the object deck. The ordering of this record in the object
deck is determined by the order in which the PUNCH statement is processed
by the assembler. The record appears after any object deck records
produced by previous statements, and before any other object deck
records produced by subsequent statements.
The PUNCH instruction statement can appear anywhere in a source
module. If a PUNCH instruction occurs before the first control section,
the resultant record punched precedes all other records in the object
deck.
The record punched as a result of a PUNCH instruction is not a
logical part of the object deck, even though it can be physically
interspersed in the object deck.
Notes: - The identification and sequence number field generated as part
of other object deck records is not generated for the record punched
by the PUNCH instruction.
- If the NODECK and NOOBJECT assembler options are specified,
no records are punched for the PUNCH instruction.
- Do not use the PUNCH instruction if the GOFF option is specified,
as the resulting file might be unusable.