EXECUTE

Read syntax diagramSkip visual syntax diagram EXECUTE Cursorlines* command

Authorization

General User

Purpose

Use the EXECUTE command only in the CSLLIST, CSLMAP, DIRLIST, FILELIST, MACLIST, RDRLIST, and VMLINK command environments. Use EXECUTE (an XEDIT macro) to issue commands (or execs) that make use of lists displayed by these commands.

EXECUTE may be used in two ways. First, on a display terminal, the command(s) to be executed can be typed directly on the screen and EXECUTE entered either on the command line or from a PF key or by pressing Enter. Second, the command to be executed can be typed in the command line at the bottom of the screen, following EXECUTE (as one of its operands). The command is then executed against one or more files in the list, beginning with the current line of the list.

Operands

Cursor
means a command is to be executed against the file (member, directory, or CSL routine) that contains the cursor. The command can either be typed on the line that describes the file, or it can be typed as an operand of EXECUTE. The CURSOR operand is valid only on display terminals and is particularly useful when assigned to a PF key. For example, if EXECUTE CURSOR XEDIT is assigned to a PF key, you can place the cursor on the line describing the file you want to edit and then press the PF key.
lines
is the number of lines in the list the command is to be executed for, starting with the file described on the current line of the list. If a command is specified, the default is one. You can specify an asterisk (*), which means execute this command on all lines, from the current line to the end of the list.
command
is a CMS or CP command (or any program or exec) that makes use of files in the list. You can either type out the command operands, or you can use the symbols.

Usage Notes

  1. When a command is typed on the screen, EXECUTE rebuilds the line and compares it with the line displayed on the screen. The line is scanned from right to left, and the first character that is different signals the end of the command. Therefore, if the information has been changed (as the result of a previous command), but this information has not yet been updated (by pressing PF2 to refresh the screen), EXECUTE will incorrectly interpret the information on the screen, as shown in Figure 1.
    Figure 1. Sample FILELIST Screen
    Cmd Filename Filetype Fm Format Lrecl  Records  Blocks   Date     Time
        CMS      EXEC     A1 F         80      268      21  1/11/82 13:44:19
        TEST     LIST     A1 F         80       22       2  1/11/82 13:19:29
      ..................
    Issue COPYFILE command:
    Cmd Filename Filetype Fm Format Lrecl  Records Blocks   Date     Time
    copyfile / test list a (APPEND     80      268     21  1/11/82 13:44:19
        TEST     LIST     A1 F         80       22      2  1/11/82 13:19:29
      ..................
    After pressing Enter, only the line with the command is refreshed:
    Cmd Filename Filetype Fm Format Lrecl  Records Blocks   Date     Time
    *   CMS      EXEC     A1 F         80      268     21  1/11/82 13:44:19
        TEST     LIST     A1 F         80       22      2  1/11/82 13:19:29
      ................
    Pressing PF2 updates the other files in the list:
    Cmd Filename Filetype Fm Format Lrecl Records Blocks   Date     Time
        TEST     LIST     A1 F         80     290     23  1/11/82 13:46:38
        CMS      EXEC     A1 F         80     268     21  1/11/82 13:44:19
      ..................
  2. Entering Commands on the Command Line

    Another way to issue commands that make use of the lines displayed is to move the current line to the first (or only) line you want the command to use, and then to issue EXECUTE (in the form EXECUTE lines command) from the XEDIT command line. This method may be used on both display and typewriter terminals.

    For example:

    First move the current line (by using XEDIT subcommands like UP or DOWN) to the first line you want to use in the command. On a full screen display, the current line is the first file on the screen. Then (in the XEDIT command line) you type:
    execute n command
    Where:
    n
    specifies the number of lines the command is executed for, starting with the current line.
    command
    specifies the name of the command.
    Note: You can use XEDIT synonyms or macros to make issuing common commands easier.

    For example, you might want to set up a command EX to be a synonym for EXECUTE 1 XEDIT.

  3. Using Symbols as Part of a Command

    Symbols can be used to represent operands in the command to be executed. They can be used in the commands typed on the screen, or as part of the command in EXECUTE (on the command line). The symbols are different in each command environment. If no symbol is entered, the slash (/) symbol is the default and is appended to the end of the command. For more information about using symbols as part of a command, see the usage notes of each of the commands that use EXECUTE.

  4. When in FILELIST, one of the most powerful features of FILELIST can be used:
    EXECUTE * COPYFILE / = = Z (OLDDATE
    If you wanted to handle EXEC and XEDIT files, you could do the following:
    FILELIST * EXEC A                    Starts FILELIST                     
    FILELIST * XEDIT A (APPEND           Add all XEDIT files to the list,    
                                          issued from FILELIST's command 
                                          line
    EXECUTE * COPYFILE / = = Z (OLDDATE  Also executed from the command 
                                          line
    You can also exploit the fact that FILELIST is XEDIT based, so before the EXECUTE *, you could change the list of files (for example, remove all files starting with PROF). All commands below are entered in FILELIST's command line.
    ALL / PROF/       Show all files with filenames beginning with: PROF  
    DEL *             Remove them from the FILELIST list.                 
                       (This does not erase the files on the disk)        
    ALL               Display all lines again                             
    TOP               Go to the top                                       
    EXECUTE * ...

Messages and Return Codes

  • DMS526E Option CURSOR valid in display mode only [RC=3]
  • DMS543E Invalid number: number [RC=5]
  • DMS561E Cursor is not on a valid data field [RC=3]
  • DMS651E EXECUTE must be issued from CSLLIST, CSLMAP, DIRLIST, FILELIST, MACLIST, RDRLIST, or VMLINK [RC=40]
  • DMS654E Invalid symbol symbol; {/0 must be specified alone│invalid character char following / symbol} [RC=24]
On a typewriter terminal only:
Executing: command
+++E(nn)+++