LIST

This system command is used to display the source code of a single object or to list one or more objects which are contained in the current library.

Note:
This command is not executable in batch mode.

This document covers the following topics:

See also the description of the command LIST XREF.


LIST Syntax Overview

LIST

Square Bracket Open

[object-type] object-name

Square Bracket Closed

COUNT

Square Bracket Open

*
object-name-range

Square Bracket Closed

DIRECTORY [object-name]
VIEW [view-name]
RESOURCE [name]
ERROR [name]

object-type

Curly Bracket Opened

*

Curly Bracket Closed

Curly Bracket Opened

CLASS
4

Curly Bracket Closed

COPYCODE
DATA-AREAS
  GLOBAL
  LOCAL
  PARAMETER

Curly Bracket Opened

DIALOG
3

Curly Bracket Closed

7 (for function)
8 (for adapter)
MAP

Curly Bracket Opened

PROCESSOR
CP
5

Curly Bracket Closed

PROGRAM
ROUTINES
  HELPROUTINE  
 

Curly Bracket Opened

SUBPROGRAM
N

Curly Bracket Closed

  SUBROUTINE  
TEXT

object-name

In place of object-name, you may specify the name of an object (8 characters long at maximum). You may also specify asterisk notation (*), see the examples below.

Displaying an Individual Source

LIST If you enter only the LIST command itself, without any parameters, the contents of the source of the object currently selected will be listed.
LIST object-name If you enter a single object name with the LIST command, you need not specify the object-type.

If you specify an object-type, you must also specify an object-name.

In both cases, the object's source code will be listed.

LIST object-type object-name

Displaying a List of Objects

LIST object-name

To have all objects in the current library listed, except DDMs, you specify an asterisk (*) for the object-name, but no object-type.

To have all objects of a certain type listed, you specify a certain object-type and an asterisk (*) for the object-name.

If you wish a certain range of objects to be listed, you can use asterisk notation (*) for the object-name and/or wildcard notation (?).

LIST object-type object-name

Examples

  • List all objects in the current library, except views, resources, errors - regardless of their types:

    LIST *
  • List all subroutines in the current library:

    LIST S *
  • List all objects (of any type) whose names begin with SYS:

    LIST SYS*
  • List all maps whose names begin with SYS:

    LIST M SYS*
  • List directory information of object PRG01 in current library:

    LIST DIR PRG01
  • List all objects such as NATAL, NATURAL, NATvrAL (where vr represents the relevant product version):

    LIST N?T*AL

Performing a Function on an Object

To perform a function on an object from the selection list, you simply mark the object with the appropriate function code in the left-hand column.

The function codes are:

Code Function
C Check the object's source code.
D Read the object's source code.
E Edit the object's source (equivalent to the system command EDIT).
L List the object's source code.
I List directory information of the object's source code (equivalent to LIST DIRECTORY object-name).
H Print hardcopy of the object's source.
R Run (that is, compile and execute) the object's source (equivalent to the system command RUN).
X Execute the object (equivalent to the system command EXECUTE).
S Stow the object in source and object form (equivalent to the system command STOW).
U Delete the object's source and object form.
. End.

Enter a question mark (?) or use F2 to display the list of the available function codes for the selected object.

Displaying Numbers and Sizes of Objects

LIST COUNT Displays a summary report that contains the numbers and sizes (in bytes or KB if greater than 1 MB) of all objects stored in the current library.

The numbers and sizes listed refer to all objects that have been saved as source (Saved) objects only or as cataloged (Cataloged) objects only, and all objects for which both saved and cataloged objects (Stowed) exist.

LIST COUNT * Displays a summary report of all objects where the numbers and sizes of saved/cataloged objects are listed per object type(s) found.
LIST COUNT object-name-range
Displays a summary report (same as above) for the specified range of objects. Valid range notations are:
 
value> All objects with names greater than or equal to value
value< All objects with names less than or equal to value
value* All objects with names that start with value

Displaying Directory Information

LIST DIRECTORY

Displays the directory information about the last active object currently in the source work area:

  • Source code:
    "Saved-on" date and time, library name, user ID, programming mode (reporting or structured), Natural version, code page information (if available), operating system, size, encoding.

  • Object code:
    "Cataloged-on" date and time, library name, user ID, programming mode, Natural version, code page information (if available), operating system/version, size, Endian mode.

Directory information on the saved source code cannot be always exact, because the source code can be edited with non-Natural editors which are not under the control of Natural.

LIST DIRECTORY object-name Displays the directory information about the specified object. If you use asterisk notation (*) for object-name, the directory information of the existing objects is displayed sequentially.

Note:
The code page information displayed shows the first 32 characters of the code page only.

Displaying Views

LIST VIEW Displays a list of all views (DDMs).
LIST VIEW view-name If you specify a single view name, the specified view will be displayed.

For the view-name, you can use asterisk notation to display a list of all views (*) or a certain range of views (for example: A*).

Displaying File Information of Resource Objects

LIST RESOURCE name Displays the file information about the specified resource object. For name, you may only use asterisk notation (*).

Example - Display the file information of all resource objects whose name starts with a W:

LIST RESOURCE W*

Displaying File Information of Error Message Containers

LIST ERROR name Displays the file information about the specified error message container NnnAPMSL.MSG, where nn is the language code. For name, you may only use asterisk notation (*).