| Date: | Thu, 15 Jul 2004 15:50:39 -0400 |
| Reply-To: | Sigurd Hermansen <HERMANS1@WESTAT.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Sigurd Hermansen <HERMANS1@WESTAT.COM> |
| Subject: | Re: A Constant in SAS |
|
| Content-Type: | text/plain |
|---|
David:
I have used SAS SQL to compute constants and assign them to SAS
Macrovariables. Unfortunately, I have not found as yet, if one exists, a
system NULL dataset that could be used in a FROM clause. Without a FROM
clause containing a suitable table reference, SAS SQL will not SELECT an
expression into a Macrovariable constant. I have to CREATE a NULL dataset
first. Other than that, the program seems easy to use, interpret, and adapt:
proc sql;
/* Ignore:*/ create table null(_ char(1));
select today() - '01jan03'd into :dtDif from null;
quit;
%put dtDif=&dtDif;
Sig
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of David
Fickbohm
Sent: Thursday, July 15, 2004 1:00 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: A Constant in SAS
People,
I am working in Windows XP SAS V8.1 I inherited a SAS program that divides
a variable by the number of days since jan 1 2003. The method by
predecessor used is ugly but works. He divided the first row of the dataset
by _N_ or one. Since the first row was Jan 1 2003 data and and he has a row
in the dataset for each day since jan 1 2003 and all he wanted was the last
row divided by number of days since jan 1 2003 this did works.
I am trying to replace this situation with something more understandable,
clearer, etc.
Temporarily I have derived the number of days since jan 1 2003 in the
datastep above the datastep where the division of the variable by the number
of days since Jan 1 2003 is done. This puts the number of days since jan 1
2003 in the datastep where the division is done.
My question is: Is there someway of deriving the number of days since jan
1, 2003 at the top of the program and then putting that number into a
constant variable I can use later in the datastep where the division is done
?
Thanks in Advance
Dave
Dave Fickbohm
Data Mining Analyst
Homegain+
2450 45th St.
Emeryville, CA, 94608
Phone 510 655 0800 ext 4151
|