BookmarkSubscribeRSS Feed
GuiVtzl
Fluorite | Level 6

Hello,

I am experiencing a little problem with an export !

I am using tagset excelxp but I have two problems :

1.) I have a character variable with values (ID) such as : 02578 03659 08753

and when it exports to Excel, it cancels the 0 so that my variable becomes 2578 3659 8753

Is there an option to prevent that ? Or something else to do ?

2) my second problem is about missing values of numeric variables. How could you to suppress the . in excel ? I need to have blanks for numeric missing values in EXCEL but it keeps the . of sas missing values.

Thnaks a lot

1 REPLY 1
Cynthia_sas
SAS Super FREQ

Hi:

  #1 -- there have been many previous forum postings about this. Generally when Excel drops a leading 0 you have to use the TAGATTR style override (with TAGSETS.EXCELXP) to tell Excel to use a Microsoft format that keeps the leading zero or else you have to tell Excel that the field is a character string. I have an example of this in my paper: http://support.sas.com/resources/papers/proceedings11/266-2011.pdf see pages 2, 3, 4 for the "leading zero" example.

  #2 -- the way to turn off the display of dot (.) for missing is to use a SAS system option:

options missing=' ';  (quote-space-quote) This tells SAS to DISPLAY the normal missing value of dot as space. And, then, of course, you would want to set it back to dot after your step was finished:

options missing='.';

cynthia

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1 reply
  • 1449 views
  • 0 likes
  • 2 in conversation