The SAS Output Delivery System and reporting techniques

how to preserve from dropping zero ,while opening csv file in excel

Reply
Contributor
Posts: 20

how to preserve from dropping zero ,while opening csv file in excel

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

Super User
Posts: 18,997

Re: how to preserve from dropping zero ,while opening csv file in excel

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

 

 

Super User
Posts: 18,997

Re: how to preserve from dropping zero ,while opening csv file in excel

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

Super User
Posts: 9,854

Re: how to preserve from dropping zero ,while opening csv file in excel

in front of it , add  '  

like :

'0021

'0032

Super User
Posts: 18,997

Re: how to preserve from dropping zero ,while opening csv file in excel

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

Super User
Super User
Posts: 7,668

Re: how to preserve from dropping zero ,while opening csv file in excel

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.

Ask a Question
Discussion stats
  • 5 replies
  • 473 views
  • 1 like
  • 4 in conversation