Example 4: suspend a request for many records

In this example, a CHECK macro is issued for the first request parameter list in a chain of parameter lists. If an error occurred for one of the request parameter lists in the chain and you have supplied error analysis routines, VSAM takes a LERAD or SYNAD exit before it returns control to your program after the CHECK. For SYNAD exit routine, the CCHHR can be in CCCCcccHR format.
FIRST    RPL   ACB=BLOCK,                                               x
               AREA=AREA1,                                              x
               AREALEN=50,                                              x
               NXTRPL=SECOND,                                           x
               OPTCD=ASY
 
SECOND   RPL   ACB=BLOCK,                                               x
               AREA=AREA2,                                              x
               AREALEN=50,                                              x
               NXTRPL=THIRD,                                            x
               OPTCD=ASY
THIRD    RPL   ACB=BLOCK,    Last list does not indicate a next list.   x
               AREA=AREA3,                                              x
               AREALEN=50,                                              x
               OPTCD=ASY
         ...
LOOP     GET   RPL=FIRST     Request gives address of first request     x
                             parameter list.
         LTR   15,15
         BNZ   NOTACCEP
Do other processing:
         CHECK RPL=FIRST
         LTR   15,15
         BNZ   ERROR
Process the three records retrieved by the GET:
         B     LOOP
NOTACCEP ...                 Request wasn't accepted.
 
ERROR    ...                 Display feedback field (FIELDS=FDBK) of    x
                             each request list to determine which       x
                             one had an error.
AREA1    DS    CL50          A single GET request causes VSAM to put    x
                             a record in AREA1, AREA2, and AREA3.
AREA2    DS    CL50
 
AREA3    DS    CL50

After the CHECK, register 15 is set to indicate the status of the request. A code of 0 indicates that no error was associated with any of the request parameter lists. Any other code indicates that an error occurred for one of the request parameter lists. You should issue a SHOWCB macro for each request parameter list in the chain to find out which one had an error. VSAM does not process any of the request parameter lists beyond the one with an error.