Tables and axes > Include and substitution > Filing and retrieving non-identical statements > Symbolic parameters for codes
 
Symbolic parameters for codes
Quick reference
To define a symbolic parameter for codes, type:
punch(letter)='code'
To use a code symbolic parameter, type:
var_name'letter'
where letter is the name of the symbolic parameter.
More information
Codes are assigned symbolic parameters in much the same way as columns, except that the notation is:
cn'a'
where n is any whole number and 'a' is any single letter in uppercase or lowercase.
For example, you might have a set of questions asking which brands of cat food were bought on various visits to the shops. Each brand has a different code, but all information about any one visit is stored in the same column. However, you need to set up axes based on the brand bought rather than the visit when it was bought. Thus you might have an axis as follows:
l brda
n10Base
n01First Visit;c=c134'1'
n01Second Visit;c=c137'1'
n01Third Visit;c=c140'1'
n01Fourth Visit;c=c143'1'
The axes for the other three brands are exactly the same except that codes 2, 3 and 4 are used instead of a ‘1’. Therefore it makes sense to use an include file:
n10Base
n01First Visit;c=c134'p'
n01Second Visit;c=c137'p'
n01Third Visit;c=c140'p'
n01Fourth Visit;c=c143'p'
and include it as follows:
l brda
#include brds;punch(p)='1'
l brdb
#include brds;punch(p)='2'
For each run, you can use up to 31 different symbolic parameters for codes (including blanks). Also, all definitions are only relevant to the statements within the include file.
If you type any additional characters inside the quotes, Quantum converts the letter to its corresponding codes and does not perform the substitution you require.
Note If your code substitution appears not to be working, check that you have not accidentally typed an extra character with the symbolic parameter inside the quotes. Quantum only performs the substitution if the symbolic parameter is the only code inside the quotes. If there is any other code inside the single quotes with the symbolic parameter, Quantum treats the symbolic parameter as a multicode. For example, if you type:
1 ax1
#include brds;punch(p)='1'

and brds contains the following line:

n01Brand A;c=c132'5p'
Quantum will treat the ‘p’ as a multicode of ‘7–&’ and will include in the element any record in which column 132 contains any of the codes 5, 7, – or &. Without the ‘5’, the specification would refer only to records with a code 1 in c132.
See also
Filing and retrieving non-identical statements