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 Alumni
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

AI Navigator GIF.gif


Navigate AI governance with SAS tools for compliance and ethical AI practices. Try SAS Ai Navigator for free for the first six months.

Check it out on Microsoft Marketplace →

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