WHICH

WHICH

object-name [FULL]

?

This command lets you find objects in the libraries used at run time in the Library Search Order (LSO).


Direct Command Syntax

WHICH Displays a window where you can enter an object name with the additional option to select the full output list.
WHICH object-name Displays the object type, the name of the first library in which the object is found, and the DBID and FNR of this library.

See Default Output of WHICH Command.

WHICH object-name FULL Lists all libraries of the library search order.

For each listed library, it indicates whether the cataloged or source object is found.

If you press PF5 in the output screen, you can start a new search.

See Full List of WHICH Command.

WHICH ? Displays the help text of the WHICH command.

Parameter Description

Parameter Format/Length Default Value Description
object-name A8 none The name of the object you want to search.

Default Output of WHICH Command

If you enter the WHICH command without the FULL option, the output looks like the following example:

Cataloged subprogram USR1002N found in library SYSEXT(12,124).

Full List of WHICH Command

If you enter the WHICH command with the FULL option, all libraries of the library search order are listed. The output looks like the following example:

12:00:49               ***** NATURAL WHICH COMMAND *****             2023-05-25
User XXXX                 - Search object USR1002N -           Library MYLIB    
                                                                               
Library   DBID   FNR Type Save/Catalog Date   Message                          
-------- ----- ----- ---- ------------------- -------------------------------- 
MYLIB       12   123                                                           
MYLIB01     12   123                                                           
MYLIB02     12   123                                                           
PROTECT                                       Library access denied            
SYSEXT      12   124  N   2022-04-20 07:59:36 Cataloged object found           
                      N   2011-05-06 16:37:46 Saved object found               
SYSTEM      12   123                                                           
SYSTEM      12   124                                                           
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
      Help        Exit        New   --    -     +     ++                Canc   

Explanation of Column Headings

Column Explanation
Library The names of libraries in the library search order.
DBID FNR The database ID and file number of the Natural system file containing the library.
Type The Natural object type code of the object. See Object Type Code in the Glossary.
Save/Catalog Date The save or catalog date of the object.
Message The result of the search.

An empty line indicates that the object was not found in that library.

Function Keys

The output screen of the WHICH command with FULL option provides the following function keys:

PF Key Name Function
PF1 Help Invoke help.
PF3 Exit Exit from WHICH command.
PF5 New New search.
PF6 -- Top of list.
PF7 - Page backward.
PF8 + Page forward.
PF9 ++ End of list.
PF12 Canc Cancel the WHICH command.

Batch Processing

The output of WHICH without FULL option is the same as the online output.

If you call the WHICH command with the FULL option, all resulting libraries are printed in one list.

WHICH Command under Natural Security

For information on WHICH under Natural Security, see Command Restrictions in the Natural Security documentation.