Tables and axes > Include and substitution > Filing and retrieving non-identical statements > Symbolic parameters for columns
 
Symbolic parameters for columns
Syntax to define a column symbolic parameter
To define a column symbolic parameter, type:
col(letter)=column_number
Syntax to use a column symbolic parameter
cann
Parameters
a
Any single upper- or lower-case letter, except C, N, T, U, X or any other letter that is the name of a user-defined variable.
Do not use C, T and X because they are the names of Quantum variables; for example, it is an error to write ct10 because Quantum thinks you mean c(t10) to substitute the value of t10. The letters N and U are invalid because they represent the operators ‘not equal to’ and ‘unequal to’; for example, it is an error to write cU30 because Quantum thinks you are trying to check whether the value in a column field is unequal to 30, but have omitted the column numbers. Similarly, do not use the same letter for a symbolic parameter as that used for the name of a user-defined variable. This is important if the variable was defined with the s option, because Quantum does not recognize the letter as a symbolic parameter and uses the value of the variable instead.
nn
Any integer number.
More information
If you choose the symbolic parameter ‘b’, in the file ifil, you might have:
n01Prefer Product A;c=cb00'1'
n01Prefer Product B;c=cb00'2'
b00 is the symbolic parameter which is replaced by the appropriate column number each time ifil is used. This is done with the notation:
col(b)=n
on the #include statement. b is the name of the symbolic parameter and n is the value to be substituted.
For example:
#include ifil;col(b)=256
Now, when the contents of ifil are read, the column numbers are interpreted as:
n01Prefer Product A;c=c256'1'
n01Prefer Product B;c=c256'2'
Remember that the value of 256 for column b00 is relevant only to the statements within ifil. Any statements in the main file using column b00 will need separate definitions for this column.
Here is a practical example. The respondents were given two detergents marked A and B to try. After two weeks they were interviewed and asked to say which product they preferred for a variety of tasks. The client wants a table showing which product was preferred for each task.
The questionnaire shows that each task is coded into a different column, but the codes defining which product was preferred remain the same throughout: a ‘2’ in c134 indicates that Product A was preferred for washing woolens, while the same code in c135 means that Product A was preferred for washing cottons. To make this example clearer, here is the relevant part of the questionnaire:
 
No
Noticed a Difference
Only
A
B
 
Task
Diff
Pref A
Pref B
No Pref
Used 1
Only
Only
 
Woolens
1
2
3
4
5
6
7
(c134)
Cottons
1
2
3
4
5
6
7
(c135)
The row texts and the codes are the same for each product, the only thing that changes is the column, therefore you can replace it with a symbolic parameter and file the statements away in a file called ipref, as follows:
n01Noticed a Difference;c=ca00'2/4'
n01   Prefer Product A;c=ca00'2'
n01   Prefer Product B;c=ca00'3'
n01   No Preference;c=ca00'4'
n01Did Not Notice a Difference;c=ca00'1'
n01Only Used One Product (DK Which);c=ca00'5'
n01Only Used Product A;c=ca00'6'
n01Only Used Product B;c=ca00'7'
In the axis, write:
l prefer
n10Base
n23Washing Woollens;unl1
#include ipref;col(a)=134
n23Washing Cottons;unl1
#include ipref;col(a)=135
n23Washing By Hand;unl1
#include ipref;col(a)=136
        .
        .
Note that when you define a value for a symbolic parameter, it always refers to the parameter numbered 00. Whenever Quantum reads a00 from ipref, it will substitute 134, 135 or 136 in its place, as defined on the #include statement. If the notation were a06 instead, Quantum would replace it with 140 (or 141 or 142), since a06 is six more than a00.
The next example has a series of unaided questions asking respondents to name products they are aware of and then to say for which products they have seen or heard advertising. For each question, the first response is recorded separately from any others. Set up two axes, one for first mentioned in brand awareness (aware1) and the other for first mentioned in advertising awareness (aware2).
Each brand in each of the two categories is coded into a separate column. If the column contains a ‘1’, the product was mentioned first, if it contains a ‘2’, the product was not named first. The questionnaire looks like this:
      Aware of Existence            Aware of Advertising
         First  Other                   First  Other
-----------------------------  -----------------------------
Brand A    1      2     (124)  Brand A    1      2     (148)
Brand B    1      2     (125)  Brand B    1      2     (149)
Brand C    1      2     (126)  Brand C    1      2     (150)
Both axes use the same brand list, so write:
l aware1
#include blist;col(a)=124
l aware2
#include blist;col(a)=148
The rows of the axis would be defined in blist as:
n10Base
n01Brand A;c=ca00'12'
n01Brand B;c=ca01'12'
n01Brand C;c=ca02'12'
The number of the symbolic parameter is increased by 1 for each brand, because each brand has its own column. In aware1, Brand A is in c124, Brand B is in c125, Brand C is in c126, and so on, whereas when you call up blist for aware2, Brand A is read from c148, Brand B from c149, and so on.
More than one symbolic parameter of the same sort can be used on a line, if the names of the parameters are different. For example, you might want to set up an include file for rows which show whether a respondent mentioned a brand first for both questions. The condition is an ‘and’ condition requiring two columns to be named. You can either:
use the same symbolic parameter and remember to increment the second by the difference in column numbers between the two questions:
n01Brand A;c=ca00'1'.and.ca24'1'
or you can use two different parameters and have each start from 00:
n01Brand A;c=ca00'1'.and.cb00'1'
The #include statement for the latter would be:
#include bfil1;col(a)=124;col(b)=148
These examples all use n01 statements. Symbolic parameters can also be used on col and val statements:
col a00;Base;Brand A;Brand B; ...
For examples of using column symbolic parameters, see Grid tables.
See also
Filing and retrieving non-identical statements