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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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