Date: Mon, 18 Feb 2008 08:57:48 -0500
Reply-To: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Subject: Re: working with weekdays
Content-Type: text/plain; charset=ISO-8859-1
What means "all months"? Here a "quick and dirty" way to make it for a
year.
%let year=2008;
%let weekd=2; /* monday */
data a;
start="01jan&year"d;
do while (weekday(start) ne &weekd);
start+1;
end;
do date=start to "31dec&year"d by 7;
output;
end;
format date date9.;
drop start;
run;
%let weekd=5; /* thursday */
data b; /* a copy of a */
start="01jan&year"d;
do while (weekday(start) ne &weekd);
start+1;
end;
do date=start to "31dec&year"d by 7;
output;
end;
format date date9.;
drop start;
run;
data dates_&year;
merge a b;
by date;
run;
Gerhard
On Mon, 18 Feb 2008 13:05:18 +0000, Marcelo Lamack
<mar.lamack@HOTMAIL.COM> wrote:
>Dear all, is it possible create, automatically, a variable with all the
>Monday and Thursday, like this:
>
>18/02/2008
>21/02/2008
>25/02/2008
>28/02/2008
>03/03/2008
>.
>.
>for all months
>
>Best regards
>
>JL
>_________________________________________________________________
>Receba GR?IS as mensagens do Messenger no seu celular quando você ¥stiver
offline. Conheç¡ o MSN Mobile!
>http://mobile.live.com/signup/signup2.aspx?lc=pt-br
|