Fields and Flags, VSAM Online

Use AMB-defined data fields and S-COBOL flags in your program.
Restriction: This topic applies only when the AppMaster Builder AddPack has been installed, and applies only to Windows platforms.
Field or Flag Name Associated Calls Description
APS- shortrecname-VAR

DB-OBTAIN DB-STORE DB-MODIFY DB-PROCESS DB-ERASE

Field that contains actual record length after a successful record retrieval (direct or sequential for DB-OBTAIN and DB-PROCESS. See Skip Sequence Processing below.

Shortrecname comes from the subschema definition; it is the REC card SHORT keyword.

APS-END-PROCESS

DB-PROCESS

Flag that terminates DB-PROCESS loop. Example: TRUE RESET-OBTAIN

APS-VSAM-NUMREC

DB-ERASE

Field that contains number of records deleted after key-qualified ERASE with partial key length specified.

ddname-APS- KEYnumber

DB-OBTAIN DB-PROCESS

Field that contains AMB-generated key name for use in skip-sequential processing. See also Skip Sequence Processing below.

Ddname is the subschema file.

Example: ORDER-APS-KEY1

ddname-RBA

DB-OBTAIN DB-PROCESSDB-STORE

Field that contains relative byte address (RBA) of a retrieved, stored ESDS file record. See also ESDS Support and Skip Sequence Processing below.

Ddname is the subschema file.

Generated field definition isDdname-RBA PIC S9(08) COMP

ddname-RRN

DB-OBTAIN DB-PROCESSDB-STORE

Field that contains relative record number (RRN) of a retrieved or stored RRDS file record. See also RRDS Support and Skip Sequence Processing below.

Generated field definition isDdname-RBA PIC S9(08) COMP

RESET-OBTAIN

DB-OBTAIN DB-PROCESS

Flag that resets browse to beginning of file. When used with PREV, resets to end of file. Example: TRUE RESET-OBTAIN

ESDS support:

  • Ddname-RBA provides access to a specific relative byte address (RBA). The current retrieved or written (stored) record determines the RBA; every successful READNEXT, READPREV, and WRITE operation updates the RBA.
  • DB-ERASE cannot delete a record from an ESDS file.
  • The operator must be EQUAL or = for a direct or positional DB-OBTAIN and for a qualified DB-PROCESS.
  • Assign ddname-RBA an RBA value prior to a DB-STORE or direct (key-specified) call.
  • If a key qualification specifies a non-existent RBA, the ILLOGIC condition occurs (the DB status flag AB-ON-REC). The AMB-supplied abnormal condition processing may need to be customized to access this condition.

RRDS support:

  • Ddname-RRN provides access to a specific relative record number (RRN). The current retrieved determines the RRN; every successful READNEXT and READPREV operation updates the RRN.
  • Assign ddname-RRN a RRN value prior to a DB-STORE or direct (key-specified) call.

Skip sequence processing:

Skip-sequential processing moves new key search criteria to a AMB-generated key while an active sequential DB-OBTAIN or DB-PROCESS browse is in progress. The following indicates the AMB-generated keys by target.

File Type Record Key

KSDS

ddname-APS-KEYnumber
 

Number indicates the key number, as follows

1 = Prime record key

 

The remaining numbers correspond to the order of the DDI IDX subschema cards for that record

2 = First alternate index, 3 = Second alternate index, . . .

 

The Micro Focus FCT facility supports only one alternate index.

ESDS

ddname-RBA PIC S9(08) COMP.

RRDS

ddname-RRN PIC S9(08) COMP.

Variable length files

  • VSAM provides the APS-shortrecname-VAR field, which contains length information for variable length files, for each record definition in the subschema.
  • APS-shortrecname-VAR must be updated with the calculated record length prior to all DB-STORE and DB-MODIFY calls. For example, the following updates APS-CUST-VAR with the actual length of CUST-RECORD prior to the DB-STORE.
    APS-CUST-VAR = WS-FIXED-PORTION +
    ... (CUST-NBR-ORDERS * WS-OCCURS-LENGTH)
    DB-STORE REC CUST-RECORD