If you open your CSV file in NOTEPAD you will see that it is perfectly OK. The problem is Excel is applying formatting to the CSV when you open it and sometimes it doesn't get it right.
You can fix the formatting in Excel by setting the data type on those columns as text. If that doesn't work then do a DATA IMPORT into Excel rather than just open the CSV and specify the data type of the long numeric columns as text.
Hi,
Yes thats correct.
But I want a solution which we can apply in SAS code which I gave above.
So that when the CSV file is created , we will be able to see the number without exponents(original value)
Is there any possible solution which can be applied in ODS CSV or PROC REPORT?
Thanks in Advance.
Try Google, paste "site:sas.com excel leading zeros" (without quotes) in the search-box.
You cannot do that with CSV. Simple put CSV is a text based format, that when opened in Excel, is parsed and interpreted by the Excel engine in its own way - another reason why you should not be using Excel for anything! If you have to open output in Excel, then you will need to change your output format to tagsets.excelxp and add in the specific foramts which Excel should apply to each column. You can find examples of this here:
https://support.sas.com/resources/papers/proceedings11/266-2011.pdf
As SASKiwi has already told you, the problem is Excel, not SAS or the CSV file, it is the engine that Excel uses to read the CSV file. If you open the CSV file in anything other than Excel you will see the file is correct (assuming your export code is correct).
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.