gtpg2m5mGeneral Macros

VPNTC-Point for Access

Use this general macro to position access for subsequent sequential or keyed retrieval. This macro is useful in partitioning scans of large databases; for example, an entry control block (ECB) can scan a range of keys starting at a discrete point in the file.

Format




label
An optional label can be used with this macro.

addr
This parameter specifies the address of the request parameter list (RPL) for this VPNTC macro request. You can specify the address in register notation (by using a register enclosed in parentheses) or by using an expression that generates an addressable data area.

Entry Requirements

Return Conditions

Programming Considerations

Examples

In the following example, the VPNTC macro positions at the first record that has a key greater than or equal to 5555. The program then scans the database from that point.

Note:
There is no need to load the key value again each time the VGETC macro is called; VSAM database support maintains context for next processing.
         .
         .
         .
         VGENC BLK=ACB,                Generate an ACB
               DDNAME=DDNAME,          ..DDname
               MACRF=(KEY,SEQ,IN)      ..Options
 
         BNZ   ERROR                   Process Errors
         LR    R6,R14                  Save ACB pointer in R6
 
         MVC   EBW000(4),KEYVALUE      Setup search key argument
         VGENC BLK=RPL,                Generate an RPL
               AM=VSAM,                ..Access method is VSAM
               ACB=(R6),               ..ACB pointer is in R6
               LEVEL=D3,               ..Data Level is D3
               ARG=EBW000,             ..Search argument starts here
               OPTCD=(KEY,SEQ,KGE,FKS) ..Key search, sequential access,
                                       ..search for key >= arguments,
                                       ..do full key search
 
         BNZ   ERROR                   Process Errors
         LR    R7,R14                  Save RPL pointer in R7
 
         VOPNC ACB=(R6)                Open file
         BNZ   ERROR                   ..Open error
 
         VPNTC RPL=(R7)                Position for start of SCAN
         BNZ   ERROR                   ..locate error
 
 
SCAN     DS    0H
         VGETC RPL=(R7)                Retrieve next record
         BNZ   ENDSCAN                 ..Assume End of Data
 
         ...                           otherwise process record
 
         B     SCAN                    Continue scan
         .
         .
         .
DDNAME   DC    CL8'TRANSLOG'           Data Definition Name
KEYVALUE DC    CL4'5555'               Search Key value