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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 675 views
  • 1 like
  • 2 in conversation