BookmarkSubscribeRSS Feed
PhilC
Rhodochrosite | Level 12

How does one re-create the WORDDATE format using only PROC FORMAT.

 

  The format WORDDATE is defined on SAS help websites. An excerpt below explains it's behavior.

Thanks in advance.

 

WORDDATE Format

 

Writes date values as the name of the month, the day, and the year in the form month-name dd, yyyy.

The example table uses the input value of 19158, which is the SAS date value that corresponds to June 14, 2012

 

SAS Statement
Result
put term worddate3.; 
Jun
 
put term worddate9.;
     June
put term worddate12.;
Jun 14, 2012
 
put term worddate20.; 
       June 14, 2012
1 REPLY 1
ed_sas_member
Meteorite | Level 14

Hi @PhilC 

 

Here is an attempt to do this:

proc format;
	picture worddate_bis (default=40) low-high = '%B %d, %Y' (datatype=date);
run;

/*Test*/ data have; format date1 worddate. date2 worddate_bis.; date1 = 19158; date2 = 19158; run;

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
  • 1 reply
  • 1092 views
  • 1 like
  • 2 in conversation