bdfp1m2k | Programming Concepts and Reference |
Use this function to obtain and initialize work space linked to the SW00SR
slot for a subfile. This space is available while the subfile is
open.
Format
- REF=dsectvv
- specifies the file or subfile that you want to access, where
dsectvv is the DSECT name and an optional 2-character version.
- REF=refname
- specifies the file or subfile that you want to access, where
refname is a label that references the DSECT name in one of the
following formats:
- refname
- is the label of an 8-byte field that contains the 6-byte DSECT name and an
optional 2-character version.
- A/refname
- is the label of a 4-byte field that contains the storage address of the
DSECT name and an optional 2-character version.
- FILE=dsect
- specifies the file or subfile that you want to access, where
dsect is the DSECT name.
- SPACE
- allocates work space for an open subfile and initializes the work space to
X'00'
- SPACEB
- allocates work space for an open subfile and initializes the work space to
X'40'
- SPACEF
- allocates work space for an open subfile and initializes the work space to
a specified character.
- space
- is the number of bytes of space that you want, which can be a maximum of
3952 bytes. Specify one of the following:
- A register that contains the number of bytes of space that you
want.
- An absolute value.
- The length of a label.
- The label of a field. The space is determined by the 2 bytes of
data beginning at the specified label.
If you request a zero amount of space, the DBSPA macro releases any space
that was previously allocated for this subfile.
- spacereg
- is the register in which you want the base address of the work space
loaded.
- fillchr
- is the character you want to use to initialize the work space.
Specify one of the following:
- The label of a 1-byte field that contains the character.
- An immediate value (for example, =X'FF').
Entry Requirements
None.
Normal Return
The address of the space that the TPFDF product has provided. The
TPFDF product also loads this address into field SW00WKA in the SW00SR
slot.
Error Return
None.
Programming Considerations
- The optional 2-character version on the REF parameter allows you to
access more than one subfile in the same file at the same time. For
example, you can code REF=IR71DF01,ALG==C'A' to access subfile A
and REF=IR71DF02,ALG==C'B' to access subfile B.
- If you specify a label, the label must be more than 3 characters
long.
- The contents of register 14 (R14) and R15 cannot be predicted across
a TPFDF macro call.
- The contents of R3, which contains the storage address of the SW00SR
slot, are used by TPFDF macro calls. Do not change the value of R3
between macro calls unless you save the value after each macro call and
restore the value before each macro call.
- If you specified a SPACE or SPACEB parameter with the DBOPN macro and you
then call the DBSPA macro with the same REF parameter value, the TPFDF product
returns the space originally allocated.
Examples
- The following example creates a 400-byte area filled with space characters
(X'40').
DBSPA REF=GR36DF,SPACEB=(400,R5)
- The following example provides space that is the same length as field
GR36REC.
DBSPA REF=GR36DF,SPACE=(L'GR36REC,R5)
- The following example provides an amount of space determined by the 2
bytes of data beginning at label EBW002.
DBSPA REF=GR36DF,SPACE=(EBW002,R5)
- The following example releases any space that was previously allocated for
subfile GR33DF.
DBSPA REF=GR33DF,SPACE=(0)
- The following example creates a 400-byte area filled with character
X'FF'.
DBSPA REF=GR36DF,SPACEF=(400,,=X'FF')
Related Macros
DBOPN-Open a Subfile.