Example: Using the Retrieve Object Description command

In this sample CL source, the Retrieve Object Description (RTVOBJD) command retrieves the description of a specific object.

Assume an object called MOBJ exists in the current library (MYLIB).


DCL  &LIB      TYPE(*CHAR) LEN(10)
DCL  &CRTDATE  TYPE(*CHAR) LEN(13)
DCL  &USEDATE  TYPE(*CHAR) LEN(7)
DCL  &USECNT   TYPE(*DEC)  LEN(5 0)
DCL  &RESET    TYPE(*CHAR) LEN(7)
.
.
.
RTVOBJD    OBJ(MYLIB/MOBJ) OBJTYPE(*FILE) RTNLIB(&LIB)
           CRTDATE(&CRTDATE) USEDATE(&USEDATE)
           USECOUNT(&USECNT) RESETDATE(&RESET)

The following information is returned to the program:

  • The current library name (MYLIB) is placed into the CL variable name &LIB.
  • The creation date of MOBJ is placed into the CL variable called &CRTDATE.
  • The date that MOBJ was last used is placed into the CL variable called &USEDATE.
  • The number of days that MOBJ has been used is placed into the CL variable called &USECNT. The start date of this count is the value placed into the CL variable called &RESET.