[EpiData-list] Date variable

epidata-list at lists.umanitoba.ca epidata-list at lists.umanitoba.ca
Thu Dec 15 02:31:38 CST 2005


It's more simple to to it step by step:
1- Your qes file has to contain a variable (string, length = 4. I call it YV1)) to store the year of the date entered in V1.
2- In the chk file, edit checkblock for V1, and add the line:
YV1 = year(V1)
3- Then, it is possible to enter the check lines that will calculate the categories:
If YV1 = "xxx" then
CATEGORY = "xxx"
Endif
If YV1 = "yyy" then
CATEGORY = "yyy"
Endif
(...)
End
(assuming there is a variable called Category!)

That's it.
It's better (although you can do without) to add NOENTER to YV1 checkblock, so that it will be impossible to enter another value by accident.

Gilles Delmas

-----Message d'origine-----
De : epidata-list at lists.umanitoba.ca [mailto:epidata-list at lists.umanitoba.ca] 
Envoyé : mardi 13 décembre 2005 18:57
À : epidata-list at lists.umanitoba.ca
Objet : [EpiData-list] Date variable 



I am having some difficulties playing around with a date variable (named v1, form dd/mm/yyyy).  I wish to create a new variable with categories based upon different years within the original variable and I have tried copying the examples provided in the help section, but I'm not having any luck.  Any direction would be greatly appreciated.  Thanks, Kate





More information about the EpiData-list mailing list