R command code
To retrieve the first segment occurrence in the subset, your program issues a Get call with the R command code. The R command code does not set or move the pointer. It indicates to IMS that you want to establish position on the first segment occurrence in the subset. The R command code is like the F command code, except that the R command code applies to the subset instead of to the entire segment chain.
GU Abbbbbbb(AKEYbbbb=bA1)
Bbbbbbbb*R1 As shown by the following figure, this call retrieves segment
B5. To continue processing segments in the chain, you can issue GN calls
as you would if you were not using subset pointers.

You can specify only one R command code for each SSA. If you use more than one R in a SSA, IMS returns an AJ status code to your program.
You can use R with other command codes, except F and Q. Other command codes in a SSA take effect after the R command code has been processed, and after position has been successfully established on the first segment in the subset. If you use the L and R command codes together, the last segment in the segment chain is retrieved. (If the subset pointer that was specified with the R command code, IMS returns a GE status code instead of the last segment in the segment chain.) Do not use the R and F command codes together. If you do, you will receive an AJ status code. The R command code overrides all insert rules, including LAST.