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

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 1387 views
  • 0 likes
  • 5 in conversation