From: Nathalie Billaudeau on 2 Feb 2010 12:26 I want to create a binary variable which equals 1 if the date is the week (between Monday and Friday) and 0 if it's the weekend (Saturday or Sunday) from a variable date MMDDYY10.
From: stickerr on 2 Feb 2010 13:00 On Feb 2, 12:26 pm, Nathalie Billaudeau <nathaliebillaud...(a)gmail.com> wrote: > I want to create a binary variable which equals 1 if the date is the > week (between Monday and Friday) and 0 if it's the weekend (Saturday > or Sunday) from a variable date MMDDYY10. WEEKDAY( date ) returns the day of the week from a SAS date value.
From: Arthur Tabachneck on 2 Feb 2010 18:27 Nathalie, I think you are asking for something like the following: data have; format date date9.; do date="1feb2010"d to "8feb2010"d; output; end; run; data want; set have; x=WEEKDAY( date ); want=not(WEEKDAY(date) in (1,7)); run; HTH, Art --------- On Tue, 2 Feb 2010 09:26:20 -0800, Nathalie Billaudeau <nathaliebillaudeau(a)GMAIL.COM> wrote: >I want to create a binary variable which equals 1 if the date is the >week (between Monday and Friday) and 0 if it's the weekend (Saturday >or Sunday) from a variable date MMDDYY10.
|
Pages: 1 Prev: U-codes for Greek letters in SAS 9.2 Next: Zip to Congressional District? |