Your SAS programs, embedded in web apps and elsewhere

Question about a date format

Reply
N/A
Posts: 0

Question about a date format

Can anyone let me know if there is a date format in SAS that would produce a date as follows:

Wednesday, 30 August 2005

or, should I create my own date format?

Thanks in advance!
SAS Super FREQ
Posts: 8,743

Re: Question about a date format

Try this (in an EG code node -- NOT as a stored process). Probably WEEKDATX is the format you want. The documentation on SAS formats is quite extensive and and overview and list of formats can be found under the topic:
Dates, Times, and Intervals --> About SAS Date, Time, and Datetime Values

in the online documentation.
cynthia
[pre]
data testdates;
infile datalines;
input name $ bday1 : mmddyy10.;
bday2 = bday1;
bday3 = bday1;
bday4 = bday1;
bday5 = bday1;
return;
datalines;
alan 11/15/1950
bob 12/31/1960
carl 11/29/1984
dave 03/03/2003
;
run;

proc print data=testdates label;
var bday1-bday5;
format bday1 WEEKDATX. bday2 WEEKDATX23. bday3 worddatx. bday4 date11.;
label bday1 = 'WEEKDATX'
bday2 = 'WEEKDATX23'
bday3 = 'WORDDATX'
bday4 = 'DATE11'
bday5 = 'unformatted value';
run;

[/pre]
N/A
Posts: 0

Re: Question about a date format

Thanks, Cynthia,

I'll look at the formats.... and do you think ALL of my code is in Stored Processes ? ;-) Just kidding! I really appreciate your guidance on so many items.

Thank you again and again!
SAS Super FREQ
Posts: 8,743

Re: Question about a date format

No, but, after the last time I forgot to mention that the code was NOT a stored process, I feel that I ought to qualify code examples with how I intend them to be run.

Glad to help.
cynthia
N/A
Posts: 0

Re: Question about a date format

try this:

data _null_;
x = put("30aug2005"d,weekdatx.);
putlog x;
run;
N/A
Posts: 0

Re: Question about a date format

Thank you, Claude, however, this issue was resolved this past July. I appreciate your trying to help.
Ask a Question
Discussion stats
  • 5 replies
  • 266 views
  • 0 likes
  • 2 in conversation