BookmarkSubscribeRSS Feed
14sas
Calcite | Level 5

 how to preserve dropping zeros while opening an csv file in excel .

5 REPLIES 5
Reeza
Super User

Same answer as your previous question here - Open the file from within Excel, using Excel's data import feature, rather than double click it. 

 

Here's the answer from a different source, if that helps.

http://www.upenn.edu/computing/da/bo/webi/qna/iv_csvLeadingZeros.html

 

 

Reeza
Super User

Also, please consider marking some answers correct if they've been answered 🙂

Ksharp
Super User

in front of it , add  '  

like :

'0021

'0032

Reeza
Super User

If you have SAS 9.4 consider ODS Excel or ODS TAGSETS.EXCELXP + a VB script to convert to native Excel file.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

You are perhap mixing types here.  CSV is a useful format for data transfer, i.e. if you are sending the data to someone that is the best format. If however the file is for review, say in Excel, then use the reporting functionalities, ods tagsets.excelxp for example, which will allow you to specify formats in the markedup output:

https://support.sas.com/resources/papers/proceedings11/266-2011.pdf

 

So, step one, decide what the output is to be used for, different formats are for different things.  Then use the best technology for that purpose.

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
  • 5 replies
  • 1013 views
  • 1 like
  • 4 in conversation