[EpiData-list] Age Calculation
epidata-list at lists.umanitoba.ca
epidata-list at lists.umanitoba.ca
Sat Feb 24 07:57:02 CST 2007
Date variables may be subtracted. So in your example, the correct syntax is:
interval = wdateu - dburthu
Why do you redefine the two dates? Are they <dd/mm/yyyy> in your .qes
file? The DATE function is for transforming STRING variables in the form
of dates into date variables (which are stored as number of days since a
time picked by the EpiData team) That's why subtraction works.
Conversion of one variable type to another is often a challenge. The
functions that help you do this are explained in the help file (just
press <F1> and then click on the Functions link). The variable types for
input and output of functions are shown.
Jamie
epidata-list at lists.umanitoba.ca wrote:
> *Try.pgm
> cls
> close
> set echo=off
> set replace logfile=on
> read "d:\work\amdate.rec"
> define wdateu <DD/MM/YYYY>
> LET wdateu=wdate
>
> define dbirthU <DD/MM/YYYY>
> LET dbirthU=dbirth
>
> logopen "TRY.PGM OUTPUT FILE" /CLOSE
> define interval ###
> let interval=date("wdateu","dmy")- date("dbirthu","dmy")
> list Interval
>
> *Error message - (NO RESPONSE)
>
More information about the EpiData-list
mailing list