For tables:
RCODE-INFO:FILE-NAME = "c:\your_program.r".
MESSAGE RCODE-INFO:TABLE-LIST.
Returns a comma-separated list of all tables referenced in the r-code file specified by the RCODE-INFO:FILE-NAME attribute. Each table reference includes the table name and related database name (for example: SPORTS.CUSTOMER).