bdfp1m24 | Programming Concepts and Reference |
Use this macro to create a new subfile, an empty pool subfile, or an empty
indexed pool subfile with its corresponding index file. You can
subsequently add logical records (LRECs) to the empty detail subfile as
required.
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.
- R3=address
- specifies the location of the SW00SR slot for this subfile, where
address is the label of a field that contains the address of the
SW00SR slot. Register 3 will be loaded with this address.
- Note:
- Do not use this parameter; it is provided only for migration
purposes. Use the REF parameter to specify the file that you want to
access.
- ALG=algarg
- identifies the subfile that you want to access, where algarg
specifies an algorithm argument.
The TPFDF product uses the algorithm argument to determine the subfile
(ordinal number) that is to be accessed. Specify the algorithm argument
based on the type of algorithm that is defined in the DSECT or DBDEF macro for
the file. If the DSECT or DBDEF macro defines the #TPFDB04 or the
#TPFDB0D algorithm, do not use this parameter.
If the subfile you are accessing is contained in a detail file or
intermediate index file defined with the #TPFDBFF algorithm, the TPFDF product
uses the algorithm argument to locate the subfile. See TPFDF Database Administration for more information about
how the TPFDF product uses the algorithm argument to locate the
subfile.
Specify algarg as one of the following:
- A register that contains the address of the algorithm argument
- A literal value that specifies the algorithm argument (for example,
ALG==C'SMITH')
- A label in one of the following formats:
- algarg
- is the label of a field that contains the algorithm argument.
- A/algarg
- is the label of a 4-byte field that contains the storage address of the
algorithm argument.
- Note:
- Do not modify the area of storage containing the algorithm argument until the
subfile is closed.
- INDEX
- creates an indexed subfile and inserts an index LREC referencing this
subfile into the related index file (or files) defined by the database
administrator. Specify the index key as the ALG parameter.
If you specify this parameter, the algorithm defined for the new subfile
must be #TPFDBFF.
- CHKA=rcc
- checks the record code check (RCC) value in each block, where rcc
is the label of a 1-byte field that contains the RCC character.
- ERROR=spmlbl
- branches to the specified location if a serious error is detected when
processing the macro, where spmlbl is a TPFDF structured program
macro (SPM) label defined with the #LOCA macro. See TPFDF and TPF Structured Programming Macros for more
information about the #LOCA macro. See Identifying Return Indicators and Errors for more information about serious errors.
- ERRORA=asmlbl
- branches to the specified location if a serious error is detected when
processing the macro, where asmlbl is an assembler label. See Identifying Return Indicators and Errors for more information about serious errors.
- NOPGM
- specifies not to change the program stamp in a block when filing
it.
- PATH
- specifies the path for a detail subfile using index support. If
there is only one index path, do not specify this parameter. Specify
one of the following:
- pathnum
- is the path number or the label of a 2-byte field that contains the path
number. The number of index paths used is defined by your database
administrator.
- ALL
- specifies all paths.
See TPFDF Database Administration for more
information about path numbers.
- POOLTYP
- overrides the pool type defined by the database administrator,
where:
- 0
- uses the pool type defined by the PF0 parameter of the DBDEF macro.
- 1
- uses the pool type defined by the PF1 parameter of the DBDEF macro.
- 2
- uses the pool type defined by the PF2 parameter of the DBDEF macro.
- type
- is the label of a 1-byte field that contains a 0, 1, or 2 to specify to
pool type.
Use the POOLTYP parameter as directed by the database administrator.
- REG=register
- specifies a register in which to return the address of the current LREC
(this address is contained in SW00SR field SW00REC). You must specify
this parameter for T-type files.
- SUFFIX=char
- allows you to use the same DSECT to map two different areas of storage,
where char is the suffix character.
Entry Requirements
None.
Normal Return
The address of the LREC created is placed in the SW00REC field of the
SW00SR. If you specify the REG parameter, the address of the LREC
created is placed in the specified register.
Error Return
See Identifying Return Indicators and Errors for information about how to check the error
indicators.
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.
- A DBADD macro creates a subfile, if one does not exist, before it adds the
LREC.
Examples
- The following example creates an indexed subfile and adds a new LREC to
that subfile.
DBCRE REF=GR45DF,ALG=EBW001,INDEX
DBADD REF=GR45DF,NEWLREC=EBW000
- The following example creates a new subfile, creates the index reference
to that subfile, and adds an LREC to the subfile.
DBCRE REF=GR23DF
DBIDX REF=GR23DF,ALG=EBW0044
DBADD REF=GR23DF
Related Macros