From: Jack Hamilton on
They're not SAS date functions, and that's why they don't work. date=oijehbwek() won't work either.

SYSDATE and SYSTIME and macro variables, not functions - the closest function equivalents are DATE() and TIME().

months_between can be done with the INTNX function. NEXT_DAY is just date()+1.

monname and downame are SAS formats, and can be used with the PUT function.

There's a list of SAS 9.1.3 functions at <http://support.sas.com/onlinedoc/913/getDoc/en/lrdict.hlp/a000245852.htm>, and a list of formats at <http://support.sas.com/onlinedoc/913/getDoc/en/lrdict.hlp/a000309859.htm>. You can also find information on functions and formats at <www.sascommunity.org>.


--
Jack Hamilton
jfh(a)alumni.stanford.org
Suave, mare magno turbantibus aequora ventis, et terra magnum alterius spectare laborem.

On Feb 3, 2010, at 8:56 pm, SAS_learner wrote:

> Hello _all_,
>
> data _null_;
> file print;
> date= sysdate() ;
> put "date=" date;
> time= systime() ;
> format time time8.;
> put "time=" time;
> months= months_between(datepart(hiredate),today()) ;
> put "months=" months;
> day= next_day(today(), 2) ;
> format day date7.;
> put "day=" day;
> a= monname(today());
> a= downame(today());
> put "a=" a;
> a= monname3(today());
> put "a=" a;
> a= downame3(today());
> put "a=" a;
> run;
>
> Some body asked me why these date functions are not working and when I tried
> Sysdate()
> data _null_;
> 98 file print;
> 99 date= sysdate() ;
> -------
> 68
> ERROR 68-185: The function SYSDATE is unknown, or cannot be accessed.
>
> 100 put "date=" date;
> 101 run;
>
> NOTE: The SAS System stopped processing this step because of errors. and
From: Jack Hamilton on
Sorry, for months_between you would use INTCK, not INTNX. Make sure you understand how it counts intervals.


--
Jack Hamilton
jfh(a)alumni.stanford.org
Caelum non animum mutant qui trans mare currunt.

On Feb 3, 2010, at 9:16 pm, Jack Hamilton wrote:

> They're not SAS date functions, and that's why they don't work. date=oijehbwek() won't work either.
>
> SYSDATE and SYSTIME and macro variables, not functions - the closest function equivalents are DATE() and TIME().
>
> months_between can be done with the INTNX function. NEXT_DAY is just date()+1.
>
> monname and downame are SAS formats, and can be used with the PUT function.
>
> There's a list of SAS 9.1.3 functions at <http://support.sas.com/onlinedoc/913/getDoc/en/lrdict.hlp/a000245852.htm>, and a list of formats at <http://support.sas.com/onlinedoc/913/getDoc/en/lrdict.hlp/a000309859.htm>. You can also find information on functions and formats at <www.sascommunity.org>.
>
>
> --
> Jack Hamilton
> jfh(a)alumni.stanford.org
> Suave, mare magno turbantibus aequora ventis, et terra magnum alterius spectare laborem.
>
> On Feb 3, 2010, at 8:56 pm, SAS_learner wrote:
>
>> Hello _all_,
>>
>> data _null_;
>> file print;
>> date= sysdate() ;
>> put "date=" date;
>> time= systime() ;
>> format time time8.;
>> put "time=" time;
>> months= months_between(datepart(hiredate),today()) ;
>> put "months=" months;
>> day= next_day(today(), 2) ;
>> format day date7.;
>> put "day=" day;
>> a= monname(today());
>> a= downame(today());
>> put "a=" a;
>> a= monname3(today());
>> put "a=" a;
>> a= downame3(today());
>> put "a=" a;
>> run;
>>
>> Some body asked me why these date functions are not working and when I tried
>> Sysdate()
>> data _null_;
>> 98 file print;
>> 99 date= sysdate() ;
>> -------
>> 68
>> ERROR 68-185: The function SYSDATE is unknown, or cannot be accessed.
>>
>> 100 put "date=" date;
>> 101 run;
>>
>> NOTE: The SAS System stopped processing this step because of errors. and
>
From: shiva on
Hi,

sysdate is the automatic macro variable and not the function.

So,If you want to use sysdate then try using like this ;-
date="&sysdate";

or you can use today() function like this;-

date=today();

Thanks,
shiva

From: Gerhard Hellriegel on
and be careful: &sysdate has a content like 09feb2010. If you want to use
that date, you have to use it like "&sysdate"d as a date-constant. Not like

if &sysdate = today() ...

The difference between that two: &sysdate contains the date when the SAS
session was started. TODAY() is the actual date when calling. That might
be a difference, e.g. if your SAS session is running very long. I
sometimes used the difference for long running batch-jobs to see how long
it was on the machine. Not &sysdate for that, but a combination of
&sysdate and &systime, like:

"&sysdate:systime"dt in comparison to datetime()

Gerhard





On Wed, 3 Feb 2010 21:16:16 -0800, Jack Hamilton <jfh(a)STANFORDALUMNI.ORG>
wrote:

>They're not SAS date functions, and that's why they don't work.
date=oijehbwek() won't work either.
>
>SYSDATE and SYSTIME and macro variables, not functions - the closest
function equivalents are DATE() and TIME().
>
>months_between can be done with the INTNX function. NEXT_DAY is just date
()+1.
>
>monname and downame are SAS formats, and can be used with the PUT
function.
>
>There's a list of SAS 9.1.3 functions at
<http://support.sas.com/onlinedoc/913/getDoc/en/lrdict.hlp/a000245852.htm>,
and a list of formats at
<http://support.sas.com/onlinedoc/913/getDoc/en/lrdict.hlp/a000309859.htm>.
You can also find information on functions and formats at
<www.sascommunity.org>.
>
>
>--
>Jack Hamilton
>jfh(a)alumni.stanford.org
>Suave, mare magno turbantibus aequora ventis, et terra magnum alterius
spectare laborem.
>
>On Feb 3, 2010, at 8:56 pm, SAS_learner wrote:
>
>> Hello _all_,
>>
>> data _null_;
>> file print;
>> date= sysdate() ;
>> put "date=" date;
>> time= systime() ;
>> format time time8.;
>> put "time=" time;
>> months= months_between(datepart(hiredate),today()) ;
>> put "months=" months;
>> day= next_day(today(), 2) ;
>> format day date7.;
>> put "day=" day;
>> a= monname(today());
>> a= downame(today());
>> put "a=" a;
>> a= monname3(today());
>> put "a=" a;
>> a= downame3(today());
>> put "a=" a;
>> run;
>>
>> Some body asked me why these date functions are not working and when I
tried
>> Sysdate()
>> data _null_;
>> 98 file print;
>> 99 date= sysdate() ;
>> -------
>> 68
>> ERROR 68-185: The function SYSDATE is unknown, or cannot be accessed.
>>
>> 100 put "date=" date;
>> 101 run;
>>
>> NOTE: The SAS System stopped processing this step because of errors. and
 | 
Pages: 1
Prev: Solutions Manuals
Next: SQL update/insert