Instrument Programming - Function Reference
The
following two columns are lists of functions that may be used in the qtext field of the internal question type.
The
same functions appear in both lists. Click on a function to link to its
explanation.
Functions
below in black are future (documentation) developments. Learn more about troubleshooting
functions.
Functions
listed Alphabetically APACK( )
Function - Deprecated > >=
< <= ==
!= Comparative Functions SELECTEDINSELECTION( )
Function |
Functions
by Type > < <= >= == (comparative
operator) Select All That Apply functions Variable Manipulation functions |
Returns the absolute value of the specified numeric expression. If the numeric expression is not negative, the argument is returned. If the numeric expression is negative, the negation of the numeric expression is returned.
Special case: If the argument is positive zero or negative zero, the result is positive zero.
Syntax
ABS( nExpression )
Returns
Numeric
Arguments
nExpression Specifies the numeric expression whose
absolute value ABS( ) returns.
Examples
{NUMBER1}
= 40
{NUMBER2}
= 2
ABS(-45) Returns
45
ABS(10-30) Returns
20
ABS(30-10) Returns
20
ABS(0) Returns
0
ABS(-0) Returns
0
ABS({NUMBER2}
– {NUMBER1}) Returns 38
ABS({NUMBER1}
– {NUMBER2}) Returns 38
Possible uses
Function |
Result |
Error report |
{NPOS} |
50 |
|
{NNEG} |
-50 |
|
[QNPOS] |
20 |
|
[QNEG] |
-20 |
|
ABS({NPOS}) |
50 |
|
ABS({NNEG}) |
50 |
|
ABS([QNPOS]) |
20 |
|
ABS([QNEG]) |
20 |
|
ABS(46) |
46 |
|
ABS(-26) |
26 |
|
ABS(
?
) ? = Date, Time, Text,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the ABS function. Found: ?, required: Numeric. |
ABS({NONEXSITANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), - (subtraction operator), * (multiplication operator), / (division operator), ^ (exponentiation operator), ACOS, ANGLE, ASIN, ATAN, CODE, COS, INT, LOG, MAX, MIN, MOD, RAND, ROUND, SIN, TAN, VAL, WEEKLYWAGE
Returns the addition of two values. Values can be numeric or text expressions (used to concatenate text).
Syntax
cExpression1 + cExpression2
nExpression1 + nExpression2
Returns
Numeric
Text
Arguments
nExpression Specifies a numeric expression.
cExpression Specifies a character expression.
Examples
12
+ 13 Returns
25
{NUMBER1} =
40
{NUMBER2} =
2
{NUMBER2}
+ {NUMBER1} Returns 42
{NAME} =
Julia
“Good
morning “ + {NAME} Returns
“Good morning Julia”
Possible uses
Function |
Result |
Error report |
{TIMEOFDAY} |
“Good morning “ |
|
{NAME} |
“Linda” |
|
[Q24] |
“Good morning “ |
|
[Q50] |
“Louis” |
|
{SALARY} |
300 |
|
{TIPS} |
8.33 |
|
[Q243] |
8.33 |
|
[Q100] |
300 |
|
{TIMEOFDAY}
+ {NAME} |
“Good
morning Linda” |
|
[Q24]
+ {NAME} |
“Good
morning Linda” |
|
“Good
morning “ + {NAME} |
“Good
morning Linda” |
|
{TIMEOFDAY}
+ [Q50] |
“Good
morning Louis” |
|
[Q24]
+ [Q50] |
“Good
morning Louis” |
|
“Good
morning “ + [Q50] |
“Good
morning Louis” |
|
{SALARY}
+ {TIPS} |
308.33 |
|
{SALARY}
+ [Q243] |
308.33 |
|
{SALARY}
+ 100 |
400 |
|
[Q100]
+ {TIPS} |
308.33 |
|
[Q100]
+ [Q243] |
308.33 |
|
[Q100]
+ 100 |
400 |
|
300
+ {TIPS} |
308.33 |
|
208.33
+ [Q243] |
216.66 |
|
208.33
+ 100 |
308.33 |
|
100
+ {NONEXISTANT} |
-999999999 |
Missing
variable : {NONEXISTANT} |
{NONEXISTANT}
+ “ doctor” |
-999999999 |
Missing
variable : {NONEXISTANT} |
“Hi
“ + 125 |
-999999999 |
Incompatible
operands in the addition (+) function. |
See Also
- (subtraction operator), * (multiplication operator), / (division operator), ^ (exponentiation operator), ABS, ACOS, ANGLE, ASIN, ATAN, CODE, COS, INT, LOG, MAX, MIN, MOD, RAND, ROUND, SIN, TAN, VAL, WEEKLYWAGE
ALLTRIM, AT, DATE2TEXT, DECODE, IN, LEN, LOWER, LTRIM, PADL, RAT, STR, STRCMP, SUBSTR, TEXT2DATE, TIME2TEXT, TITLECASE, UPPER, VAL
Creates a new case. Adds a row in the USER table with a new caseID if there isn’t already an infosheet row that exists for that caseID. The user table can be in the current instrument or it can be in another instrument. If the user table is in another instrument, make sure the other instrument has been launched from Survey to ensure necessary database tables have been setup.
Syntax
ADDCASE( nExpression, cExpression1, cExpression2 )
Returns
Numeric (integer: 1 success case was
added correctly, 0 fail to add the case)
Arguments
nExpression Specifies the number of the instrument
where to add the case.
cExpression1 Specifies the mode of the instrument
where to add the case.
cExpression2 Specifies the NEW caseID to add.
Examples
ADDCASE(266,”TEST”,“1236”) Returns 1
Possible uses
Function |
Result |
Error report |
{INST_MODE} |
“TEST” |
|
{NEW_CASEID} |
“123456” |
|
[GET_CASEID] |
“123456” |
|
{^A_CASEID(1)^} |
“123456” |
|
{*HHI.ID(1)*} |
“123456” |
|
[GET_INST_MODE] |
“TEST” |
|
{^A_INST_MODE(1)^} |
“TEST” |
|
{INST_ID} |
266 |
|
{*HHI.INST_MODE(1)*} |
“TEST” |
|
ADDCASE(266,
{INST_MODE}, {NEW_CASEID}) |
1 |
|
ADDCASE(266,
{INST_MODE}, [GET_CASEID]) |
1 |
|
ADDCASE(266,
{INST_MODE}, {^A_CASEID(1)^}) |
1 |
|
ADDCASE(266,
{INST_MODE}, {*HHI.ID(1)*}) |
1 |
|
ADDCASE(266,
{INST_MODE}, “123456”) |
1 |
|
ADDCASE(266,
[GET_INST_MODE], { NEW_CASEID}) |
1 |
|
ADDCASE(266,
[GET_INST_MODE], [GET_CASEID]) |
1 |
|
ADDCASE(266,
[GET_INST_MODE], {^A_CASEID(1)^}) |
1 |
|
ADDCASE(266,
[GET_INST_MODE], {*HHI.ID(1)*}) |
1 |
|
ADDCASE(266,
[GET_INST_MODE], “123456”) |
1 |
|
ADDCASE(266
, {^A_INST_MODE(1)^}, {NEW_CASEID}) |
1 |
|
ADDCASE(266,
{^A_INST_MODE(1)^}, [GET_CASEID]) |
1 |
|
ADDCASE(266,
{^A_INST_MODE(1)^}, {^A_CASEID(1)^}) |
1 |
|
ADDCASE(266,
{^A_INST_MODE(1)^}, {*HHI.ID(1)*}) |
1 |
|
ADDCASE(266,
{^A_INST_MODE(1)^}, “123456”) |
1 |
|
ADDCASE(266
, “TEST”, {NEW_CASEID}) |
1 |
|
ADDCASE(266,
“TEST”, [GET_CASEID]) |
1 |
|
ADDCASE(266,
“TEST”, {^A_CASEID(1)^}) |
1 |
|
ADDCASE(266,
“TEST”, {*HHI.ID(1)*}) |
1 |
|
ADDCASE(266,
“TEST”, “123456”) |
1 |
|
ADDCASE({INST_ID}
, {*HHI.INST_MODE(1)*}, {NEW_CASEID}) |
1 |
|
ADDCASE({INST_ID},
{*HHI.INST_MODE(1)*}, [GET_CASEID]) |
1 |
|
ADDCASE({INST_ID},
{*HHI.INST_MODE(1)*}, {^A_CASEID(1)^}) |
1 |
|
ADDCASE({INST_ID},
{*HHI.INST_MODE(1)*}, {*HHI.ID(1)*}) |
1 |
|
ADDCASE({INST_ID},
{*HHI.INST_MODE(1)*}, “123456”) |
1 |
|
ADDCASE(
Numeric, Text, ?2) ?2 = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression2 of the ADDCASE function. Found: ?2, required: Text. |
ADDCASE(
Numeric, ?1,
Text) ?1 = Numeric, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression1 of the ADDCASE function. Found: ?1, required: Text. |
ADDCASE(
?,
Text, Text) ? = Date, Time, Text,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the ADDCASE function. Found: ?, required: Numeric. |
ADDCASE({INST_ID},
{INST_MODE}, {NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
ADDCASE({INST_ID},
{NONEXISTANT}, {NEW_CASEID}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
ADDCASE({NONEXISTANT},
{INST_MODE}, {NEW_CASEID}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
ADDCASE, INFOSHEET, INSERTFIELDS, SELECTFIELD, UPDATECASE, UPDATEFIELDS, UPDATELOGIN
Adds n days to a date if nExpression is a positive number. Subtract n days to a date if nExpression is a negative number.
Syntax
ADDDAYS( dExpression, nExpression )
Returns
Date
Arguments
dExpression Date to which the number of day(s) will
be added or subtracted. The date must be a complete and valid date in the
format: yyyymmdd.
nExpression Integer number of days to add or
subtract. May be a variable or an integer.
Examples
{LDATE}
= 20010828
{ADD}
= 2
{MINUS}
= -3
ADDDAYS({LDATE},{ADD}) Returns 20010830
ADDDAYS({LDATE},10) Returns
20010907
ADDDAYS({LDATE},{MINUS}) Returns 20010825
Possible uses
Function |
Result |
Error report |
{LINTDATE} |
20040825 |
|
[QDAYS_3]) |
3 |
|
{THREE} |
3 |
|
[DAYS_S] |
-3 |
|
{MINUS_3} |
-3 |
|
[LDATE] |
20040825 |
|
ADDDAYS({LINTDATE},
3) |
20040828 |
|
ADDDAYS({LINTDATE},
[QDAYS_3]) |
20040828 |
|
ADDDAYS({LINTDATE},
{THREE}) |
20040828 |
|
ADDDAYS([LDATE],
-3) |
20040822 |
|
ADDDAYS([LDATE],
[DAYS_S]) |
20040822 |
|
ADDDAYS([LDATE],
{MINUS_3}) |
20040822 |
|
ADDDAYS(
Date, ?) ? = Text, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the ADDDAYS function. Found: ?, required: Numeric. |
ADDDAYS(
?,
Numeric) ? = Numeric, Text, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter dExpression of the ADDDAYS function. Found: ?, required: Date. |
ADDDAYS({LINTDATE},
{NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
ADDDAYS({NONEXISTANT},
{THREE}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
ADDYEARS, AGE, CDOW, CREATE CALENDAR, DATE, DATE2DAY, DATE2TEXT, DATE2WK, DATEFORMAT, DIFFAGE, DOW, FINDGAPS IN CALENDAR, FIXDAY, FIXMONTH, FIXYEAR, GETSUBDATE, GOMONTH, ISCOMPLETE, MARK CALENDAR, TEXT2DATE
Adds n years to a date if nExpression is a positive number. Subtract n years to a date if nExpression is a negative number.
Syntax
ADDYEARS( dExpression, nExpression )
Returns
Date
Arguments
dExpression Date
to which the number of year(s) will be added. The date must be a complete and
valid date in the format: yyyymmdd.
nExpression Integer number of years to add or
subtract. May be a variable or an integer.
Examples
{LDATE}
= 20010828
{ADDY}
= 2
ADDYEARS({LDATE},{ADDY}) Returns 20030828
ADDYEARS({LDATE},
-3) Returns 19880828
Possible uses
Function |
Result |
Error report |
{LINTDATE} |
20130828 |
|
[QYEARS3] |
3 |
|
{THREE} |
3 |
|
[NOWDATE] |
20130120 |
|
[QYEARS_S] |
-3 |
|
{MINUS_3} |
-3 |
|
ADDYEARS({LINTDATE},
3) |
20160828 |
|
ADDYEARS({LINTDATE},
[QYEARS3]) |
20160828 |
|
ADDYEARS({LINTDATE},
{THREE}) |
20160828 |
|
ADDYEARS([NOWDATE],
-3) |
20100120 |
|
ADDYEARS([NOWDATE],
[QYEARS_S]) |
20100120 |
|
ADDYEARS([NOWDATE],
{MINUS_3}) |
20100120 |
|
ADDYEARS(
Date, ?) ? = Text, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the ADDYEARS function. Found: ?, required: Numeric. |
ADDYEARS(
?,
Numeric) ? = Numeric, Text, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter dExpression of the ADDYEARS function. Found: ?, required: Date. |
ADDYEARS({DOB},
{NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
ADDYEARS({NONEXISTANT},
{NODAYS}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
ADDDAYS, AGE, CDOW, CREATE CALENDAR, DATE, DATE2DAY, DATE2TEXT, DATE2WK, DATEFORMAT, DIFFAGE, DOW, FINDGAPS IN CALENDAR, FIXDAY, FIXMONTH, FIXYEAR, GETSUBDATE, GOMONTH, ISCOMPLETE, MARK CALENDAR, TEXT2DATE
ACOS( ) returns the arc cosine of an angle specified in the numeric expression . The arccosine is the angle whose cosine is number. The returned angle is given in radians in the range 0 (zero) to pi (3.141592).
Syntax
ACOS( nExpression )
Returns
Numeric
Arguments
nExpression Specifies a numeric expression whose
arc cosine ACOS( ) returns. The value of nExpression can range from –1
through +1.
Examples
ACOS(0.5) Returns 1.05
ACOS
(1) Returns
0
Possible uses
Function |
Result |
Error report |
{ANGLE} |
-0.5 |
|
[QANGLE] |
-0.5 |
|
ACOS({ANGLE}) |
2.094395102 |
|
ACOS([QANGLE]) |
2.094395102 |
|
ACOS(-0.5) |
2.094395102 |
|
ACOS(
?
) ? = Date, Time, Text,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the ACOS function. Found: ?, required: Numeric. |
ACOS({NONEXSITANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), - (subtraction operator), * (multiplication operator), / (division operator), ^ (exponentiation operator), ABS, ANGLE, ASIN, ATAN, CODE, COS, INT, LOG, MAX, MIN, MOD, RAND, ROUND, SIN, TAN, VAL, WEEKLYWAGE
Calculates the difference between two sets of dates in terms of days or months or years.
Syntax
AGE( dExpression1, dExpression2, "DAY"|"MO"|"YR" )
Returns
Numeric
Arguments
dExpression1 Beginning
date for the age calculation. The date must be a complete and valid date in the
format: yyyymmdd.
dExpression2 Terminating date for the age calculation.
The date must be a complete and valid date in the format: yyyymmdd.
"DAY"|"MO"|"YR" Specifies what resultant
calculation will represent: days, months or years.
Examples
{NOW}
= 20020909
{BDATE}
= 19970122
AGE({NOW},
{BDATE}, "YR") Returns 5
AGE({NOW},
{BDATE}, "MO") Returns 67
Possible uses
Function |
Result |
Error report |
{TODAY} |
20010730 |
|
{DOB} |
19970122 |
|
[Q1] |
19970122 |
|
AGE
({TODAY}, {DOB}, "DAY") |
1650 |
|
AGE({TODAY},
{DOB}, "MO") |
54 |
|
AGE({TODAY},
{DOB}, "YR") |
4 |
|
AGE({TODAY},
[Q1], "DAY") |
1650 |
|
AGE({TODAY},
[Q1], "MO") |
54 |
|
AGE({TODAY},
[Q1], "YR") |
4 |
|
AGE({TODAY},
"19970122", "DAY") |
1650 |
|
AGE({TODAY},
"19970122", "MO") |
54 |
|
AGE({TODAY},
"19970122", "YR") |
4 |
|
AGE([Q1],
{DOB}, "DAY") |
0 |
|
AGE([Q1],
{DOB}, "MO") |
0 |
|
AGE([Q1],
{DOB}, "YR") |
0 |
|
AGE([Q1],
[Q1], "DAY") |
0 |
|
AGE([Q1],
[Q1], "MO") |
0 |
|
AGE([Q1],
[Q1], "YR") |
0 |
|
AGE([Q1],
"19970122", "DAY") |
0 |
|
AGE([Q1],
"19970122", "MO") |
0 |
|
AGE([Q1],
"19970122", "YR") |
0 |
|
AGE("20010730",
{DOB}, "DAY") |
1650 |
|
AGE("20010730",
{DOB}, "MO") |
54 |
|
AGE("20010730",
{DOB}, "YR") |
4 |
|
AGE("20010730",
[Q1], "DAY") |
1650 |
|
AGE("20010730",
[Q1], "MO") |
54 |
|
AGE("20010730",
[Q1], "YR") |
4 |
|
AGE("20010730",
"19970122", "DAY") |
1650 |
|
AGE("20010730",
"19970122", "MO") |
54 |
|
AGE("20010730",
"19970122", "YR") |
4 |
|
AGE("20010730",
"19970122", "XX") |
-999999999 |
Invalid
format (XX) in the parameter "DAY"|"MO"|"YR" of
the AGE function. |
AGE(
Date, Date, ?
) ? = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression of the AGE function. Found: ?, required: Text. |
AGE(
Date, ?2,
Text ) ?2 = Numeric, Text, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter dExpression2 of the AGE function. Found: ?2, required: Date. |
AGE(
?1,
Date, Text ) ? 1 = Numeric, Time,
Text, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter dExpression1 of the AGE function. Found: ?1, required: Date. |
AGE({TODAY},
{DOB}, {NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
AGE({TODAY},
{NONEXISTANT}, “YR”) |
-999999999 |
Missing
variable : {NONEXISTANT} |
AGE({NONEXISTANT},
{DOB}, “YR”) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
ADDDAYS, ADDYEARS, CDOW, CREATE CALENDAR, DATE, DATE2DAY, DATE2TEXT, DATE2WK, DATEFORMAT, DIFFAGE, DOW, FINDGAPS IN CALENDAR, FIXDAY, FIXMONTH, FIXYEAR, GETSUBDATE, GOMONTH, ISCOMPLETE, MARK CALENDAR, TEXT2DATE
ALEN( ) counts the number of elements in an array.
Syntax
ALEN( {^ArrayName^} )
Returns
Numeric
Arguments
{^ArrayName^} Name of the array of the elements to be
counted.
Examples
ALEN
({^ANAMES^}) Returns 2
Possible uses
Function |
Result |
Error report |
{^ANAMES(1)^} |
“Maria” |
|
{^ANAMES(2)^} |
“Josh” |
|
{^ANAMES(3)^} |
“Ann” |
|
ALEN
({^ANAMES^}) |
2 |
|
ALEN(
?
) ? = Numeric, Date,
Time, Text, Roster, Matrix |
-999999999 |
Incompatible
types in the parameter array of the ALEN function. Found: ?, required: Array. |
ALEN({NONEXSITANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
Removes leading and trailing blanks (white spaces) from the specified character expression and returns the trimmed expression as a character string.
ALLTRIM( ) can be used to ensure that blanks are removed from data entered by the user.
Syntax
ALLTRIM( cExpression )
Returns
Text
Arguments
cExpression Specifies the character expression from
which leading and trailing blanks are removed.
Examples
ALLTRIM(“
Trim strings “) Returns “Trim strings”
ALLTRIM
({FULLNAME}) Returns “Luisa
Lane”
Possible uses
Function |
Result |
Error report |
{FULLNAME} |
“Luisa Lane “ |
|
[QFNAME] |
“ Pete Rivers” |
|
ALLTRIM({FULLNAME}) |
“Luisa
Lane“ |
|
ALLTRIM([QFNAME]) |
“Pete
Rivers“ |
|
ALLTRIM("
Hi, how are you? ") |
“Hi,
how are you?“ |
|
ALLTRIM(
?
) ? = Numeric, Date,
Time, Array, Roster, Matrix |
-999999999 |
Incompatible
types in the parameter array of the ALLTRIM function. Found: ?, required: Text. |
ALLTRIM({NONEXSITANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), AT, DATE2TEXT, DECODE, IN, LEN, LOWER, LTRIM, PADL, RAT, STR, STRCMP, SUBSTR, TEXT2DATE, TIME2TEXT, TITLECASE, UPPER, VAL
ANGLE( ) returns the angle between the line y = 0 and the line connecting the specified coordinates and the origin (0, 0) of the coordinate system.
Syntax
ANGLE( nYCoordinate, nXCoordinate )
Returns
Numeric
Arguments
nYCoordinate Specifies the y coordinate.
nXCoordinate Specifies the x coordinate.
Examples
ANGLE(10,
10) Returns 45
ANGLE(0,
-10) Returns 180
Possible uses
Function |
Result |
Error report |
{X1} |
10 |
|
{Y1} |
10 |
|
[QYCORD] |
10 |
|
ANGLE({X1},
{Y1}) |
0.785398163 |
|
ANGLE({X1},
[QYCORD]) |
0.785398163 |
|
ANGLE({X1},
10) |
0.785398163 |
|
ANGLE([QYCORD],
{Y1}) |
0.785398163 |
|
ANGLE([QYCORD],
[QYCORD]) |
0.785398163 |
|
ANGLE([QYCORD],
10) |
0.785398163 |
|
ANGLE(10,
{Y1}) |
0.785398163 |
|
ANGLE(10,
[QYCORD]) |
0.785398163 |
|
ANGLE(10,
10) |
0.785398163 |
|
ANGLE(
Numeric, ?2) ?2 = Text, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression2 of the ANGLE function. Found: ?2, required: Numeric. |
ANGLE
( ?1,
Numeric) ?1 = Date, Text, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression1 of the ANGLE function. Found: ?1, required: Numeric. |
ANGLE({X1},
{NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
ANGLE({NONEXISTANT},
{Y1}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), - (subtraction operator), * (multiplication operator), / (division operator), ^ (exponentiation operator), ABS, ACOS, ASIN, ATAN, CODE, COS, INT, LOG, MAX, MIN, MOD, RAND, ROUND, SIN, TAN, VAL, WEEKLYWAGE
Packs an array. APACK(
) removes empty elements in an array.
Syntax
APACK( {^ArrayName^} )
Returns
Array
Arguments
{^ArrayName^} Name of the array of the elements to be
packed.
Examples
{^ANAMES(1)^} = “Thomas”
{^ANAMES(2)^}
= “Susan”
{^ANAMES(3)^}
=
{^ANAMES(4)^}
= “Louis”
APACK({^ANAMES^}) {^ANAMES^}
{^ANAMES(1)^}
= “Thomas”
{^ANAMES(2)^}
= “Susan”
{^ANAMES(3)^}
= “Louis”
Possible uses
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
See Also
This command will append all the records from a source roster that match a logical expression (ExprL) to the target roster. If a list of fields is included, the function will append only those fields. If * is specified all fields will be appended.
Syntax
APPEND *|Field1, ...Fieldn FROM {*SourceRosterName*} INTO {*TargetRosterName*} [WHERE <ExprL>]
Returns
Numeric (integer: 1 success information
got appended correctly, 0 fail to append the information)
Arguments
Field1, ...Fieldn List
of fields that restrict what items in the roster will be appended.
* All
fields will be appended.
{*SourceRosterName*} Roster name from which the
records will be appended.
{*TargetRosterName*} Roster name to which the records
will be appended.
ExprL Logical
expression that if matched controls what records will be appended to the target
roster.
Examples
APPEND * FROM {*OLDHHI*} INTO
{*HHI*}
See Also
CLEAN ROSTER, CLONE ROSTER, COMPRESS ROSTER, COUNTROSTER, DELETE FROM, RECCOUNT, SORT, UPDATE, XFER
Writes (append) the contents of a character string to a file. APPENDTOFILE returns the number of bytes (characters) written to the file.
Syntax
APPENDTOFILE( cExpression1, cExpression2 )
Returns
Numeric
Arguments
cExpression1 Specifies the name of the file to which
the character string is written. Include a path with the file name if the file
is in a directory other than the current default directory. If the specified
file does not exist, it will be created automatically.
cExpression2 Specifies the character string that is
written to the file. cExpression2 can be a literal character string, an
expression that evaluates to a character string, or a character type symbol,
array element, or question.
Examples
APPENDTOFILE([QFNAME],
"End") Returns 3
Possible uses
Function |
Result |
Error
report |
{FNAME1} |
“C:\Temp\Test.txt” |
|
{FULLNAME} |
“Josh Smith” |
|
[INFO] |
“Data begins” |
|
[QFILENAME1] |
“C:\Temp\Trial.txt” |
|
APPENDTOFILE({FNAME1},
{FULLNAME}) |
10 |
|
APPENDTOFILE({FNAME1},
[INFO]) |
11 |
|
APPENDTOFILE({FNAME1},
"INFORMATION SHEET") |
17 |
|
APPENDTOFILE([QFILENAME1],
{FULLNAME}) |
10 |
|
APPENDTOFILE([QFILENAME1],
[INFO]) |
11 |
|
APPENDTOFILE([QFILENAME1],
"INFORMATION SHEET") |
17 |
|
APPENDTOFILE(
Text, ?2) ?2 = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression2 of the APPENDTOFILE function. Found: ?2, required: Text. |
APPENDTOFILE(
?1,
Text) ?1 = Numeric, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression1 of the APPENDTOFILE function. Found: ?1, required: Text. |
APPENDTOFILE({NAME},
{NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
APPENDTOFILE({NONEXISTANT},
{NAME}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
COPYFILE, DELETEFILE, FILE, READFILE
ASIN( ) returns in radians the arc sine of a numeric expression. The arcsine is the angle whose sine is number. The returned angle is given in radians in the range -pi/2 to pi/2 where pi = 3.141592.
Syntax
ASIN( nExpression )
Returns
Numeric
Arguments
nExpression Specifies the numeric expression whose arc sine ASIN( ) returns. The value of nExpression can range from +1 through –1, and the value ASIN( ) returns can range from -pi/2 through +pi/2 ( –1.57079 to 1.57079).
Examples
ASIN(0.5) Returns 0.52
ASIN
(1) Returns
1.57
Possible uses
Function |
Result |
Error report |
{ANGLE} |
-5 |
|
[QANGLE] |
-5 |
|
ASIN
({ANGLE}) |
-0.523598776 |
|
ASIN
([QANGLE]) |
-0.523598776 |
|
ASIN
(-0.5) |
-0.523598776 |
|
ASIN(
?
) ? = Date, Time, Text,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the ASIN function. Found: ?, required: Numeric. |
ASIN({NONEXSITANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), - (subtraction operator), * (multiplication operator), / (division operator), ^ (exponentiation operator), ABS, ACOS, ANGLE, ATAN, CODE, COS, INT, LOG, MAX, MIN, MOD, RAND, ROUND, SIN, TAN, VAL, WEEKLYWAGE
Returns the beginning numeric position of the first occurrence of a character expression within another character expression, counting from the left most character. Left most character position is 0. If the character expression isn't found, AT( ) returns -1. The search performed by AT( ) is case-sensitive.
Syntax
AT( cExpression1, cExpression2, nExpression )
Returns
Numeric
Arguments
cExpression1 Specifies the
character expression that AT( ) searches in.
cExpression2 Specifies the character expression that
AT( ) searches for.
nExpression Integer value that specifies which
occurrence (first, second, third, and so on) of cExpression2 is searched for in
cExpression1.
Examples
{FULLNAME}
= “Lucia Herrera”
{LNAME} = “Herrera”
AT({FULLNAME},
{LNAME}, 1) Returns 7
AT(“L.
Herrera”, “Herrera”, 1) Returns 4
Possible uses
Function |
Result |
Error report |
{FULLNAME} |
“Maria Smith” |
|
{LNAME} |
“Smith” |
|
{X} |
1 |
|
[QLNAME] |
“Smith” |
|
[Q20] |
1 |
|
[QFULLNAME] |
“Maria Smith” |
|
AT({FULLNAME},
{LNAME}, {X}) |
7 |
|
AT({FULLNAME},
{LNAME},[Q20]) |
7 |
|
AT({FULLNAME},
{LNAME}, 1) |
7 |
|
AT({FULLNAME},
[QLNAME], {X}) |
7 |
|
AT({FULLNAME},
[QLNAME], [Q20]) |
7 |
|
AT({FULLNAME},
[QLNAME], 1) |
7 |
|
AT({FULLNAME},
"Smith", {X}) |
7 |
|
AT({FULLNAME},
"Smith", [Q20]) |
7 |
|
AT({FULLNAME},
"Smith", 1) |
7 |
|
AT([QFULLNAME],
{LNAME}, {X}) |
21 |
|
AT([QFULLNAME],
{LNAME},[Q20]) |
21 |
|
AT([QFULLNAME],
{LNAME}, 1) |
21 |
|
AT([QFULLNAME],
[QLNAME], {X}) |
21 |
|
AT([QFULLNAME],
[QLNAME], [Q20]) |
21 |
|
AT([QFULLNAME],
[QLNAME], 1) |
21 |
|
AT([QFULLNAME],
"Smith", {X}) |
21 |
|
AT([QFULLNAME],
"Smith", [Q20]) |
21 |
|
AT([QFULLNAME],
"Smith", 1) |
21 |
|
AT("Ann
Marie Smith", {LNAME}, {X}) |
11 |
|
AT("Ann
Marie Smith", {LNAME},[Q20]) |
11 |
|
AT("Ann
Marie Smith", {LNAME}, 1) |
11 |
|
AT("Ann
Marie Smith", [QLNAME], {X}) |
11 |
|
AT("Ann
Marie Smith", [QLNAME], [Q20]) |
11 |
|
AT("Ann
Marie Smith", [QLNAME], 1) |
11 |
|
AT("Ann
Marie Smith", "Smith", {X}) |
11 |
|
AT("Ann
Marie Smith", "Smith", [Q20]) |
11 |
|
AT("Ann
Marie Smith", "Smith", 1) |
11 |
|
AT(
Text, Text, ?) ? = Text, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the AT function. Found: ?, required: Numeric. |
AT(
Text, ?2,
Numeric) ?2 = Numeric, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression2 of the AT function. Found: ?2, required: Text. |
AT(
?1,
Text, Numeric ) ?1 = Numeric, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression1 of the AT function. Found: ?, required: Text. |
AT({NAME},
{NAME}, {NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
AT({NAME},
{NONEXISTANT}, {NAME}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
AT({NONEXISTANT},
{NAME}, {NAME}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), ALLTRIM, DATE2TEXT, DECODE, IN, LEN, LOWER, LTRIM, PADL, RAT, STR, STRCMP, SUBSTR, TEXT2DATE, TIME2TEXT, TITLECASE, UPPER, VAL
ATAN( ) returns in radians the arc tangent of a numeric expression. The value returned by ATAN( ) can range from –pi/2 through +pi/2 (–1.57079 to 1.57079) where pi = 3.141592.
Syntax
ATAN( nExpression )
Returns
Numeric
Arguments
nExpression Specifies
a numeric expression whose arc tangent ATAN( ) returns. nExpression can be
any value, and the value ATAN( ) returns can range –pi/2 through +pi/2
(–1.57079 to 1.57079).
Examples
ATAN(0.5) Returns 0.46
ATAN(1) Returns 0.79
Possible uses
Function |
Result |
Error report |
{X} |
1 |
|
[Q20] |
1 |
|
ATAN({X}) |
0.785398163397448 |
|
ATAN([Q20]) |
0.785398163397448 |
|
ATAN(1) |
0.785398163397448 |
|
ATAN(
?
) ? = Date, Time, Text,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the ATAN function. Found: ?, required: Numeric. |
ATAN({NONEXSITANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), - (subtraction operator), * (multiplication operator), / (division operator), ^ (exponentiation operator), ABS, ACOS, ANGLE, ASIN, CODE, COS, INT, LOG, MAX, MIN, MOD, RAND, ROUND, SIN, TAN, VAL, WEEKLYWAGE
This command blanks out one symbol or multiple symbols. The contents of the specified variable(s) is purged.
Syntax
BLANK Var1, Var2, Var3, ..., Varn
Returns
Numeric (integer: 1 success variables
were blanked correctly, 0 fail to blank at least one of the variables)
Arguments
Varx Variable
to be blanked. A variable can be a {Symbol},
{^ArrayElement(({Symbol}|[QName]|Number)^} or {^ArrayName^}
Examples
BLANK
{NAME}, {^ANAMES({INDEX})^}, {^AAGES^}
See Also
ALEN, APACK, COUNT, INLIST, ISVAREMPTY, SWITCH, SYMBOL, VAREXIST, VARTYPE
This function blocks or unblocks backing up to specified questions or sections.
Syntax
BLOCKBACKUP( cExpression1, cExpression2, cExpression3 [, ... cExpressionN] )
Returns
Numeric (integer: 1 success questions or sections got blocked correctly, 0 fail to block questions or sections)
Arguments
cExpression1 "ON"|"OFF". "ON" backing up is blocked. "OFF" backing up is unblocked.
cExpression2 "SECTION"|"QUESTION".
Blocking type. "SECTION" will block/unblock backing up to all the questions that are part of the specified section(s). "QUESTION" will block/unblock backing up to those specific question(s) listed.
cExpression3 Specifies either a list of questions or a sections depending on the type of blocking "SECTION"|"QUESTION". Must have already passed the question upon turning block backup on for question(s) to be blocked.
Examples
BLOCKBACKUP(“OFF”, “SECTION”, “YTEST”)
BLOCKBACKUP(“ON”, “QUESTION”, “H1”, “H2”)
Possible uses
Function |
Result |
Error report |
{MODE} |
“ON” |
|
{TYPE} |
“SECTION” |
|
[SNAME] |
“HH Info” |
|
{^ANAMES(1)^} |
“Greta” |
|
{*HHI.NAME(1)*}) |
“Jeff Smith” |
|
[QFNAME] |
“MISC1” |
|
{^ATNAMES(1)^} |
“MISC1” |
|
{*HHI.TNAMES(1)*} |
“MISC1” |
|
{TABLE} |
“USER” |
|
BLOCKBACKUP(“USER”,
{FNAME}, {NAME}) |
1 |
|
BLOCKBACKUP(
“USER”, {FNAME}, [Q5]) |
1 |
|
BLOCKBACKUP(
“USER”, {FNAME}, {^ANAMES(1)^}) |
1 |
|
BLOCKBACKUP(
“USER”, {FNAME}, {*HHI.NAME(1)*}) |
1 |
|
BLOCKBACKUP(
“USER”, {FNAME}, “Josh Smith”) |
1 |
|
BLOCKBACKUP(
“USER”, [QFNAME], {NAME}) |
1 |
|
BLOCKBACKUP(
“USER”, [QFNAME], [Q5]) |
1 |
|
BLOCKBACKUP(
“USER”, [QFNAME], {^ANAMES(1)^}) |
1 |
|
BLOCKBACKUP(
“USER”, [QFNAME], {*HHI.NAME(1)*}) |
1 |
|
BLOCKBACKUP(
“USER”, [QFNAME], “Josh Smith”) |
1 |
|
BLOCKBACKUP(
“USER” , {^ATNAMES(1)^}, {NAME}) |
1 |
|
BLOCKBACKUP(
“USER”, {^ATNAMES(1)^}, [Q5]) |
1 |
|
BLOCKBACKUP(
“USER”, {^ATNAMES(1)^}, {^ANAMES(1)^}) |
1 |
|
BLOCKBACKUP(
“USER”, {^ATNAMES(1)^}, {*HHI.NAME(1)*}) |
1 |
|
BLOCKBACKUP(
“USER”, {^ATNAMES(1)^}, “Josh Smith”) |
1 |
|
UPDATELOGIN(“USER”
, “MISC1”, {NAME}) |
1 |
|
BLOCKBACKUP(
“USER”, “MISC1”, [Q5]) |
1 |
|
BLOCKBACKUP(
“USER”, “MISC1”, {^ANAMES(1)^}) |
1 |
|
BLOCKBACKUP(
“USER”, “MISC1”, {*HHI.NAME(1)*}) |
1 |
|
BLOCKBACKUP(
“USER”, “MISC1”, “Josh Smith”) |
1 |
|
BLOCKBACKUP(
“USER”, {*HHI.TNAMES(1)*}, {NAME}) |
1 |
|
BLOCKBACKUP(
“USER”, {*HHI.TNAMES(1)*}, [Q5]) |
1 |
|
BLOCKBACKUP(
“USER”, {*HHI.TNAMES(1)*}, {^ANAMES(1)^}) |
1 |
|
BLOCKBACKUP(
“USER”, {*HHI.TNAMES(1)*}, {*HHI.NAME(1)*}) |
1 |
|
BLOCKBACKUP(
“USER”, {*HHI.TNAMES(1)*}, “Josh Smith”) |
1 |
|
BLOCKBACKUP({TABLE},
{*HHI.TNAMES(1)*}, {NAME}) |
1 |
|
BLOCKBACKUP({TABLE},
{*HHI.TNAMES(1)*}, [Q5]) |
1 |
|
BLOCKBACKUP({TABLE},
{*HHI.TNAMES(1)*}, {^ANAMES(1)^}) |
1 |
|
BLOCKBACKUP({TABLE},
{*HHI.TNAMES(1)*}, {*HHI.NAME(1)*}) |
1 |
|
BLOCKBACKUP({TABLE},
{*HHI.TNAMES(1)*}, “Josh Smith”) |
1 |
|
BLOCKBACKUP( Numeric, Text, ?3) ?3 = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression3 of the UPDATELOGIN function. Found: ?3, required: Text. |
BLOCKBACKUP( Numeric, ?2,
Text) ?2 = Numeric, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression2 of the UPDATELOGIN function. Found: ?2, required: Text. |
BLOCKBACKUP( ?1, Text, Text) ?1 = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression1 of the UPDATELOGIN function. Found: ?1, required: Text. |
BLOCKBACKUP({INST_ID}, {INST_MODE},
{NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
BLOCKBACKUP({INST_ID}, {NONEXISTANT},
{NEW_CASEID}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
BLOCKBACKUP({NONEXISTANT}, {INST_MODE},
{NEW_CASEID}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
Gets the day-of-the-week value from a specific date.
Syntax
CDOW( dExpression )
Returns
Text
Arguments
dExpression Specifies the date from which CDOW()
returns the day of the week.
Examples
CDOW({DOM}) Returns Wednesday
Possible uses
Function |
Result |
Error
report |
{DOB} |
20130313 |
|
[Q2] |
20130101 |
|
CDOW({DOB}) |
“Wednesday” |
|
CDOW ([Q2]) |
“Tuesday” |
|
CDOW(
?
) ? = Numeric, Time,
Text, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter dExpression of the CDOW function. Found: ?, required: Date. |
CDOW({NONEXSITANT}) |
-999999999 |
Missing variable : {NONEXISTANT} |
See Also
ADDDAYS, ADDYEARS, AGE, CREATE CALENDAR, DATE, DATE2DAY, DATE2TEXT, DATE2WK, DATEFORMAT, DIFFAGE, DOW, FINDGAPS IN CALENDAR, FIXDAY, FIXMONTH, FIXYEAR, GETSUBDATE, GOMONTH, ISCOMPLETE, MARK CALENDAR, TEXT2DATE
Cleans a Roster. Deletes everything in the specified Roster and there is no way to recover that information.
Syntax
CLEAN ROSTER {*SourceRosterName*}
Returns
Numeric (integer: 1 success roster got
cleaned correctly, 0 fail to clean the roster)
Arguments
{*SourceRosterName*} Name of the Roster to be cleaned.
Examples
CLEAN
ROSTER {*HHI*}
See Also
APPEND, CLONE ROSTER, COMPRESS ROSTER, COUNTROSTER, DELETE FROM, RECCOUNT, SORT, UPDATE, XFER
This command creates an exact duplicate of a the SourceRosterName into TargetRosterName roster.
Syntax
CLONE ROSTER {*SourceRosterName*} TO {*TargetRosterName*}
Returns
Numeric (integer: 1 success roster got
cloned correctly, 0 fail to clone the roster)
Arguments
{*SourceRosterName*} Name of the Roster to be
duplicated.
{*TargetRosterName*} Roster name of the new duplicate
roster.
Examples
CLONE
ROSTER {*HHI*} TO {*TEMPHHI*}
See Also
APPEND, CLEAN ROSTER, COMPRESS ROSTER, COUNTROSTER, DELETE FROM, RECCOUNT, SORT, UPDATE, XFER
CODE( ) returns the numeric code for a specific character expression in a specific distribution code (DCode).
Syntax
CODE( cExpression, {%DcodeName%}, nExpression )
Returns
Numeric
Arguments
cExpression Specifies the character expression that
will be searched in the specified distribution code.
{%DcodeName%} Name of the distribution code.
nExpression Integer number that specifies the
language to use in the distribution code.
Examples
CODE(“Son”,
{%REL%}, 1) Returns 3
Possible uses
Function |
Result |
Error report |
{STATUSTXT} |
“Married” |
|
MARSTATUS |
|
|
Single |
1 |
|
Married |
2 |
|
Divorced |
3 |
|
Widow |
4 |
|
{LANGNO} |
1 |
|
[Q20] |
1 |
|
[MSTATUS] |
“Widow” |
|
CODE({STATUSTXT},
{%MARSTATUS%}, {LANGNO}) |
2 |
|
CODE({STATUSTXT},
{%MARSTATUS%}, [Q20]) |
2 |
|
CODE({STATUSTXT},
{%MARSTATUS%}, 1) |
2 |
|
CODE([MSTATUS],
{%MARSTATUS%}, {LANGNO}) |
4 |
|
CODE([MSTATUS],
{%MARSTATUS%}, [Q20]) |
4 |
|
CODE([MSTATUS],
{%MARSTATUS%}, 1) |
4 |
|
CODE("Single",
{%MARSTATUS%}, {LANGNO}) |
1 |
|
CODE("Single",
{%MARSTATUS%}, [Q20]) |
1 |
|
CODE("Single",
{%MARSTATUS%}, 1) |
1 |
|
CODE(
Text, DCodeName, ? ) ? = Text, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the CODE function.
Found: ?,
required: Numeric. |
CODE(
Numeric, ?,
Text) ? = Numeric, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter DCodeName of the CODE function.
Found: ?,
required: DCodeName. |
CODE(
?,
DCodeName, Numeric) ? = Date, Time, Numeric,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression of the CODE function.
Found: ?,
required: Text. |
CODE({NAME},
{NAME}, {NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
CODE({NAME},
{NONEXISTANT}, {NAME}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
CODE({NONEXISTANT},
{NAME}, {NAME}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), - (subtraction operator), * (multiplication operator), / (division operator), ^ (exponentiation operator), ABS, ACOS, ANGLE, ASIN, ATAN, COS, INT, LOG, MAX, MIN, MOD, RAND, ROUND, SIN, TAN, VAL, WEEKLYWAGE
Relational operators work with all numeric, text and date data types. The function returns a logical value, 1 is true, and 0 is false. The following table lists the comparative operators.
Operator |
Action |
Examples |
< |
Less than |
23 < 54 |
> |
Greater than |
1 > 2 |
== |
Equal to |
cVar1 == cVar2 |
!= |
Not equal to |
5 != 3 |
<= |
Less than or equal to |
16 <= 216 |
>= |
Greater than or equal to |
32 >= nHisAge |
Syntax
nExpression1 > | >= | < | <= | == | != nExpression2
cExpression1 > | >= | < | <= | == | != cExpression2
dExpression1 > | >= | < | <= | == | != dExpression2
Returns
Numeric
Arguments
Expression1 Specifies the first numeric, text or date expression that will be compared.
Expression2 Specifies the second numeric, text or date expression that will be compared.
Examples
{nHisAge} = 20
23 < 54 Returns 1
1 > 2 Returns 0
5 != 3 Returns 1
16 <= 216 Returns 1
32 >= {nHisAge} Returns 1
{cVar1} = “Mary”
{cVar2} = “Josh”
{cVar1} == {cVar} Returns 0
{cVar1} != {cVar} Returns 1
{d1} = 12/30/1992
{d2} = 03/19/2001
{d1} >= {d2} Returns 0
Possible uses
Function |
Result |
Error report |
{NPOS} |
5 |
|
{NNEG} |
-33 |
|
{cVAR1} |
“Maria” |
|
{cVAR2} |
“Mario” |
|
{DOB} |
19920202 |
|
{TODAY} |
20130404 |
|
{NPOS}
< {NNEG} |
0 |
|
{NPOS}
> {NNEG} |
1 |
|
{NPOS}
<= {NNEG} |
0 |
|
{NPOS}
>= {NNEG} |
1 |
|
{NPOS}
== {NNEG} |
0 |
|
{NPOS}
!= {NNEG} |
1 |
|
{cVar1}
< {cVar2} |
0 |
|
{cVar1}
> {cVar2} |
1 |
|
{cVar1}
<= {cVar2} |
0 |
|
{cVar1}
>= {cVar2} |
1 |
|
{cVar1}
== {cVar2} |
0 |
|
{cVar1}
!= {cVar2} |
1 |
|
{DOB}
< {TODAY} |
1 |
|
{DOB}
> {TODAY} |
0 |
|
{DOB}
<= {TODAY} |
1 |
|
{DOB}
>= {TODAY} |
0 |
|
{DOB}
== {TODAY} |
0 |
|
{DOB}
!= {TODAY} |
1 |
|
{NPOS}
< {NONEXISTANT} |
-999999999 |
Missing
variable : {NONEXISTANT} |
{NONEXISTANT}
!= {DOB} |
-999999999 |
Missing
variable : {NONEXISTANT} |
{cVar1}
< {NPOS} |
-999999999 |
Incompatible
types. Expression1 and Expression2
have to be of the same type. |
{cVar1}
< {DOB} |
-999999999 |
Incompatible
types. Expression1 and Expression2 have
to be of the same type. |
{NPOS}
== {cVar1} |
-999999999 |
Incompatible
types. Expression1 and Expression2 have
to be of the same type. |
{NPOS}
== {DOB} |
-999999999 |
Incompatible
types. Expression1 and Expression2 have
to be of the same type. |
{DOB}
!= {cVar1} |
-999999999 |
Incompatible
types. Expression1 and Expression2 have
to be of the same type. |
{DOB}
!= {NPOS} |
-999999999 |
Incompatible
types. Expression1 and Expression2 have
to be of the same type. |
{DOB}
< {TIMEBORN} |
-999999999 |
Incompatible
types in the parameter Expression2 of the < function. Found: Time ,
required: Numeric, Text or Date. |
{DOB}
> {*HHI*} |
-999999999 |
Incompatible
types in the parameter Expression2 of the < function. Found: Roster ,
required: Numeric, Text or Date. |
{DOB}
<= {^A_NAMES^} |
-999999999 |
Incompatible
types in the parameter Expression2 of the < function. Found: Array ,
required: Numeric, Text or Date. |
See Also
IIF, || (or operator), && (and operator), ! NOT
Deletes lines from the roster {*RosterName*} if the field FieldName is empty.
This command will compress lines out of a specified roster, if a specified field in that roster is blank. If the field specified is blank for a line that line will be deleted and the other lines moved up. CAUTION: Once a roster is compressed, there is no way to recover the compressed lines.
Syntax
COMPRESS ROSTER {*RosterName*} ON FieldName
Returns
Numeric (integer: 1 success roster got
compressed correctly, 0 fail to compress the roster)
Arguments
{*SourceRosterName*} Name of the Roster to be searched for compression.
FieldName Field name in the roster to be tested for blank.
Examples
COMPRESS ROSTER {*HHI*} ON ID
See Also
APPEND, CLEAN ROSTER, CLONE ROSTER, COUNTROSTER, DELETE FROM, RECCOUNT, SORT, UPDATE, XFER
COPYFILE creates a duplicate of the file whose name is specified in FileName1. You can use COPYFILE to copy any type of file. The file to be copied cannot be open. You must include the extensions for both the source file name FileName1 and destination file name FileName2. COPYFILE( ) returns 1 if the file was copied; otherwise, COPYFILE( ) returns 0.
Syntax
COPYFILE( cExpression1, cExpression2 )
Returns
Numeric
Arguments
cExpression1 Specifies the file to copy.
The file name must include a path if it is on a different drive or volume, or in a different directory from the default, and the file name extension must be included. The file name cannot contain wildcards.
cExpression2 Specifies the file where to copy.
The file name must include a path if it is on a different drive or volume, or in a different directory from the default, and the file name extension must be included. The file name cannot contain wildcards.
Examples
{FNAME1} = “C:\TEMP\ANSWERS.TXT”
{FN2} = “C:\TEMP\ANSWERS.BAK”
COPYFILE({FNAME1}, {FN2}) Returns 1
Possible uses
Function |
Result |
Error report |
{ FILENAME1} |
“C:\Temp\Test.txt” |
|
{FILENAME2} |
“C:\Temp\Test.bak” |
|
[SETFNAME] |
“C:\Temp\TestOut.bak” |
|
[QFILENAME1] |
“C:\Temp\Trial.txt” |
|
COPYFILE({FILENAME1},
{FILENAME2}) |
1 |
|
COPYFILE({FILENAME1},
[SETFNAME]) |
1 |
|
COPYFILE({FILENAME1},
"C:\BACKUP.TXT") |
1 |
|
COPYFILE([QFILENAME1],
{FILENAME2}) |
1 |
|
COPYFILE([QFILENAME1],
[SETFNAME]) |
1 |
|
COPYFILE([QFILENAME1],
"C:\BACKUP.TXT") |
1 |
|
COPYFILE(
Text, ?2) ?2 = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression2 of the COPYFILE function. Found: ?2, required: Text. |
COPYFILE
( ?1,
Text) ?1 = Numeric, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression1 of the COPYFILE function. Found: ?1, required: Text. |
COPYFILE({NAME},
{NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
COPYFILE({NONEXISTANT},
{NAME}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
APPENDTOFILE, DELETEFILE, FILE, READFILE
COS( ) returns the cosine of a specified numeric expression in radians. The returned angle is given in radians in the range -1 to 1.
Syntax
COS( nExpression )
Returns
Numeric
Arguments
nExpression Specifies a numeric expression whose cosine COS( ) returns. nExpression can be any value.
Examples
COS(0.5) Returns .88
COS (0) Returns 1
Possible uses
Function |
Result |
Error report |
{ANGLE} |
-0.5 |
|
[QANGLE] |
-0.5 |
|
COS({ANGLE}) |
0.88 |
|
COS([QANGLE]) |
0.88 |
|
COS(-0.5) |
0.88 |
|
COS(
?
) ? = Date, Time, Text,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the COS function. Found: ?, required: Numeric. |
COS({NONEXSITANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), - (subtraction operator), * (multiplication operator), / (division operator), ^ (exponentiation operator), ABS, ACOS, ANGLE, ASIN, ATAN, CODE, INT, LOG, MAX, MIN, MOD, RAND, ROUND, SIN, TAN, VAL, WEEKLYWAGE
COUNT( ) returns the number of times a specified string occurs in an array.
Syntax
COUNT( {^ArrayName^}, nExpression1, nExpression2, cExpression )
Returns
Numeric
Arguments
{^ArrayName^} Name of the array of the elements to be searched.
nExpression1 Starting integer index of the array.
nExpression2 Ending integer index of the array.
cExpression Alpha-numeric string to search for. It can be a literal or the contents of a symbol. If a literal, quotation marks are needed.
Examples
{^AAGE(1)^} = 10
{^AAGE(2)^} = 10
{^AAGE(3)^} = 20
COUNT({^AAGE^},1,3,"10") Returns 2
Possible uses
Function |
Result |
Error report |
{^ANAMES(1)^} |
“Miguel” |
|
{^ANAMES(2)^} |
“Josh” |
|
{^ANAMES(3)^} |
“Ann” |
|
{^ANAMES(4)^} |
“Ross” |
|
{^ANAMES(5)^} |
“Miguel G” |
|
{^ANAMES(6)^} |
“Monica” |
|
{X} |
1 |
|
{Y} |
6 |
|
{Z} |
3 |
|
[QFER] |
“Ann” |
|
{^AAGE(1)^} |
10 |
|
{^AAGE(2)^} |
20 |
|
{^AAGE(3)^} |
30 |
|
[Q20] |
1 |
|
[Q21] |
6 |
|
[Q5] |
3 |
|
COUNT({^ANAMES^},
{X}, {Y}, "Miguel") |
2 |
|
COUNT({^ANAMES^},
{X}, {Y}, {^ANAMES(2)^}) |
1 |
|
COUNT({^ANAMES^},
{X}, {Y}, [QFER]) |
1 |
|
COUNT({^ANAMES^},
{X}, [Q21], "Miguel") |
2 |
|
COUNT({^ANAMES^},
{X}, [Q21], {^ANAMES(2)^}) |
1 |
|
COUNT({^ANAMES^},
{X}, [Q21], [QFER]) |
1 |
|
COUNT({^ANAMES^},
{X}, 6, "Miguel") |
2 |
|
COUNT({^ANAMES^},
{X}, 6, {^ANAMES(2)^}) |
1 |
|
COUNT({^ANAMES^},
{X}, 6, [QFER]) |
1 |
|
COUNT({^ANAMES^},
[Q20], {Y}, "Miguel") |
2 |
|
COUNT({^ANAMES^},
[Q20], {Y}, {^ANAMES(2)^}) |
2 |
|
COUNT({^ANAMES^},
[Q20], {Y}, [QFER]) |
2 |
|
COUNT({^ANAMES^},
[Q20], [Q21], "Miguel") |
2 |
|
COUNT({^ANAMES^},
[Q20], [Q21], {^ANAMES(2)^}) |
2 |
|
COUNT({^ANAMES^},
[Q20], [Q21], [QFER]) |
2 |
|
COUNT({^ANAMES^},
[Q20], 6, "Miguel") |
2 |
|
COUNT({^ANAMES^},
[Q20], 6, {^ANAMES(2)^}) |
2 |
|
COUNT({^ANAMES^},
[Q20], 6, [QFER]) |
2 |
|
COUNT({^ANAMES^},
1, {Y}, "Miguel") |
2 |
|
COUNT({^ANAMES^},
1, {Y}, {^ANAMES(2)^}) |
2 |
|
COUNT({^ANAMES^},
1, {Y}, [QFER]) |
2 |
|
COUNT({^ANAMES^},
1, [Q21], "Miguel") |
2 |
|
COUNT({^ANAMES^},
1, [Q21], {^ANAMES(2)^}) |
2 |
|
COUNT({^ANAMES^},
1, [Q21], [QFER]) |
2 |
|
COUNT({^ANAMES^},
1, 6, "Miguel") |
2 |
|
COUNT({^ANAMES^},
1, 6, {^ANAMES(2)^}) |
2 |
|
COUNT({^ANAMES^},
1, 6, [QFER]) |
2 |
|
COUNT(
Array, Numeric, Numeric, ?) ? = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression of the COUNT function. Found: ?, required: Text. |
COUNT(
Array, Numeric, ?2, Text ) ?2 = Date, Text, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression2 of the COUNT function. Found: ?2, required: Numeric. |
COUNT(
Array, ?1,
Numeric, Text ) ?1 = Date, Text, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression1 of the COUNT function. Found: ?1, required: Numeric. |
COUNT(
?,
Numeric, Numeric, Text ) ? = Numeric, Date, Text, Time, Roster, Matrix |
-999999999 |
Incompatible
types in the parameter ArrayName of the COUNT function. Found: ?, required: Array. |
COUNT({^ANAMES^},
{X}, {Y}, {NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
COUNT({^ANAMES^},
1, {NONEXISTANT}, "Miguel") |
-999999999 |
Missing
variable : {NONEXISTANT} |
COUNT({^ANAMES^},
{NONEXISTANT}, 6, "Miguel") |
-999999999 |
Missing
variable : {NONEXISTANT} |
COUNT({NONEXISTANT},
{X}, {Y}, "Miguel") |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
COUNTROSTER ( ) counts and returns the number of times a specified string or a numeric value occurs in a column (field) in a Roster.
Syntax
COUNTROSTER( {*RosterName*}, "FieldName”, cExpression2 )
Returns
Numeric
Arguments
{*RosterName*} Name of the roster to search.
"FieldName" Name of the field to be the target of the search.
cExpression | nExpression Numeric or Text value to search for. It can be a literal or the contents of a variable.
Examples
COUNTROSTER({*JOBS*}, "AGE", "33") Returns 2
Possible uses
Function |
Result |
Error report |
[Q33] |
“33” |
|
{^AAGE(4)^} |
“33” |
|
{S33} |
“33” |
|
{SAGE} |
“AGE” |
|
[QFNAME] |
“AGE” |
|
COUNTROSTER({*JOBS*},
"AGE", "33") |
2 |
|
COUNTROSTER({*JOBS*},
"AGE", [Q33]) |
2 |
|
COUNTROSTER({*JOBS*},
"AGE", {^AAGE(4)^}) |
2 |
|
COUNTROSTER({*JOBS*},
"AGE", {S33}) |
2 |
|
COUNTROSTER({*JOBS*},
{SAGE}, "33") |
2 |
|
COUNTROSTER({*JOBS*},
{SAGE}, [Q33]) |
2 |
|
COUNTROSTER({*JOBS*},
{SAGE}, {^AAGE(4)^}) |
2 |
|
COUNTROSTER({*JOBS*},
{SAGE}, {S33}) |
2 |
|
COUNTROSTER({*JOBS*},
[QFNAME], "33") |
2 |
|
COUNTROSTER({*JOBS*},
[QFNAME], [Q33]) |
2 |
|
COUNTROSTER({*JOBS*},
[QFNAME], {^AAGE(4)^}) |
2 |
|
COUNTROSTER({*JOBS*},
[QFNAME], {S33}) |
2 |
|
COUNTROSTER( Roster, Text, ?2) ?2 = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression2 of the COUNTROSTER function. Found: ? 2,
required: Text. |
COUNTROSTER( Roster, ?1,
Text) ?1 = Numeric, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter dExpression2 of the COUNTROSTER function. Found: ?1,
required: Text. |
COUNTROSTER( ?1, Text, Text) ? 1 = Numeric, Date,
Time, Text, Array, Matrix |
-999999999 |
Incompatible
types in the parameter dExpression1 of the COUNTROSTER function. Found: ?1,
required: Roster. |
COUNTROSTER({*JOBS*},"AGE",{NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
COUNTROSTER({*JOBS*},{NONEXISTANT},"33") |
-999999999 |
Missing
variable : {NONEXISTANT} |
COUNTROSTER({*JJJOBS*},
"AGE", "33") |
-999999999 |
Missing
variable : {*JJJOBS*} |
See Also
APPEND, CLEAN ROSTER, CLONE ROSTER, COMPRESS ROSTER, DELETE FROM, RECCOUNT, SORT, UPDATE, XFER
This command creates a new calendar at runtime. The calendar is assigned the name passed in as the parameter. However, if the name matches that of an existing calendar, the original calendar is re-initialized. This resets all information contained in a calendar.
Syntax
CREATE CALENDAR "CalendarName"
Returns
Numeric (integer: 1 success calendar
got created correctly, 0 fail to create the calendar)
Arguments
"CalendarName" Name of the calendar to be created.
Examples
CREATE CALENDAR “Jobs”
ADDDAYS, ADDYEARS, AGE, CDOW, DATE, DATE2DAY, DATE2TEXT, DATE2WK, DATEFORMAT, DIFFAGE, DOW, FINDGAPS IN CALENDAR, FIXDAY, FIXMONTH, FIXYEAR, GETSUBDATE, GOMONTH, ISCOMPLETE, MARK CALENDAR, TEXT2DATE
Returns the system current date.
Syntax
DATE( cExpression )
Returns
Date or Text
Arguments
cExpression Specifies the format of the date that will be returned.
“SHORT” | “LONG”
Can be a LONG format or a SHORT format. LONG returns a date in a string format: January 12, 1952 and SHORT returns a date in a full date format.
Examples
{FORMAT} = “LONG”
DATE({FORMAT}) Returns January 9, 2003
DATE (“LONG”) Returns January 9, 2003
Possible uses
Function |
Result |
Error report |
{FORMAT} |
“LONG” |
|
[QFORMAT] |
“LONG” |
|
DATE({FORMAT}) |
“January
9, 2003” |
|
DATE([QFORMAT]) |
“January
9, 2003” |
|
DATE(“LONG”) |
“January
9, 2003” |
|
DATE(“SHORT”) |
20030109 |
|
DATE(
?
) ? = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression of the DATE function. Found: ?, required: Text. |
DATE({NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
ADDDAYS, ADDYEARS, AGE, CDOW, CREATE CALENDAR, DATE2DAY, DATE2TEXT, DATE2WK, DATEFORMAT, DIFFAGE, DOW, FINDGAPS IN CALENDAR, FIXDAY, FIXMONTH, FIXYEAR, GETSUBDATE, GOMONTH, ISCOMPLETE, MARK CALENDAR, TEXT2DATE
Converts a date (YYYYMMDD) into the specified format.
Syntax
DATEFORMAT( dateExpression, “FULL” | ”SHORT” | ”EXTENDED” )
Returns
Text
Arguments
dateExpression Date to be converted.
"FULL"|"SHORT"|"EXTENDED" Specifies the format to convert the date.
Examples
{TODAY} = 20030925
DATEFORMAT({TODAY}, “FULL”) Returns 20030925
DATEFORMAT({TODAY}, “SHORT”) Returns 200309
DATEFORMAT({TODAY}, “EXTENDED”) Returns September, 25 2003
Possible uses
Function |
Result |
Error report |
{LINTDATE} |
20030925 |
|
[QTODAY] |
20030925 |
|
DATEFORMAT({LINTDATE},
“FULL”) |
“20030925” |
|
DATEFORMAT([QTODAY],
“SHORT”) |
“200309” |
|
DATEFORMAT(
Date, ?) ? = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression of the DATEFORMAT function. Found: ?, required: Text. |
DATEFORMAT(
?,
Text ) ? = Numeric, Text, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter dExpression of the DATEFORMAT function. Found: ?, required: Date. |
DATEFORMAT({NONEXISTANT},
“FULL”) |
-999999999 |
Missing
variable : {NONEXISTANT} |
DATEFORMAT({LINTDATE},
{NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
ADDDAYS, ADDYEARS, AGE, CDOW, CREATE CALENDAR, DATE, DATE2DAY, DATE2TEXT, DATE2WK, DIFFAGE, DOW, FINDGAPS IN CALENDAR, FIXDAY, FIXMONTH, FIXYEAR, GETSUBDATE, GOMONTH, ISCOMPLETE, MARK CALENDAR, TEXT2DATE
Converts a date (YYYYMMDD) into a Julian format. Returns the number of days.
Syntax
DATE2DAY( dExpression )
Returns
Numeric
Arguments
dExpression Specifies the date to be converted.
Examples
{TODAY} = 20130312
DATE2DAY({TODAY}) Returns 15776
Possible uses
Function |
Result |
Error report |
{TODAY} |
20130312 |
|
[NOWDATE] |
20130312 |
|
DATE2DAY({TODAY}) |
15776 |
|
DATE2DAY([NOWDATE]) |
15776 |
|
DATE2DAY(
?
) ? = Numeric, Time, Text, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter dExpression of the DATE2DAY function. Found: ?, required: Date. |
DATE2DAY({NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
ADDDAYS, ADDYEARS, AGE, CDOW, CREATE CALENDAR, DATE, DATE2TEXT, DATE2WK, DATEFORMAT, DIFFAGE, DOW, FINDGAPS IN CALENDAR, FIXDAY, FIXMONTH, FIXYEAR, GETSUBDATE, GOMONTH, ISCOMPLETE, MARK CALENDAR, TEXT2DATE
Converts a date (YYYYMMDD) into a strintext) format.
Syntax
DATE2TEXT( dExpression )
Returns
Text
Arguments
dExpression Specifies the date to be converted.
Examples
DATE2TEXT({LINTDATE}) Returns September 11, 2002
Possible uses
Function |
Result |
Error report |
{LINTDATE} |
20020911 |
|
[NOWDATE] |
20030109 |
|
DATE2TEXT({LINTDATE}) |
“September
11, 2002” |
|
DATE2TEXT([NOWDATE]) |
“January
9, 2003” |
|
DATE2TEXT(
?
) ? = Numeric, Time, Text, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter dExpression of the DATE2DAY function. Found: ?, required: Date. |
DATE2TEXT({NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
ADDDAYS, ADDYEARS, AGE, CDOW, CREATE CALENDAR, DATE, DATE2DAY, DATE2WK, DATEFORMAT, DIFFAGE, DOW, FINDGAPS IN CALENDAR, FIXDAY, FIXMONTH, FIXYEAR, GETSUBDATE, GOMONTH, ISCOMPLETE, MARK CALENDAR, TEXT2DATE
+ (additive operator), ALLTRIM, AT, DECODE, IN, LEN, LOWER, LTRIM, PADL, RAT, STR, STRCMP, SUBSTR, TIME2TEXT, TITLECASE, UPPER, VAL
Converts a date (YYYYMMDD) into a week number. Returns the number of weeks between the base date and the relative date being converted.
Syntax
DATE2WK( dExpression )
Returns
Numeric
Arguments
dExpression Specifies the date to be converted.
Examples
DATE2WK({LINTDATE}) Returns 1651
Possible uses
Function |
Result |
Error report |
{LINTDATE} |
20020911 |
|
[NOWDATE] |
20030109 |
|
DATE2WK({LINTDATE}) |
1651 |
|
DATE2WK([NOWDATE]) |
1672 |
|
DATE2WK(
?
) ? = Numeric, Time, Text, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter dExpression of the DATE2WK function. Found: ?, required: Date. |
DATE2WK({NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
ADDDAYS, ADDYEARS, AGE, CDOW, CREATE CALENDAR, DATE, DATE2DAY, DATE2TEXT, DATEFORMAT, DIFFAGE, DOW, FINDGAPS IN CALENDAR, FIXDAY, FIXMONTH, FIXYEAR, GETSUBDATE, GOMONTH, ISCOMPLETE, MARK CALENDAR, TEXT2DATE
Converts a code from a specific PickList into its corresponding character string. It will return the descriptive character string of a code number. The description for the code specified is returned as the answer.
Syntax
DECODE( nExpression1, {%PickListName%}, nExpression2 )
Returns
Text
Arguments
nExpression1 Specifies the code to be converted. Codes can be any number between –999999999 and 999999999.
{%PickListName%} Name of a PickList where the function will look for the code.
nExpression2 Integer number that specifies in which language the item will be searched in the PickList.
Examples
DECODE({STATCODE}, {%MARSTAT%}, 1) Returns Single
Possible uses
Function |
Result |
Error report |
{STATUS} |
1 |
|
MARSTATUS |
|
|
Single |
1 |
|
Married |
2 |
|
Divorced |
3 |
|
Widow |
4 |
|
{LANGNO} |
1 |
|
[Q20] |
1 |
|
[MSTATUS] |
4 |
|
DCODE({STATUS},
{%MARSTATUS%}, {LANGNO}) |
“Single“ |
|
DCODE({STATUS},
{%MARSTATUS%}, [Q20]) |
“Single“ |
|
DCODE({STATUS},
{%MARSTATUS%}, 1) |
“Single“ |
|
DCODE([MSTATUS],
{%MARSTATUS%}, {LANGNO}) |
“Widow“ |
|
DCODE([MSTATUS],
{%MARSTATUS%}, [Q20]) |
“Widow“ |
|
DCODE([MSTATUS],
{%MARSTATUS%}, 1) |
“Widow“ |
|
DCODE(2,
{%MARSTATUS%}, {LANGNO}) |
“Married“ |
|
DCODE(2,
{%MARSTATUS%}, [Q20]) |
“Married“ |
|
DCODE(2,
{%MARSTATUS%}, 1) |
“Married“ |
|
DCODE(
Numeric, DCodeName, ? ) ? = Text, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the DCODE function.
Found: ?,
required: Numeric. |
DCODE(
Numeric, ?,
Text) ? = Numeric, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter DCodeName of the DCODE function.
Found: ?,
required: DCodeName. |
DCODE(
?,
DCodeName, Numeric) ? = Date, Time, Text,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression of the DCODE function.
Found: ?,
required: Numeric. |
DCODE({NAME},
{NAME}, {NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
DCODE({NAME},
{NONEXISTANT}, {NAME}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
DCODE({NONEXISTANT},
{NAME}, {NAME}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), ALLTRIM, AT, DATE2TEXT, IN, LEN, LOWER, LTRIM, PADL, RAT, STR, STRCMP, SUBSTR, TEXT2DATE, TIME2TEXT, TITLECASE, UPPER, VAL
Deletes the file denoted by cExpression abstract pathname from a disk. DELETEFILE( ) returns 1 if the file was deleted; otherwise, DELETEFILE ( ) returns 0.
Syntax
DELETEFILE( cExpression )
Returns
Numeric
Arguments
cExpression Specifies the file to delete. The file name must include a path if it is on a different drive or volume, or in a different directory from the default, and the file name extension must be included. The file name cannot contain wildcards.
Examples
{FILENAME} = “C:\WINDOWS\TEMP.TXT”
DELETEFILE({FILENAME}) Returns 1
Possible uses
Function |
Result |
Error report |
{CFNAME} |
“C:\TEMP\A.TXT” |
|
[CFILENAME] |
“C:\TEMP\NOEXIST.TXT” |
|
DELETEFILE({CFNAME}) |
1 |
|
DELETEFILE
([CFILENAME]) |
0 |
|
DELETEFILE
( ?
) ? = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression of the DELETEFILE function. Found: ?,
required: Text. |
DELETEFILE
({NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
DELETEFILE
({NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
APPENDTOFILE, COPYFILE, FILE, READFILE
This command deletes rows (records) from a roster. Be careful with this function, once you delete a row (record) from a roster there is no way to recover it.
Syntax
DELETE FROM {*RosterName*} [WHERE <ExprL> [AND | OR <ExprL> ...] ]
Returns
Numeric (integer: 1 success rows were
deleted correctly, 0 fail to delete rows)
Arguments
{*RosterName*} Roster name from which the records will be deleted.
nExpression1 Integer number of the first row in the roster to be deleted.
nExpression2|"END" Integer number of the last row in the roster to be deleted. If “END” is specified indicates that records up to and through the last row in the roster will be deleted.
ExprL Logical expression that if matched controls what records will be deleted from the roster.
Examples
DELETE FROM {*JOBS*} WHERE (Age <= 17)
See Also
APPEND, CLEAN ROSTER, CLONE ROSTER, COMPRESS ROSTER, COUNTROSTER, RECCOUNT, SORT, UPDATE, XFER
Calculates the difference in days, months, or years between two sets of dates. The first and second parameters are the dates whose difference is to be calculated.
Syntax
DIFFAGE( dExpression1, dExpression2, cExpression )
Returns
Numeric
Arguments
dExpression1 Terminating
date. May be a variable (symbol, question name, array element, roster element)
or a date constant in the “yyyymmdd” format.
dExpression2 Beginning
date. May be a variable (symbol, question name, array element, roster element)
or a date constant in the “yyyymmdd” format.
cExpression "DAY"|"MO"|"YR"|"DIF"
Specifies
what resultant calculation will represent: days, months (30 days), years (365
days) or just the difference (DIF).
Examples
DIFFAGE ("20010803", "19970122", "DAY") Returns 12
Possible uses
Function |
Result |
Error report |
{TODAY} |
20130312 |
|
{DOB} |
19970122 |
|
[Q1] |
19970122 |
|
DIFFAGE
({TODAY}, {DOB}, "DAY") |
21 |
|
DIFFAGE({TODAY},
{DOB}, "MO") |
1 |
|
DIFFAGE({TODAY},
{DOB}, "YR") |
16 |
|
DIFFAGE({TODAY},
{DOB}, "DIF") |
5893 |
|
DIFFAGE({TODAY},
[Q1], "DAY") |
21 |
|
DIFFAGE({TODAY},
[Q1], "MO") |
1 |
|
DIFFAGE({TODAY},
[Q1], "YR") |
16 |
|
DIFFAGE({TODAY},
[Q1], "DIFF") |
5893 |
|
DIFFAGE({TODAY},
"19970122", "DAY") |
21 |
|
DIFFAGE({TODAY},
"19970122", "MO") |
1 |
|
DIFFAGE({TODAY},
"19970122", "YR") |
16 |
|
DIFFAGE({TODAY},
"19970122", "DIF") |
5893 |
|
DIFFAGE([Q1],
{DOB}, "DAY") |
0 |
|
DIFFAGE([Q1],
{DOB}, "MO") |
0 |
|
DIFFAGE([Q1],
{DOB}, "YR") |
0 |
|
DIFFAGE([Q1],
{DOB}, "DIF") |
0 |
|
DIFFAGE([Q1],
[Q1], "DAY") |
0 |
|
DIFFAGE([Q1],
[Q1], "MO") |
0 |
|
DIFFAGE([Q1],
[Q1], "YR") |
0 |
|
DIFFAGE([Q1],
[Q1], "DIFF") |
0 |
|
DIFFAGE([Q1],
"19970122", "DAY") |
0 |
|
DIFFAGE([Q1],
"19970122", "MO") |
0 |
|
DIFFAGE([Q1],
"19970122", "YR") |
0 |
|
DIFFAGE([Q1],
"19970122", "DIF") |
0 |
|
DIFFAGE("20130312",
{DOB}, "DAY") |
21 |
|
DIFFAGE("20130312",
{DOB}, "MO") |
1 |
|
DIFFAGE("20130312",
{DOB}, "YR") |
16 |
|
DIFFAGE("20130312",
{DOB}, "DIF") |
5893 |
|
DIFFAGE("20130312",
[Q1], "DAY") |
21 |
|
DIFFAGE("20130312",
[Q1], "MO") |
1 |
|
DIFFAGE("20130312",
[Q1], "YR") |
16 |
|
DIFFAGE("20130312",
[Q1], "DIFF") |
5893 |
|
DIFFAGE("20130312",
"19970122", "DAY") |
21 |
|
DIFFAGE("20130312",
"19970122", "MO") |
1 |
|
DIFFAGE("20130312",
"19970122", "YR") |
16 |
|
DIFFAGE("20130312",
"19970122", "DIF") |
5893 |
|
DIFFAGE("20130312",
"19970122", "XX") |
-999999999 |
Invalid
format (XX) in the parameter "DAY"|"MO"|"YR"|”DIF”
of the DIFFAGE function. |
DIFFAGE(
Date, Date, ?) ? = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression of the DIFFAGE function. Found: ?, required: Text. |
DIFFAGE(
Date, ?2,
Text) ?2 = Numeric, Text, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter dExpression2 of the DIFFAGE function. Found: ?2, required: Date. |
DIFFAGE(
?1,
Date, Text) ? 1 = Numeric, Time,
Text, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter dExpression1 of the DIFFAGE function. Found: ?1, required: Date. |
DIFFAGE({TODAY},
{DOB}, {NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
DIFFAGE({TODAY},
{NONEXISTANT}, “YR”) |
-999999999 |
Missing
variable : {NONEXISTANT} |
DIFFAGE({NONEXISTANT},
{DOB}, “YR”) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
ADDDAYS, ADDYEARS, AGE, CDOW, CREATE CALENDAR, DATE, DATE2DAY, DATE2TEXT, DATE2WK, DATEFORMAT, DOW, FINDGAPS IN CALENDAR, FIXDAY, FIXMONTH, FIXYEAR, GETSUBDATE, GOMONTH, ISCOMPLETE, MARK CALENDAR, TEXT2DATE
Returns the division of two values.
Syntax
nExpression1 / nExpression2
Returns
Numeric
Arguments
nExpression1 Specifies a numeric expression.
nExpression2 Specifies a numeric expression. This value can’t be 0.
Examples
20 / 10 Returns 2.0
10 / 30 Returns 0.3333
Possible uses
Function |
Result |
Error report |
{SALARY} |
30000 |
|
{MONTHS} |
12 |
|
[Q243] |
12 |
|
[Q100] |
30000 |
|
{SALARY}
/ {MONTHS} |
2500 |
|
{SALARY}
/ [Q243] |
2500 |
|
{SALARY}
/ 100 |
300 |
|
[Q100]
/ {MONTHS} |
2500 |
|
[Q100]
/ [Q243] |
2500 |
|
[Q100]
/ 100 |
300 |
|
30000
/ {MONTHS} |
2500 |
|
30000
/ [Q243] |
2500 |
|
30000
/ 100 |
300 |
|
100
/ {NONEXISTANT} |
-999999999 |
Missing
variable : {NONEXISTANT} |
“Hi
“ / 125 |
-999999999 |
Incompatible
operands in the addition (/) function. |
See Also
+ (additive operator), - (subtraction operator), * (multiplication operator), ^ (exponentiation operator), ABS, ACOS, ANGLE, ASIN, ATAN, CODE, COS, INT, LOG, MAX, MIN, MOD, RAND, ROUND, SIN, TAN, VAL, WEEKLYWAGE
Converts a date (YYYYMMDD) into a numeric day-of-the-week value.
Syntax
DOW( dExpression )
Returns
Numeric
Arguments
dExpression Specifies the date from which DOW() returns the day.
Examples
DOW({DOM}) Returns 3
Possible uses
Function |
Result |
Error report |
{DOM} |
20130313 |
|
[Q2] |
20130313 |
|
DOW({DOM}) |
3 |
|
DOW
([Q2]) |
3 |
|
DOW(
?
) ? = Numeric, Time, Text, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter dExpression of the DOW function.
Found: ?,
required: Date. |
DOW
({NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
ADDDAYS, ADDYEARS, AGE, CDOW, CREATE CALENDAR, DATE, DATE2DAY, DATE2TEXT, DATE2WK, DATEFORMAT, DIFFAGE, FINDGAPS IN CALENDAR, FIXDAY, FIXMONTH, FIXYEAR, GETSUBDATE, GOMONTH, ISCOMPLETE, MARK CALENDAR, TEXT2DATE
Executes windows specific command.
Returns the result of raising the first operand to the power of the second operand.
Syntax
nExpression1 ^ nExpression2
Returns
Numeric
Arguments
nExpression1 Specifies a numeric expression.
nExpression2 Specifies a numeric expression.
Examples
5 ^ 4 Returns 625.00
2 ^ 30 Returns 1073741824.00
Possible uses
Function |
Result |
Error report |
{BASE} |
16 |
|
{EXPVALUE} |
2 |
|
[Q_BASE] |
4 |
|
[Q_EXP] |
4 |
|
{BASE}
^ {EXPVALUE} |
256 |
|
{BASE}
^ [Q_BASE] |
1296 |
|
{BASE}
^ 3 |
4096 |
|
[Q_BASE]
^ {EXPVALUE} |
16 |
|
[Q_BASE]
^ [Q_EXP]] |
256 |
|
[Q_BASE]
^ 3 |
64 |
|
3
^ {EXPVALUE} |
9 |
|
2
^ [Q_EXP] |
16 |
|
8
^ 3 |
512 |
|
10
^ {NONEXISTANT} |
-999999999 |
Missing
variable : {NONEXISTANT} |
{NONEXISTANT}
^ 3 |
-999999999 |
Missing
variable : {NONEXISTANT} |
“Hi
“ ^ 125 |
-999999999 |
Incompatible
operands in the addition (^) function. |
See Also
+ (additive operator), - (subtraction operator), * (multiplication operator), / (division operator), ABS, ACOS, ANGLE, ASIN, ATAN, CODE, COS, INT, LOG, MAX, MIN, MOD, RAND, ROUND, SIN, TAN, VAL, WEEKLYWAGE
Returns 1 if the specified file is found on disk, otherwise FILE() returns 0.
Syntax
FILE( cExpression )
Returns
Numeric
Arguments
cExpression Specifies the name of the file to locate. cFileName must include the file's extension. You can include a path with the file name to search for a file in a directory or on a drive other than the current directory or drive.
Examples
{FILENAME} = “C:\WINDOWS\TEMP.TXT”
FILE({FILENAME}) Returns 1
Possible uses
Function |
Result |
Error report |
{CFNAME} |
“C:\TEMP\T.TXT” |
|
[CFILENAME] |
“C:\TEMP\X.TXT” |
|
FILE({CFNAME}) |
1 |
|
FILE
([CFILENAME]) |
0 |
|
FILE(
?
) ? = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression of the FILE function.
Found: ?,
required: Text. |
FILE ({NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
APPENDTOFILE, COPYFILE, DELETEFILE, READFILE
Creates a calendar with a list of unmarked segments in a calendar.
Syntax
FINDGAPS IN CALENDAR {*CalendarName*} BETWEEN dExpression1 AND dExpression2 INTO {*ResultCalendarName*} GAP IS nExpression
Arguments
{*CalendarName*} Name of the calendar to check for unmarked segments.
dExpression1 Beginning
date. May be a variable (symbol, question name, array element, roster element)
or a date constant in the “yyyymmdd” format.
dExpression2 Terminating
date. May be a variable (symbol, question name, array element, roster element)
or a date constant in the “yyyymmdd” format.
{*ResultCalendarName*} Calendar name where the unmarked segments (gap dates) will be stored.
nExpression Integer variable that specifies the minimum length in days for an unmarked segment to be counted as a gap. The most comon value is 7.
Examples
FINDGAPS IN CALENDAR {*JOBS*} BETWEEN “20000101” AND “20010101” INTO {*OFFWORK*} GAP IS 7
See Also
ADDDAYS, ADDYEARS, AGE, CDOW, CREATE CALENDAR, DATE, DATE2DAY, DATE2TEXT, DATE2WK, DATEFORMAT, DIFFAGE, DOW, FIXDAY, FIXMONTH, FIXYEAR, GETSUBDATE, GOMONTH, ISCOMPLETE, MARK CALENDAR, TEXT2DATE
Repairs a date in the form of YYYYMM-2 or YYYYMM-1 and restores it to a valid date format, i.e., YYYYMM15.
Syntax
FIXDAY( dExpression, nExpression )
Returns
Date
Arguments
dExpression Specifies the date to be fixed.
nExpression Parameter that specifies the integer number to use when repairing the day.
Examples
{DOM} = 199207-2
FIXDAY({DOM}, 1) Returns 19920701
Possible uses
Function |
Result |
Error report |
{DOM} |
199207-2 |
|
{DEFAULTDAY} |
1 |
|
[Q6] |
1 |
|
[Q2] |
199207-2 |
|
FIXDAY({DOM},
1) |
19920701 |
|
FIXDAY({DOM},
{DEFAULTDAY}) |
19920701 |
|
FIXDAY({DOM},
[Q6]) |
19920701 |
|
FIXDAY([Q2],
1) |
19920701 |
|
FIXDAY([Q2],
{DEFAULTDAY}) |
19920701 |
|
FIXDAY([Q2],
[Q6]) |
19920701 |
|
FIXDAY( Date, ?) ? = Text, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the FIXDAY function. Found: ?,
required: Numeric. |
FIXDAY( ?, Numeric) ? = Numeric, Text, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter dExpression of the FIXDAY function. Found: ?,
required: Date. |
FIXDAY({LINTDATE}, {NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
FIXDAY({NONEXISTANT}, {THREE}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
ADDDAYS, ADDYEARS, AGE, CDOW, CREATE CALENDAR, DATE, DATE2DAY, DATE2TEXT, DATE2WK, DATEFORMAT, DIFFAGE, DOW, FINDGAPS IN CALENDAR, FIXMONTH, FIXYEAR, GETSUBDATE, GOMONTH, ISCOMPLETE, MARK CALENDAR, TEXT2DATE
Repairs a date in the form of YYYY-2DD or YYYY-1DD and restores it to a valid date format, i.e., YYYY06DD.
Syntax
FIXMONTH( dExpression, nExpression )
Returns
Date
Arguments
dExpression Specifies the date to be fixed.
nExpression Numeric value that specifies the integer number to use when repairing the month.
Examples
{LINTD} = 1997-122
FIXMONTH({LINTD}, 1) Returns 19970122
Possible uses
Function |
Result |
Error report |
{DOM} |
1992-103 |
|
{DEFAULTMONTH} |
6 |
|
[Q6] |
6 |
|
[Q2] |
1992-103 |
|
FIXMONTH({DOM},
1) |
19920601 |
|
FIXMONTH({DOM},
{DEFAULTMONTH}) |
19920601 |
|
FIXMONTH({DOM},
[Q6]) |
19920601 |
|
FIXMONTH([Q2],
1) |
19920601 |
|
FIXMONTH([Q2],
{DEFAULTMONTH}) |
19920601 |
|
FIXMONTH([Q2],
[Q6]) |
19920601 |
|
FIXMONTH( Date, ?) ? = Text, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the FIXMONTH function. Found: ?,
required: Numeric. |
FIXMONTH( ?, Numeric) ? = Numeric, Text, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter dExpression of the FIXMONTH function. Found: ?,
required: Date. |
FIXMONTH({LINTDATE},
{NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
FIXMONTH({NONEXISTANT}, {THREE}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
ADDDAYS, ADDYEARS, AGE, CDOW, CREATE CALENDAR, DATE, DATE2DAY, DATE2TEXT, DATE2WK, DATEFORMAT, DIFFAGE, DOW, FINDGAPS IN CALENDAR, FIXDAY, FIXYEAR, GETSUBDATE, GOMONTH, ISCOMPLETE, MARK CALENDAR, TEXT2DATE
Repairs a date in the form of –002MMDD or –001MMDD and restores it to a valid date format, i.e., 1980MMDD.
Syntax
FIXYEAR( dExpression, nExpression )
Returns
Date
Arguments
dExpression Specifies the date to be fixed.
nExpression Value that specifies the integer number to use in repairing the year.
Examples
{LINTD} = -20122
FIXYEAR({LINTD}, 1997) Returns 19970122
Possible uses
Function |
Result |
Error report |
{DOM} |
-10601 |
|
{DEFAULTYEAR} |
1997 |
|
[Q6] |
1997 |
|
[Q2] |
-10601 |
|
FIXYEAR({DOM},
1) |
19970601 |
|
FIXYEAR({DOM},
{DEFAULTYEAR}) |
19970601 |
|
FIXYEAR({DOM},
[Q6]) |
19970601 |
|
FIXYEAR([Q2],
1) |
19970601 |
|
FIXYEAR([Q2],
{DEFAULTYEAR}) |
19970601 |
|
FIXYEAR([Q2],
[Q6]) |
19970601 |
|
FIXYEAR( Date, ?) ? = Text, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the FIXYEAR function. Found: ?,
required: Numeric. |
FIXYEAR( ?, Numeric) ? = Numeric, Text, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter dExpression of the FIXYEAR function. Found: ?,
required: Date. |
FIXYEAR({LINTDATE},
{NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
FIXYEAR({NONEXISTANT}, {THREE}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
ADDDAYS, ADDYEARS, AGE, CDOW, CREATE CALENDAR, DATE, DATE2DAY, DATE2TEXT, DATE2WK, DATEFORMAT, DIFFAGE, DOW, FINDGAPS IN CALENDAR, FIXDAY, FIXMONTH, GETSUBDATE, GOMONTH, ISCOMPLETE, MARK CALENDAR, TEXT2DATE
Executes a set of commands a specified number of times.
Syntax
FOR (LoopControlVariable =nInitialValue; ExprL; LoopControlVariable= LoopControlVariable +|-nIncrement; [EndForQName])
Statements
.
ENDFOR
Arguments
LoopControlVariable Specifies a variable that acts as the counter. The variable doesn't have to exist before FOR ... ENDFOR is executed.
nInitialValue Initial value of the counter.
ExprL Logical expression that if not matched transfers control from within the loop to the question specified in [EndForQName].
nIncrement Amount the counter is incremented or decremented.
[EndForQName] Name of the question where the corresponding ENDFOR is. This question is where the program will go after the ExprL (logical expression) doesn’t match anymore, that is that the ExprL returns false.
Examples
FOR({INDEX}=1; {INDEX} <= 5; {INDEX}={INDEX}+1; [QENDFORLOOP])
.
Statements (Questions)
.
.
ENDFOR
See Also
IIF, ISVAREMPTY, LANGUAGE, READGLOBAL, REPEAT ... UNTIL, SET HEADER TO, SWITCH, SYMBOL, VAREXIST, VARTYPE, WHILE ... ENDWHILE, WRITEGLOBAL
Converts a code from a specific PickList into its corresponding character string. It will return the descriptive character string of a code number. The description for the code specified is returned as the answer.
Syntax
GETEXTRAINFO( nExpression1, {%PickListName%}, nExpression2, cExpression )
Returns
Numeric or Text
Arguments
nExpression1 Specifies the code to be converted.
{%PickListName%} Name of a PickList where the function will look for the code.
nExpression2 Specifies in which language the item will be searched in the PickList.
cExpression Name of the field to get from the PickList.
Possible values: "PICK_ID”
"PICK_SEQ”
"PICK_LANGUAGE”
"PICK_VALUE”
“PICK_TEXT”
"PICK_OTHER_SPECIFY”
"PICK_NAME"
"PICK_DESCRIPTION"
"PICK_RANDOMIZE"
Examples
{OPT} = 2
MARSTAT (PickList)
1 Single
2 Married
3 Divorced
4 Widow
GETEXTRAINFO({OPT}, {%MARSTAT%}, 1, "PICK_DESCRIPTION") Returns “R is currently married”
Possible uses
Function |
Result |
Error report |
MARSTATUS |
|
|
Single |
1 |
|
Married |
2 |
|
Divorced |
3 |
|
Widow |
4 |
|
{OPT} |
2 |
|
{LANGNO} |
1 |
|
{FIELD} |
“PICK_DESCRIPTION” |
|
{^AAGE(1)^} |
10 |
|
{^AAGE(2)^} |
20 |
|
{^AAGE(3)^} |
30 |
|
[QFIELD] |
“PICK_DESCRIPTION” |
|
[QLANG] |
2 |
|
[Q5] |
3 |
|
GETEXTRAINFO({OPT},
{%MARSTATUS%}, {LANGNO}, "PICK_DESCRIPTION") |
2 |
|
GETEXTRAINFO({OPT},
{%MARSTATUS%}, {LANGNO}, {FIELD}) |
2 |
|
GETEXTRAINFO({OPT},
{%MARSTATUS%}, {LANGNO}, [QFIELD]) |
2 |
|
GETEXTRAINFO({OPT},
{%MARSTATUS%}, 1, "PICK_DESCRIPTION") |
2 |
|
GETEXTRAINFO({OPT},
{%MARSTATUS%}, 1, {FIELD}) |
2 |
|
GETEXTRAINFO({OPT},
{%MARSTATUS%}, 1, [QFIELD]) |
2 |
|
GETEXTRAINFO({OPT},
{%MARSTATUS%}, [QLANG], "PICK_DESCRIPTION") |
2 |
|
GETEXTRAINFO({OPT},
{%MARSTATUS%}, [QLANG], {FIELD}) |
2 |
|
GETEXTRAINFO({OPT},
{%MARSTATUS%}, [QLANG], [QFIELD]) |
2 |
|
GETEXTRAINFO(
Numeric, DCodeName, Numeric, ?) ? = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression of the GETEXTRAINFO function. Found: ?, required: Text. |
GETEXTRAINFO(
Numeric, DCodeName, ?2, Text ) ?2 = Date, Text, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression2 of the GETEXTRAINFO function. Found: ?2, required: Numeric. |
GETEXTRAINFO(
Array, ?,
Numeric, Text ) ? = Numeric, Date, Text,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter DCodeName of the GETEXTRAINFO function. Found: ?1, required: DCodeName. |
GETEXTRAINFO(
?1,
Numeric, Numeric, Text ) ?1
= Date, Text, Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter ArrayName of the GETEXTRAINFO function. Found: ?, required: Numeric. |
GETEXTRAINFO({OPT},
{%X%}, {Y}, {NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
GETEXTRAINFO({OPT},
{%X%}, {NONEXISTANT}, “PICK_DESCRIPTION”) |
-999999999 |
Missing
variable : {NONEXISTANT} |
GETEXTRAINFO({OPT},
{%NONEXISTANT%}, {Y}, "PICK_DESCRIPTION") |
-999999999 |
Missing
variable : {NONEXISTANT} |
GETEXTRAINFO({NONEXISTANT},
{%X%}, {Y}, "PICK_DESCRIPTION") |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
Extracts part of a date. If the second parameter is DAY it will return the day; MO will return the month; YR will return the year. The third parameter determines the format of the result.
Syntax
GETSUBDATE( dExpression, "DAY"|"MO"|"YR"|"MMYYYY", "INT"|"CHAR" )
Returns
Numeric or Text
Arguments
dExpression Specifies the source date.
"DAY"|"MO"|"YR"|"MMYYYY" What to get Day, Month, Year.
"INT"|"CHAR" Format of the answer.
Examples
GETSUBDATE({DOB}, "DAY", "INT") Returns 22
Possible uses
Function |
Result |
Error report |
{DOB} |
19970122 |
|
[Q3] |
19970122 |
|
GETSUBDATE({DOB},
"DAY", "INT") |
22 |
|
GETSUBDATE({DOB},
"DAY", "CHAR") |
“22” |
|
GETSUBDATE({DOB},
"MO", "INT") |
1 |
|
GETSUBDATE({DOB},
"MO", "CHAR") |
“1” |
|
GETSUBDATE({DOB},
"YR", "INT") |
1997 |
|
GETSUBDATE({DOB},
"YR", "CHAR") |
“1997” |
|
GETSUBDATE({DOB},"MMYYYY","CHAR") |
“011997” |
|
GETSUBDATE
([Q3], "DAY", "INT") |
22 |
|
GETSUBDATE
([Q3], "DAY", "CHAR") |
“22” |
|
GETSUBDATE
([Q3], "MO", "INT") |
1 |
|
GETSUBDATE
([Q3], "MO", "CHAR") |
“1” |
|
GETSUBDATE
([Q3], "YR", "INT") |
1997 |
|
GETSUBDATE
([Q3], "YR", "CHAR") |
“1997” |
|
GETSUBDATE
([Q3], "MMYYYY", "CHAR") |
“011997” |
|
GETSUBDATE
({DOB}, "DAY", "XX") |
-999999999 |
Invalid
format (XX) in the parameter "INT"|"CHAR" of the GETSUBDATE
function. |
GETSUBDATE
({DOB}, "XX", "INT") |
-999999999 |
Invalid
format (XX) in the parameter "DAY"|"MO"|"YR|YYYYMM"
of the GETSUBDATE function. |
GETSUBDATE(
Date, Text, ?2
) ? = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression of the GETSUBDATE function. Found: ?2, required: Text. |
GETSUBDATE(
Date, ?1,
Text ) ?2 = Numeric, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter dExpression2 of the GETSUBDATE function. Found: ?1, required: Text. |
GETSUBDATE(
?,
Text, Text ) ? 1 = Numeric, Time,
Text, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter dExpression1 of the GETSUBDATE function. Found: ?, required: Date. |
GETSUBDATE({TODAY},
{DOB}, {NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
GETSUBDATE({TODAY},
{NONEXISTANT}, “YR”) |
-999999999 |
Missing
variable : {NONEXISTANT} |
GETSUBDATE({NONEXISTANT},
{DOB}, “YR”) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
ADDDAYS, ADDYEARS, AGE, CDOW, CREATE CALENDAR, DATE, DATE2DAY, DATE2TEXT, DATE2WK, DATEFORMAT, DIFFAGE, DOW, FINDGAPS IN CALENDAR, FIXDAY, FIXMONTH, FIXYEAR, GOMONTH, ISCOMPLETE, MARK CALENDAR, TEXT2DATE
Returns the date that is a specified number of months before or after a given Date expression.
Syntax
GOMONTH( dExpression, nExpression )
Returns
Date
Arguments
dExpression Specifies a date expression for which GOMONTH( ) returns the date.
nExpression Integer value that specifies the number of months to add from the provided date. If numericExpression is positive, GOMONTH( ) returns a date that is numericExpression months after the date. If numericExpression is negative, GOMONTH( ) returns a date that is numericExpression months before the date.
Examples
{DOB} = 19970122
{MONTHS} = 8
GOMONTH({DOB},{MONTHS}) Returns 19970922
Possible uses
Function |
Result |
Error report |
{LINTDATE} |
20040825 |
|
[QDAYS_3]) |
3 |
|
{THREE} |
3 |
|
[DAYS_S] |
-3 |
|
{MINUS_3} |
-3 |
|
[LDATE] |
20040825 |
|
GOMONTH({LINTDATE},
3) |
20041128 |
|
GOMONTH({LINTDATE},
[QDAYS_3]) |
20041128 |
|
GOMONTH({LINTDATE},
{THREE}) |
20041128 |
|
GOMONTH([LDATE],
-3) |
20040522 |
|
GOMONTH([LDATE],
[DAYS_S]) |
20040522 |
|
GOMONTH([LDATE],
{MINUS_3}) |
20040522 |
|
GOMONTH(
Date, ?) ? = Text, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the GOMONTH function. Found: ?, required: Numeric. |
GOMONTH(
?,
Numeric) ? = Numeric, Text, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter dExpression of the GOMONTH function. Found: ?, required: Date. |
GOMONTH({LINTDATE},
{NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
GOMONTH({NONEXISTANT},
{THREE}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
ADDDAYS, ADDYEARS, AGE, CDOW, CREATE CALENDAR, DATE, DATE2DAY, DATE2TEXT, DATE2WK, DATEFORMAT, DIFFAGE, DOW, FINDGAPS IN CALENDAR, FIXDAY, FIXMONTH, FIXYEAR, GETSUBDATE, ISCOMPLETE, MARK CALENDAR, TEXT2DATE
Returns one of two values depending on the value of the logical expression. This function, evaluates the logical expression and then returns one of two expressions.
If the logical expression evaluates to true, IIF( ) returns the first expression and if the logical expression evaluates to false, IIF( ) returns the second expression.
Syntax
IIF( lExpression, eExpression1, eExpression2 )
Returns
Numeric or Text
Arguments
lExpression Specifies the logical expression that IIF( ) evaluates.
eExpression1, eExpression2 Returned expression. Both have to be of the same type.
Examples
{AGE} = 8
IIF({AGE}>10, 1, 0) Returns 0
Possible uses
Function |
Result |
Error report |
{AGE} |
8 |
|
IIF({AGE}>10,
1, 0) |
0 |
|
IIF({AGE}>15,
"you are a young adult", "you are a child") |
“you
are a child” |
|
IIF({AGE}>10,
DATE("SHORT"), {LINTDATE}) |
20020801 |
|
See Also
> < <= >= == (comparative operator), || (or operator), && (and operator), ! NOT
IIF, ISVAREMPTY, LANGUAGE, READGLOBAL, REPEAT ... UNTIL, SET HEADER TO, SWITCH, SYMBOL, VAREXIST, VARTYPE, WHILE ... ENDWHILE, WRITEGLOBAL
Returns true (1) if the first character expression is contained in the second character expression; otherwise, returns false (0).
Syntax
IN( cExpression1, cExpression2 )
Returns
Numeric
Arguments
cExpression1 Specifies the expression looked for within cExpression2.
cExpression2 Specifies the expression that is searched to see if it contains cExpression1.
Examples
{LNAME} = “Smith”
{FULLNAME} = “Matt Smith”
IN({LNAME}, {FULLNAME}) Returns 1
Possible uses
Function |
Result |
Error report |
{FULLNAME} |
“Woody Allen” |
|
{LNAME} |
“Allen” |
|
[QFULLNAME] |
“Woody Avy” |
|
[QLNAME] |
“Avy” |
|
IN({LNAME},
{FULLNAME}) |
1 |
|
IN({LNAME},
[QFULLNAME]) |
0 |
|
IN({LNAME},
"Woody Allen") |
1 |
|
IN([QLNAME],
{FULLNAME}) |
0 |
|
IN([QLNAME],
[QFULLNAME]) |
1 |
|
IN([QLNAME],
"Woody Avy") |
1 |
|
IN("son",
{FULLNAME}) |
0 |
|
IN("son",
[QFULLNAME]) |
0 |
|
IN("wood",
"Woody Allen") |
0 |
|
IN(
Text, ?2) ?2 = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression2 of the IN function. Found: ?2, required: Text. |
IN(
?1,
Text) ?1 = Numeric, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression1 of the IN function. Found: ?1, required: Text. |
IN({NAME},
{NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
IN({NONEXISTANT},
{NAME}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), ALLTRIM, AT, DATE2TEXT, DECODE, LEN, LOWER, LTRIM, PADL, RAT, STR, STRCMP, SUBSTR, TEXT2DATE, TIME2TEXT, TITLECASE, UPPER, VAL
This command writes out the contents of the specified variable(s) into an INFO table.
The variables will be added in nExpression instrumentID using cExpression1 mode under cExpression2 as the caseID.
The INFO table can be in the current instrument or it can be in another instrument. The caseID has to exist first, so be sure to use ADDCASE function to add the caseID to the USER table first and then use INFOSHEET command to add variables to caseID. If the user table is in another instrument, make sure the other instrument has been launched from Survey to ensure necessary database tables have been setup.
Syntax
INFOSHEET nExpression, cExpression1, cExpression2, Var1, Var2, Var3, ..., Varn
Returns
Numeric (integer: 1 success variables
were added correctly, 0 fail to add the variables)
Arguments
nExpression Specifies the number of the instrument
where to add the variables.
cExpression1 Specifies the mode of the instrument
where to add the variables.
cExpression2 Specifies the caseID to use.
Varx Variable to be added to the INFO table. A variable can be a {Symbol}, {^ArrayElement(({Symbol}|[QName]|Number)^}, {^ArrayName^} or a {*RosterName*}
Examples
INFOSHEET 266, “REAL”, “112345”, {NAME},
{^ANAMES({INDEX})^}, {^AAGES^}
See Also
ADDCASE, INFOSHEET, INSERTFIELDS, SELECTFIELD, UPDATECASE, UPDATEFIELDS, UPDATELOGIN
Determines whether an expression matches another expression in a set of expressions. Returns 1 if the expression was found, otherwise 0.
Syntax
INLIST( {SearchedStr}|[QName]|"STRING"
[,{SearchedStr}|[QName]|"STRING1", ... ,
{SearchedStr}|[QName]|"STRINGn"])
INLIST( {SearchedNo}|[QName]|#NUMBER
[,{SearchedNo}|[QName]|#NUMBER1, ... ,
{SearchedNo}|[QName]|#NUMBERn])
Returns
Numeric
Arguments
{SearchedStr}|[QName]|"STRING" Specifies the character expression to search in the set of expressions.
{SearchedStr}|[QName]|"STRINGn" ] Specifies the set of expressions to search, must include at least one.
{SearchedNo}|[QName]|#NUMBER Specifies the numeric expression to search in the set of expressions.
[,{SearchedNo}|[QName]|#NUMBERn Specifies the set of expressions to search, must include at least one.
Examples
INLIST("Herrera", {LNAME}, "Rodriguez", "Baker") Returns 1
Possible uses
Function |
Result |
Error report |
INLIST("Herrera",
{LNAME}, "Rodriguez", "Baker") |
1 |
|
INLIST("XHerrera",
{LNAME}, "Rodriguez", "Baker") |
0 |
|
INLIST(10,
11, 12, {Y}, {DOM~M}, {*HHI.AGE(4)*}, {NPOS}) |
1 |
|
INLIST(4,
10, 11, 12) |
0 |
|
INLIST("Herrera",
{LNAME}, "Rodriguez", "Baker", {XXX}) |
-999999999 |
Missing
variable : {XXX} |
INLIST("Herrera",
{LNAME}, "Rodriguez", "Baker", {X}) |
-999999999 |
Incompatible
types in InList.parameters[5] Found:Numeric,
required: Text. |
INLIST("Herrera",
{LNAME}, "Rodriguez", "Baker", {*JOBS*}) |
-999999999 |
Incompatible
types in InList.parameters[5] Found:Roster,
required: Text. |
INLIST("Herrera",
{LNAME}, "Baker", {^ANAMES^}) |
-999999999 |
Incompatible
types in InList.parameters[4] Found:Array,
required: Text. |
See Also
BLANK, ISVAREMPTY, SWITCH, SYMBOL, VAREXIST, VARTYPE
Checks if an item was selected in a Code All that Apply question returning true (1) if that item was selected; otherwise, returns false (0).
Syntax
INSELECTION( [QName], nExpression )
Returns
Numeric
Arguments
[QName] Name of the question whose response is to be parsed.
nExpression Long integer expression where the code of the option to search for is stored.
Examples
INSELECTION([QSALL], 3) Returns 1
Possible uses
Function |
Result |
Error report |
[QSALL] |
|
|
Option 1 (selected) |
1 |
|
Option 2 (not selected) |
0 |
|
Option 3 (selected) |
1 |
|
Option 4 (not selected) |
0 |
|
Option 5 (not selected) |
0 |
|
{X} |
3 |
|
[Q6] |
3 |
|
[Q21] |
4 |
|
INSELECTION([QSALL],
3) |
1 |
|
INSELECTION([QSALL],
{X}) |
1 |
|
INSELECTION([QSALL],
[Q6]) |
1 |
|
INSELECTION([QSALL],
[Q21]) |
0 |
|
INSELECTION(
Matrix, ?) ? = Text, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the INSELECTION function. Found: ?, required: Numeric. |
INSELECTION(
?,
Numeric) ? = Numeric, Date, Text,
Time, Roster, Array |
-999999999 |
Incompatible
types in the parameter [QName] of the INSELECTION
function. Found: ?, required: Matrix. |
INSELECTION([QSALL], {NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
INSELECTION({NONEXISTANT},
{X}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
MAXINSELECTION, MININSELECTION, SELECTEDINSELECTION, TOTALINSELECTION
Writes/Adds a row in the specified table.
Syntax
INSERTFIELDS( cExpression1, cExpressionFieldNAME1, cExpressionFieldVALUE1
[, cExpressionFieldNAME2, cExpressionFieldVALUE2
[,… cExpressionFieldNAMEn, cExpressionFieldVALUEn )
Returns
Numeric (1 success values were inserted correctly, 0 fail to insert the values)
Arguments
cExpression1 Specifies the name of the table to write.
cExpressionFieldNAME1 Specifies the name of the field.
cExpressionFieldVALUE1 Specifies the value to set.
Examples
{STREET_ADDRESS} = “254 North High Street”
INSERTFIELDS(“WEB_DATA.ADDRESS”, “STREET”, {STREET_ADDRESS})
Possible uses
Function |
Result |
Error report |
{FNAME} |
“STREET” |
|
{FVALUE} |
“12 N High St” |
|
[Q5] |
“12 N High St” |
|
{^ANAMES(1)^} |
“12 N High St” |
|
{*HHI.NAME(1)*}) |
“12 N High St” |
|
[QFNAME] |
“STREET” |
|
{^ATNAMES(1)^} |
“STREET” |
|
{*HHI.TNAMES(1)*} |
“STREET” |
|
{TABLE} |
“WEB_DATA.ADDRESS” |
|
INSERTFIELDS(“WEB_DATA.ADDRESS”,
{FNAME}, {FVALUE}) |
1 |
|
INSERTFIELDS(“WEB_DATA.ADDRESS”,
{FNAME}, [Q5]) |
1 |
|
INSERTFIELDS(“WEB_DATA.ADDRESS”,
{FNAME}, {^ANAMES(1)^}) |
1 |
|
INSERTFIELDS(“WEB_DATA.ADDRESS”,
{FNAME}, {*HHI.NAME(1)*}) |
1 |
|
INSERTFIELDS(“WEB_DATA.ADDRESS”,
{FNAME}, “12 N High St”) |
1 |
|
INSERTFIELDS(“WEB_DATA.ADDRESS”,
[QFNAME], {FVALUE}) |
1 |
|
INSERTFIELDS(“WEB_DATA.ADDRESS”,
[QFNAME], [Q5]) |
1 |
|
INSERTFIELDS(“WEB_DATA.ADDRESS”,
[QFNAME], {^ANAMES(1)^}) |
1 |
|
INSERTFIELDS(“WEB_DATA.ADDRESS”,
[QFNAME], {*HHI.NAME(1)*}) |
1 |
|
INSERTFIELDS(“WEB_DATA.ADDRESS”,
[QFNAME], “12 N High St”) |
1 |
|
INSERTFIELDS(“WEB_DATA.ADDRESS”
, {^ATNAMES(1)^}, {FVALUE}) |
1 |
|
INSERTFIELDS(“WEB_DATA.ADDRESS”,
{^ATNAMES(1)^}, [Q5]) |
1 |
|
INSERTFIELDS(“WEB_DATA.ADDRESS”,
{^ATNAMES(1)^}, {^ANAMES(1)^}) |
1 |
|
INSERTFIELDS(“WEB_DATA.ADDRESS”,
{^ATNAMES(1)^}, {*HHI.NAME(1)*}) |
1 |
|
INSERTFIELDS(“WEB_DATA.ADDRESS”,
{^ATNAMES(1)^}, “12 N High St”) |
1 |
|
INSERTFIELDS(“WEB_DATA.ADDRESS”
, “STREET”, {FVALUE}) |
1 |
|
INSERTFIELDS(“WEB_DATA.ADDRESS”,
“STREET”, [Q5]) |
1 |
|
INSERTFIELDS(“WEB_DATA.ADDRESS”,
“STREET”, {^ANAMES(1)^}) |
1 |
|
INSERTFIELDS(“WEB_DATA.ADDRESS”,
“STREET”, {*HHI.NAME(1)*}) |
1 |
|
INSERTFIELDS(“WEB_DATA.ADDRESS”,
“STREET”, “12 N High St”) |
1 |
|
INSERTFIELDS(“WEB_DATA.ADDRESS”,
{*HHI.TNAMES(1)*}, {FVALUE}) |
1 |
|
INSERTFIELDS(“WEB_DATA.ADDRESS”,
{*HHI.TNAMES(1)*}, [Q5]) |
1 |
|
INSERTFIELDS(“WEB_DATA.ADDRESS”,
{*HHI.TNAMES(1)*}, {^ANAMES(1)^}) |
1 |
|
INSERTFIELDS(“WEB_DATA.ADDRESS”,
{*HHI.TNAMES(1)*}, {*HHI.NAME(1)*}) |
1 |
|
INSERTFIELDS(“WEB_DATA.ADDRESS”,
{*HHI.TNAMES(1)*}, “12 N High St”) |
1 |
|
INSERTFIELDS({TABLE},
{*HHI.TNAMES(1)*}, {FVALUE}) |
1 |
|
INSERTFIELDS({TABLE},
{*HHI.TNAMES(1)*}, [Q5]) |
1 |
|
INSERTFIELDS({TABLE},
{*HHI.TNAMES(1)*}, {^ANAMES(1)^}) |
1 |
|
INSERTFIELDS({TABLE},
{*HHI.TNAMES(1)*}, {*HHI.NAME(1)*}) |
1 |
|
INSERTFIELDS({TABLE},
{*HHI.TNAMES(1)*}, “12 N High St”) |
1 |
|
INSERTFIELDS( Numeric, Text, ?3) ?3 = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression3 of the INSERTFIELDS function.
Found: ?3,
required: Text. |
INSERTFIELDS( Numeric, ?2,
Text) ?2 = Numeric, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression2 of the INSERTFIELDS function.
Found: ?2,
required: Text. |
INSERTFIELDS( ?1, Text, Text) ?1 = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression1 of the INSERTFIELDS function.
Found: ?1,
required: Text. |
INSERTFIELDS({INST_ID}, {INST_MODE},
{NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
INSERTFIELDS({INST_ID}, {NONEXISTANT},
{NEW_CASEID}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
INSERTFIELDS({NONEXISTANT}, {INST_MODE},
{NEW_CASEID}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
ADDCASE, INFOSHEET, INSERTFIELDS, SELECTFIELD, UPDATECASE, UPDATEFIELDS, UPDATELOGIN
Evaluates a numeric expression and returns the integer portion of the expression.
Syntax
INT( nExpression )
Returns
Numeric
Arguments
nExpression Specifies the numeric expression for which INT( ) returns the integer portion.
Examples
INT(0.5) Returns 0
INT(20.33) Returns 20
INT(12.7) Returns 12
Possible uses
Function |
Result |
Error report |
{ANGLE} |
0.5 |
|
[QANGLE] |
0.5 |
|
[QSALARY] |
3,455.88 |
|
INT({ANGLE}) |
0 |
|
INT([QANGLE]) |
0 |
|
INT(-0.5) |
0 |
|
INT([QSALARY]) |
3455 |
|
INT(
?
) ? = Date, Time, Text,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the INT function. Found: ?, required: Numeric. |
INT({NONEXSITANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), - (subtraction operator), * (multiplication operator), / (division operator), ^ (exponentiation operator), ABS, ACOS, ANGLE, ASIN, ATAN, CODE, COS, LOG, MAX, MIN, MOD, RAND, ROUND, SIN, TAN, VAL, WEEKLYWAGE
Checks to determine if a date is complete or if there is a negative value in it. A negative value this means that a -2 "Don't Know" or a -1 "Refuse" response was entered.
Syntax
ISCOMPLETE( dExpression )
Returns
Numeric
Arguments
dExpression Date expression to check.
Examples
{TODAY} = 20130313
ISCOMPLETE({TODAY}) Returns 1
Possible uses
Function |
Result |
Error
report |
{DOB} |
20130313 |
|
[Q2] |
2013-201 |
|
ISCOMPLETE({DOB}) |
1 |
|
ISCOMPLETE([Q2]) |
0 |
|
ISCOMPLETE( ? ) ? = Numeric, Time,
Text, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter dExpression of the ISCOMPLETE function. Found: ?,
required: Date. |
ISCOMPLETE({NONEXSITANT}) |
-999999999 |
Missing variable : {NONEXISTANT} |
ADDDAYS, ADDYEARS, AGE, CDOW, CREATE CALENDAR, DATE, DATE2DAY, DATE2TEXT, DATE2WK, DATEFORMAT, DIFFAGE, DOW, FINDGAPS IN CALENDAR, FIXDAY, FIXMONTH, FIXYEAR, GETSUBDATE, GOMONTH, MARK CALENDAR, TEXT2DATE
Checks to determine if a time variable is complete or if there is a negative value in it. A negative value means that a -2 "Don't Know" or a -1 "Refuse" response was entered.
Syntax
ISTIMECOMPLETE( tExpression )
Returns
Numeric
Arguments
tExpression Time expression to check.
Examples
{WAKET} = 07:00AM
ISTIMECOMPLETE({WAKET}) Returns 1
Possible uses
Function |
Result |
Error
report |
{WAKEUP} |
0700AM |
|
[BEDTIME] |
10-2PM |
|
ISTIMECOMPLETE({DOB}) |
1 |
|
ISTIMECOMPLETE([Q2]) |
0 |
|
ISTIMECOMPLETE( ? ) ? = Numeric, Date,
Text, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter tExpression of the ISTIMECOMPLETE function.
Found: ?,
required: Time. |
ISTIMECOMPLETE({NONEXSITANT}) |
-999999999 |
Missing variable : {NONEXISTANT} |
See Also
Determines whether the contents of a variable evaluates to empty. If empty returns true (1), otherwise false (0).
Syntax
ISVAREMPTY( {SymbolName}|[QName] )
Returns
Numeric
Arguments
{SymbolName} | [QName] Variable to check.
Examples
ISVAREMPTY({EMPTYVAR}) Returns 1
Possible uses
Function |
Result |
Error report |
{EMPTYVAR} |
|
|
[QEMPTY] |
|
|
{NAME} |
|
|
[QFULLNAME] |
“Mary Smith” |
|
ISVAREMPTY({EMPTYVAR}) |
1 |
|
ISVAREMPTY([QEMPTY]) |
1 |
|
ISVAREMPTY({NAME}) |
1 |
|
ISVAREMPTY([QFULLNAME]) |
0 |
|
ISVAREMPTY( ? ) ? = Roster, Array |
-999999999 |
Incompatible
types in the parameter variable of the ISVAREMPTY function. Found: ?,
required: Numeric, Date, Time, Text or Matrix. |
ISVAREMPTY({NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
ISVAREMPTY([XXX]) |
-999999999 |
Missing
variable : [XXX] |
See Also
FOR ... ENDFOR, IIF, LANGUAGE, READGLOBAL, REPEAT ... UNTIL, SET HEADER TO, SWITCH, SYMBOL, VAREXIST, VARTYPE, WHILE ... ENDWHILE, WRITEGLOBAL
BLANK, INLIST, SWITCH, SYMBOL, VAREXIST, VARTYPE
Sets or changes the active language.
Syntax
LANGUAGE( nExpression )
Returns
Numeric (1 of the language got changed successfully otherwise 0).
Arguments
nExpression Numeric expression that can be any value representing a language (code).
Examples
{LANG} = 2
LANGUAGE(52) Sets the language to Creole and returns 1.
LANGUAGE(1) Sets the language to English and returns 1.
LANGUAGE({LANG}) Sets the language to Spanish and returns 1.
Possible uses
Function |
Result |
Error report |
{LANG} |
2 |
|
[SELECT_LANG] |
52 |
|
LANGUAGE({LANG}) |
1 |
|
LANGUAGE([SELECT_LANG]) |
1 |
|
LANGUAGE(16) |
1 |
|
LANGUAGE( ? ) ? = Date, Time, Text,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the LANGUAGE function. Found: ?,
required: Numeric. |
LANGUAGE({NONEXSITANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
FOR ... ENDFOR, IIF, ISVAREMPTY, READGLOBAL, REPEAT ... UNTIL, SET HEADER TO, SWITCH, SYMBOL, VAREXIST, VARTYPE, WHILE ... ENDWHILE, WRITEGLOBAL
Returns the number of characters in a character expression.
Syntax
LEN( cExpression )
Returns
Numeric
Arguments
cExpression Specifies the character expression for which LEN() returns the number of characters..
Examples
LEN([QFULLNAME]) Returns 27
Possible uses
Function |
Result |
Error report |
{FULLNAME} |
“Luisa Lane “ |
|
[QFNAME] |
“Pete Rivers” |
|
LEN({FULLNAME}) |
10 |
|
LEN([QFNAME]) |
11 |
|
LEN("
Hi, how are you?") |
16 |
|
LEN(
?
) ? = Numeric, Date,
Time, Array, Roster, Matrix |
-999999999 |
Incompatible
types in the parameter array of the LEN function. Found: ?, required: Text. |
LEN({NONEXSITANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), ALLTRIM, AT, DATE2TEXT, DECODE, IN, LOWER, LTRIM, PADL, RAT, STR, STRCMP, SUBSTR, TEXT2DATE, TIME2TEXT, TITLECASE, UPPER, VAL
Returns the natural logarithm (base e) of the specified numeric expression.
Syntax
LOG( nExpression )
Returns
Numeric
Arguments
nExpression Specifies the numeric expression for which LOG( ) returns the value of x in the equation e^x = nExpression. nExpression must be greater than 0.
Examples
LOG([NPOS]) Returns 2.302585093
Possible uses
Function |
Result |
Error report |
{NUMBER} |
10 |
|
[QVALUE] |
10 |
|
LOG({NUMBER}) |
2.302585093 |
|
LOG([VALUE]) |
2.302585093 |
|
LOG(10) |
2.302585093 |
|
LOG(
?
) ? = Date, Time, Text,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the LOG function. Found: ?, required: Numeric. |
LOG({NONEXSITANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), - (subtraction operator), * (multiplication operator), / (division operator), ^ (exponentiation operator), ABS, ACOS, ANGLE, ASIN, ATAN, CODE, COS, INT, MAX, MIN, MOD, RAND, ROUND, SIN, TAN, VAL, WEEKLYWAGE
Logical operators work with numeric data types. The function returns a logical value, 1 is true, and 0 is false. The following table lists the logical operators.
Operator |
Action |
Examples |
NOT, ! |
Logical negative |
NOT(25
< 33) !(25 < 33) |
&& |
Logical AND |
(1 > 2) && (22 == 22) |
|| |
Logical OR |
(1 > 2) || (22 == 22) |
Syntax
nExpression1 || nExpression2
nExpression1 && nExpression2
!nExpression
NOT(nExpression)
Returns
Numeric (1 if true, 0 if false)
Arguments
nExpression1 First numeric expression that will be evaluated.
nExpression2 Second numeric expression that will be evaluated.
Examples
(23 < 54) || (44 == 22) Returns 1
(1 > 2) || (23 == 21) Returns 0
(23 < 54) && (22 == 22) Returns 1
(1 > 2) && (23 == 21) Returns 0
!(23 < 54) Returns 0
!(1 > 2) || (23 == 21) Returns 1
See Also
> < <= >= == (comparative operator), IIF, ! NOT
Returns the specified character expression in lowercase letters. LOWER() converts all uppercase letters (A – Z) in the character expression to lowercase (a - z). All other characters in the character expression remain unchanged
Syntax
LOWER( cExpression )
Returns
Text
Arguments
cExpression Specifies the character expression LOWER() converts to lowercase.
Examples
LOWER(“ABCDEFGH”) Returns abcdefg
LOWER(“My house is red”) Returns my house is red
Possible uses
Function |
Result |
Error report |
{FULLNAME} |
“Luisa Lane “ |
|
[QFNAME] |
“Pete Rivers” |
|
LOWER({FULLNAME}) |
“luisa
lane” |
|
LOWER([QFNAME]) |
“pete
rivers” |
|
LOWER("
Hi, how are you?") |
“hi,
how are you?” |
|
LOWER(
?
) ? = Numeric, Date,
Time, Array, Roster, Matrix |
-999999999 |
Incompatible
types in the parameter array of the LOWER function. Found: ?, required: Text. |
LOWER({NONEXSITANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), ALLTRIM, AT, DATE2TEXT, DECODE, IN, LEN, LTRIM, PADL, RAT, STR, STRCMP, SUBSTR, TEXT2DATE, TIME2TEXT, TITLECASE, UPPER, VAL
Returns the specified character expression with leading blanks removed.
Syntax
LTRIM( cExpression )
Returns
Text
Arguments
cExpression Variable specifying the source character expression.
Examples
{RNAME} = “ Jeff Smith”
LTRIM({RNAME}) Returns “Jeff Smith”
Possible uses
Function |
Result |
Error report |
{FULLNAME} |
“Luisa Lane “ |
|
[QFNAME] |
“ Pete Rivers” |
|
LTRIM({FULLNAME}) |
Luisa
Lane |
|
LTRIM([QFNAME]) |
Pete
Rivers |
|
LTRIM("
Hi, how are you? ") |
Hi,
how are you? |
|
LTRIM(
?
) ? = Numeric, Date,
Time, Array, Roster, Matrix |
-999999999 |
Incompatible
types in the parameter array of the LTRIM function. Found: ?, required: Text. |
LTRIM({NONEXSITANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), ALLTRIM, AT, DATE2TEXT, DECODE, IN, LEN, LOWER, PADL, RAT, STR, STRCMP, SUBSTR, TEXT2DATE, TIME2TEXT, TITLECASE, UPPER, VAL
This command marks a range of dates on a calendar. If the periods overlap, marking them produces a continuous marked range.
Syntax
MARK CALENDAR {*CalendarName*} FROM dExpression1 TO dExpression2
Returns
Numeric (integer: 1 success, calendar
got marked correctly, 0 fail to mark the calendar)
Arguments
{*CalendarName*} Name of the calendar to be marked.
dExpression1 Beginning
date. May be a variable (symbol, question name, array element, roster element)
or a date constant in the “yyyymmdd” format.
dExpression2 Terminating date. May be a variable (symbol, question name, array element, roster element) or a date constant in the “yyyymmdd” format.
Examples
For example, in tracking employment history, this can be used to mark off each period of employment on the calendar.
MARK CALENDAR {*JOBS*} FROM {STARTDATE} TO {ENDDATE}
See Also
ADDDAYS, ADDYEARS, AGE, CDOW, CREATE CALENDAR, DATE, DATE2DAY, DATE2TEXT, DATE2WK, DATEFORMAT, DIFFAGE, DOW, FINDGAPS IN CALENDAR, FIXDAY, FIXMONTH, FIXYEAR, GETSUBDATE, GOMONTH, ISCOMPLETE, TEXT2DATE
Evaluates a set of numeric expressions and returns the numeric expression with the maximum value.
Syntax
MAX( nExpression1, nExpression2 [, nExpression3 ...] )
Returns
Numeric
Arguments
nExpression Specify the expressions from which you want MAX( ) to return the expression with the highest value. All the expressions must be of the same data type (numeric).
Examples
MAX(1, 33, -3, 9483) Returns 9483
Possible uses
Function |
Result |
Error report |
{^AAGES(1)^} |
10 |
|
{^AAGES (2)^} |
33 |
|
{^AAGES (3)^} |
21 |
|
[SALARY(1)] |
1230 |
|
[SALARY(2)] |
3100 |
|
[SALARY(3)] |
890 |
|
[SALARY(4)] |
3388 |
|
MAX({^AGES(1)^},{^AGES(2)^},{^AGES(3)^}) |
33 |
|
MAX([QSALARY(1)],
[QSALARY(2)], [QSALARY(3)], [QSALARY(4)]) |
3388 |
|
MAX(88,20,
{^AGES(1)^},{^AGES(2)^},{^AGES(3)^}) |
88 |
|
MAX(15,
{^AAGES(2)^}) |
33 |
|
MAX(15,
[SALARY(4)]) |
3388 |
|
MAX(15,
20) |
15 |
|
MAX(
Numeric, Numeric, ? ) ? = Date, Time, Text,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the MAX function. Found: ?, required: Numeric. |
MAX({^AAGES(1)^},
{NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), - (subtraction operator), * (multiplication operator), / (division operator), ^ (exponentiation operator), ABS, ACOS, ANGLE, ASIN, ATAN, CODE, COS, INT, LOG, MIN, MOD, RAND, ROUND, SIN, TAN, VAL, WEEKLYWAGE
Evaluates all the elements selected in a Select All that apply question and returns the expression with the maximum value.
Syntax
MAXINSELECTION( [QName] )
Returns
Numeric
Arguments
[QName] Name of the question whose response is to be evaluated to find the maximum element selected.
Examples
MAXINSELECTION([QSALL]) Returns 7
Possible uses
Function |
Result |
Error report |
[QSALL] |
|
|
Option 1 (selected) |
1 |
|
Option 2 (not selected) |
0 |
|
Option 3 (selected) |
1 |
|
Option 4 (not selected) |
0 |
|
Option 5 (not selected) |
0 |
|
MAXINSELECTION([QSALL]) |
3 |
|
MAXINSELECTION( ? ) ? = Numeric, Date, Text,
Time, Roster, Array |
-999999999 |
Incompatible
types in the parameter [QName] of the MAXINSELECTION function. Found: ?, required: Matrix. |
MAXINSELECTION({NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
INSELECTION, MININSELECTION, SELECTEDINSELECTION, TOTALINSELECTION
Evaluates a set of numeric expressions and returns the numeric expression with the minimum value.
Syntax
MIN( nExpression1, nExpression2 [, nExpression3 ...] )
Returns
Numeric
Arguments
nExpression Specify the expressions from which you want MIN( ) to return the expression with the lowest value. All the expressions must be of the same data type (numeric).
Examples
MIN(1, 33, -3, 9483) Returns -3
Possible uses
Function |
Result |
Error report |
{^AAGES(1)^} |
10 |
|
{^AAGES (2)^} |
33 |
|
{^AAGES (3)^} |
21 |
|
[SALARY(1)] |
1230 |
|
[SALARY(2)] |
3100 |
|
[SALARY(3)] |
890 |
|
[SALARY(4)] |
3388 |
|
MIN({^AGES(1)^},{^AGES(2)^},{^AGES(3)^}) |
10 |
|
MIN([QSALARY(1)],
[QSALARY(2)], [QSALARY(3)], [QSALARY(4)]) |
890 |
|
MIN(88,20,
{^AGES(1)^},{^AGES(2)^},{^AGES(3)^}) |
10 |
|
MIN(15,
{^AAGES(2)^}) |
15 |
|
MIN(15,
[SALARY(4)]) |
15 |
|
MIN(15,
20) |
15 |
|
MIN(
Numeric, Numeric, ? ) ? = Date, Time, Text,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the MIN function. Found: ?, required: Numeric. |
MIN({^AAGES(1)^},
{NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), - (subtraction operator), * (multiplication operator), / (division operator), ^ (exponentiation operator), ABS, ACOS, ANGLE, ASIN, ATAN, CODE, COS, INT, LOG, MAX, MOD, RAND, ROUND, SIN, TAN, VAL, WEEKLYWAGE
Evaluates all the elements selected in a Select All that apply question and returns the expression with the minimum value.
Syntax
MININSELECTION( [QName] )
Returns
Numeric
Arguments
[QName] Name of the question whose response is to be evaluated to find the minimum element selected.
Examples
MININSELECTION([QSALL]) Returns 1
Possible uses
Function |
Result |
Error report |
[QSALL] |
|
|
Option 1 (selected) |
1 |
|
Option 2 (not selected) |
0 |
|
Option 3 (selected) |
1 |
|
Option 4 (not selected) |
0 |
|
Option 5 (not selected) |
0 |
|
MININSELECTION([QSALL]) |
1 |
|
MININSELECTION( ? ) ? = Numeric, Date, Text,
Time, Roster, Array |
-999999999 |
Incompatible
types in the parameter [QName] of the MININSELECTION function. Found: ?, required: Matrix. |
MININSELECTION({NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
INSELECTION, MAXINSELECTION, SELECTEDINSELECTION, TOTALINSELECTION
Divides one numeric expression by another numeric expression and returns the remainder.
Syntax
MOD( nExpression1, nExpression2 )
Returns
Numeric
Arguments
nExpression1 Specifies a numeric expression, the dividend.
nExpression2 Specifies a numeric expression, the divisor. This value can’t be 0.
Examples
MOD(20, 10) Returns 0
MOD(10, 30) Returns 10
Possible uses
Function |
Result |
Error report |
{GROUPSIZE} |
10 |
|
{PAIR} |
2 |
|
[THIRD] |
3 |
|
MOD({GROUPSIZE},
{PAIR}) |
0 |
|
MOD({GROUPSIZE},
[THIRD]) |
1 |
|
MOD({GROUPSIZE},
4) |
2 |
|
MOD([THIRD],
{PAIR}) |
1 |
|
MOD([THIRD],
[THIRD]) |
0 |
|
MOD([THIRD],
10) |
3 |
|
MOD(15,
{PAIR}) |
1 |
|
MOD(15,
[THIRD]) |
0 |
|
MOD(15,
10) |
5 |
|
MOD(
Numeric, ?2) ?2 = Date, Text, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression2 of the MOD function. Found: ?2, required: Numeric. |
MOD
( ?1,
Numeric) ?1 = Date, Text, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression1 of the MOD function. Found: ?1, required: Numeric. |
MOD({X1},
{NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
MOD({NONEXISTANT},
{Y1}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), - (subtraction operator), * (multiplication operator), / (division operator), ^ (exponentiation operator), ABS, ACOS, ANGLE, ASIN, ATAN, CODE, COS, INT, LOG, MAX, MIN, RAND, ROUND, SIN, TAN, VAL, WEEKLYWAGE
Returns the multiplication of two values.
Syntax
nExpression1 * nExpression2
Returns
Numeric
Arguments
nExpression1 Specifies a numeric expression.
nExpression2 Specifies a numeric expression.
Examples
20 * 10 Returns 200
2 * 30 Returns 60
Possible uses
Function |
Result |
Error report |
{SALARY} |
3000 |
|
{MONTHS} |
12 |
|
[Q243] |
12 |
|
[Q100] |
3000 |
|
{SALARY}
* {MONTHS} |
36000 |
|
{SALARY}
* [Q243] |
36000 |
|
{SALARY}
* 100 |
300000 |
|
[Q100]
* {MONTHS} |
36000 |
|
[Q100]
* [Q243] |
36000 |
|
[Q100]
* 100 |
300000 |
|
30000
* {MONTHS} |
36000 |
|
30000
* [Q243] |
36000 |
|
30000
* 100 |
300000 |
|
100
* {NONEXISTANT} |
-999999999 |
Missing
variable : {NONEXISTANT} |
“Hi
“ * 125 |
-999999999 |
Incompatible
operands in the addition ( * ) function. |
See Also
+ (additive operator), - (subtraction operator), / (division operator), ^ (exponentiation operator), ABS, ACOS, ANGLE, ASIN, ATAN, CODE, COS, INT, LOG, MAX, MIN, MOD, RAND, ROUND, SIN, TAN, VAL, WEEKLYWAGE
Returns the negative value of a logical expression.
Syntax
!lExpression
Returns
Numeric
Arguments
lExpression Specifies a logical expression.
Examples
!(10 == 10) Returns 0
!(-20 != -20) Returns 1
Possible uses
Function |
Result |
Error report |
{NPOS} |
10 |
|
[QYCORD] |
5 |
|
{NNEG} |
-3 |
|
[QNNEG] |
-8 |
|
{NAME} |
“Mary” |
|
!(10
== 10) |
0 |
|
!({NPOS}
== {NPOS}) |
0 |
|
!([QYCORD]
!= [QYCORD]) |
1 |
|
!(-20
!= -20) |
1 |
|
!({NNEG}
> {NNEG}) |
1 |
|
!([QNNEG]
== [QNNEG]) |
0 |
|
!({NAME}) |
-999999999 |
Incompatible
operands in the negative ( ! )
function. |
!({NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
> < <= >= == (comparative operator), IIF, || (or operator), && (and operator)
Returns a text from an expression, padded with spaces or characters to a specified length on the left side.
Syntax
PADL( cExpression1, nExpression, cExpression2 )
Returns
Text
Arguments
cExpression1 Specifies the expression to be padded.
nExpression Integer value that specifies the total number of characters in the expression after it is padded.
cExpression2 Specifies the value to use for padding. This value is repeated as necessary to pad the expression to the specified number of characters.
Examples
{RNAME} = “Jeff Smith”
PADL({RNAME}, 15, “ “) Returns “ Jeff Smith”
Possible uses
Function |
Result |
Error report |
{NAME} |
“Lucy” |
|
{SPACE} |
“ “ |
|
[QSPACE] |
“ “ |
|
{TOTALCHARS} |
8 |
|
[LENGTH] |
12 |
|
[Q24] |
“Good morning” |
|
{V20} |
20 |
|
[QV20] |
20 |
|
PADL({NAME},
10, "X") |
“XXXXXXLucy” |
|
PADL({NAME},
10, {SPACE}) |
“ Lucy” |
|
PADL({NAME},
10, [QSPACE]) |
“ Lucy” |
|
PADL({NAME},
{TOTALCHARS}, "X") |
“XXXXLucy” |
|
PADL({NAME},
{TOTALCHARS}, {SPACE}) |
“ Lucy” |
|
PADL({NAME},
{TOTALCHARS}, [QSPACE]) |
“ Lucy” |
|
PADL({NAME},
[LENGTH]], "X") |
“XXXXXXXXLucy” |
|
PADL({NAME},
[LENGTH], {SPACE}) |
“ Lucy” |
|
PADL({NAME},
[LENGTH], [QSPACE]) |
“ Lucy” |
|
PADL([Q24],
20, "X") |
“XXXXXXXXGood
morning” |
|
PADL([Q24],
20, {SPACE}) |
“ Good morning” |
|
PADL([Q24],
20, [QSPACE]) |
“ Good morning” |
|
PADL([Q24],
{V20}, "X") |
“XXXXXXXXGood
morning” |
|
PADL([Q24],
{V20}, {SPACE}) |
“ Good morning” |
|
PADL([Q24],
{V20}, [QSPACE]) |
“ Good morning” |
|
PADL([Q24],
[QV20], "X") |
“XXXXXXXXGood
morning” |
|
PADL([Q24],
[QV20], {SPACE}) |
“ Good morning” |
|
PADL([Q24],
[QV20], [QSPACE]) |
“ Good morning” |
|
PADL(
Text, Numeric, ?2) ?2 = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression2 of the PADL function. Found: ?2, required: Text. |
PADL(
Text, ?,
Text) ? = Text, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the PADL function. Found: ?, required: Numeric. |
PADL(
?1,
Numeric, Text ) ?1 = Numeric, Date, Time,
Roster, Array,Matrix |
-999999999 |
Incompatible
types in the parameter cExpression1 of the PADL function. Found: ?1 required: Text. |
PADL({NAME},
{NAME}, {NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
PADL({NAME},
{NONEXISTANT}, {NAME}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
PADL({NONEXISTANT},
{NAME}, {NAME}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
See Also
+ (additive operator), ALLTRIM, AT, DATE2TEXT, DECODE, IN, LEN, LOWER, LTRIM, RAT, STR, STRCMP, SUBSTR, TEXT2DATE, TIME2TEXT, TITLECASE, UPPER, VAL
Returns a random number between 0 and 1.
Syntax
RAND( 0 )
Returns
Numeric
Examples
RAND(0) Returns 0.4332
Possible uses
Function |
Result |
Error report |
RAND(0) |
0.7382 |
|
RAND( ? ) ? = Date, Time, Text,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the RAND
function. Found: ?, required: Numeric. |
RAND({NONEXSITANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), - (subtraction operator), * (multiplication operator), / (division operator), ^ (exponentiation operator), ABS, ACOS, ANGLE, ASIN, ATAN, CODE, COS, INT, LOG, MAX, MIN, MOD, ROUND, SIN, TAN, VAL, WEEKLYWAGE
Returns the numeric position of the last (rightmost) occurrence of a character string within another character string. Left most character position is 0.
Syntax
RAT( cExpression1, cExpression2, nExpression )
Returns
Numeric
Arguments
cExpression1 Specifies the character expression that RAT( ) looks for in cExpression2.
cExpression2 Specifies the character expression that RAT( ) searches.
nExpression Integer value that specifies which occurrence, starting from the right and moving left, of cExpression1 RAT( ) searches for in cExpression2. If nOccurrence is 2, RAT( ) searches for the next to last occurrence, and so on.
Examples
{NAME} = “Marry Johnson John”
{LNAME} = “John”
RAT({NAME}, {LNAME}, 1) Returns 15
RAT(“Lee Ivy Lee”, “Lee”, 1) Returns 9
Possible uses
Function |
Result |
Error report |
{FULLNAME} |
“Maria Smith” |
|
{MLETTER} |
“m” |
|
{X} |
1 |
|
[ILETTER] |
I |
|
[Q20] |
2 |
|
[QFULLNAME] |
“Sandra Lee” |
|
RAT({FULLNAME},
{MLETTER}, {X}) |
8 |
|
RAT({FULLNAME},
{MLETTER},[Q20]) |
1 |
|
RAT({FULLNAME},
{MLETTER}, 1) |
8 |
|
RAT({FULLNAME},
[ILETTER], {X}) |
9 |
|
RAT({FULLNAME},
[ILETTER], [Q20]) |
4 |
|
RAT({FULLNAME},
[ILETTER], 1) |
9 |
|
RAT({FULLNAME},
"a", {X}) |
5 |
|
RAT({FULLNAME},
"a", [Q20]) |
2 |
|
RAT({FULLNAME},
"a", 1) |
5 |
|
RAT([QFULLNAME],
{MLETTER}, {X}) |
0 |
|
RAT([QFULLNAME],
{MLETTER},[Q20]) |
0 |
|
RAT([QFULLNAME],
{MLETTER}, 1) |
0 |
|
RAT([QFULLNAME],
[ILETTER], {X}) |
0 |
|
RAT([QFULLNAME],
[ILETTER], [Q20]) |
0 |
|
RAT([QFULLNAME],
[ILETTER], 1) |
0 |
|
RAT([QFULLNAME],
"e”, {X}) |
9 |
|
RAT([QFULLNAME],
“e", [Q20]) |
9 |
|
RAT([QFULLNAME],
"e", 1) |
9 |
|
RAT("Annie
Marie Smith", {MLETTER}, {X}) |
14 |
|
RAT("Annie
Marie Smith", {MLETTER},[Q20]) |
7 |
|
RAT("Annie
Marie Smith", {MLETTER}, 1) |
14 |
|
RAT("Annie
Marie Smith", [ILETTER], {X}) |
15 |
|
RAT("Annie
Marie Smith", [ILETTER], [Q20]) |
4 |
|
RAT("Annie
Marie Smith", [ILETTER], 1) |
15 |
|
RAT("Annie
Marie Smith", "Smith", {X}) |
13 |
|
RAT("Annie
Marie Smith", "Smith", [Q20]) |
0 |
|
RAT("Annie
Marie Smith", "Smith", 1) |
13 |
|
RAT(
Text, Text, ?) ? = Text, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the RAT function. Found: ?, required: Numeric. |
RAT(
Text, ?2,
Numeric) ?2 = Numeric, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression2 of the RAT function. Found: ?2, required: Text. |
RAT(
?1,
Text, Numeric ) ?1 = Numeric, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression1 of the RAT function. Found: ?, required: Text. |
RAT({NAME},
{NAME}, {NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
RAT({NAME},
{NONEXISTANT}, {NAME}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
RAT({NONEXISTANT},
{NAME}, {NAME}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), ALLTRIM, AT, DATE2TEXT, DECODE, IN, LEN, LOWER, LTRIM, PADL, STR, STRCMP, SUBSTR, TEXT2DATE, TIME2TEXT, TITLECASE, UPPER, VAL
Reads the contents of an ascii file.
Syntax
READFILE( cExpression, nExpression1, nExpression2 )
Returns
Numeric
Arguments
cExpression Name of the file to which the character string is read from. Include a path with the file name if the file is in a directory other than the default directory.
nExpression1 Specifies the number of bytes to move the file pointer.
nExpression2 Specifies the number of bytes returned with a limit of 65,535 bytes.
READFILE( ) returns data starting from the current file pointer position and continues until it returns nBytes bytes or until it encounters the end of the file.
Examples
READFILE([QFNAME], 0, 12) Returns “13245 Miller”
Possible uses
Function |
Result |
Error report |
{FNAME} |
“C:\TEMP.TXT" |
|
{FROM} |
0 |
|
{TO} |
3 |
|
[GET_TOTCHAR] |
3 |
|
[GET_FROM] |
0 |
|
READFILE("C:\TEMP.TXT", {FROM}, {TO}) |
“Sta“ |
|
READFILE("C:\TEMP.TXT", {FROM}, [GET_TOTCHAR]) |
“Sta“ |
|
READFILE("C:\TEMP.TXT", {FROM}, 3) |
“Sta“ |
|
READFILE("C:\TEMP.TXT", [GET_FROM], {TO}) |
“Sta“ |
|
READFILE("C:\TEMP.TXT", [GET_FROM], [GET_TOTCHAR]) |
“Sta“ |
|
READFILE("C:\TEMP.TXT", [GET_FROM], 3) |
“Sta“ |
|
READFILE("C:\TEMP.TXT", 0, {TO}) |
“Sta“ |
|
READFILE("C:\TEMP.TXT", 0, [GET_TOTCHAR]) |
“Sta“ |
|
READFILE("C:\TEMP.TXT", 0, 3) |
“Sta“ |
|
READFILE({FNAME}, {FROM}, {TO}) |
“Sta“ |
|
READFILE({FNAME}, {FROM}, [GET_TOTCHAR]) |
“Sta“ |
|
READFILE({FNAME}, {FROM}, 3) |
“Sta“ |
|
READFILE({FNAME}, [GET_FROM], {TO}) |
“Sta“ |
|
READFILE({FNAME}, [GET_FROM], [GET_TOTCHAR]) |
“Sta“ |
|
READFILE({FNAME}, [GET_FROM], 3) |
“Sta“ |
|
READFILE({FNAME}, 0, {TO}) |
“Sta“ |
|
READFILE({FNAME}, 0, [GET_TOTCHAR]) |
“Sta“ |
|
READFILE({FNAME}, 0, 3) |
“Sta“ |
|
READFILE(
Numeric, Text, ?2) ?2 = Date, Text, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression2 of the READFILE function. Found: ?2, required: Numeric. |
READFILE(
Numeric, ?1,
Text) ?1 = Date, Text, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression1 of the READFILE function. Found: ?1, required: Numeric. |
READFILE(
?,
Text, Text) ? = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression of the READFILE function. Found: ?, required: Text. |
READFILE(“C:\TEMP.TXT”,
0, {NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
READFILE(“C:\TEMP.TXT”,
{NONEXISTANT}, 5) |
-999999999 |
Missing
variable : {NONEXISTANT} |
READFILE({NONEXISTANT},
0, 5) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
APPENDTOFILE, COPYFILE,
DELETEFILE, FILE
Reads a global symbol value. A global symbol exists only once in the answers, so if a different value is set, previous value will be overwritten. The global symbol value is accessible in every scope.
Syntax
READGLOBAL( {SymbolName} )
Returns
Numeric, Date, Text, Time
Arguments
{SymbolName} Symbol name of the global variable to read.
Examples
READGLOBAL({IS_SAQ_HIT}) Returns 1
Possible uses
Function |
Result |
Error report |
{NAME_PROVIDED}] |
1 |
|
READGLOBAL({NAME_PROVIDED}) |
1 |
|
READGLOBAL( ? ) ? = Roster, Array |
-999999999 |
Incompatible
types in the parameter {SymbolName} of
the READGLOBAL function. Found: ?, required: Numeric, Date, Text or Time. |
READGLOBAL({NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
FOR ... ENDFOR, IIF, ISVAREMPTY, LANGUAGE, REPEAT ... UNTIL, SET HEADER TO, SWITCH, SYMBOL, VAREXIST, VARTYPE, WHILE ... ENDWHILE, WRITEGLOBAL
Counts the number of records in a roster.
Syntax
RECCOUNT( {*RosterName*} )
Returns
Numeric
Arguments
{*RosterName*} Name of the roster to search.
Examples
RECCOUNT({*JOBS*}) Returns 6
Possible uses
Function |
Result |
Error report |
RECCOUNT({*HHI*}) |
4 |
|
RECCOUNT({*OLDHHI*}) |
5 |
|
RECCOUNT(
?
) ? = Numeric, Date,
Time, Text, Array, Matrix |
-999999999 |
Incompatible
types in the parameter rExpression of the RECCOUNT function. Found: ?, required: Roster. |
RECCOUNT({*NONEXISTANTROSTER*}) |
-999999999 |
Missing
variable : {*NONEXISTANTROSTER*} |
See Also
APPEND, CLEAN ROSTER, CLONE ROSTER, COMPRESS ROSTER, COUNTROSTER, DELETE FROM, SORT, UPDATE, XFER
Allows for recording audio over the microphone if running Survey locally on a laptop. Must be enabled by using the “ENABLE” function argument to actually get recordings if specified to start recording. Audio files are in mp3 encoded format and are stored in a single zip file for a given case. On the laptops these zip files are encrypted with 128 bit AES with the extension mez instead of zip for media encrypted zip. After these mez files are transferred from the laptops that are decrypted back to zip files.
Syntax
RECORDAUDIO( cExpression|nExpression [,cExpression] )
RECORDAUDIO( cExpression )
RECORDAUDIO( cExpression, cExpression )
RECORDAUDIO( nExpression )
RECORDAUDIO( nExpression, cExpression )
Returns
Numeric 1 for Success or 0 for Failure
Arguments
RECORDAUDIO( “START” )
Does not stop per question. Creates a single file by default. Uses first display question as filename. Must call “STOP” in order to stop recording.
RECORDAUDIO( “START”, “QUESTION” )
Can be used to stop on each question, creating a new audio file per display question with that display question name as the filename.
RECORDAUDIO( “STOP” )
Stop any audio recording that may be in progress, regardless of how it was started.
RECORDAUDIO(
“QUESTION” )
Start recording on the display question after the function is specified. Records for a max of 5 minutes. Filename is of display question after function is defined. Shorthand for RECORDAUDIO( 300, “QUESTION”).
RECORDAUDIO( “ENABLE” )
Enable audio recording, allows audio recording to be started if specified. Be default audio recording is disabled and this must be specified in order to allow audio recording to be started. This also effects the microphone icon in Survey, if enabled the icon will not be grayed out.
RECORDAUDIO( “DISABLE” )
Disable audio recording, stop any current recordings. Disallow any new audio recordings to start. This will gray out the audio recording microphone icon in Survey.
RECORDAUDIO(
seconds )
Duration of audio recording in seconds. Creates a single file. Does not stop per question. Uses first display question as filename.
RECORDAUDIO( seconds, “QUESTION” )
Uses first display question name as filename. Will stop if duration goes beyond first display question after function was defined.
Examples
RECORDAUDIO( 100 )
RECORDAUDIO( 10, “QUESTION”)
Possible uses
Function |
Result |
Error report |
{NOSECS} |
800 |
|
[QTIME] |
1000 |
|
RECORDAUDIO({NOSECS}) |
1 |
|
RECORDAUDIO([QTIME]) |
1 |
|
RECORDAUDIO(1000) |
1 |
|
RECORDAUDIO({NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
RECORDAUDIO(
?
) ? = Date, Time, Text,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the RECORDAUDIO function. Found: ?, required: Numeric. |
See Also
Executes a set of questions within a conditional loop.
Syntax
REPEAT
Questions
.
.
UNTIL ( lExpression )
Arguments
lExpression Specifies a logical expression whose value determines whether the questions between REPEAT and UNTIL are executed. As long as lExpression evaluates to false, the control will be returned to the question after the REPEAT command. Once the lExpression evaluates to true, the control will be passed to the question that the UNTIL command declares as next.
Examples
REPEAT
Questions
.
.
UNTIL({MOREPEOPLE} == 1)
See Also
FOR ... ENDFOR, IIF, ISVAREMPTY, LANGUAGE, READGLOBAL, SET HEADER TO, SWITCH, SYMBOL, VAREXIST, VARTYPE, WHILE ... ENDWHILE, WRITEGLOBAL
Round is defined as nearest integer, with rounding done to an even number if the operand is exactly between two integers.
Syntax
ROUND( nExpression )
Returns
Numeric
Arguments
nExpression Specifies the numeric expression whose value is to be rounded.
Examples
ROUND(1234.1262) Returns 1234
ROUND(1234.6962) Returns 1235
Possible uses
Function |
Result |
Error report |
{ANG} |
1.25 |
|
[QANG] |
0.44 |
|
ROUND({ANG}) |
1 |
|
ROUND([QANG]) |
9 |
|
ROUND(1.047) |
1 |
|
ROUND(
?
) ? = Date, Time, Text,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the ROUND function. Found: ?, required: Numeric. |
ROUND({NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), - (subtraction operator), * (multiplication operator), / (division operator), ^ (exponentiation operator), ABS, ACOS, ANGLE, ASIN, ATAN, CODE, COS, INT, LOG, MAX, MIN, MOD, RAND, SIN, TAN, VAL, WEEKLYWAGE
Finds how many options were selected in a Select Option-Code All That Apply question type.
Syntax
SELECTEDINSELECTION( [QName] )
Returns
Numeric
Arguments
[QName] Name of the question whose response is to be parsed.
Examples
SELECTEDINSELECTION([QSALL]) Returns 4
Possible uses
Function |
Result |
Error report |
[QSALL] |
|
|
Option 1 (selected) |
1 |
|
Option 2 (not selected) |
0 |
|
Option 3 (selected) |
1 |
|
Option 4 (not selected) |
0 |
|
Option 5 (not selected) |
0 |
|
SELECTEDINSELECTION([QSALL]) |
2 |
|
SELECTEDINSELECTION( ? ) ? = Numeric, Date, Text,
Time, Roster, Array |
-999999999 |
Incompatible
types in the parameter [QName] of the SELECTEDINSELECTION function. Found: ?, required: Matrix. |
SELECTEDINSELECTION([NOQEXIST]) |
-999999999 |
Missing
variable : [NOQEXIST] |
See Also
INSELECTION, MAXINSELECTION, MININSELECTION, TOTALINSELECTION
Gets a value of a field in the specified table that matches the condition.
Syntax
SELECTFIELDS( cExpression1, cExpression2, cExpression3, cExpression4 )
Returns
Numeric, Date, Text, Time
Arguments
cExpression1 Specifies the name of the table to get the data from.
cExpression2 Specifies the name of the condition field.
cExpression3 Specifies the value of the condition field to match.
cExpression4 Specifies the name of the field to get.
Examples
SELECTFIELD(“WEB_DATA.USER_TEST_00266”, “USERID”, {CASEID}, “GROUP_ID”)
Returns 2
Possible uses
Function |
Result |
Error report |
{TABLE } |
“WEB_DATA.PEOPLE” |
|
{LOOKFIELD} |
“ID” |
|
[SET_LF] |
“ID” |
|
{^A_LF(1)^} |
“ID” |
|
{*T.LV(1)*} |
“ID” |
|
{ID_VALUE} |
“3” |
|
[SET_ID] |
“3” |
|
{^A_ID(1)^} |
“3” |
|
{*T.ID(1)*} |
“3” |
|
{GETFIELD} |
“NAME” |
|
SELECTFIELD({TABLE},
{LOOKFIELD}, {ID_VALUE}, "NAME") |
2 |
|
SELECTFIELD({^ANAMES^},
{X}, {Y}, {^ANAMES(2)^}) |
1 |
|
SELECTFIELD({^ANAMES^},
{X}, {Y}, [QFER]) |
1 |
|
SELECTFIELD({^ANAMES^},
{X}, [Q21], "Miguel") |
2 |
|
SELECTFIELD({^ANAMES^},
{X}, [Q21], {^ANAMES(2)^}) |
1 |
|
SELECTFIELD({^ANAMES^},
{X}, [Q21], [QFER]) |
1 |
|
SELECTFIELD({^ANAMES^},
{X}, 6, "Miguel") |
2 |
|
SELECTFIELD({^ANAMES^},
{X}, 6, {^ANAMES(2)^}) |
1 |
|
SELECTFIELD({^ANAMES^},
{X}, 6, [QFER]) |
1 |
|
SELECTFIELD({^ANAMES^},
[Q20], {Y}, "Miguel") |
2 |
|
SELECTFIELD({^ANAMES^},
[Q20], {Y}, {^ANAMES(2)^}) |
2 |
|
SELECTFIELD({^ANAMES^},
[Q20], {Y}, [QFER]) |
2 |
|
SELECTFIELD({^ANAMES^},
[Q20], [Q21], "Miguel") |
2 |
|
SELECTFIELD({^ANAMES^},
[Q20], [Q21], {^ANAMES(2)^}) |
2 |
|
SELECTFIELD({^ANAMES^},
[Q20], [Q21], [QFER]) |
2 |
|
SELECTFIELD({^ANAMES^},
[Q20], 6, "Miguel") |
2 |
|
SELECTFIELD({^ANAMES^},
[Q20], 6, {^ANAMES(2)^}) |
2 |
|
SELECTFIELD({^ANAMES^},
[Q20], 6, [QFER]) |
2 |
|
SELECTFIELD({^ANAMES^},
1, {Y}, "Miguel") |
2 |
|
SELECTFIELD({^ANAMES^},
1, {Y}, {^ANAMES(2)^}) |
2 |
|
SELECTFIELD({^ANAMES^},
1, {Y}, [QFER]) |
2 |
|
SELECTFIELD({^ANAMES^},
1, [Q21], "Miguel") |
2 |
|
SELECTFIELD({^ANAMES^},
1, [Q21], {^ANAMES(2)^}) |
2 |
|
SELECTFIELD({^ANAMES^},
1, [Q21], [QFER]) |
2 |
|
SELECTFIELD({^ANAMES^},
1, 6, "Miguel") |
2 |
|
SELECTFIELD({^ANAMES^},
1, 6, {^ANAMES(2)^}) |
2 |
|
SELECTFIELD({^ANAMES^},
1, 6, [QFER]) |
2 |
|
SELECTFIELD( Array, Numeric, Numeric,
?) ? = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression of the COUNT function. Found: ?, required: Text. |
SELECTFIELD( Array, Numeric, ?2,
Text ) ?2 = Date, Text, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression2 of the COUNT function. Found: ?2, required: Numeric. |
SELECTFIELD( Array, ?1,
Numeric, Text ) ?1 = Date, Text, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression1 of the COUNT function. Found: ?1, required: Numeric. |
SELECTFIELD( ?, Numeric, Numeric, Text ) ? = Numeric, Date, Text, Time, Roster, Matrix |
-999999999 |
Incompatible
types in the parameter ArrayName of the COUNT function. Found: ?, required: Array. |
SELECTFIELD({^ANAMES^},
{X}, {Y}, {NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
SELECTFIELD({^ANAMES^},
1, {NONEXISTANT}, "Miguel") |
-999999999 |
Missing
variable : {NONEXISTANT} |
SELECTFIELD({^ANAMES^},
{NONEXISTANT}, 6, "Miguel") |
-999999999 |
Missing
variable : {NONEXISTANT} |
SELECTFIELD({NONEXISTANT},
{X}, {Y}, "Miguel") |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
ADDCASE, INFOSHEET, INSERTFIELDS, SELECTFIELD, UPDATECASE, UPDATEFIELDS, UPDATELOGIN
Sets the header at runtime on the upper right corner on the screen.
Syntax
SET HEADER TO cExpression
Arguments
cExpression Specifies the character expression to be set as the header.
Examples
STRPROJECTID} = “Project: 013J”
SET HEADER TO {STRPROJECTID}
See Also
FOR ... ENDFOR, IIF, ISVAREMPTY, LANGUAGE, READGLOBAL, REPEAT ... UNTIL, SWITCH, SYMBOL, VAREXIST, VARTYPE, WHILE ... ENDWHILE, WRITEGLOBAL
Turns OFF or ON the audio.
Syntax
SETAUDIO( cExpression )
Arguments
cExpression Specifies the mode of the sound, “ON” or “OFF”.
Examples
{MODE} = “OFF”
SETAUDIO({MODE})
SETAUDIO(“ON”)
Possible uses
Function |
Result |
Error report |
{AUDIO_ON} |
“ON“ |
|
[AUDIOMODE] |
“ OFF” |
|
SETAUDIO({AUDIO_ON}) |
1 |
|
SETAUDIO([AUDIOMODE]) |
1 |
|
SETAUDIO("ON") |
1 |
|
SETAUDIO(
?
) ? = Numeric, Date,
Time, Array, Roster, Matrix |
-999999999 |
Incompatible
types in the parameter array of the SETAUDIO function. Found: ?, required: Text. |
SETAUDIO({NONEXSITANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
Sets the recording audio mode OFF or ON.
Syntax
SETRECORDAUDIO( cExpression )
Arguments
cExpression Specifies the mode of the recording audio, “ON” or “OFF”.
Examples
{MODE} = “OFF”
SETRECORDAUDIO({MODE})
SETRECORDAUDIO(“ON”)
Possible uses
Function |
Result |
Error report |
{AUDIO_ON} |
“ON“ |
|
[AUDIOMODE] |
“ OFF” |
|
SETRECORDAUDIO({AUDIO_ON}) |
1 |
|
SETRECORDAUDIO([AUDIOMODE]) |
1 |
|
SETRECORDAUDIO("ON") |
1 |
|
SETRECORDAUDIO(
?
) ? = Numeric, Date,
Time, Array, Roster, Matrix |
-999999999 |
Incompatible
types in the parameter array of the SETRECORDAUDIO function. Found: ?, required: Text. |
SETRECORDAUDIO({NONEXSITANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
RECORDAUDIO, SETAUDIO, SETRECORDAUDIO
SIN( ) returns the sine of a specified numeric expression in radians. The returned angle is given in radians and the value returned by SIN( ) ranges between -1 and 1.
Syntax
SIN( nExpression )
Returns
Numeric
Arguments
nExpression Specifies a numeric expression whose sine SIN( ) returns. nExpression can be any value.
Examples
SIN(0.5) Returns .48
SIN(0) Returns 0
Possible uses
Function |
Result |
Error report |
{ANGLE} |
1.047 |
|
[QANGLE] |
1.047 |
|
SIN({ANGLE}) |
0.865926611 |
|
SIN([QANGLE]) |
0.865926611 |
|
SIN(1.047) |
0.865926611 |
|
SIN(
?
) ? = Date, Time, Text,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the SIN function. Found: ?, required: Numeric. |
SIN({NONEXSITANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), - (subtraction operator), * (multiplication operator), / (division operator), ^ (exponentiation operator), ABS, ACOS, ANGLE, ASIN, ATAN, CODE, COS, INT, LOG, MAX, MIN, MOD, RAND, ROUND, TAN, VAL, WEEKLYWAGE
Sorts a roster by a specified key.
Syntax
SORT {*RosterName*} ON FieldName [/A|/D]
Arguments
{*SourceRosterName*} Roster name from which the records will be sorted.
FieldName Field name from the roster to sort on.
[/A | /D] A or D for ascending or descending order.
Examples
SORT {*HHI*} ON AGE /A
See Also
APPEND, CLEAN ROSTER, CLONE ROSTER, COMPRESS ROSTER, COUNTROSTER, DELETE FROM, RECCOUNT, UPDATE, XFER
Returns the character equivalent of a specified numeric expression.
Syntax
STR( nExpression )
Returns
Text
Arguments
nExpression Specifies the numeric expression STR( ) evaluates and converts so character.
Examples
STR(0.5) Returns “0.5”
STR(90) Returns “90”
Possible uses
Function |
Result |
Error report |
{VALUE} |
12 |
|
[GET_AGE] |
46 |
|
STR({VALUE}) |
“12” |
|
STR([GET_AGE]) |
“46” |
|
STR(283) |
“238” |
|
STR(
?
) ? = Date, Time, Text,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the STR function. Found: ?, required: Numeric. |
STR({NONEXSITANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), ALLTRIM, AT, DATE2TEXT, DECODE, IN, LEN, LOWER, LTRIM, PADL, RAT, STRCMP, SUBSTR, TEXT2DATE, TIME2TEXT, TITLECASE, UPPER, VAL
Compares two character expressions and returns a 1 if they are identical. The comparison is from left to right and not case sensitive.
Syntax
STRCMP( cExpression1, cExpression2 )
Returns
Numeric
Arguments
cExpression1 Is the first character expression of the comparison. It can be a variable or a literal enclosed in double quotes (").
cExpression2 Is the second character expression of the comparison. It can be a variable or a literal enclosed in double quotes (").
Examples
STRCMP("Susan Miller", "Susan Miller") Returns 1
Possible uses
Function |
Result |
Error report |
{FNAME1} |
“Mary Smith“ |
|
{FNAME2} |
“Josh Smith“ |
|
[Q_NAME1] |
“Ann Lee“ |
|
[Q_NAME2] |
“Ann Lee“ |
|
STRCMP({FNAME1},
{FNAME2}) |
0 |
|
STRCMP({FNAME1},
[Q_NAME1]) |
0 |
|
STRCMP({FNAME1},
"Mary Smith") |
1 |
|
STRCMP([Q_NAME1],
{FNAME1}) |
0 |
|
STRCMP([Q_NAME1],
[Q_NAME2]) |
1 |
|
STRCMP([Q_NAME1],
"Mary Smith") |
0 |
|
STRCMP(
Text, ?2) ?2 = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression2 of the STRCMP function. Found: ?2, required: Text. |
STRCMP(
?1,
Text) ?1 = Numeric, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression1 of the STRCMP function. Found: ?1, required: Text. |
STRCMP({NAME},
{NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
STRCMP({NONEXISTANT},
{NAME}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), ALLTRIM, AT, DATE2TEXT, DECODE, IN, LEN, LOWER, LTRIM, PADL, RAT, STR, SUBSTR, TEXT2DATE, TIME2TEXT, TITLECASE, UPPER, VAL
Extracts a substring from an existing character expression (string). Extraction is from left to right. The substring begins at the specified StartIndex and extends to the character at index EndIndex - 1. Thus the length of the substring is EndIndex-StartIndex.
Syntax
SUBSTR( cExpression, nExpression1, nExpression2 )
Returns
Text
Arguments
cExpression Variable specifying the source character expression (string).
nExpression1 An integer number that specifies the starting character position from the left of the source character expression (string). The first position of a character expression is 1.
nExpression2 An integer number that specifies the ending character position.
Examples
SUBSTR("Natalia Baker", 1, 5) Returns Natal
Possible uses
Function |
Result |
Error report |
{FULLNAME} |
“Lucia Romero“ |
|
{X} |
1 |
|
{Z} |
5 |
|
[Q5] |
5 |
|
[Q20] |
1 |
|
[QFULLNAME] |
“Ana P. Arjona“ |
|
SUBSTR({FULLNAME},
{X}, {Z}) |
“Lucia“ |
|
SUBSTR({FULLNAME},
{X}, [Q5]) |
“Lucia“ |
|
SUBSTR({FULLNAME},
{X}, 5) |
“Lucia“ |
|
SUBSTR({FULLNAME},
[Q20], {Z}) |
“Lucia“ |
|
SUBSTR({FULLNAME},
[Q20], [Q5]) |
“Lucia“ |
|
SUBSTR({FULLNAME},
[Q20], 5) |
“Lucia“ |
|
SUBSTR({FULLNAME},
1, {Z}) |
“Lucia“ |
|
SUBSTR({FULLNAME},
1, [Q5]) |
“Lucia“ |
|
SUBSTR({FULLNAME},
1, 5) |
“Lucia“ |
|
SUBSTR([QFULLNAME],
{X}, {Z}) |
“Ana P“ |
|
SUBSTR([QFULLNAME],
{X}, [Q5]) |
“Ana P“ |
|
SUBSTR([QFULLNAME],
{X}, 5) |
“Ana P“ |
|
SUBSTR([QFULLNAME],
[Q20], {Z}) |
“Ana P“ |
|
SUBSTR([QFULLNAME],
[Q20], [Q5]) |
“Ana P“ |
|
SUBSTR([QFULLNAME],
[Q20], 5) |
“Ana P“ |
|
SUBSTR([QFULLNAME],
1, {Z}) |
“Ana P“ |
|
SUBSTR([QFULLNAME],
1, [Q5]) |
“Ana P“ |
|
SUBSTR([QFULLNAME],
1, 5) |
“Ana P“ |
|
SUBSTR("Natalia
Isabel Herrera Baker", {X}, {Z}) |
“Natal“ |
|
SUBSTR("Natalia
Isabel Herrera Baker", {X}, [Q5]) |
“Natal“ |
|
SUBSTR("Natalia
Isabel Herrera Baker", {X}, 5) |
“Natal“ |
|
SUBSTR("Natalia
Isabel Herrera Baker", [Q20], {Z}) |
“Natal“ |
|
SUBSTR("Natalia
Isabel Herrera Baker", [Q20], [Q5]) |
“Natal“ |
|
SUBSTR("Natalia
Isabel Herrera Baker", [Q20], 5) |
“Natal“ |
|
SUBSTR("Natalia
Isabel Herrera Baker", 1, {Z}) |
“Natal“ |
|
SUBSTR("Natalia
Isabel Herrera Baker", 1, [Q5]) |
“Natal“ |
|
SUBSTR("Natalia
Isabel Herrera Baker", 1, 5) |
“Natal“ |
|
SUBSTR(
Text, Numeric, ?2) ?2 = Date, Text, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression2 of the SUBSTR function. Found: ?2, required: Numeric. |
SUBSTR(
Text, ?1,
Numeric) ?1 = Date, Text, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression1 of the SUBSTR function. Found: ?1, required: Numeric. |
SUBSTR(
?,
Numeric, Numeric) ? = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression of the SUBSTR function. Found: ?, required: Text. |
SUBSTR({INST_NAME
}, 1, {NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
SUBSTR({INST_NAME},
{NONEXISTANT}, 5) |
-999999999 |
Missing
variable : {NONEXISTANT} |
SUBSTR({NONEXISTANT},
1, 5) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), ALLTRIM, AT, DATE2TEXT, DECODE, IN, LEN, LOWER, LTRIM, PADL, RAT, STR, STRCMP, TEXT2DATE, TIME2TEXT, TITLECASE, UPPER, VAL
Returns the subtraction of two numeric expressions.
Syntax
nExpression1 - nExpression2
Returns
Numeric
Arguments
nExpression1 Specifies a numeric expression.
nExpression2 Specifies a numeric expression.
Examples
12 - 13 Returns -1
30 + 10 Returns 20
Possible uses
Function |
Result |
Error report |
{SALARY} |
300 |
|
{TAXES} |
8.33 |
|
[Q243] |
8.33 |
|
[Q100] |
300 |
|
{SALARY}
- {TAXES} |
291.67 |
|
{SALARY}
- [Q243] |
291.67 |
|
{SALARY}
- 100 |
200 |
|
[Q100]
- {TAXES} |
291.67 |
|
[Q100]
- [Q243] |
291.67 |
|
[Q100]
- 100 |
200 |
|
300
- {TAXES} |
291.67 |
|
208.33
- [Q243] |
200 |
|
208.33
- 100 |
108.33 |
|
100
- {NONEXISTANT} |
-999999999 |
Missing
variable : {NONEXISTANT} |
“Hi
“ - 125 |
-999999999 |
Incompatible
operands in the addition ( -) function. |
See Also
+ (additive operator), * (multiplication operator), / (division operator), ^ (exponentiation operator), ABS, ACOS, ANGLE, ASIN, ATAN, CODE, COS, INT, LOG, MAX, MIN, MOD, RAND, ROUND, SIN, TAN, VAL, WEEKLYWAGE
Executes the first set of commands whose conditional expression evaluates to true.
Syntax
SWITCH (COND)
BEGIN
CASE VAL1 [, VAL2, ... Valn1] : STATEMENT1;
.
.
STATEMENTn;
CASE VAL3 [, VAL4, ... Valn2] : STATEMENT2;
.
.
STATEMENTn;
CASE VALn [, VALm, ... Valn3] : STATEMENT3;
.
.
STATEMENTn;
DEFAULT : STATEMENTn1;
.
.
STATEMENTnm;
END
Arguments
COND Any standard arithmetic expression that can be evaluated and that the result of the evaluation is an integer or a run-time error occurs.
Examples
SWITCH ({MARSTATUS})
BEGIN
CASE 1,3 : {TEXTSTATUS} = “partner”;
{CODESTATUS} = 1;
CASE 2, 4 : {TEXTSTATUS} = “spouse”;
{CODESTATUS} = 2;
DEFAULT : {TEXTSTATUS} = “couple”;
{CODESTATUS} = 0;
END
See Also
FOR ... ENDFOR, IIF, ISVAREMPTY, LANGUAGE, READGLOBAL, REPEAT ... UNTIL, SET HEADER TO, SYMBOL, VAREXIST, VARTYPE, WHILE ... ENDWHILE, WRITEGLOBAL
Creates and initializes symbols or array elements.
Syntax
SYMBOL({VarName1}=Value=Type, {VarName2}=Value=Type, ... {VarNamen}=Value=Type)
Arguments
{VarNamen} Name of the symbol or array element to be created.
Value Initial value of the created symbol or array element. It can be another variable or a constant value.
Type Type of the symbol to be created.
INT = integer
LONG = long integer
FLOAT = floating point field
DATE = date
TIME = time
CHAR = character
DOUBLE = double
Examples
SYMBOL({NOPRODUCTS}=0=INT, {OTHER}=”other products”=CHAR)
SYMBOL({^ANAMES(1)^}=”Ann”=CHAR, {^ANAMES(2)^}=”Smith”=CHAR)
See Also
FOR ... ENDFOR, IIF, ISVAREMPTY, LANGUAGE, READGLOBAL, REPEAT ... UNTIL, SET HEADER TO, SWITCH, VAREXIST, VARTYPE, WHILE ... ENDWHILE, WRITEGLOBAL
This trigonometric function returns the tangent of an angle.
Syntax
TAN( nExpression )
Returns
Numeric
Arguments
nExpression Specifies the angle in radians for which TAN( ) returns the tangent.
Examples
TAN(0.5) Returns 0.55
TAN(1) Returns 1.56
Possible uses
Function |
Result |
Error report |
{ANGLE} |
1.047 |
|
[QANGLE] |
1.047 |
|
TAN({ANGLE}) |
1.731260873 |
|
TAN([QANGLE]) |
1.731260873 |
|
TAN(1.047) |
1.731260873 |
|
TAN(
?
) ? = Date, Time, Text,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the TAN function. Found: ?, required: Numeric. |
TAN({NONEXSITANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), - (subtraction operator), * (multiplication operator), / (division operator), ^ (exponentiation operator), ABS, ACOS, ANGLE, ASIN, ATAN, CODE, COS, INT, LOG, MAX, MIN, MOD, RAND, ROUND, SIN, VAL, WEEKLYWAGE
Converts a date in the string format "YYYYMMDD" into a date format (into a real date).
Syntax
TEXT2DATE( cExpression )
Returns
Date
Arguments
cExpression Date in string format to be converted to a date.
Examples
TEXT2DATE(“20000817”) Returns date 2000 08 17
Possible uses
Function |
Result |
Error report |
{DATEASCHAR} |
“20020801” |
|
[NOWDATEASCHAR] |
“20020801” |
|
TEXT2DATE({DATEASCHAR}) |
20020801 |
|
TEXT2DATE([NOWDATEASCHAR]) |
20020801 |
|
TEXT2DATE("20020801") |
20020801 |
|
TEXT2DATE(
?
) ? = Numeric, Date,
Time, Array, Roster, Matrix |
-999999999 |
Incompatible
types in the parameter array of the TEXT2DATE function. Found: ?, required: Text. |
TEXT2DATE({NONEXSITANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
ADDDAYS, ADDYEARS, AGE, CDOW, CREATE CALENDAR, DATE, DATE2DAY, DATE2TEXT, DATE2WK, DATEFORMAT, DIFFAGE, DOW, FINDGAPS IN CALENDAR, FIXDAY, FIXMONTH, FIXYEAR, GETSUBDATE, GOMONTH, ISCOMPLETE, MARK CALENDAR
+ (additive operator), ALLTRIM, AT, DECODE, IN, LEN, LOWER, LTRIM, PADL, RAT, STR, STRCMP, SUBSTR, TIME2TEXT, TITLECASE, UPPER, VAL
Returns the current system time in milliseconds.
Syntax
TIME( nExpression )
Returns
Numeric
Arguments
nExpression Numeric expression that can be any value, however, if value is not 0 then formats millis to seconds.
Examples
TIME(0) Returns 1137045845531
Possible uses
Function |
Result |
Error report |
{ZERO} |
0 |
|
[QZEROVAL] |
0 |
|
TIME({ZERO}) |
1037045845531 |
|
TIME(0) |
1037045845531 |
|
TIME([QZEROVAL]) |
1037045845531 |
|
TIME(
?
) ? = Date, Time, Text,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the TIME function. Found: ?, required: Numeric. |
TIME({NONEXSITANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+, ALLTRIM, AT, DATE2TEXT, DECODE, IN, LEN, LOWER, LTRIM, PADL, RAT, STR, STRCMP, SUBSTR, TEXT2DATE, TITLECASE, UPPER, VAL
Converts a time in milliseconds into a 24 string (text) format.
Syntax
TIME2TEXT( nExpression )
Returns
Text
Arguments
nExpression Long integer value that represents the time in milliseconds to be converted.
Examples
TIME2TEXT(1037045845531) Returns “2:17:25 PM CST”
Possible uses
Function |
Result |
Error report |
{STIME} |
1037045845531 |
|
[STARTTIME] |
1037045845531 |
|
TIME2TEXT({STIME}) |
“2:17:25
PM CST” |
|
TIME2TEXT([STARTTIME]) |
“2:17:25
PM CST” |
|
TIME2TEXT(1037045845531) |
“2:17:25
PM CST” |
|
TIME2TEXT(
?
) ? = Date, Time, Text,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the TIME2TEXT function. Found: ?, required: Numeric. |
TIME2TEXT({NONEXSITANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), ALLTRIM, AT, DATE2TEXT, DECODE, IN, LEN, LOWER, LTRIM, PADL, RAT, STR, STRCMP, SUBSTR, TEXT2DATE, TITLECASE, UPPER, VAL
Returns from a character expression a string capitalized as appropriate for proper names.
Syntax
TITLECASE( cExpression )
Returns
Text
Arguments
cExpression Specifies the character expression from which TITLECASE() returns a capitalized character text.
Examples
TITLECASE(“anna lucia”) Returns Anna Lucia
TITLECASE(“My house is red”) Returns My House Is Red
Possible uses
Function |
Result |
Error report |
{FULLNAME} |
“Luisa lane“ |
|
[QFNAME] |
“pete rivers” |
|
TITLECASE({FULLNAME}) |
“Luisa
Lane” |
|
TITLECASE([QFNAME]) |
“Pete
Rivers” |
|
TITLECASE("Hi, how are
you?") |
“Hi,
How Are You?” |
|
TITLECASE( ? ) ? = Numeric, Date,
Time, Array, Roster, Matrix |
-999999999 |
Incompatible
types in the parameter array of the TITLECASE function. Found: ?,
required: Text. |
TITLECASE({NONEXSITANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), ALLTRIM, AT, DATE2TEXT, DECODE, IN, LEN, LOWER, LTRIM, PADL, RAT, STR, STRCMP, SUBSTR, TEXT2DATE, TIME2TEXT, UPPER, VAL
Finds how many options were available in a Select Option-Code All That Apply question type.
Syntax
TOTALINSELECTION( [QName] )
Returns
Numeric
Arguments
[QName] Name of the question whose response is to be parsed.
Examples
TOTALINSELECTION([QALL]) Returns 3
Possible uses
Function |
Result |
Error report |
[QSALL] |
|
|
Option 1 (selected) |
1 |
|
Option 2 (not selected) |
0 |
|
Option 3 (selected) |
1 |
|
Option 4 (not selected) |
0 |
|
Option 5 (not selected) |
0 |
|
TOTALINSELECTION([QSALL]) |
5 |
|
TOTALINSELECTION( ? ) ? = Numeric, Date, Text,
Time, Roster, Array |
-999999999 |
Incompatible
types in the parameter [QName] of the TOTALINSELECTION function. Found: ?, required: Matrix. |
TOTALINSELECTION([NOQEXIST]) |
-999999999 |
Missing
variable : [NOQEXIST] |
See Also
INSELECTION, MAXINSELECTION, MININSELECTION, SELECTEDINSELECTION
Updates records in a roster with new values.
Syntax
UPDATE {*RosterName*} SET FieldName1 = Expression1 [, FieldName2 = Expression2, …
FieldNamen = Expressionn] FROM FromRNo | {FromRNo} | [QName]
TO ToRNo | {ToRNo} | [QName] | "END" [WHERE ExprL1 [AND | OR ExprL2 ...] ]
Arguments
{*RosterName*} Roster name from which the records will be updated.
FromRNo|{FromRNo}|[QName] Integer number of the first row in the roster to be updated.
ToRNo|{ToRNo}|[QName]|"END" Integer number of the last row in the roster to be updated. If “END” is specified indicates that records up to and through the last row in the roster will be updated.
ExprL Logical expression that if matched controls what records will be updated from the roster.
Examples
UPDATE {*HHI*} SET WORKSTATUS=0, CURRENTWORK=”None” FROM 1 TO “END” WHERE (AGE < 18)
See Also
APPEND, CLEAN ROSTER, CLONE ROSTER, COMPRESS ROSTER, COUNTROSTER, DELETE FROM, RECCOUNT, SORT, XFER
Updates the field cExpressionFieldNAME1 with value cExpressionFieldVALUE1 in the User table in nExpression1 instrument ID, cExpression1 MODE in cExpression2 case ID.
Note: The cExpression2 case ID should exist, otherwise will return the following error: “The instrument is trying to update information into a case that does NOT exist.”
Syntax
UPDATECASE( nExpression, cExpression1, cExpression2,
cExpressionFieldNAME1, cExpressionFieldVALUE1
[, cExpressionFieldNAME2, cExpressionFieldVALUE2
[,… cExpressionFieldNAMEn, cExpressionFieldVALUEn )
Returns
Numeric (1 success values were updated correctly, 0 fail to update the values)
Arguments
nExpression Specifies the number of the instrument
where to update the case.
cExpression1 Specifies the mode of the instrument
where to update the case.
cExpression2 Specifies the caseID to update.
cExpressionFieldNAME1 Specifies the name of the field to update.
cExpressionFieldVALUE1 Specifies the value of the field.
Updatable field names: ALTUSERID, RESPONDENT, HEADER,GROUP_ID, INSTRUMENT_ID, INSTRUMENT_MODE, MISC1, MISC2, MISC3, MISC4, MISC5, MISC6, MISC7, MISC8, MISC9, MISC10, MISC11, MISC12, MISC13, MISC14, MISC15, MISC16, MISC17, MISC18, MISC19, MISC20
Examples
{RESPNAME} = “James Bond”
{CASEID} = “123456”
{INTERVIEWER_NAME} = “John Smith”
UPDATECASE( 266, “TEST”, {CASEID}, “RESPONDENT”, {RESPNAME}, “MISC1”, {INTERVIEWER_NAME})
Possible uses
Function |
Result |
Error report |
{INST_MODE} |
“TEST” |
|
{CASEID} |
“123456” |
|
[GET_CASEID] |
“123456” |
|
{^A_CASEID(1)^} |
“123456” |
|
{*HHI.ID(1)*} |
“123456” |
|
[GET_INST_MODE] |
“TEST” |
|
{^A_INST_MODE(1)^} |
“TEST” |
|
{INST_ID} |
266 |
|
{*HHI.INST_MODE(1)*} |
“TEST” |
|
{NAME} |
“Ana” |
|
UPDATECASE(266, {INST_MODE},
{CASEID}, “RESPONDENT”, {NAME}) |
|
|
UPDATECASE(266, {INST_MODE},
[GET_CASEID], “RESPONDENT”, {NAME}) |
1 |
|
UPDATECASE(266, {INST_MODE},
{^A_CASEID(1)^}, “RESPONDENT”, {NAME}) |
1 |
|
UPDATECASE(266, {INST_MODE},
{*HHI.ID(1)*}, “RESPONDENT”, {NAME}) |
1 |
|
UPDATECASE(266, {INST_MODE},
“123456” , “RESPONDENT”, {NAME}) |
1 |
|
UPDATECASE(266,
[GET_INST_MODE], {CASEID}, “RESPONDENT”, {NAME}) |
1 |
|
UPDATECASE(266,
[GET_INST_MODE], [GET_CASEID], “RESPONDENT”, {NAME}) |
1 |
|
UPDATECASE(266,
[GET_INST_MODE], {^A_CASEID(1)^}, “RESPONDENT”, {NAME}) |
1 |
|
UPDATECASE(266,
[GET_INST_MODE], {*HHI.ID(1)*}, “RESPONDENT”, {NAME}) |
1 |
|
UPDATECASE(266,
[GET_INST_MODE], “123456”, “RESPONDENT”, {NAME}) |
1 |
|
UPDATECASE(266 ,
{^A_INST_MODE(1)^}, {CASEID}, “RESPONDENT”, {NAME}) |
1 |
|
UPDATECASE(266,
{^A_INST_MODE(1)^}, [GET_CASEID], “RESPONDENT”, {NAME}) |
1 |
|
UPDATECASE(266,
{^A_INST_MODE(1)^}, {^A_CASEID(1)^}, “RESPONDENT”, {NAME}) |
1 |
|
UPDATECASE(266,
{^A_INST_MODE(1)^}, {*HHI.ID(1)*}, “RESPONDENT”, {NAME}) |
1 |
|
UPDATECASE(266,
{^A_INST_MODE(1)^}, “123456”, “RESPONDENT”, {NAME}) |
1 |
|
UPDATECASE(266 , “TEST”, {CASEID},
“RESPONDENT”, {NAME}) |
1 |
|
UPDATECASE(266, “TEST”,
[GET_CASEID], “RESPONDENT”, {NAME}) |
1 |
|
UPDATECASE(266, “TEST”,
{^A_CASEID(1)^}, “RESPONDENT”, {NAME}) |
1 |
|
UPDATECASE(266, “TEST”,
{*HHI.ID(1)*}, “RESPONDENT”, {NAME}) |
1 |
|
UPDATECASE(266, “TEST”,
“123456”, “RESPONDENT”, {NAME}) |
1 |
|
UPDATECASE({INST_ID} ,
{*HHI.INST_MODE(1)*}, {CASEID}, “RESPONDENT”, {NAME}) |
1 |
|
UPDATECASE({INST_ID},
{*HHI.INST_MODE(1)*}, [GET_CASEID] , “RESPONDENT”, {NAME}) |
1 |
|
UPDATECASE({INST_ID},
{*HHI.INST_MODE(1)*}, {^A_CASEID(1)^} , “RESPONDENT”, {NAME}) |
1 |
|
UPDATECASE({INST_ID},
{*HHI.INST_MODE(1)*}, {*HHI.ID(1)*} , “RESPONDENT”, {NAME}) |
1 |
|
UPDATECASE({INST_ID},
{*HHI.INST_MODE(1)*}, “123456”, “RESPONDENT”, {NAME}) |
1 |
|
UPDATECASE( Numeric, Text, Text,
Text, ?5
) ?4 = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression4 of the UPDATECASE function. Found: ?5,
required: Text. |
UPDATECASE( Numeric, Text, Text,
?4,
Text ) ?4 = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression3 of the UPDATECASE function. Found: ?4,
required: Text. |
UPDATECASE( Numeric, Text, ?3,
Text, Text ) ?3 = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression2 of the UPDATECASE function. Found: ?3,
required: Text. |
UPDATECASE( Numeric, ?2,
Text, Text, Text ) ?2 = Numeric, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression1 of the UPDATECASE function. Found: ?2,
required: Text. |
UPDATECASE( ?1, Text, Text,
Text, Text ) ?1 = Text, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter nExpression of the UPDATECASE function. Found: ?1,
required: Numeric. |
UPDATECASE({INST_ID}, {INST_MODE},
{CASEID}, “RESPONDENT”, {NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
UPDATECASE({INST_ID}, {INST_MODE},
{CASEID}, {NONEXISTANT}, {NAME}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
UPDATECASE({INST_ID}, {INST_MODE},
{NONEXISTANT}, “RESPONDENT”, {NAME}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
UPDATECASE({INST_ID}, {NONEXISTANT},
{CASEID}, “RESPONDENT”, {NAME}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
UPDATECASE({NONEXISTANT}, {INST_MODE},
{CASEID}, “RESPONDENT”, {NAME}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
ADDCASE, INFOSHEET, INSERTFIELDS, SELECTFIELD, UPDATECASE, UPDATEFIELDS, UPDATELOGIN
Updates the field cExpressionFieldNAME1 with value cExpressionFieldVALUE1 in cExpression1 table where cExpression2 using cExpression3 as the condition meets value cExpression4.
Syntax
UPDATEFIELDS( cExpression1, cExpression2, cExpression3, cExpression4,
cExpressionFieldNAME1, cExpressionFieldVALUE1
[, cExpressionFieldNAME2, cExpressionFieldVALUE2
[,… cExpressionFieldNAMEn, cExpressionFieldVALUEn )
Returns
Numeric (1 success values were updated correctly, 0 fail to update the values)
Arguments
cExpression1 Specifies the name of the table to update.
cExpression2 Specifies the field name to use in the
criteria.
cExpression3 Specifies the logical condition to use in
the criteria.
cExpression4 Specifies the value to meet the condition
to use in the criteria.
cExpressionFieldNAME1 Specifies the name of the field to update.
cExpressionFieldVALUE1 Specifies the value of the field.
Examples
{CASEID} = “123456”
UPDATEFIELDS( “WEB_DATA.USER_TEST_00266”, “USERID”, “!=”, {CASEID}, “MISC2”, “Franklin”)
Possible uses
Function |
Result |
Error report |
{TABLE } |
“WEB_DATA.PEOPLE” |
|
{LOOKFIELD} |
“AGE” |
|
[SET_LF] |
“AGE” |
|
{^A_LF(1)^} |
“AGE” |
|
{*T.LV(1)*} |
“AGE” |
|
{CONDITION} |
“>” |
|
[SET_CONDITION] |
“>” |
|
{^A_CONDITION(1)^} |
“>” |
|
{*T.CONDITION(1)*} |
“>” |
|
{SETVALUE} |
“1” |
|
UPDATEFIELDS(“WEB_DATA.PEOPLE”,
{LOOKFIELD}, {CONDITION}, {LOOKVALUE}, “ADULT_FLAG”, {SETVALUE}) |
|
|
UPDATEFIELDS(“WEB_DATA.PEOPLE”,
{LOOKFIELD}, [SET_CONDITION], [SET_LV], “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS(“WEB_DATA.PEOPLE”,
{LOOKFIELD}, {^A_CONDITION(1)^}, {^A_LV(1)^}, “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS(“WEB_DATA.PEOPLE”,
{LOOKFIELD}, {*T.CONDITION(1)*}, {*T.LV(1)*}, “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS(“WEB_DATA.PEOPLE”,
{LOOKFIELD}, “>”, “18”, “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS(“WEB_DATA.PEOPLE”,
[SET_LF], {CONDITION}, {LOOKVALUE}, “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS(“WEB_DATA.PEOPLE”,
[SET_LF], [SET_CONDITION], [SET_LV], “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS(“WEB_DATA.PEOPLE”,
[SET_LF], {^A_CONDITION(1)^}, {^A_LV(1)^}, “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS(“WEB_DATA.PEOPLE”,
[SET_LF], {*T.CONDITION(1)*}, {*T.LV(1)*}, “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS(“WEB_DATA.PEOPLE”,
[SET_LF], “>”, “18”, “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS(“WEB_DATA.PEOPLE”,
{^A_LF(1)^}, {CONDITION}, {LOOKVALUE}, “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS(“WEB_DATA.PEOPLE”,
{^A_LF(1)^}, [SET_CONDITION], [SET_LV], “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS(“WEB_DATA.PEOPLE”,
{^A_LF(1)^}, {^A_CONDITION(1)^}, {^A_LV(1)^}, “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS(“WEB_DATA.PEOPLE”,
{^A_LF(1)^}, {*T.CONDITION(1)*}, {*T.LV(1)*}, “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS(“WEB_DATA.PEOPLE”,
{^A_LF(1)^}, “>”, “18”, “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS(“WEB_DATA.PEOPLE”,
{*T.FIELD(1)*}, {CONDITION}, {LOOKVALUE}, “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS(“WEB_DATA.PEOPLE”,
{*T.FIELD(1)*}, [SET_CONDITION], [SET_LV], “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS(“WEB_DATA.PEOPLE”,
{*T.FIELD(1)*}, {^A_CONDITION(1)^}, {^A_LV(1)^}, “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS(“WEB_DATA.PEOPLE”,
{*T.FIELD(1)*}, {*T.CONDITION(1)*}, {*T.LV(1)*}, “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS(“WEB_DATA.PEOPLE”,
{*T.FIELD(1)*}, “>”, “18”, “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS(“WEB_DATA.PEOPLE”,
“AGE”, {CONDITION}, {LOOKVALUE}, “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS(“WEB_DATA.PEOPLE”,
“AGE”, [SET_CONDITION], [SET_LV], “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS(“WEB_DATA.PEOPLE”,
“AGE”, {^A_CONDITION(1)^}, {^A_LV(1)^}, “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS(“WEB_DATA.PEOPLE”,
“AGE”, {*T.CONDITION(1)*}, {*T.LV(1)*}, “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS(“WEB_DATA.PEOPLE”,
“AGE”, “>”, “18”, “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS({TABLE},
{LOOKFIELD}, {CONDITION}, {LOOKVALUE}, “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS({TABLE},
{LOOKFIELD}, [SET_CONDITION], [SET_LV], “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS({TABLE},
{LOOKFIELD}, {^A_CONDITION(1)^}, {^A_LV(1)^}, “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS({TABLE},
{LOOKFIELD}, {*T.CONDITION(1)*}, {*T.LV(1)*}, “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS({TABLE},
{LOOKFIELD}, “>”, “18”, “ADULT_FLAG”, {SETVALUE}) |
1 |
|
UPDATEFIELDS( Text, Text, Text, Text,
?5
) ?5 = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression5 of the UPDATECASE function. Found: ?5,
required: Text. |
UPDATEFIELDS( Text, Text, Text, ?4,
Text ) ?4 = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression4 of the UPDATECASE function. Found: ?4,
required: Text. |
UPDATEFIELDS(
Text, Text,
?3,
Text, Text ) ?3 = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression3 of the UPDATECASE function. Found: ?3,
required: Text. |
UPDATEFIELDS(
Text, ?2,
Text, Text, Text ) ?2 = Numeric, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression2 of the UPDATECASE function. Found: ?2,
required: Text. |
UPDATEFIELDS( ?1, Text, Text,
Text, Text, Text ) ?1 = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression1 of the UPDATECASE function. Found: ?1,
required: Text. |
UPDATEFIELDS({TABLE},
{LOOKFIELD}, {CONDITION}, {LOOKVALUE}, “RESPONDENT”, {NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
UPDATEFIELDS({TABLE},
{LOOKFIELD}, {CONDITION}, {NONEXISTANT}, {NAME}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
UPDATEFIELDS({TABLE},
{LOOKFIELD}, {NONEXISTANT}, “RESPONDENT”, {NAME}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
UPDATEFIELDS({TABLE},
{NONEXISTANT}, {CONDITION}, “RESPONDENT”, {NAME}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
UPDATEFIELDS({NONEXISTANT},
{LOOKFIELD}, {CONDITION}, “RESPONDENT”, {NAME}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
ADDCASE, INFOSHEET, INSERTFIELDS, SELECTFIELD, UPDATECASE, UPDATEFIELDS, UPDATELOGIN
Writes the value cExpression2 to the Interviewer/User table in the cExpression1 field.
Syntax
UPDATELOGIN( "INTERVIEWER"|"USER", cExpression1, cExpression2 )
Returns
Numeric (1 success values were written correctly, 0 fail to write the values)
Arguments
"INTERVIEWER"|"USER" Specifies the name of the table where the value will be written.
cExpression1 Name of the field to update.
cExpression2 New value of the field.
Examples
{RESPNAME} = “James Bond”
UPDATELOGIN(”USER”, “ALTUSERID”, {RESPNAME})
Possible uses
Function |
Result |
Error report |
{FNAME} |
“MISC1” |
|
{NAME} |
“James Bond” |
|
[Q5] |
“Tom Cruise” |
|
{^ANAMES(1)^} |
“Greta” |
|
{*HHI.NAME(1)*}) |
“Jeff Smith” |
|
[QFNAME] |
“MISC1” |
|
{^ATNAMES(1)^} |
“MISC1” |
|
{*HHI.TNAMES(1)*} |
“MISC1” |
|
{TABLE} |
“USER” |
|
UPDATELOGIN(“USER”,
{FNAME}, {NAME}) |
1 |
|
UPDATELOGIN(“USER”,
{FNAME}, [Q5]) |
1 |
|
UPDATELOGIN(“USER”,
{FNAME}, {^ANAMES(1)^}) |
1 |
|
UPDATELOGIN(“USER”,
{FNAME}, {*HHI.NAME(1)*}) |
1 |
|
UPDATELOGIN(“USER”,
{FNAME}, “Josh Smith”) |
1 |
|
UPDATELOGIN(“USER”,
[QFNAME], {NAME}) |
1 |
|
UPDATELOGIN(“USER”,
[QFNAME], [Q5]) |
1 |
|
UPDATELOGIN(“USER”,
[QFNAME], {^ANAMES(1)^}) |
1 |
|
UPDATELOGIN(“USER”,
[QFNAME], {*HHI.NAME(1)*}) |
1 |
|
UPDATELOGIN(“USER”,
[QFNAME], “Josh Smith”) |
1 |
|
UPDATELOGIN(“USER”
, {^ATNAMES(1)^}, {NAME}) |
1 |
|
UPDATELOGIN(“USER”,
{^ATNAMES(1)^}, [Q5]) |
1 |
|
UPDATELOGIN(“USER”,
{^ATNAMES(1)^}, {^ANAMES(1)^}) |
1 |
|
UPDATELOGIN(“USER”,
{^ATNAMES(1)^}, {*HHI.NAME(1)*}) |
1 |
|
UPDATELOGIN(“USER”,
{^ATNAMES(1)^}, “Josh Smith”) |
1 |
|
UPDATELOGIN(“USER”
, “MISC1”, {NAME}) |
1 |
|
UPDATELOGIN(“USER”,
“MISC1”, [Q5]) |
1 |
|
UPDATELOGIN(“USER”,
“MISC1”, {^ANAMES(1)^}) |
1 |
|
UPDATELOGIN(“USER”,
“MISC1”, {*HHI.NAME(1)*}) |
1 |
|
UPDATELOGIN(“USER”,
“MISC1”, “Josh Smith”) |
1 |
|
UPDATELOGIN(“USER”,
{*HHI.TNAMES(1)*}, {NAME}) |
1 |
|
UPDATELOGIN(“USER”,
{*HHI.TNAMES(1)*}, [Q5]) |
1 |
|
UPDATELOGIN(“USER”,
{*HHI.TNAMES(1)*}, {^ANAMES(1)^}) |
1 |
|
UPDATELOGIN(“USER”,
{*HHI.TNAMES(1)*}, {*HHI.NAME(1)*}) |
1 |
|
UPDATELOGIN(“USER”,
{*HHI.TNAMES(1)*}, “Josh Smith”) |
1 |
|
UPDATELOGIN({TABLE},
{*HHI.TNAMES(1)*}, {NAME}) |
1 |
|
UPDATELOGIN({TABLE},
{*HHI.TNAMES(1)*}, [Q5]) |
1 |
|
UPDATELOGIN({TABLE},
{*HHI.TNAMES(1)*}, {^ANAMES(1)^}) |
1 |
|
UPDATELOGIN({TABLE},
{*HHI.TNAMES(1)*}, {*HHI.NAME(1)*}) |
1 |
|
UPDATELOGIN({TABLE},
{*HHI.TNAMES(1)*}, “Josh Smith”) |
1 |
|
UPDATELOGIN(
Numeric, Text, ?3) ?3 = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression3 of the UPDATELOGIN function. Found: ?3, required: Text. |
UPDATELOGIN(
Numeric, ?2,
Text) ?2 = Numeric, Date, Time,
Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression2 of the UPDATELOGIN function. Found: ?2, required: Text. |
UPDATELOGIN(
?1,
Text, Text) ?1 = Numeric, Date,
Time, Roster, Array, Matrix |
-999999999 |
Incompatible
types in the parameter cExpression1 of the UPDATELOGIN function. Found: ?1, required: Text. |
UPDATELOGIN({INST_ID},
{INST_MODE}, {NONEXISTANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
UPDATELOGIN({INST_ID},
{NONEXISTANT}, {NEW_CASEID}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
UPDATELOGIN({NONEXISTANT},
{INST_MODE}, {NEW_CASEID}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
ADDCASE, INFOSHEET, INSERTFIELDS, SELECTFIELD, UPDATECASE, UPDATEFIELDS, UPDATELOGIN
Returns the specified character expression in uppercase. Each lowercase letter (a – z) in the character expression is converted to uppercase (A- Z) in the returned string.
Syntax
UPPER( cExpression )
Returns
Text
Arguments
cExpression Specifies the character expression UPPER() converts to uppercase.
Examples
UPPER(“abcdefgh”) Returns ABCDEFGH
UPPER (“My house is red”) Returns MY HOUSE IS RED
Possible uses
Function |
Result |
Error report |
{FULLNAME} |
“Luisa lane“ |
|
[QFNAME] |
“pete rivers” |
|
UPPER({FULLNAME}) |
“LUISA
LANE” |
|
UPPER([QFNAME]) |
“PETE
RIVERS” |
|
UPPER("Hi, how are
you?") |
“HI,
HOW ARE YOU?” |
|
UPPER( ? ) ? = Numeric, Date,
Time, Array, Roster, Matrix |
-999999999 |
Incompatible
types in the parameter array of the UPPER
function. Found: ?, required: Text. |
UPPER({NONEXSITANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+ (additive operator), ALLTRIM, AT, DATE2TEXT, DECODE, IN, LEN, LOWER, LTRIM, PADL, RAT, STR, STRCMP, SUBSTR, TEXT2DATE, TIME2TEXT, TITLECASE, VAL
Returns a numeric value from a character expression composed of numbers.
Syntax
VAL( cExpression )
Returns
Numeric
Arguments
cExpression Specifies a character expression.
Examples
VAL(“90”) Returns 90
Possible uses
Function |
Result |
Error report |
{RATE} |
“1.047“ |
|
[Q333] |
“1.047” |
|
VAL({RATE}) |
1.047 |
|
VAL([Q333]) |
1.047 |
|
VAL("1.047") |
1.047 |
|
VAL( ? ) ? = Numeric, Date,
Time, Array, Roster, Matrix |
-999999999 |
Incompatible
types in the parameter array of the VAL
function. Found: ?, required: Text. |
VAL({NONEXSITANT}) |
-999999999 |
Missing
variable : {NONEXISTANT} |
See Also
+
(additive operator), - (subtraction operator), * (multiplication
operator), / (division operator), ^ (exponentiation operator), ABS, ACOS, ANGLE, ASIN, ATAN, CODE, COS, INT, LOG, MAX, MIN, MOD, RAND, ROUND, SIN, TAN, WEEKLYWAGE
ALLTRIM, AT, DATE2TEXT, DECODE, IN, LEN, LOWER, LTRIM, PADL, RAT, STR, STRCMP, SUBSTR, TEXT2DATE, TIME2TEXT, TITLECASE, UPPER
Determines if a variable exists. VAREXIST( ) returns 1 if the variable exists; otherwise, VAREXIST( ) returns 0.
Syntax
VAREXIST( Expression )
Returns
Numeric
Arguments
Expression Variable to check. {SymbolName} | [QName] | {^ArrayElement^}
Examples
VAREXIST({NONEXISTANT}) Returns 0
Possible uses
Function |
Result |
Error report |
VAREXIST({NOASCHAR}) |
1 |
|
VAREXIST([Q333]) |
1 |
|
VAREXIST({TODAY}) |
1 |
|
VAREXIST({X}) |
1 |
|
VAREXIST({NONEXISTANT}) |
0 |
|
VAREXIST({CTIME}) |
1 |
|
VAREXIST({*JOBS*}) |
1 |
|
VAREXIST({^ANAMES(1)^}) |
1 |
|
VAREXIST({^ANAMES^}) |
1 |
|
VAREXIST([QSALL]) |
1 |
|
See Also
FOR ... ENDFOR, IIF, ISVAREMPTY, LANGUAGE, READGLOBAL, REPEAT ... UNTIL, SET HEADER TO, SWITCH, SYMBOL, VARTYPE, WHILE ... ENDWHILE, WRITEGLOBAL
Determines the type of a variable could be -1 (doesn't exist), 0 = NULL (doesn't have a specified type), > 0 Var Type.
Syntax
VARTYPE( Expression )
Returns
Numeric
Arguments
Expression Variable to get the type. {SymbolName} | [QName] | {^ArrayElement^}
Examples
VARTYPE({NONEXISTANT}) Returns 0
Possible uses
Function |
Result |
Error report |
VARTYPE({NOASCHAR}) |
7 |
|
VARTYPE([Q333]) |
7 |
|
VARTYPE({TODAY}) |
8 |
|
VARTYPE({X}) |
1 |
|
VARTYPE({NONEXISTANT}) |
-1 |
|
VARTYPE({CTIME}) |
8 |
|
VARTYPE({*JOBS*}) |
8 |
|
VARTYPE({^ANAMES(1)^}) |
7 |
|
VARTYPE({^ANAMES^}) |
8 |
|
VARTYPE([QSALL]) |
8 |
|
See Also
FOR ... ENDFOR, IIF, ISVAREMPTY, LANGUAGE, READGLOBAL, REPEAT ... UNTIL, SET HEADER TO, SWITCH, SYMBOL, VAREXIST, WHILE ... ENDWHILE, WRITEGLOBAL
Calculates a weekly pay rate from another pay rate format.
Syntax
WEEKLYWAGE( {SymbolName}|[QName], "HOURLY" | "DAILY" | "WEEKLY" | "BIWEEKLY" | "MONTHLY" | "BIMONTHLY" | "YEARLY" | {Format}, "DOLLARS" | "CENTS",
{HoursXWeek}|[QName]|HoursXWeek, {HoursXDay}|[QName]|HoursXDay )
Returns
Numeric
Arguments
{SymbolName}|[QName] nExpression where the actual dollar amount of pay is stored.
“HOURLY”|”DAILY”|”WEEKLY”|”BIWEEKLY”|”MONTHLY”|”BIMONTHLY”|”YEARLY”|{Format}
Indicates the actual time unit of pay rate reported and can be one of the following :
HOURLY | DAILY | WEEKLY | BIWEEKLY | MONTHLY | BIMONTHLY | YEARLY.
The format may also be stored as a variable.
SPECIAL FORMATS
If the format specified is DAILY the syntax will be:
WEEKLYWAGE(%PayRate%, DAILY|%Format%, RESULT, %SaveSymbol%, %HoursXDay%, %HoursXWeek%);
Where: %HoursXDay%, hours per day, and %HoursXWeek%, hours per week, are SymbolName that contain the number of hours worked per day and the number of hours worked per week.
If the format specified is HOURLY the syntax will be:
WEEKLYWAGE(%PayRate%, HOURLY|%Format%, RESULT, %SaveSymbol%, %HoursXDay%);
Where: %HoursXDay%, hours per day is a symbol that contains the number of hours worked per day.
“DOLLARS”|”CENTS” Specifies how the calculated pay rate is to be expressed. May be expressed in DOLLARS|CENTS.
e.g., 7.83 or 783, respectively.
{HoursXDay}|[QName]|HoursXDay
Number of hours worked per day that is necessary for the calculation of specific types of time units (FORMATS).
{HoursXWeek}|[QName]|HoursXWeek
Number of hours worked per week that is necessary for the calculation of specific types of time units (FORMATS).
Examples
WEEKLYWAGE({SALARY}, “HOURLY”, “DOLLARS”, 40, 8) Returns 8333.20
Possible uses
Function |
Result |
Error report |
WEEKLYWAGE({SALARY},
"HOURLY", "DOLLARS", {HOURSXWEEK}, {HOURSXDAY}) |
8333.200195 |
|
WEEKLYWAGE({SALARY},
"HOURLY", "DOLLARS", {HOURSXWEEK}, [QHOURSXD]) |
8333.200195 |
|
WEEKLYWAGE({SALARY},
"HOURLY", "DOLLARS", {HOURSXWEEK}, 8) |
8333.200195 |
|
WEEKLYWAGE({SALARY},
"HOURLY", "DOLLARS", [QHOURSXW], {HOURSXDAY}) |
8333.200195 |
|
WEEKLYWAGE({SALARY},
"HOURLY", "DOLLARS", [QHOURSXW], [QHOURSXD]) |
8333.200195 |
|
WEEKLYWAGE({SALARY},"HOURLY","DOLLARS",
[QHOURSXW], 8) |
8333.200195 |
|
WEEKLYWAGE({SALARY},
"HOURLY", "DOLLARS", 40, {HOURSXDAY}) |
8333.200195 |
|
WEEKLYWAGE({SALARY},
"HOURLY", "DOLLARS", 40, [QHOURSXD]) |
8333.200195 |
|
WEEKLYWAGE({SALARY},
"HOURLY", "DOLLARS", 40, 8) |
8333.200195 |
|
WEEKLYWAGE
([QSALARY], "HOURLY", "DOLLARS", {HOURSXWEEK},
{HOURSXDAY}) |
8333.200195 |
|
WEEKLYWAGE
([QSALARY], "HOURLY", "DOLLARS", {HOURSXWEEK},
[QHOURSXD]) |
8333.200195 |
|
WEEKLYWAGE
([QSALARY], "HOURLY", "DOLLARS", {HOURSXWEEK}, 8) |
8333.200195 |
|
WEEKLYWAGE
([QSALARY], "HOURLY", "DOLLARS", [QHOURSXW], {HOURSXDAY}) |
8333.200195 |
|
WEEKLYWAGE
([QSALARY], "HOURLY", "DOLLARS", [QHOURSXW], [QHOURSXD]) |
8333.200195 |
|
WEEKLYWAGE
([QSALARY], "HOURLY", "DOLLARS", [QHOURSXW], 8) |
8333.200195 |
|
WEEKLYWAGE
([QSALARY], "HOURLY", "DOLLARS", 40, {HOURSXDAY}) |
8333.200195 |
|
WEEKLYWAGE
([QSALARY], "HOURLY", "DOLLARS", 40, [QHOURSXD]) |
8333.200195 |
|
WEEKLYWAGE
([QSALARY], "HOURLY", "DOLLARS",40,8) |
8333.200195 |
|
WEEKLYWAGE
(208.33, "HOURLY", "DOLLARS", {HOURSXWEEK}, {HOURSXDAY}) |
8333.200195 |
|
WEEKLYWAGE
(208.33, "HOURLY", "DOLLARS", {HOURSXWEEK}, [QHOURSXD]) |
8333.200195 |
|
WEEKLYWAGE
(208.33, "HOURLY", "DOLLARS", {HOURSXWEEK}, 8) |
8333.200195 |
|
WEEKLYWAGE
(208.33, "HOURLY", "DOLLARS", [QHOURSXW], {HOURSXDAY}) |
8333.200195 |
|
WEEKLYWAGE
(208.33, "HOURLY", "DOLLARS", [QHOURSXW], [QHOURSXD]) |
8333.200195 |
|
WEEKLYWAGE
(208.33, "HOURLY", "DOLLARS", [QHOURSXW], 8) |
8333.200195 |
|
WEEKLYWAGE
(208.33, "HOURLY", "DOLLARS", 40, {HOURSXDAY}) |
8333.200195 |
|
WEEKLYWAGE
(208.33, "HOURLY", "DOLLARS", 40, [QHOURSXD]) |
8333.200195 |
|
WEEKLYWAGE
(208.33, "HOURLY", "DOLLARS", 40, 8) |
8333.200195 |
|
WEEKLYWAGE({SALARY},
"HOURLY", "DOLLARS", {HOURSXWEEK}, {NAME}) |
-999999999 |
Incompatible
types in WeeklyWage.HoursXDay. Found:STRING,
required: NUMERIC. |
WEEKLYWAGE({SALARY},
"HOURLY", "DOLLARS", {HOURSXWEEK}, {XXX}) |
-999999999 |
Missing
variable : {XXX} |
WEEKLYWAGE({SALARY},
"HOURLY", "DOLLARS", {HOURSXWEEK}, {TODAY}) |
-999999999 |
Incompatible
types in WeeklyWage.HoursXDay. Found:DATE,
required: NUMERIC. |
WEEKLYWAGE({SALARY},
"HOURLY", "DOLLARS", {NAME}, {HOURSXDAY}) |
-999999999 |
Incompatible
types in WeeklyWage.HoursXWeek. Found:STRING,
required: NUMERIC. |
WEEKLYWAGE({SALARY},
"HOURLY", "DOLLARS", {XXX}, {HOURSXDAY}) |
-999999999 |
Missing
variable : {XXX} |
WEEKLYWAGE({SALARY},
"HOURLY", "DOLLARS", {TODAY}, {HOURSXDAY}) |
-999999999 |
Incompatible
types in WeeklyWage.HoursXWeek. Found:DATE,
required: NUMERIC. |
WEEKLYWAGE({SALARY},
"HOURLY", {X}, {HOURSXWEEK}, {HOURSXDAY}) |
-999999999 |
Incompatible
types in WeeklyWage.resultFormat. Found:NUMERIC,
required: STRING. |
WEEKLYWAGE({SALARY},
"HOURLY", {XXX}, {HOURSXWEEK}, {HOURSXDAY}) |
-999999999 |
Missing
variable : {XXX} |
WEEKLYWAGE({SALARY},
"HOURLY", "XDOLLARS", {HOURSXWEEK}, {HOURSXDAY}) |
-999999999 |
Invalid
result format 'XDOLLARS' in WeeklyWage function. |
WEEKLYWAGE({SALARY},
{X}, "DOLLARS", {HOURSXWEEK}, {HOURSXDAY}) |
-999999999 |
Incompatible
types in WeeklyWage.answerFormat. Found:NUMERIC,
required: STRING. |
WEEKLYWAGE({SALARY},
{XXX}, "DOLLARS", {HOURSXWEEK}, {HOURSXDAY}) |
-999999999 |
Missing
variable : {XXX} |
WEEKLYWAGE({SALARY},
"XHOURLY", "DOLLARS", {HOURSXWEEK}, {HOURSXDAY}) |
-999999999 |
Invalid
answer format 'XHOURLY' in WeeklyWage function. |
WEEKLYWAGE({NAME},
"HOURLY", "DOLLARS", {HOURSXWEEK}, {HOURSXDAY}) |
-999999999 |
Incompatible
types in WeeklyWage.payRate. Found:STRING,
required: NUMERIC. |
WEEKLYWAGE({XXX},
"HOURLY", "DOLLARS", {HOURSXWEEK}, {HOURSXDAY}) |
-999999999 |
Missing
variable : {XXX} |
WEEKLYWAGE({TODAY},
"HOURLY", "DOLLARS", {HOURSXWEEK}, {HOURSXDAY}) |
-999999999 |
Incompatible
types in WeeklyWage.payRate. Found:DATE,
required: NUMERIC. |
See Also
+ (additive operator), - (subtraction operator), * (multiplication operator), / (division operator), ^ (exponentiation operator), ABS, ACOS, ANGLE, ASIN, ATAN, CODE, COS, INT, LOG, MAX, MIN, MOD, RAND, ROUND, SIN, TAN, VAL
Executes a set of questions within a conditional loop.
Syntax
WHILE (lExpression; [EndWhileQName])
Questions
.
.
ENDWHILE
Arguments
lExpression Specifies a logical expression whose value determines whether the questions between WHILE and ENDWHILE are executed. As long as lExpression evaluates to true, the set of questions are executed.
[EndWhileQName] Corresponding ENDWHILE question name. This is the question to go after the ExprL (logical expression) does not match anymore, when it returns false.
Examples
WHILE (({MOREPEOPLE} == 1); [QENDWHILE])
Questions
.
.
ENDWHILE
See Also
FOR ... ENDFOR, IIF, ISVAREMPTY, LANGUAGE, READGLOBAL, REPEAT ... UNTIL, SET HEADER TO, SWITCH, SYMBOL, VAREXIST, VARTYPE, WRITEGLOBAL
Writes a global symbol value. A global symbol exists only once in the answers, so if a different value is set, previous value will be overwritten. The global symbol value is accessible in every scope.
Syntax
WRITEGLOBAL({VarName1}=Value=Type, {VarName2}=Value=Type, ... {VarNamen}=Value=Type)
Arguments
{VarNamen} Name of the symbol or array element to be created globally.
Value Initial value of the created symbol or array element. It can be another variable or a constant value.
Type Type of the symbol to be created.
INT = integer
LONG = long integer
FLOAT = floating point field
DATE = date
TIME = time
CHAR = character
DOUBLE = double
Examples
WRITEGLOBAL({NOPRODUCTS}=0=INT, {OTHER}=”other products”=CHAR)
WRITEGLOBAL({^ANAMES(1)^}=”Ann”=CHAR, {^ANAMES(2)^}=”Smith”=CHAR)
See Also
FOR ... ENDFOR, IIF, ISVAREMPTY, LANGUAGE, READGLOBAL, REPEAT ... UNTIL,
SET HEADER TO, SWITCH, SYMBOL, VAREXIST, VARTYPE,
WHILE ... ENDWHILE
The XFER command transfers the values in roster fields to symbols (variables), or from symbols (variables) to roster fields. Conditions upon transferring may be put on individual fields.
Syntax
XFER INTO {*RosterName*} [ TO RNo | {RNo} | [QName] ]
[ WHERE ExprL [AND | OR ExprL ...]]
FIELDS RosterField1={SymbolName1} [, ..., RosterFieldn={SymbolNamem}]
XFER OUT {*RosterName*} [ FROM RNo | {RNo} | [QName] ]
[ WHERE ExprL [AND | OR ExprL ...]]
FIELDS RosterField1={SymbolName1} [, ..., RosterFieldn={SymbolNamem}]
Arguments
{*RosterName*} Roster name to be used.
RNo|{RNo}|[QName] Integer number of the row to transfer in or out the values.
ExprL Logical expression that if matched controls what records will be transfered from or into the roster.
ToRNo|{ToRNo}|[QName]|"END" Integer number of the last row in the roster to be updated. If “END” is specified indicates that records up to and through the last row in the roster will be updated.
RosterFieldn Roster field whose contents will transfer in or out.
{SymbolNamem} Name of the variable whose contents will transfer in or out.
Examples
XFER INTO {*HHI*} TO 1 FIELDS NAME={RNAME}, SEX={RSEX}
XFER INTO {*HHI*} WHERE {^AAGE^}<20 FIELDS NAME={^ANAME^}
XFER INTO {*BI*} FIELDS NAME={^BI_NAME^}, SEX={^AGENDER^}
XFER OUT {*HHI*} FIELDS NAME={^AHHINAMES^}, SEX={^AGENDER^}
See Also
APPEND, CLEAN ROSTER, CLONE ROSTER, COMPRESS ROSTER, COUNTROSTER, DELETE FROM, RECCOUNT, SORT, UPDATE