Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

FIND-CMD-OUTPUT

&pagelevel(3)&pagelevel

Filter command outputs specifically by a string

Component:

FIND-CMD-OUTPUT

Functional area:

Command processing

Domain:

UTILITIES                                                                                                             

Privileges:

STD-PROCESSING

TSOS

HARDWARE-MAINTENANCE

SAT-FILE-EVALUATION

SAT-FILE-MANAGEMENT

SECURITY-ADMINISTRATION

Function

With the command FIND-CMD-OUTPUT, the output of BS2000 commands can be filtered specifically by a string, so that only the relevant lines of the output are displayed. The commands whose outputs are to be searched can be specified directly or via a command file. All SHOW* and LIST* SDF commands that can be executed under the current privileges and the ISP command BCSHOW are valid. All SHOW-BCAM-INFO* commands and the commands SHOW-FILE and SHOW-SYSEVENT-LOG are excluded. 
In order to find the command name for a desired output, FIND-CMD-OUTPUT offers the possibility to filter the output of a large number of system selected commands by a string. For this purpose, the system selects SHOW* and LIST* commands and their parameters, so that a lot of information can be searched under the current privileges and without the user's intervention (i.e. without explicit parameter specification).

If SYSOUT is set to a variable when executing the command FIND-CMD-OUTPUT, the command cannot be executed correctly. Instead, it will be written to the set SYSOUT variable that the command FIND-CMD-OUTPUT cannot output to a variable.  

Format

FIND-CMD-OUTPUT                                                                                                             

Alias: FCMDO

 CMD = *SYSTEM(...) / *FROM-FILE(...) / <c-string 1..1800>


*SYSTEM(...)



|

INFORMATION = *MEDIUM / *MINIMUM *MAXIMUM


*FROM-FILE(...)



|

FILE-NAME list-possible(50): <filename 1..54 without-gen-vers with-wild> 



|

,INFORMATION = *MEDIUM / *MINIMUM *MAXIMUM

,UPDATE-CMDS = *STD*YES

,PATTERN = <c-string 0..1800 with-low>

,PATTERN-TYPE = *STRING/ *REGULAR-EXPRESSION 

,OUTPUT = *SYSOUT / <filename 1..54 >

Operands

CMD = *SYSTEM(...) / *FROM-FILE / <c-string_1..1800>
Determines the set of commands whose output is to be searched.

CMD= *SYSTEM(...)
Specifies that the outputs of system selected commands are searched. These are all SHOW* and LIST* SDF commands with parameter combinations, which can be executed successfully without explicit parameter specifications under the current privileges. If possible, the parameter *ALL, *MAXIMUM or *ANY is set for the operands. As exceptions, the outputs of the SHOW-BCAM-INFO* commands and the commands SHOW-INPUT-HISTORY, SHOW-FILE, SHOW-FILE-ATTRIBUTES, SHOW-FTP-TELNET-STATUS, SHOW-NET-STATISTICS, SHOW-POSIX-STATUS, SHOW-SYSEVENT-LOG and SHOW-VARIABLE-ATTRIBUTES are not searched.

INFORMATION = *MEDIUM / *MINIMUM / *MAXIMUM
Determines whether the lines with matches and commands without matches are displayed.

INFORMATION = *MEDIUM 
Specifies that the names and lines with matches of the commands with matches in their output are displayed. 

INFORMATION = *MINIMUM
Specifies that the names of the commands with matches in their output are displayed. 

INFORMATION = *MAXIMUM
Specifies that the names and lines with matches of all commands are displayed, i.e. also the names of commands in whose output nothing was found.

CMD= *FROM-FILE(...)
Specifies that the output of all commands from one or more command files should be searched. The following syntax rules for command files apply.  

Syntax of a command file

If a line begins with the string ' /&* ', it is a comment line and will be ignored. Every other line is interpreted as a complete command by FIND-CMD-OUTPUT and the resulting output of the execution of the command in this form is filtered by the search string. 
The commands can be given with or without a leading slash, with or without a leading space, as well as in a short form. Parameters for the command can be specified and be separated from each other by any number of spaces. The general SDF rules for line continuation apply.
If the command file contains an erroneous command, the error message is displayed with the corresponding command name when filtering the outputs of the commands from this file. The outputs of all correctly executable commands are still searched normally.
The command GENERATE-FIND-CMD-TEMPLATE (SP24.2 BS2000 V21 Commands, #221.5) creates a template of a command file.

FILE-NAME= list-possible(50): <filename_1..54_without-generation-version_with-wildcards> 
Specifies the file with the commands whose outputs are filtered by the search string.

INFORMATION = *MEDIUM / *MINIMUM / *MAXIMUM
Determines whether the lines with matches and commands without matches are displayed.

INFORMATION = *MEDIUM 
Specifies that the names and lines with matches of the commands with matches in their output are displayed. 

INFORMATION = *MINIMUM
Specifies that the names of the commands with matches in their output are displayed. 

INFORMATION = *MAXIMUM
Specifies that the names and lines with matches of all commands are displayed, i.e. also the names of commands in whose output nothing was found.

CMD= <c-string_1..1800>
Specifies the command whose output is to be filtered by the search string. Short forms of the command and wildcards are recognized. When using wildcards, all matching commands are searched in alphabetical order.   

UPDATE-CMDS = *STD/ *YES
CMD=* SYSTEM: Determines whether the selection of commands whose output is searched is updated.
CMD = <c-string_1..1800> or CMD=*FROM-FILE: Determines whether the compilation of valid commands is updated.

UPDATE-CMDS = *STD
Specifies that the compilation of commands is only done if it has not yet been created since LOGON.

UPDATE-CMDS = *YES
Determines that the command selection is renewed in any case.

PATTERN= <c-string_1..1800 with-low>
Specifies the search string to filter by

PATTERN-TYPE = *STRING/ *REGULAR-EXPRESSION
Determines how the search string is evaluated.

PATTERN-TYPE = *STRING
The command output is filtered by the specified string.

PATTERN-TYPE = *REGULAR-EXPRESSION
The command output is filtered by the string specified as a regular expression according to POSIX rules (see “POSIX Commands” manual [29], chapter 5.2).

OUTPUT = *SYSOUT/ <filename_1..54>
Specifies where to output the information.

OUTPUT = *SYSOUT
The output is written to the SYSOUT system file.

OUTPUT = <filename_1..54>
The output is written to a file with the specified name. If a file with the specified name already exists, it will be overwritten.

Return codes

(SC2)

SC1

Maincode

Meaning/Guaranteed messages


0

CMD0001

Command executed


1

CMD0202

Syntax error in command


32

FND0001

Internal error


01

FND1001

Command &00 unknown / not allowed / terminated with error (&01) 


01

FND1002

Parameter error. Operand FILE-NAME is incorrect. 


64

FND0002

SYSOUT was set to a variable when the command was called. 

Examples

Example 1: Filtering the output of a specific command by a string 

/FIND-CMD-OUTPUT CMD='SHOW-LINE-ATTRIBUTES',PATTERN='LINE-NAME'     

command: SHOW-LINE-ATTRIBUTES (SHLNA)
search string: LINE-NAME
                                                    
 LINE-NAME           : L#MANLO1
 LINE-NAME           : L#MANLO2
Only the lines of the output of SHOW-LINE-ATTRIBUTES that contain the string 'LINE-NAME' are displayed.

Example 2: Search for a command to output a desired string

/FIND-CMD-OUTPUT CMD=*SYSTEM(INFORMATION=*MINIMUM),PATTERN='LANGUAGE'     

search string: LANGUAGE
                                                   
command: SHOW-MSG-FILE-ASSIGNMENT *ALL , INFORMATION= *ALL

command: SHOW-USER-ATTRIBUTES , SELECT= *ALL
Only the names of the commands that contain the string 'LANGUAGE' in their output are displayed.

/FIND-CMD-OUTPUT CMD=*SYSTEM(INFORMATION=*MEDIUM),PATTERN='LANGUAGE'     

search string: LANGUAGE
                                                   
command: SHOW-MSG-FILE-ASSIGNMENT *ALL , INFORMATION= *ALL

 SYSTEM LANGUAGES : ED 
 TASK LANGUAGE  : D   TASK SEARCH : *ALL

command: SHOW-USER-ATTRIBUTES , SELECT= *ALL

 DEFAULT-MSG-LANGUAGE                         TEMP-SPACE-LIMIT       2147483547

The names and the lines with matches of the commands that contain the string 'LANGUAGE' in their output are displayed.