bdfp1m2l | Programming Concepts and Reference |
Use this macro to sort logical records (LRECs) in an open subfile.
Format
|
Notes:
If you use these parameters, you must also specify the file organization of the keys. See Specifying File Organization with Keyn Parameters for more information about how to do this. Use one or more of the following subparameters with the KEYn parameter:
... KEY1=(R=GR00FLD)
... KEY1=(R=EBX010,L==H'4')
... KEY1=(R=D/2,L=L'GR00NAM,UP)
You can also specify the absolute value implicitly; for example:
... KEY1=(R=D/GR00NAM-GR00REC,L=L'GR00NAM,UP)
... KEY1=(R==H'2',L==H'4')
... KEY1=(R=GR00FLD+2,L==H'4')
or
... KEY1=(R=GR00FLD+L'GR00FLD,L==H'4')
The default value is the length of the field specified with the R subparameter.
See Setting Up and Using a Key List for information about how to set up a key list.
Use the POOLTYP parameter as directed by the database administrator.
Entry Requirements
Both subfiles must be opened before you call the DBSRT macro.
Normal Return
None.
Error Return
See Identifying Return Indicators and Errors for information about how to check the error indicators.
Programming Considerations
The KEYn and KEYLIST parameters are ignored for B+Tree files. The output file is organized according default keys defined on the DBDEF macro for the file. See TPFDF Database Administration for more information about default keys.
If you do not use SR05SR, you must specify a subfile of the same type as the input file.
Figure 21. Sorting LRECs from One Subfile into Another. The input file is defined by the INPUTREF parameter and the output file is defined by the REF parameter.
Examples
DBOPN REF=SR05SR,HOLD,DETAC DBSRT REF=SR05SR,ERROR=label,RELFC, * INPUTREF=IWTLDC,RELEASE, * KEY1=(R=D/IWTLKEY-IWTLREC,UP), * KEY2=(R=D/IWTLAPI-IWTLREC,L==AL2(IWTLLDT-IWTLAPI),UP) DBIFB REF=SR05SR,NEWREF=IWTLDC
DBOPN REF=IR00DFX,HOLD,DETAC,POOLTYP=1 DBSRT REF=IR00DFX,RELFC,ERROR=label, * INPUTREF=IR00DF,RELEASE, * KEY1=(PKY=#IR00K80,UP), * KEY2=(R=IR00FLD,L=EBW000,UP)
DBOPN REF==C'SR05SR ',FILE=IWTLDC DBSRT REF==C'SR05SR ',INPUTREF=IWTLDC, * KEY1=(PKY=#IWTKPKY,UP), * KEY2=(R=IWTLAPI,L==AL2(IWTLLDT-IWTLAPI),UP)
Related Macros