Feature Upgrade: Since CSPro 6.0, you can now use variable-length strings. You are encouraged to use strings instead of fixed-width alpha variables whenever possible.
alpha [(len)] var-1[, var-2[..., var-n]];
The alpha statement is used to define alphanumeric variables used in the application. The len is the number of characters in the variable. The len applies to all variables which follow in the same statement. If no len is given, 16 is assumed. The maximum string length that can be declared is 8,192. If you attempt to assign to an alpha variable a string that is longer than the variable's size, the string will be truncated from the right. Conversely, it you assign a string that is shorter than the variable's size, the trailing character positions will be blank-filled.
The following two examples, using the declaration of x below, should clarify this point:
x = "hi mom";
x will now equal "hi mom "
x = "good night, mom";
x will now equal "good night"
alpha (3) reply;
if q5 = 1 then
reply = "Yes";
flag = "Y";
If the user attempts to assign the string "Not reported" to the variable "reply," CSPro would place the letters "Not" in the variable and drop the remaining characters of the string.