Ordinarily this program is invoked by the Web interface for the SDA programs, and the user does not have to deal with the keywords given in this document. Output from the program is in HTML, which can be viewed with a Web browser. Users who run this program interactively should see the online help document.
It is also possible to run the program directly by preparing a command file, which specifies the variables to be analyzed and the options to use. This document explains how to prepare such a file. The name of this batch command file is specified to the program after the ‘-b’ option flag.
(Input and output definitions) MAP= (Recode map) * CATLABELS= [optional] (Category text and labels) * TEXT= [optional] (Descriptive text) *A line with two asterisks (**) on a line by itself can be added, in order to separate sets of RECODE commands in the same batch file. This is how you include multiple recodes in the same file.
Keyword Possible Specification Default (if no keyword) _____________________________________________________________________ STudies= path of source dataset(s) Look for input variables only in current directory INvars= name(s) of input var(s) REQUIRED
Keyword Possible Specification Default (if no keyword) _____________________________________________________________________ OUTSTudy= path of study for new variable Current directory OUTVar= name of new variable REQUIRED LABEL= long label for new variable No long label CATlabels= (precedes lines of category No category text text - see details below) or labels MAP= (precedes lines with recode REQUIRED map or rules - see below) MD= list of invalid codes, ranges No defined MD codes (also used for output value if input has missing data -- see below) MIN= minimum valid code No defined minimum MAX= maximum valid code No defined maximum OVERwrite= yes Do not overwrite new var if it already exists OTHercases= name of the input variable Set to MD code from which to take the value (or system-missing) for cases that do not match a pattern in the MAP TEXT= (precedes lines of descriptive No item text text - see details below)
Keyword Possible Specification Default (if no keyword) _____________________________________________________________________ DIAGnostics= yes No diagnostic summary of the new variable COLorcoding= yes No colored headings in the diagnostic output GVARCase= LOWER or UPPER Do not convert all variable names to lower/upper case LAnguagefile= Name of file with non-English English labels on labels and messages output SAVebatch= name of directory No file preserved with batch commands to create new var (for interactive version) The batch file name is the name of the new variable, with the suffix ’.rec’
map= 1: 18-49; 1 2: 18-49; 2 3: 50-97; 1 4: 50-97; 2 *
Each recode rule can include more than one value or range for
each input variable. A single asterisk (*) in a recode rule
matches any VALID value of the corresponding input variable. Two
asterisks (**) match ANY value, including missing-data (both
user-defined and system-missing) and out-of-range values. It is
possible to have more than one rule for a given output value --
notice that the output code 4 has three rules in the example
given below.
map= 1: 1,3-5,7 ; 1-10 2: 1,3-5,7 ; 11-50 3: 1,3-5,7 ; 51-90 4: 8-10,12 ; * 4: 41,45,55; 11-90 4: 61-90 ; * 9: ** ; ** *
If a case matches more than one recode rule, the first rule encountered will apply. Notice in this example that the recode rule ‘**; **’ matches all values of the two input variables; any cases not covered by a rule higher up in the map will receive the value 9.
catlabels= 1 Professional and technical [Prf,Tech] 2 Managers 3 Blue collar workers [Blue Col] 4 Other 9 Missing *
Note, however, that in the CSA recode rules, a single asterisk
(*) matches ALL values of an input variable. SDA distinguishes
between a single asterisk, which matches only the VALID values of
an input variable; and two asterisks, which match ALL values.
study = /sda/testdata invar = age outvar = age3 label = Collapsed age - 3 categories md = 9 map= 1: 18-29 2: 30-49 3: 50-97 * catlabels= 1 <30 2 30-49 3 50+ 9 missing * **
invars = age gender outvar = agesex label = Age-gender typology overwrite = yes md = 9 map= 1: 18-49; 1 2: 18-49; 2 3: 50-97; 1 4: 50-97; 2 * catlabels= 1 Yng Male 2 Yng Feml 3 Old Male 4 Old Feml 9 Missing * text= This variable is a four-category typology of age and gender * **
study = /sda/testdata invar = age outvar = age2070 label = Collapsed age - 20-70
# Note the use of the ‘othercases=’ option; # only the codes given in the map are changed. # The new variable will carry over the original values # of ’age’ for all cases not covered by the map. othercases = age
# Cases that have the value 99 on ’age’ are not covered in # the map and are assumed to be missing data. # This ’MD=’ command specifies that cases with 99 # will be defined as missing data also on the new variable. md = 99
map= 20: 1-20 70: 70-97 *
catlabels= 20 20 or younger 70 70 or older *
**
invar = spend outvar = numspend label = Recoded spend variable md = 8,9
map= 1: 1-2 2: 3 8: D 9: R *
catlabels= 1 A lot 2 Not enough 8 Don’t know 9 Refused *
**