Example 1

Obtain the UCB address for the device whose volume serial number is specified by VOL. The look-up should include UCBs for dynamic devices. Pin the UCB, and return the UCB address at the address specified by UCBPTR. After all processing related to the UCB has completed, unpin the UCB.
         UCBLOOK VOLSER=VOL,UCBPTR=UCBPTR,DYNAMIC=YES,PIN,             X
               TEXT=TEXTLOOK,PTOKEN=PTOKLOOK
*
*    Process UCB
*
         UCBPIN UNPIN,PTOKEN=PTOKLOOK
*
*        ...
*
UCBPTR   DS   F
VOL      DS   CL6                            VOLSER searching for
TEXTLOOK DC   CL58'PIN TEXT FOR UCBLOOK'     Pin Text
PTOKLOOK DS   CL8                            Pin Token