MPE/iX Commands Reference Manual (32650-90877)
648 AppendixB
Expression Evaluator Functions
References
comment the right side is not executed. This
comment means no INPUT() will be performed.
For LTRIM and RTRIM if
trimstr
is not given, then a space is used as the default
POS (
findstr,sourcestr
[,
N
]). If
N
is specified, the Nth occurrence of
findstr
is
searched for in
sourcestr
. If
N
is negative, the ABS(
N
)th occurrence of
findstr
is
searched for in
sourcestr
from the right. A value of zero for
N
results in a zero being
returned. This is the same value which is returned if the requested occurrence of
findstr
is not found in
sourcestr
. For example:
POS('.','FILE.GRP.ACCT') WILL RETURN 5
POS('.','FILE.GRP.ACCT',-1) WILL RETURN 9
The SETVAR() function is different from other evaluator functions in that it is the first
function that modifies its environment. The syntax is as follows:
SETVAR (
varname, expression
)
The
expression
is evaluated. If it evaluates with no errors, the value is returned and
the variable with the name given as the first parameter is set to that value. Normal
rules on setting variables apply: if it does not exist, it is created; if it does exist, its type
is set to the type of the result of expression. Please refer to the SETVAR command for
additional information. The Table B-2. on page 648 shows the FINFO Specifications
NOTE
The SETVAR() function is not executed in a partial evaluation skip state. See
the INPUT() function above for an example.
Table B-2. FINFO Specifications
Num
ber
Alias Data
Type
Item Description
0 EXIST Boolean Existence of file
1 FILENAME ONLY FNAME FULL
FILENAME FULLFNAME FULLY
QUALIFIED FILENAME
String File name
2 GROUP GROUPNAME String Group name
3 ACCOUNT ACCT
ACCOUNTNAME
String Account name
4 CREATOR String File creator name
5 FMTSECURITY FORMATTED
SECURITY MATRIX
String Security matrix for access
-5 SECURITY MATRIX
INTSECURITY
Integer Security matrix for access
6 CREATED CREATION DATE
FMTCREATED
String File creation date