Re: [EpiData-list] wild cards in variable names?
I have 70 variables, named var1, var2, . . . var70
Each has a corresponding numerical variable, which is calculated from the value of var, during data entry, via an IF THEN ELSE statement in the check file:
var1num, var2num, . . . var70num
I would like each varXnum to be zero by default, when a new record is opened.
Easy: (try): before file defaultvalue var1num-var70num 0 end
You must get v3.1 latest build (jan 2006) for this to work. Also the variables must be placed in sequence. The first implementation of defaultvalue wasa a bit different, updated installation files with the text below in the help files are uploaded with about 30 minutes.
The command DEFAULTVALUE can be used to assign a certain value instead of “blank” for any fields.
Default values can be defined like this:
In a BEFORE FILE or BEFORE RECORD block you add:
DEFAULTVALUE ALL | ALLSTRINGS | ALLSTRING | ALLNUMERIC x
Similarly for lists of fields:
DEFAULTVALUE field1-field10,field12 x DEFAULTVALUE field14-field20,field11 "x"
In a field block: DEFAULTVALUE x
A DEFAULTVALUE expands the range, legal or comment legal definitions of a field. If DEFAULTVALUE 9 is part of a field block then the value 9 is allowed to be entered even if e.g. RANGE 1-5 is also defined. Field block specification overrules a general definition in a BEFORE FILE or BEFORE RECORD block.
DEFAULTVALUEs will be exported as part of the any COMMENT LEGAL definitions for the field in question.
The category text assigned will be “Default”.
*NOTE: The value assignment only takes place in new records. Not in already entered records.*
/ /
/Examples:/
(in before file block):
DEFAULTVALUE ALL 9 fills all numerical and string fields with 9
DEFAULTVALUE ALL “No info” ALLstrings fills all string fields with “No info”
(in a field block):
DEFAULTVALUE 2001 assigns the value 2001 as default.
(in a string field):
DEFAULTVALUE “No Information” assigns the value “No Information” as default.
Regards Jens Lauritsen EpiData Association ps. The revising of the website is almost done (a few pages are left).
participants (1)
-
epidata-list@lists.umanitoba.ca