BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
DLROW
Quartz | Level 8

Hi,

 

I need the date to be like 02Jan2018, but when I export to excel it is 2jan2018.  I am not using any date format because the data itself is in 02Jan2018 formatting. 

 

Proc report Data=date nowd;

define date / display "date";

run;

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  Even if you're using ODS EXCEL, you may still need to use TAGATTR in your PROC REPORT so you get the leading zero on the day part of the date, as shown below:

ods_excel_tagattr.png

Hope this helps,

Cynthia

View solution in original post

3 REPLIES 3
Reeza
Super User

How are you exporting your file to Excel? I suspect Excel is mangling it, so you'll need to force the format. There's different ways to do that, depending on how you're exporting your file.

 


@DLROW wrote:

Hi,

 

I need the date to be like 02Jan2018, but when I export to excel it is 2jan2018.  I am not using any date format because the data itself is in 02Jan2018 formatting. 

 

Proc report Data=date nowd;

define date / display "date";

run;


 

Cynthia_sas
SAS Super FREQ

Hi:

  Even if you're using ODS EXCEL, you may still need to use TAGATTR in your PROC REPORT so you get the leading zero on the day part of the date, as shown below:

ods_excel_tagattr.png

Hope this helps,

Cynthia

DLROW
Quartz | Level 8
Thank you, Cynthia. It works.

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 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 853 views
  • 2 likes
  • 3 in conversation