Example: position with POINT

In this example, the POINT macro is used to position at a record identified by a full key (5-byte) search argument, compared equal.
BLOCK    ACB   DDNAME=IO        Default MACRF subparameters sufficient.
 
POSITION RPL   ACB=BLOCK,       ARG parameter and KEQ and FKS OPTCD    x
               AREA=WORK,       subparameters define the POINT         x
               AREALEN=50,      request.                               x
               ARG=SRCHKEY,                                            x
         .     OPTCD=(KEY,SEQ,SYN,KEQ,FKS)
         .
LOOP     MVC   SRCHKEY,source   Search argument for positioning, moved x
                                from a table or transaction record.
         POINT RPL=POSITION
         LTR   15,15
         BNZ   ERROR
LOOP1    GET   RPL=POSITION
         LTR   15,15
         BNZ   ERROR
Process the record. Decide whether to skip to another position (forward or backward).
         BE    LOOP              Yes; skip.
         B     LOOP1             No; continue in consecutive sequence.
ERROR    ...                     Request was not accepted, or failed.
         .
SRCHKEY  DS    CL5               Search argument for positioning.
 
WORK     DS    CL50              VSAM puts a record here for each GET  x
                                 request.