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).
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.
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.