900 Series HP 3000 Computer Systems Command Interpreter Access and Variables Programmer's Guide ABCDE HP Part No. 32650-90011 Printed in U.S.A.
The information contained in this document is subject to change without notice. Hewlett-Packard makes no warranty of any kind with regard to this material, including, but not limited to, the implied warranties of merchantability or tness for a particular purpose. Hewlett-Packard shall not be liable for errors contained herein or for direct, indirect, special, incidental or consequential damages in connection with the furnishing or use of this material.
Printing History The following table lists the printings of this document, together with the respective release dates for each edition. The software version indicates the version of the software product at the time this document was issued. Many product releases do not require changes to the document. Therefore, do not expect a one-to-one correspondence between product releases and document editions.
iv
Preface MPE/iX, Multiprogramming Executive with Integrated POSIX, is the latest in a series of forward-compatible operating systems for the HP 3000 line of computers. In HP documentation and in talking with HP 3000 users, you will encounter references to MPE XL, the direct predecessor of MPE/iX. MPE/iX is a superset of MPE XL. All programs written for MPE XL will run without change under MPE/iX.
Chapter 7, \Sample Command Files," provides samples of actual command les o er suggested uses of many of the CI functions. A short description of each points out some of the key processing techniques that can be accomplished with the CI. Chapter 8, \Command Input/Output Redirection (CIOR)," describes how to de ne di erent les for command input and command output. Two appendixes provide lists of commonly used prede ned variables and evaluator functions.
Conventions UPPERCASE In a syntax statement, commands and keywords are shown in uppercase characters. The characters must be entered in the order shown; however, you can enter the characters in either uppercase or lowercase.
Conventions (continued) [ ... ] In a syntax statement, horizontal ellipses enclosed in brackets indicate that you can repeatedly select the element(s) that appear within the immediately preceding pair of brackets or braces. In the example below, you can select parameter zero or more times. Each instance of parameter must be preceded by a comma: [,parameter][...
Contents 1. Introduction What Is the Command Interpreter? . . . . . . . . How Is the Command Interpreter Used? . . . . . . How Programmers Use the CI . . . . . . . . . . 1-1 1-2 1-2 2. Accessing the Command Interpreter Issuing Commands Directly . . . . . . . . . Reissuing and Modifying Commands . . . . . Issuing Commands Through UDCs . . . . . . Creating a UDC File . . . . . . . . . . . Executing a UDC . . . . . . . . . . . . Specifying UDC Options . . . . . . . . .
4. Evaluating Expressions Using Expressions in CI Commands . Performing Arithmetic Operations Evaluating Strings . . . . . . . Performing Bit Operations . . . . Converting Numbers . . . . . . Evaluating File Characteristics . . Comparing Results . . . . . . . Expression Substitution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1 4-1 4-2 4-3 4-4 4-4 4-10 4-10 5. Using Language Constructs Available Obtaining Input . . . . . . . . .
A. Prede ned Variables B.
Figures 6-1. 6-2. 7-1. 7-2. 7-3. 7-4. 7-5. 7-6. 7-7. 7-8. 7-9. 7-10. 7-11. HPCIPUTVAR Intrinsic Example . . . . . . HPCIGETVAR Intrinsic Example . . . . . . Center Command File . . . . . . . . . . . . Center Command File with the Repeat Function Function Key Command File . . . . . . . . . FKEY Sample Output . . . . . . . . . . . Additional Capability Command File . . . . . ADDCAP Sample Output . . . . . . . . . . File Information Command File . . . . . . . FILINFO Sample Output . . . . . . . . . .
1 Introduction The user's interface to the operating system (MPE/iX) provides a exible, productive environment for all users. The command interpreter (CI) is an integral part of this interface. The CI is an executable program that acts as an interface between the user and MPE/iX. What Is the Command It consists of two parts: a centralized scanner/parser that scans a command string for valid syntax, and an interpreter that invokes the appropriate command executor based on command input.
How Is the Command Interpreter Used? The CI is used by everyone on the system. Entering CI commands is the primary method of communication between the user and the operating system. Every logon invokes the CI. General users access the operating system through logon and logo commands. A user obtains le information and runs subsystems through CI commands. The general user's view of the CI is described in the self-paced tutorial Using the 900 Series HP 3000: Fundamental Skills (32650-60037).
Some programming tasks can be coded more simply and e ciently with CI commands than with a standard application language. Routines can be written with CI commands and accessed from application programs through the intrinsic facility. Variables can be used by both CI routines and application programs to pass information between routines.
2 Accessing the Command Interpreter Command images are routed to the CI through several di erent paths. You can issue CI commands in several ways: From a job or session. Through the REDO and DO commands. Through user-de ned commands (UDCs) and command les. From application programs using CI intrinsics. From the INFO= string when a second level of the CI is run. From an input le when a second level of the CI is run with its $STDIN le redirected.
Reissuing and Modifying Commands By using the DO and REDO commands, you can modify and reissue a command that has been entered interactively from a session. These commands are especially helpful to correct typing errors or to avoid retyping complicated command input. The command history stack retains the latest commands that have been issued from the session or job. Usually, the last 20 commands that have been issued are kept in the stack. The LISTREDO command displays the command history stack.
To distinguish a UDC le from other les, it must be cataloged, using the SETCATALOG command. This process identi es the contents of the le as UDCs, so that any UDC name within the le is interpreted as a command by the CI. UDC les can be created at the user level, the account level, or the system level. UDCs can be added to or deleted from an existing UDC le, but must be uncataloged rst.
PROGRAM or NOPROGRAM Controls the ability of a UDC to be executed from a program. The contents of a UDC can be listed as each command is executed using the LIST option. All or any portion of the UDC can be kept from listing by specifying the NOLIST option. The NOLIST option is often used to eliminate unnecessary display or to maintain security. The NOHELP option similarly limits the listing of a UDC's contents within the Help facility.
Issuing Commands Through Command Files Creating a Command File Command les, like UDCs, can be created to execute single or multiple commands. Unlike UDCs, only one routine can be included in a command le. Any editor can be used to create a command le and to modify or delete a portion of it. The le name is used to invoke the command le. There is no cataloging procedure for a command le. Command les are often used to test a new user command before establishing it as a UDC.
Specifying Options for Command Files The RECURSION and LOGON options speci ed for UDCs are not applicable to command les. Other options available with UDCs can be used in command les. If a command, UDC, or another command le is called from a command le, the standard search path is used: UDCs, built-in MPE/iX commands, command or program les. The RECURSION option, therefore, is unnecessary for command les. Command les cannot be invoked automatically when a user logs on to the system.
ANYPARM ANYPARM causes all normal delimiters to be ignored. That is,the meaning and delimiters are now considered part of the parameter's value. This de nition forces ANYPARM to be the last parameter declared, since the equal sign (=), comma (,), semicolon (;), quotes ("), etc. are treated as part of the ANYPARM parameter's value.
3 Setting and Manipulating Variables The CI provides a method of setting, displaying, and deleting variables for each session. Variables are de ned by the numeric, string, or boolean values assigned to them. Job control words (JCWs), 16-bit numeric variables, are a subset of MPE/iX variables. Variables are maintained in the session's variable table, a list of currently de ned variables and their values that is established and maintained for each session or job.
Defining Variable Type The variable type is de ned by your input. Quotation marks specify that the enclosed phrase is a character string. In the previous example, the rst and last names are interpreted as string variables. The value 1000, an unquoted numeric string, is interpreted as an integer value. The unquoted word, FALSE, sets the variable to a boolean value. Expressions can also be used to set variable values. An unquoted string is interpreted as a variable name, not a character string.
Using Predefined Variables The CI provides prede ned variables, giving the user access to system information. The names and default values are preset in the session variable table. The following list categorizes the type of system information available and some of the prede ned variables that access it. (A listing of commonly used prede ned variables is provided in Appendix A. Refer to the MPE/iX Commands Reference Manual (32650-90003) for a listing of all prede ned variables available.
In this last example, /SK72NM/PUB is an /ACCOUNT/GROUP path (in hierarchical le system) that corresponds to an MPE/iX GROUP.ACCOUNT, and somehfsdir is a directory (below PUB). Modifying Values No prede ned variables can be deleted by the user, however, some of them are modi able. (Refer to the MPE/iX Commands Reference Manual (32650-90003) for a list of prede ned variables that cannot be modi ed.) You can change the default setting of any modi able prede ned variable to better suit your needs.
Explicit Dereferencing Any variable can be dereferenced explicitly by preceding the variable name with an exclamation point. Explicit dereferencing is available with every CI command. The variable's value rather than its name is substituted in the statement or expression. Explicit dereferencing is often used to include a variable value in an expression. :SETVAR X "Blue" :SETVAR Y "!X is the best color." :SHOWVAR X,Y X = Blue Y = Blue is the best color.
Note that X was not dereferenced fully when the variable Z was set because recursive dereferencing of the variable was speci ed. The value of X was substituted only when the ECHO command was executed, requiring the dereferencing of Z itself. For the variable Y, however, X was dereferenced when its value was loaded to Y. The value of Y always remained the same and did not re ect any change when X was reset to a new value.
If a dereferenced variable is enclosed in quotation marks, any dereferencing within the quotation marks is performed rst. The following example demonstrates the di erence between string substitution sequences. :SETVAR VAR1 "ABC" :SETVAR VAR 'hello' :SETVAR A 1 :ECHO !VAR!A hello1 :ECHO !"VAR!A" ABC The rst ECHO command is dereferenced from left to right. The value of the variable VAR (hello) is concatenated with the value of the variable A (1). No space was inserted between the two variables.
4 Evaluating Expressions Expression results can be used to de ne complex functions. They form the basis of comparison structures in establishing branches and loops. Expressions can also be used to set variables based on an equation of prede ned variables, user-de ned variables, constants, and arithmetic or logical operators.
The following example sets the variable EXP with the result of an expression. Note the order in which the operations are performed. :SETVAR A 1 :SETVAR B 2 :SETVAR C 3 :SETVAR D 4 :SETVAR EXP A+B*C/D :SHOWVAR EXP EXP = 2 The multiplication and division functions are performed rst from left to right. The integer result is added to A. Note that division is an integer function; results are truncated, not rounded. Parentheses can be inserted to clarify or to alter the logical order of operations.
The length of a string can be determined with the LEN function. :SETVAR ANS LEN("abcdefg") :SHOWVAR ANS ANS = 7 The RPT function repeats a string a speci ed number of times. This is often used to pad another string with blanks or zeros. :SETVAR ANS RPT("A",3) :SHOWVAR ANS ANS = AAA The LTRIM and RTRIM functions trim leading or trailing characters from the left or right of a string. Blanks are trimmed from the string unless a trim character is speci ed in the command.
Note that the preceding examples show the use of the bit operations. A simpler way of determining if a user has AM capability would be the following method. IF POS("AM",HPUSERCAPF) > 0 THEN . . . Converting Numbers Numeric values can be converted from decimal representation to octal or hexadecimal string equivalents. Numeric output is identi ed by three pre xes: # represents decimal, $ represents hexadecimal, and % represents octal. If no pre x is speci ed, decimal is assumed.
KSAM XL version device type (disk, tape, port, streams, sockets, etc.) whether the le has been released. Refer to New Features of MPE/iX: Using The Hierarchical File System (32650-90351). The following table provides some of the most commonly used FINFO options, by number and alias, and a description of the results. FINFO passes the name of the le using either MPE syntax (the default) or HFS syntax. You can enter CALC FINFO('.1',0) and receive TRUE as output, and lename in HFS can end in any character.
Table 4-1.
Table 4-1.
Table 4-1.
Table 4-1.
The FINFO function is often used in le maintenance routines to create, delete, or determine certain characteristics of a le. The following examples demonstrate the responses to several FINFO requests about the le X.PUB.SYS. :CALC FINFO('X',0) TRUE :CALC FINFO('X','EXISTS') TRUE :CALC FINFO('X',13) ASCII, FIXED, NOCCTL, STD :CALC FINFO('X','FMTFOPT') ASCII, FIXED, NOCCTL, STD :CALC FINFO('X',1) X.PUB.SYS :CALC FINFO('X','FULLFNAME') X.PUB.
:BUILD Y;DISC=![FINFO(FILE1,'EOF')*110] :ECHO ![UPS(FILE1)] does not exist. Expressions are evaluated from left to right within the operator hierarchy. This sequence can be altered, however, by including parentheses in the expression. Parentheses can be nested to provide a speci c sequence for evaluation. The following example shows the expression that centers the variable TEXT on an 80-character line.
5 Using Language Constructs Available with CI The CI programming structures provide standard programming routines for input, output, looping, and branching. These structures provide the basis for sophisticated programming. Several of the most common structures are described and demonstrated in the following sections. (Chapter 7 provides complete command le routines that have been excerpted in this chapter.
In this example, the le name is a required parameter since no default value has been provided for the parameter eld. In processing the command le, the le name is inserted in any expression where the parameter FNAME is dereferenced, such as in the FINFO statement. Note Parameters must be accessed by explicit dereferencing. Implicit dereferencing will result in either a message stating that the variable does not exist or insertion of a variable value of the same name.
Prompting for Input The INPUT command prompts the user for input data and reads user input from $STDIN, the user's terminal, into a de ned variable. The data received with the INPUT command is considered string, even if it consists of numeric data. The INPUT command allows three parameters. The rst parameter speci es the variable name for the input data. The second speci es a character string to be used as the prompt.
SETVAR, REMOTE, or COMMENT statements. All other CI statements can perform input redirection. Branching After Evaluation Sequence within a command le or UDC can be controlled with the IF, ELSEIF, ELSE, and ENDIF statements. When the conditions speci ed in the IF statement are met, the actions following this statement are performed. When the conditions are not met, an optional ELSEIF or ELSE statement provides an alternative. Each IF construct must be ended with its associated ENDIF statement.
Creating Processing Loops The CI provides a looping structure through the WHILE and ENDWHILE statements. Combined with the expression evaluator functions, a series of statements can be repeated as long as a particular condition exists. The MENU command le provides a processing loop that continues prompting for the user's response and selecting the proper subroutine until the user selects 0 to exit the routine. SETVAR CHOICE " " WHILE CHOICE <> "0" DO ECHO Enter 0 to exit. ECHO 1 to review database.
Reporting Results Displaying Output to the Terminal Usually, output from a command le or UDC is displayed on the user's terminal. The ECHO command and, in some situations, the PRINT command display output from a command le or UDC to the terminal. In some instances, output can be used as input for a subsequent procedure. This is easily accomplished by redirecting output from a command le or a UDC to a le. The ECHO command displays information to the user's terminal.
The le is created with write, shared, and multiaccess. These default values can be overridden by using a backreference to a le equation. Note that if the le exists and the output redirection indicator is >, the output from the statement overwrites any existing data in the le. To open an existing le and append new output, the output redirection indicator is >>. The following example creates a le for the SHOWME command output. It then appends output from the SHOWOUT command to the same le.
prompt. If a jobstream invokes the command, the job is ushed from the system.
6 Accessing Variables and CI Commands in Applications The intrinsic mechanism provides a means of communicating with the CI from an application program. Several intrinsics manipulate user-de ned and prede ned variables from within an application. User-de ned and prede ned variables can be set and retrieved within an application as a means of communicating with another process in the same session. Intrinsics can also execute a CI command, UDC, or command le from within an application.
14 item number and item pair is required when item number 2 has been speci ed.) Indicates that the following parameter contains a nonzero value if the string value speci ed by item number 2 is to be stored as entered. It contains a zero if the string value speci ed by item number 2 is to be interpreted. If interpreted, a string containing a number within the range of -2147483648 to 2147483648 is interpreted as a numeric value.
Procedure Create_CI_Variable; Const KeyWord_StringValue = 2; { keyword #2 in the intrinsic manual } KeyWord_StringLength = 11; { Keyword #11 in the intrinsic manual } StringLength = 34; CIVarNameLen = 6; { Length of variable name to be created } Type StatusType = Record Case Boolean Of True : ( Error_Num : Integer ); False : ( Info, SubSys : ShortInt ); End; CIVarNameType = Packed Array[ 1..CIVarNameLen ] Of Char; ToBeWrittenType = Packed Array[ 1..
The HPCIPUTVAR intrinsic can also be used to modify the value of a prede ned variable. The prede ned variable to be modi ed is identi ed by specifying the variable name in the intrinsic call. Its value is determined by item number and item pairs specifying the data type and the value to be inserted. Note that some prede ned variables cannot be modi ed. (Refer to the MPE/iX Commands Reference Manual (32650-90003) for a list of prede ned variables that can be modi ed.
10 11 12 13 Indicates that the following parameter contains the length of the byte array receiving the variable's string value. If a length is passed and a byte array is not, an error is returned. Indicates that the following parameter receives the actual length (in bytes) of the variable's string value. Indicates that the following parameter contains a nonzero value to dereference the variable recursively. A zero value in this parameter retrieves the level-1 value of the variable.
Function At_Physical_Console : Boolean; Const PhysicalConsoleLDev = 20; KeyWord_GetIntegerValue = 1; { keyword #2 in the intrinsic manual } CIVarNameLen = 9; Type StatusType = Record Case Boolean Of True : ( Error_Num : Integer ); False : ( Info, SubSys : ShortInt ); End; CIVarNameType = Packed Array[ 1..
The FINDJCW intrinsic retrieves the value of a speci ed JCW variable. The GETJCW intrinsic retrieves the current value of only the prede ned variable named JCW. Both of these functions can be accomplished with the HPCIGETVAR intrinsic by specifying the appropriate variable name. To ensure program readability, use the HPCIGETVAR intrinsic in all cases. Using Intrinsics to Execute CI Commands The HPCICOMMAND intrinsic provides programmatic access to the CI command set, command les, and UDCs.
7 Sample Command Files Samples of the command les that have been excerpted in the previous text are provided in the following section. They provide examples of how the CI's programming elements can be used to create sophisticated sequential routines. An explanation of each routine's purpose, a sample of its use, and highlights of the routine are supplied. To Center a String The CENTER command le is an example of string manipulation functions.
To Set a Function Key The FKEY command le sets a single function key. It demonstrates setting escape sequences with string concatenation and variable dereferencing. Parameter input de nes the key to be set by the command le (KEY), the label (L1), the string to be generated when the function key is pressed (S1), and the key attribute parameter (A1).
To Add User Capabilities The ADDCAP command le adds capabilities to a user's capability list. The ALTUSER command is used to alter the capability list. The AM capability, therefore, is required to execute this command le. Since the new capability does not become e ective until the user logs on again, the user is o ered the option of being logged on automatically. This command also permits an authorized user to change the UID of a user.
There are three possible outcomes in running this command le using acceptable input: No capability was entered as a parameter value. The user's current capabilities are listed. The user already has the capability. The capability is added to the user's list. Note that a relogging option prompts the user to relog automatically or to wait until the next logon to activate the new capabilities. d The following examples illustrate these three possibilities.
PARM FILE IF NOT (FINFO("!FILE","EXISTS")) THEN COMMENT ** FILE DOES NOT EXIST ** IF LFT("!FILE",1) <> "*" AND LFT("!FILE",1) <> "$" THEN COMMENT **QUALIFY FILE BEFORE REPORTING NON-EXISTENCE** IF POS(".","!FILE") > 0 THEN COMMENT ** A GROUP NAME IS SPECIFIED ** IF POS(".","!FILE",2) > 0 THEN COMMENT ** FILE NAME IS FULLY QUALIFIED ** ECHO ![UPS("!FILE")] does not exist. ELSE ECHO ![UPS("!FILE")].!HPACCOUNT does not exist. ENDIF ELSE ECHO ![UPS("!FILE")].!HPGROUP.!HPACCOUNT & does not exist.
d c This command le searches for a designated le. If found, its formal le designator, creator and creation date, modi cation information, le code, record size, end of le, le limit, and le options are displayed. The following example provides a sample of the display provided by the FILINFO command le. :FILINFO SAMPLE (FINFO): Full description for SAMPLE.PUB.MILL follows: Created by CLM on WED, MAY 10, 1989. Modified on WED, MAY 10, 1989 at 3:21 PM. FCODE: 0. RECSIZE: -80, EOF: 5, FLIMIT:5.
PARM ENH_CH=D COMMENT Interactive calculator using calc and input ECHO ![CHR(27) + "h" + CHR(27) + "J"] CENTER "MPE/iX INTERACTIVE CALCULATOR" CENTER ": executes any MPE/iX command!" CENTER "Type [RETURN] to exit" ECHO SETVAR CALCIT_ESC CHR(27) + "A" + RPT(CHR(27) + "C", 64) SETVAR CALCIT_PROMPT LFT(UPS("!-1"), POS(' ',"!-1" + ' ')-1) + ' ==> ' WHILE SETVAR (CALCIT_EXPR, RTRIM(INPUT(CALCIT_PROMPT))) <> '' DO COMMENT Save length before trimming leading blanks SETVAR CALCIT_LEN LEN(CALCIT_EXPR) SETVAR CALCIT_
d c The following example shows the terminal display to calculate the equation 5 + 7. :CALCIT MPE/iX INTERACTIVE CALCULATOR : executes any MPE/iX command Type [RETURN] to exit CALCIT ==> 5+7 = 12 CALCIT ==> : To Create a Menu of Options b The MENU command le provides a mechanism for running two programs, DBREVIEW and DBUPDATE. The user's response of 1 or 2 performs the proper program and prompts the user for another selection.
To List Multiple Files The LIST command le prints the contents of multiple les to device class LP. Up to six les can be speci ed as parameters when invoking the command le. PARM F1,F2=$NULL,F3=$NULL,F4=$NULL,F5=$NULL,F6=$NULL SETVAR LIST_I 1 SETVAR LIST_F "!!F1" WHILE LIST_I <= 6 IF UPS("!LIST_F") <> "$NULL" FILE !LIST_F;DEV=LP ECHO (LIST): Printing of !LIST_F is in progress.
8 Command Input/Output Redirection (CIOR) Command Input/Output Redirection (CIOR) enables you to de ne di erent les for command input and command output. Without CIOR, command input and output defaults to $STDIN or $STDLIST. For sessions, $STDIN and $STDLIST are your terminal. For jobs, $STDIN and $STDLIST are spool les although $STDLIST is most commonly seen as a printed job output (spool le) listing. CIOR provides independent management of redirection by the command interpreter.
Redirecting Command Input To redirect command input you would enter: command < infile Command can be any MPE/iX command except for the following: CALC COMMENT ELSEIF IF REMOTE SETVAR SETJCW TELL TELLOP WARN WHILE and infile is the le that contains the input to that command. For example: editor < edinput This invokes the EDITOR and instructs it to read data from the le edinput. The data is used by EDITOR as if it was being typed as input at the terminal.
This invokes EDITOR, instructs it to read input from le edinput and to write output to $NULL. Output from EDITOR for includes the banner, the prompt and all other EDITOR output. Redirecting I/O with a File Backreference Backreferencing a le equation with CIOR is both simple and useful. To accomplish it you enter: file formaldesig1;parm . . . ;parm . . . file formaldesig2;parm . . . ;parm . . .
Redirection supports HFS (hierarchical le system) names. ECHO Hi There! >> ./somefile appends to the le ./somefile To append redirected output enter: command >>outfile For example: echo echo echo echo echo text file1 > edinput find "patt1" >> edinput delete >> edinput keep >> edinput exit >> edinput The rst line in this example produces the temporary le edinput. The next four lines append edit commands to this le.
file lp602;dev=epoc;env=lp602.hpenv.sys listfile @.@.myaccount,-2 > *lp602 listfile @.@.myaccount,4 >> *lp602 Both listfile commands are directed to a printer in this example. When the rst listfile command nishes, its spool le is closed and made ready for printing. Once this happens to a spool le it cannot be reopened. For this reason, the second listfile command cannot append to the rst le even though the >> sign has been used. The second listfile command simply writes another spool le.
Things to Remember about Redirection Constructions When creating redirection constructions it is important to remember that the redirection speci cation is stripped from the command line after string substitution (variable and expression substitution) but before the command is actually executed.
Expression substitution is also done in the string substitution pass and would, therefore, also be performed before the redirection scan. For example, the LISTF command might be invoked as follows: listsf ![input(`ENTER THE FILESET TO BE DISPLAYED:')],6 & >![input(`ENTER THE FILE NAME FOR THE OUTPUT OF THE LISTF:')] During the string substitution scan the user is prompted rst for the le set, and then for the output le name.
Redirection File Defaults If a le equation is not used to specify the characteristics of an output redirection, le the following are taken as defaults: 256-byte, variable length, ASCII records DISC=10000 Temporary le domain NOCCTL When output is redirected using the > lename redirection speci cation to a temporary le which already exists, the following defaults apply to the open: WRITE SHARED access MULTI access If the >> lename speci cation is used instead, APPEND access is requested instead of WRITE.
A Predefined Variables Various abbreviations are used in the type column of the following table to distinguish a variable's type and characteristics. The data types are identi ed as follows: I - Integer format. B - Boolean format (TRUE/FALSE). S - String (ASCII) format. No prede ned variables can be deleted. The following abbreviations specify whether a variable can be modi ed or not: R - Read only variable (cannot be modi ed). W - Read/write variable (can be modi ed).
Table A-1.
Table A-1. Predefined Variables (continued) Variable HPCWD Type RS De nition The HPCWD variable displays your current working directory name in the HFS (Hierarchical File System) convention.
Table A-1.
Table A-1.
Table A-1. Predefined Variables (continued) Variable Type De nition Initial Value HPVERSION RS MPE XL version ID (v.uu.
B Evaluator Functions The following table identi es most of the expression evaluator functions. For a list of the latest evaluator functions, refer to the MPE/iX Commands Reference Manual (32650-90003). Table B-1.
Table B-1. Expression Evaluator Functions (continued) Symbol Function Example Result BAND bitwise and 7 BAND 13 5 BNOT bitwise not BNOT 5 -6 BOR bitwise or 5 BOR 2 7 BOUND(varname ) BOUND(HPPATH) variable de nition test (Returns TRUE if varname has been de ned.
Table B-1. Expression Evaluator Functions (continued) Symbol Function Example Result ORD(string ) ordinal ORD('AbcD') 65 POS( nd str,source str [,n ]) nd Nth occurrence of nd str in source str (-N searches from right) POS('ab','cgabd') POS('.',' le.grp.acct',2) POS('.',' le.grp.
Index A B C arithmetic operations, 4-1 bit operations, 4-3 branching, 5-4 BREAK option, 2-3 CHR function, 4-3 CI command length, 1-1 CI de nition, 1-1 CIOR, 8-1{8 appending redirected command output, 8-3 command exceptions, 8-2 construction, 8-6{7 defaults, 8-1 determining redirection, 8-8 escaping redirection, 8-7 examples, 8-1{8 le backreferencing, 8-3 redirecting output to a device le, 8-4 redirection le defaults, 8-8 redirection indicators, 8-1 stacked redirection, 8-5 wildcarding, 8-1 command les, 1-
LISTREDO, 2-2 PARM, 5-1 PRINT, 5-6 REDO, 2-2 RETURN, 5-7 SETCATALOG, 2-2 SETVAR, 3-1 SHOWVAR, 3-1, 3-3 WHILE, 5-5 comparison operators, 4-10 conditional branching, 5-4 CSL function, 4-3 CSR function, 4-3 D E F Index-2 decimal representation, 4-4 DELETEVAR command, 3-2 dereferencing explicit, 3-5 expressions, 4-10 implicit, 3-4 parameters, 5-2 recursive, 3-5 device le output, 5-7 DO command, 2-2 DWNS function, 4-2 ECHO command, 5-6 ELSE command, 5-4 ELSEIF command, 5-4 ENDIF command, 5-4 ENDWHILE command
FINFO, 4-4 HEX, 4-4 LEN, 4-3 LSL, 4-3 LSR, 4-3 LTRIM, 4-3 OCTAL, 4-4 ORD, 4-3 RPT, 4-3 RTRIM, 4-3 UPS, 4-2 G H I GETJCW intrinsic, 6-6 HELP option, 2-3, 2-4 hexadecimal representation, 4-4 HEX function, 4-4 HPCICOMMAND intrinsic, 2-6, 6-7 HPCIDELETEVAR intrinsic, 6-4 HPCIGETVAR intrinsic, 6-4, 6-5 HPCIPUTVAR intrinsic, 6-1, 6-3 HPSTDIN , 8-8 HPSTDLIST , 8-8 IF command, 5-4 implicit dereferencing, 3-4 index variable, 5-5 input from a le, 5-3 interactive, 5-3 parameter, 5-1 redirection, 5-3 INPUT command, 5
J L N O P Index-4 JCW, 3-1, 6-4, 6-6 job control word.
R S U RECURSION option, 2-3, 2-4 recursive dereferencing, 3-5 redirection, command input and output, 8-1{8 redirection speci cation stripping from command line, 8-6 REDO command, 2-2 repeat function example, 7-1 RETURN command, 5-7 RPT function, 4-3 RTRIM function, 4-3 search sequence command les, 2-5 UDC, 2-3 session variable table, 3-1, 3-3 SETCATALOG command, 2-2 SETJCW intrinsic, 6-4 SETVAR command, 3-1 SHOWVAR command, 3-1, 3-3 spool le, 8-1 string case shifting, 4-2 example, 7-1, 7-6 ordinal repres
V W Index-6 variable, 1-2 current value, 3-2, 3-3 deletion, 3-2, 6-4 in expression, 4-10 naming convention, 3-2 prede ned, 3-1, 3-3, 6-3 retrieval, 6-4 setting, 3-1, 6-1, 6-3 type, 3-1, 3-2 user-de ned, 3-1, 3-1, 6-1, 6-4 wildcard character, 3-1 variable table, 3-1, 3-3 WHILE command, 5-5 wildcard character, 3-1 wildcarding, 8-1