|
|
date question
Can someone tell me why I am getting different results for date1 and date2?
data _null_;
date1 = '31MAR2003'd;
call symput ('date1',date1);
run;
%let date2 =%STR('31MAR2003'd);
%put &date1 ;
%put &date2 ;
1208 %let date2 =%STR('31MAR2003'd);
1209 %put &date1 ;
15795
1210 %put &date2 ;
'31MAR2003'd
|
|
0
|
|
|
|
Reply
|
cynqiu (10)
|
10/3/2003 4:46:30 PM |
|
The date was being resolved in the datastep. Try this:
data _null_;
date1 = "'31MAR2003'd";
call symput ('date1',date1);
run;
%let date2 =%STR('31MAR2003'd);
%put &date1 ;
%put &date2 ;
Paul Choate
DDS Data Extraction
(916) 654-2160
-----Original Message-----
From: Cynthia qiu [mailto:cynqiu@YAHOO.COM]
Sent: Friday, October 03, 2003 9:47 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: date question
Can someone tell me why I am getting different results for date1 and date2?
data _null_;
date1 = '31MAR2003'd;
call symput ('date1',date1);
run;
%let date2 =%STR('31MAR2003'd);
%put &date1 ;
%put &date2 ;
1208 %let date2 =%STR('31MAR2003'd);
1209 %put &date1 ;
15795
1210 %put &date2 ;
'31MAR2003'd
|
|
0
|
|
|
|
Reply
|
pchoate (2551)
|
10/3/2003 5:06:11 PM
|
|
On 3 Oct 03 16:46:30 GMT, cynqiu@YAHOO.COM (Cynthia qiu) wrote:
>Can someone tell me why I am getting different results for date1 and date2?
>
>data _null_;
> date1 = '31MAR2003'd;
> call symput ('date1',date1);
>run;
>%let date2 =%STR('31MAR2003'd);
>%put &date1 ;
>%put &date2 ;
>
>1208 %let date2 =%STR('31MAR2003'd);
>1209 %put &date1 ;
>15795
>1210 %put &date2 ;
>'31MAR2003'd
Dates are stored by SAS as integers. The expression '31mar2003'd in a
data step generates an integer that corresponds to the number of days
between 01jan1960 and 31mar2003. Your call symput statement converts
this integer to a string, and stores it as a macro variable. When you
define date2 you are simply writing the string <'31mar2003'd> as a
macro variable - outside of the data step no integer conversion
occurs.
JW
|
|
0
|
|
|
|
Reply
|
jweedon (207)
|
10/3/2003 5:40:14 PM
|
|
|
2 Replies
36 Views
(page loaded in 0.32 seconds)
Similiar Articles: Re: Question about read in Excel date data - comp.soft-sys.sas ...Sarah, I couldn't decide whether to post my response in your thread, or the one that Peter started regarding "Bad Ways to Code Data". But, since ... Question from AIX guy re language/date settings on Solaris - comp ...John Leslie <johnleslie@madasafish.com> wrote: > My question is, what controls character set/language and date format > settings on Solaris? > > Does Solaris use ... Set passwords to not expire on Samba - comp.os.linux.questions ...Getting password expiration date - comp.sys.hp.hpux Set passwords to not expire on Samba - comp.os.linux.questions ... Getting password expiration date - comp.sys.hp.hpux ... Date Range Calculation - comp.databases.filemaker... etc I was thinking of using several global fields for specific date ranges but I can't figure out how to base a calculation on a date range. So I guess my question ... Julian Date to Normal Date - comp.soft-sys.matlabThe result will be the serial date number of date/time in question, and can be converted back using datenum. Alternately, get the date vector form of the ... implementation question (Java): Timestamp - comp.protocols.time ...Checksum with no creation date - comp.lang.java.help I need the jar files ... New to Web Services question about wsgen - comp.lang.java ... ... STS with a java ... Select As question - comp.databases.oracle.serverIn SQL I am able to select a field as something else. I will use this in generic function for naming grid columns readable to the user. e.g. Select bdate as [Date of ... lpstat -p question - comp.unix.solaris... lpstat -p question - comp.unix.solaris Cups on solaris 8 - comp.unix.solaris lpstat -p question - comp.unix.solaris (say pre-Solaris 8) you have to get up to date on the ... date time concatenation - comp.soft-sys.sasOracle: Will someone help me with a date ? time concatenation ... database.itags.org: Oracle question: Will someone help me with a date ? time concatenation?, created at ... SAS and dates - comp.soft-sys.sasI know SAS keeps dates by the number of days since (or before) a certain date. So I figure to find out my question I would do: LengthDisease=datesurveytaken ... The Best Questions For A First Date « OkTrendsFirst dates are awkward. There is so much you want to know about the person across the table from you, and yet so little you can directly ask. Start With A Date - 25 QuestionsSpeed dating is a new, fun, exciting, and no pressure way to meet other singles in your age and/or interest group. What makes speed dating different from the typical ... 7/22/2012 9:45:59 PM
|
|
|
|
|
|
|
|
|