Expression commands

Top  Previous  Next

These commands perform special functions which enable Facform to obtain and decode the input file of raw data.

 

$A????  (treat as UPPER case, alphabetical)

"Alphabetize": means convert to UPPER-CASE characters, between quotation marks, the expression ????, whether or not it is already in quotes, e.g., $A("New York") becomes "NEW YORK".

 

$Cnnn  (locate Comma-Separated value)

"Comma-separated value": means read the nnn"th comma-separated value from the current data record into a quoted character variable,

e.g., if the data record is 12,34,56,43, then $C2 is "34".

By default, the separating character is ",". Change this with $Separator=.

For Tab separators, use $T

 

$G  (the current line-group number)

"Group": means the current line-group number. The line-group number advances each time the keyword list is restarted. This is the same as $L unless $Nextline appears in the keyword list. When $Nextline is processed, $L advances by 1, but $G does not change. This can be used to identify examinees in the raw data file, e.g.,

$Label=1,$G ; Facet 1 is examinees, line-group number is the examinee number

Y=$G ; assigns the current line-group number to variable Y.

 

$I????  (treat as an integer value)

"Integer": means convert the expression represented by ???? to the nearest integer value. Values ending in 0.5 evaluate to the next larger value in absolute size. $I12.49 evaluates to 12. $I12.5 evaluates to 13. $I(-12.5) evaluates to -13.

The expression may be in numeric or character format. For character expression, only leading digits are evaluated. $I"23abcd" evaluates to 23. $I"AB12" evaluates to 0.

 

$L  (use the current line number)

"Line": means the current line number in the input file of raw data file. This is useful when you wish to identify anomalies in the raw data file. E.g.,

$If=(DATUM>"4")

$Print "Unexpected value of "+DATUM+" in line "+$Q($L)

$Endif

 

$N????  (convert into a number)

"Number": means convert the expression represented by ???? to a number. If the expression is already a number, it is unchanged. If it is a character expression, then the leading digits are evaluated. E.g., $N"23.4abcd" evaluates to 23.4

 

$Q????  (put value between "")

"Quote": means convert to characters, between quotation marks, the expression ????. If ???? is already a quoted character value, it is unchanged. Otherwise ???? is converted to characters and placed between "". E.g., $Q(2+3) becomes "5".

 

$SxxEyy  (start and end in data line)

"Start-End": means read the characters from the current data record, starting in position xx and ending in position yy as a quoted character variable.

E.g., if the data record contains ABCDEF starting in column 1, then $S2E4 yields "BCD".

 

$SxxWww (start and width in data line)

"Start-Width": means read the characters from the current data record, starting in position xx with a width of ww, as a quoted character variable.

E.g., if the data record contains ABCDEF starting in column 1, then $S3W2 yields "CD".

 

$Tnnn  (locate Tab-separated value)

"Tab-separated value": means read the nnn"th Tab-separated value from the current data record into a quoted character variable,

e.g., if the data record is 12[Tab] 34[Tab] 56[Tab] 43, then $T2 is "34".

 

$U????  (unquote, remove from "")

"Unquote": means remove the quotes from around the value ???? if there are any. This can be used to convert a character string into a variable name. e.g., $U"AB" is the variable name AB.