Dear Friends, Thanks for your time and effort. I tried in so many many ways. Nothing is working. I am attching a sample file with following PGM.
The error message obtained are shown in the next line beginning with "*" Kindly help.
With regards,
Dr. Shavinder Singh
*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)
define interval2 ### let interval2=Integer(date("wdate" - "dbirth")) list Interval2
*Error message Access violation at address 006C91D6 in module 'EPIDATASTAT.EXE'. Read of address FFFFFFFF
define interval3 ### let interval3=Integer(date("wdate") - date("dbirth")) list Interval3
*Error message - (NO RESPONSE)
define interval4 ### let interval4=Integer(round(date("wdate","mdy")- date("dbirth","mdy"))) list Interval4
*Error message -(NO RESPONSE) close
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@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)
participants (1)
-
epidata-list@lists.umanitoba.ca