Data editing > Using subroutines in the edit > Subroutines in the Quantum library > Using look-up files
 
Using look-up files
Quick reference
To load data from a look-up file, type:
call fetch($file_name$, key_start_col,put_start_col)
To load data from a look-up file and generate a report of used and unused keys, type:
call fetchx($file_name$, key_start_col,put_start_col,keys)
keys is a number whose value determines whether used or unused keys are listed in the report.
More information
Sometimes you might have additional information available that is not part of each respondent’s data record but that nevertheless needs to be read into the C array for use in the analysis. For example, you might do some additional work on a chocolate purchasing survey and collect information about the cost of various types of chocolate bars. You can transfer this information to the array in two ways:
write an edit to check which brand has been bought and then copy the appropriate price into the record using if and an assignment statement
or
in a simpler operation, put the costs into a look-up file and call them up as required with the fetch statement.
See
Creating a look-up file
The fetch statement
Listing used and unused keys
See also
Subroutines in the Quantum library