BookmarkSubscribeRSS Feed
SASPhile
Quartz | Level 8
I have a date 20100430.How to show it as Apr-10?
5 REPLIES 5
Cynthia_sas
SAS Super FREQ
Hi:
It depends is that value a character string or a number????

cynthia
SASPhile
Quartz | Level 8
character
chang_y_chung_hotmail_com
Obsidian | Level 7
[pre]
proc format;
picture monyyd
low-high = '%b-%0y' (datatype=date);
run;
data _null_;
d = input('20100430', yymmdd8.);
f = propcase(put(d, monyyd6.));
put f=;
run;
/* on log
f=Apr-10
*/
[/pre]
Tim_SAS
Barite | Level 11
[pre]
data _null_;
d = input('20100430', yymmdd8.);
put 'd=' d monname3. '-' d year2.;
run;
[/pre]
writes to the log:
[pre]d=Apr-10
[/pre]
PatrickG
SAS Employee
There's a lot of good info on using SAS dates here. Hopefully, this helps.

http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a002200738.htm

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 718 views
  • 0 likes
  • 5 in conversation