BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
JohanK
Calcite | Level 5

Dear reader, I ran into a small issue..

 

I want to output date as a visible date in (in this case DATE9.) format and not as a numeric output.  The format of AESTDT is DATE9. As an example 01DEC2021

My code for this example is Code: MSG='Onset Date - '||TRIM(AESTDT)||'- is available';

The output is this: Onset Date - 22974- is available
But what I want is Onset Date - 01DEC2021- is available

What can I do?   Thanks so much for your help!

1 ACCEPTED SOLUTION

Accepted Solutions
PeterClemmensen
Tourmaline | Level 20

Try this

 

data test;
   AESTDT = '01DEC2021'd;
   MSG = 'Onset Date - '||TRIM(put(AESTDT, date9.))||'- is available';
run;

View solution in original post

2 REPLIES 2
PeterClemmensen
Tourmaline | Level 20

Try this

 

data test;
   AESTDT = '01DEC2021'd;
   MSG = 'Onset Date - '||TRIM(put(AESTDT, date9.))||'- is available';
run;
JohanK
Calcite | Level 5

Great, this works... Thanks 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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
  • 2 replies
  • 237 views
  • 0 likes
  • 2 in conversation