BookmarkSubscribeRSS Feed
SASPhile
Quartz | Level 8
I have a date 20100430.How to show it as Apr-10?
5 REPLIES 5
Cynthia_sas
Diamond | Level 26
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

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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