[EpiData-list] help with week + year combination

epidata-list at lists.umanitoba.ca epidata-list at lists.umanitoba.ca
Tue Oct 17 22:15:32 CDT 2006


It works perfectly.  Thanks very much.

-----Original Message-----
From: epidata-list-bounces at lists.umanitoba.ca
[mailto:epidata-list-bounces at lists.umanitoba.ca] On Behalf Of
epidata-list at lists.umanitoba.ca
Sent: Tuesday, October 17, 2006 4:16 PM
To: epidata-list at lists.umanitoba.ca
Subject: Re: [EpiData-list] help with week + year combination

Small change to your code below. Will that work?
Jamie

> I am hoping I can get some help with epidata and use of year and 
> week. 
>
>   
Before file
  DEFINE WEEKS ##
  DEFINE YEARS ####
  DEFINE WEEK ####.##
end
DATEFROM
  MUSTENTER
  AFTER ENTRY
    LET WEEKS = WEEKNUM(DATEFROM) + 1
    LET YEARS = YEAR(DATEFROM)
    LET WEEK =  float(YEARS)+float(WEEKS)/100
  END
END

If you want WEEK as a string, try:

let week = string(years)+"-"+copy(string(100+weeks),2,2)
(week is a string of length 7)
This will yield WEEK like the following
"2006-01"
"2006-52"



_______________________________________________
EpiData-list mailing list
EpiData-list at lists.umanitoba.ca
http://lists.umanitoba.ca/mailman/listinfo/epidata-list


More information about the EpiData-list mailing list