Pointer manipulation commands
Pointer manipulation commands operate on the Record Delivery Area (RDA) and on user-defined pointer work areas. They are the building blocks of every Q-Language unload, reload, and pointer-fix routine.
- DEFINE PTR — reserve a pointer work area
- GETPTR — extract a range of pointers from the current record
- INSPTR — insert pointers into the current record
- NULPTR — null out a range of pointers
- PUTPTR — store pointer values back into the record
- REMPTR — remove pointers and shift the rest left
- RSTPTR — restore previously nulled pointers
- SET CURRENT DBP — set the current database pointer for subsequent operations
- SETPTR — load a database pointer into a work area
- XREF — cross-reference an old database key to its current value
- XTRPTR — extract a single pointer for inspection or BITSPLIT
DEFINE P PTR-HOLD 12 . 12-word pointer work area
GETPTR (1,3) P-HOLD . get first three pointers
PUTPTR (2,2) FROM P-HOLD . place at positions 2 and 3
XTRPTR (3) H-PTR . extract pointer 3 into H-PTR
BITSPLIT H-PTR INTO X,Y,Z (10,17,9) . area / page / slotQRYSCH — Query Schema Utility
QRYSCH interrogates a schema absolute and produces the SGSFILE used by every other reorganization run. It reports pages, slots, CALC chains, set ownership, and area allocation in a stable, parsable format.
*** SARP ***
Area bits: 10, page bits: 17, rec/slot bits: 9
Allocate 50 overflow pages AT END
Page length: 896 words
Number of CALC chains: 1SCHUTL — Schema Modification Utility
SCHUTL applies non-destructive changes to the schema absolute — area sizing, pack-id moves, page-size changes, and minor set changes — without recompiling the schema source. Use the USE SCHEMA directive to point SCHUTL at the absolute you want to modify.
PBLD and PFIX — pointer correction utilities
PBLD rebuilds owner-side pointers from scratch by scanning the database for member records and threading them onto their owners. PFIX repairs broken or shifted pointers (including DBPCHG-style global pointer rewrites) without rebuilding entire chains.
Common directives
- AREAS area-name-1[, ... area-name-n] — limit the scope of the run
- DBPFILE file-name — input/output file of database pointer mappings
- SEARCH AREAS area-spec-1[, ... area-spec-n] — restrict scan to specific area specs
- RELINK USING schema-name FILE schema-file — bind the run to a target schema absolute
Sample PFIX run
@ASG,T XC.,F70M/1000//1000,REM802
@ASG,T TEMP.,F70M/1000//1000,REM900
@.
@PFIX
RELINK USING PROD-SCH FILE DMS*SCHEMA.
AREAS ORDERS, ORDCTL
@FIN