bdfp1m29 | Programming Concepts and Reference |
Use this macro to create one or more index references to a subfile
identified by an algorithm parameter. You can choose to index one or
more paths.
Format
- 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.
- 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.
- 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.
Entry Requirements
- You must have a detail file available.
- Ensure that the relationship of the index file (or index files, if there
are multilevel indexes) to the detail file has been defined in the DBDEF macro
by your database administrator.
Normal Return
None.
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.
- The TPFDF product determines the amount of data to move in an index
LREC by calculating the number of bytes between labels
xxxxEyy and xxxxAyy in the DSECT for the
index file, where xxxx is the first 4 characters in the name of the
DSECT and yy is the primary key.
- Path 0 is the default path. The DBIDX macro creates index
references for this path unless you have set one or more different paths using
the PATH parameter on the DBIDX or DBOPN macro.
- No actual index structure needs to exist before you index the
subfile. All that is needed is an existing index file at the highest
level of the index. This must be a fixed file. If there is no
existing index structure, the TPFDF product creates the required index
structure automatically when you call the DBIDX macro.
- If you index a subfile with the DBIDX macro in an application program, you
must also remove the index when needed. (You can do this by using the
DBDIX macro.)
- When running in detac mode, if an application program creates a pool file
using the DBCRE macro and an index reference using the DBIDX macro, the
application program must delete the index reference using DBDIX macro before
using the ABORT parameter on the DBCLS macro. If the index reference is
not deleted, subsequent recoup processing may identify the index reference as
a broken chain.
Examples
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