WRKOBJ “Work with Objects” command shows a list of objects from one or more libraries in AS400 system.
The object name, object type, library name, object attribute, and short text description for the object are shown for each listed object.
How to use WRKOBJ command on AS400 system:
Go to command Line and type WRKOBJ and press F4.
User will see below screen after pressing F4.
Below are the Paramters which user can use:
Parameter 1: OBJECT (OBJ), user need to enter the name of the object which we need to work with, User can pass three type of parametric value (Required Parameter):
a. Specific name, in case user knows the exact object name.
b. Generic name, in case we don’t remember the exact object name then we can go for “generic*” parameter value, A generic name is a character string that contains one or more characters followed by an asterisk (*), for example if user passed value like “TST*” then system will list all objects starting with TST i.e TST, TST1, TSTABCD.
c. *ALL, all objects from the system will be shown here depends on the Library and Object type parameter value.
Parameter 2: LIBRARY parameter, User can specify library in which search to be performed, default value “*LIBL”. User can pass below parametric value:
Specific name, *LIBL, *CURLIB, *USRLIBL, *ALLUSR, *ALL
a. Specific name: exact name of the library in which object need to be searched.
b. *LIBL: all libraries in the library list in which object need to be searched.
c. *CURLIB : The current library in which object need to be searched.
d. *USRLIBL : If a current library entry exists in the library list for the current thread, the current library and the libraries in the user portion of the library list are searched. If there is no current library entry, only the libraries in the user portion of the library list are searched
e. *ALLUSR : All libraries except system libraries like names that begins with the letter Q and few system libraries are searched.
f. *ALL : All libraries in the system, including QSYS, are searched.
Parameter 3 : Object type (OBJTYPE) parameter, Specifies the object type for objects to be shown, default value “*ALL”. User can pass two type of parametric value:
a. *ALL : All objects are shown that have an object name that matches the value specified for the Object (OBJ) parameter
b. Specify object type : Specify the object type for objects to be searched, such as command (*CMD), file (*FILE), or program (*PGM). To see a complete list of object types, position the cursor on the field for this parameter and press F4.
1. Specific object name “TST” need to be searched in specific library named “SWAPNIL” and object type should be “*FILE” then we can use below command:
WRKOBJ OBJ(SWAPNIL/TST) OBJTYPE(*FILE)
Result: System having one object in that particular library with object type *FILE
2. Specific object name “TST” need to be searched in *all libraries and object type should be “*FILE” then we can use below command:
WRKOBJ OBJ(*ALL/TST) OBJTYPE(*FILE)
Result: System having one object in each of the library with object type *FILE
3. In case no object found in the system as per parameter values passed then result shown as
Scenarios and use:
1. To search particular object in the system.
2. To know in which library the particular object reside.
3. To know, the type of object or attribute of that object, for example TST is an object, now we want to know whether it is program, library, file, command etc.
4. In case if an object type is *FILE than using WRKOBJ we can see the attribute of that particular object to identify whether it is LF, PF or DSPF.
Only the libraries and objects to which we have use (*USE) authority will be searched.