Command Logic

#### Search Results

Search

# Command Logic

This document covers the following topics:

- Command Logic Overview

- Session Commands - Definition

- Function Commands - Definition

- Local Commands - Definition

- PF Key Assignments

- Multiple Command Input

- Issuing Commands by Magic Character

- Selection Windows and Wildcards

## Command Logic Overview

Navigating and executing functions in Natural ISPF is done using commands issued from the command line of any Natural ISPF screen.

Alternatively, a command can be assigned to a PF key or a magic (special) character. Pressing the PF key or entering the magic character in the command line has the same effect as if the command were entered in the command line.

Natural ISPF commands fall into three main categories:

- Session commands

- Function commands

- Local commands

Note
Apart from these commands, a number of Editor commands are available from the command line of a `LIST`, `BROWSE` or `EDIT` session. An overview of Editor commands is provided in section Editor.

The following subsections define these command types in more detail.

Command input is supported by a number of special features that include:

- Command redisplay (see section Useful Features);

- Confirmation windows (see section Useful Features).

## Session Commands - Definition

With session commands, you can control your Natural ISPF session(s). For example, use the session command `SPLIT` to enter split-screen mode, `SUSPEND` to suspend the current Natural ISPF session and start a new one, `POP` to make a suspended session current, etc.

An overview of all available session commands is provided in the subsection Session Commands - Description of section Command Reference.

## Function Commands - Definition

These commands address Natural ISPF objects (PDS members, Natural programs, Natural views, job SYSOUT, etc.) and perform functions on them. Examples of function commands are `EDIT`, `BROWSE`, `PRINT`, `DELETE`, `LIST`.

Function commands can be issued in three different ways:

1. From the command field of an Entry Panel, with parameters in the input fields to identify the object to be addressed. If you leave the command line blank, the parameters entered in the input fields of an Entry Panel assume certain commands as default. For example, if you enter a PDS library name in the Dataset Name field of the PDS Objects Entry Panel and press ENTER, the assumed command is `LIST`. If you enter a PDS library name, followed by a member name in the Member field, the command defaults to `EDIT`. To list function commands relevant to the current Entry Panel, enter an asterisk (*) in the command field and press ENTER.

2. From the command field of any system screen, together with parameters to identify the object to be addressed. Used in this mode, function commands provide easy access to any object without having to leave the current screen. After the function has been performed, you can press PF3 to return to the screen from which the function command was issued.

   In this direct access mode, function commands take the format:

       COMMAND object-type object-parameters,function-parameters

   where:

   Parameter-type | Meaning
   --- | ---
   `object-type` | Any Natural ISPF object type, for example: `P` for PDS member, `N` for Natural member, etc.
   `object-parameters` | Can consist of positional parameters and keyword parameters that correspond to the parameter fields on the Entry Panel of the object to be addressed.
   `function-parameters` | Additional, function-specific parameters, for example a printer name in the `PRINT` command, a target source for `COPY`, a target node for `SUBMIT`, or target environment for `EXPORT` (PC or Con-nect), or a new name in the `RENAME` command.

   For a more detailed discussion of function command parameters, see the subsection Function Commands - Description in section Command Reference.

   Below is an example of the `LIST` command using this command syntax:

       LIST P LIBRARY1 SCAN=ISP

   The positional parameter `LIBRARY1` identifies the library to be listed, the keyword parameter `SCAN=ISP` lists only those members in the library which contain the string `ISP`;

   Used in this mode, Natural ISPF assumes parameter values from the current environment. For example, if you issue the `LIST` command from the PDS facility, PDS is assumed as object type.

3. As line commands from lists of object names. It is common to select a required object from a list of object names. You can select an object for further processing by entering a line command in the input field preceding the object name on the list. Line commands are unique abbreviations of function commands and have the same effect as if the full function command were issued from the command line. Available line commands are described for each object type in the corresponding sections of this documentation.

   Note
   Line commands can also be used as valid abbreviations of function commands entered in the command line of any screen.

Natural ISPF supports function command input with a powerful system of selection and prompt windows that help you select the right option or object if you leave out any required parameter from the command syntax. This makes the direct working mode using function commands easy even for less experienced users. Additionally, function commands assume default values from the environment in which they are issued. For example, the `LIST` command issued from the Main Menu displays a selection list of object types that can be listed; if you issue a `LIST` command from the PDS Objects Entry Panel, a window prompts you for the dataset name to be listed (see also the subsection Selection Windows and Wildcards).

A full description of function commands, including examples, is contained in the section Command Reference.

## Local Commands - Definition

Local commands are commands that apply only to the object currently displayed in Editor format in `LIST`, `EDIT` or `BROWSE` mode. For example, when editing a Natural program, you can issue the `STOW` or `RUN` command, which are not available for any other object type. Local commands are described in detail for each object type in the section Natural Objects, as well as in the section Command Reference.

To obtain help information about available local commands in your current `EDIT`, `BROWSE` or `LIST` session, enter an asterisk (*) and press ENTER. A window opens that lists all available local commands.

## PF Key Assignments

You can assign any Natural ISPF command, Editor main command, a sequence of commands separated by semi-colons (;), or an Editor line command preceded by a colon (:) to a PF key using the `PROFILE` option on the Natural ISPF Main Menu. Some standard functions are assigned to PF keys by default. These are listed below:

PF Key | Function (Command)
--- | ---
PF1 | Enter the Natural ISPF online help system (`HELP`)
PF2 | Enter split-screen mode (`SPLIT`)
PF3 | Return to previous screen (`END`)
PF4 | Suspend current session (`SUSPEND`)
PF5 | Repeat previous Editor `FIND` command (`RFIND`)
PF6 | Repeat previous Editor `CHANGE` command (`RCHAN`)
PF7 | Scroll displayed data backwards (`UP`)
PF8 | Scroll displayed data forward (`DOWN`)
PF9 | Make other session active (`SWAP`)
PF10 | Scroll displayed data left (`LEFT`)
PF11 | Scroll displayed data right (`RIGHT`)
PF12 | When in Editor, place cursor in command line (`CURSOR`)

If the PF-key line is displayed on your screen, you can use the `FLIP` command to choose between a display of PF1-PF12 or PF13-PF24.

If the PF-key line is not displayed on your screen, you can display it by issuing the session command `KEYS ON`.

You can modify any PF-key setting in your user profile in any of the following ways:

- Select the `PROFILES` option on the Natural ISPF Main Menu or issue the `PROFILES` command from any system screen to enter the profile maintenance facility;

- Issue the `KEYS` command without parameters to display the PF key modification screen in your user profile;

- Issue the `KEYS` command with parameters to directly assign a command to a PF key without entering the user profile. The command format is:

      KEYS n string

  where n is the number of the PF key and string is the command string to be assigned.

### Examples:

- For example, if you issue the command:

      KEYS 13 SEPARATE

  then every time you press PF13, the `SEPARATE` command is executed.

- The command:

      KEYS 13 INITIAL

  resets PF13 to its initial value in the user profile.

#### Important

If the command string to be assigned consists of more than one command (for example: `SEPARATE;SPLIT`), you must use a double command delimiter to signal to Natural ISPF that this whole command sequence is being assigned. For example, to assign the command sequence `SEPARATE;SPLIT` to PF13, you must issue the command

    KEYS 13 SEPARATE;;SPLIT

If you use only one command delimiter, the command `KEYS 13 SEPARATE` is executed first and then the command `SPLIT`.

You can also enter data in the command line prior to pressing a PF key assigned to a command. The command associated with the PF key is then concatenated ahead of the data entered in the command line to form the complete command.

For example, you may have the command `COMPRESS` assigned to PF16. If you enter a PDS library name in the command line and press PF16, the compress function is performed on the specified library. A common way to enter split-screen mode is to enter a line number in the command line and then press the PF key assigned to the `SPLIT` command (usually PF2).

## Multiple Command Input

You can enter several commands in a single input operation if you separate them with the command delimiter specified in your user profile. They are then executed as if you had entered them individually. For example, the command sequence

    SUSPEND;EDIT N MYLIB(MYPROG)

suspends the current session and starts a new edit session with Natural object `MYPROG` in the library `MYLIB`, if the semicolon (;) is the command delimiter specified in your user profile (see section Profile Maintenance).

Such command sequences can be assigned to PF keys for easy execution (see the subsection PF Key Assignments).

### Multiple Editor Command Input

In the Natural ISPF Editor you can:

1. change data,

2. enter a line command, and

3. enter a main command.

   When you press ENTER, the commands are executed in the above order.

#### Example:

In the screen below, for example, if you:

1. insert the line `print #tamp` after line 40,

2. use the `R` line command to repeat line 40 (`WRITE #TEMP`) three times,

3. issue the main command `CHG TAMP TEMP ALL` to change all occurrences of `TAMP` to `TEMP`, and press ENTER.

          EDIT-NAT:BRY(EDT-CMD)-Program->Struct-Free-47K ---------------- Columns 001 072
           COMMAND===> CHG TAMP TEMP ALL                                  SCROLL===> CSR
          ****** ****************************** top of data *****************************
          000010  DEFINE DATA LOCAL
          000020  1 #TEMP (A8)
          000030  END-DEFINE
          r30040  WRITE #TEMP
          ''''''  print #tamp
          000050  END
          ****** **************************** bottom of data ****************************

4. ... the line `print #tamp` is written,

5. line `40 WRITE #TEMP` is written three times and

6. all occurrences of `TAMP` are changed to `TEMP`:

          EDIT-NAT:BRY(EDT-CMD)-Program->Struct-Free-47K ----------- Char  'tamp' changed
           COMMAND===>                                                    SCROLL===> CSR
          ****** ****************************** top of data *****************************
          000010  DEFINE DATA LOCAL
          000020  1 #TEMP (A8)
          000030  END-DEFINE
          000040  WRITE #TEMP
          000050  WRITE #TEMP
          000060  WRITE #TEMP
          000070  WRITE #TEMP
          ==chg>  print #temp
          000090  END
          ****** **************************** bottom of data ****************************

## Issuing Commands by Magic Character

You can abbreviate any string used in Natural ISPF commands by assigning it to a magic character, usually a special character. If you enter this special character in the command line of any Natural ISPF screen, the effect is the same as if you had entered the associated string.

This feature makes entering long command sequences and multiple command input much more comfortable, for example when switching sessions, accessing other system functions or issuing operator commands. For example, if you assign the string `SUSPEND` to the exclamation mark (!), the command

    !E NAT name

automatically starts a new Natural ISPF editing session with the specified Natural object. Or if you assign the stroke (/) to the string `OPERATOR_`, the command:

    /C object=name

automatically executes the operator command `CANCEL` on the specified object.

Issuing command sequences by magic character can be an alternative to using PF keys if these are already assigned to other functions.

Note
Like any other command string, magic characters can be assigned to PF keys.

## Selection Windows and Wildcards

When you enter function commands from the command line, Natural ISPF helps you choose the required object by providing selection lists and prompt windows when you leave out any required parameters from the command syntax.

Selection lists can be narrowed down by using certain wildcards for object parameters. You can enter wildcards in the parameter fields of object Entry Panels or as object parameters in function command syntax.

Two wildcard characters are available for all objects:

- An asterisk (*) selects object names with any character string;

- An underscore (_) selects object names with one character in the place of each underscore.

For Natural members, libraries, views and Con-nect documents, the following wildcards are also available:

- A less than sign (<) following a value lists all objects with lower values.

- A greater than sign (>) following a value lists all objects with greater or equal values.

  (See examples below.)

Notes:

1. You can either use the asterisk, or a combination of asterisk(s) and underscore(s).
2. If you use either < or > as wildcard, these must be the last character in the parameter field and cannot be combined with asterisks or underscores. A single asterisk following < or > is accepted, but is redundant.
3. `*eoj` and `*cancel` are reserved words of Com-plete. If you use Natural ISPF with Com-plete and enter such a string as first input to be processed on a map, the input is ignored (`*eoj`) or Natural terminates (`*cancel`).

### Examples:

- Enter a prefix followed by an asterisk (*) in the Member field to list all object names with that prefix. For example, in the Natural members facility, enter `ISP*` in the Member field and press ENTER to list all members in the specified library that start with `ISP`.

  The corresponding function command syntax issued from any system screen is:

      LIST N library(ISP*)

- Enter an asterisk (*) followed by a suffix in the Member field to list all object names with that suffix. For example, in the PDS members facility, enter `*INPL` in the Member field and press ENTER to list all members that end with `INPL` in the specified library.

  The corresponding function command syntax issued from any system screen is:

      LIST P library(*INPL)

- To list object names that contain a certain string in the name, you can use the notation *string* in the Member field. For example, `*ISP*` lists all objects that have the string `ISP` in their name. `A*B*` lists all object names that start with an A and also have a B in the name.

- To list object names with characters in certain places, use the underscore: for example, `A_ _E*` lists all object names with an `A` as first character and `E` as fourth character.

- The command:

      LIST DS *

  opens a window with a list of available library short names (see the subsection Library Definition in section Profile Maintenance).

- The command:

      LIST NAT C<

  lists all Natural members starting with `A` and `B`.

- The command:

      LIST NAT V>

  lists all Natural members starting with `V`, `W`, `X`, `Y` or `Z`.

### On this page

- Command Logic Overview
- Session Commands - Definition
- Function Commands - Definition
- Local Commands - Definition
- PF Key Assignments
- Multiple Command Input
- Issuing Commands by Magic Character
- Selection Windows and Wildcards