I am using a proc import step to load an xls file to sas dataset.
Now I want to export everything as text...how to do it? By default, it is importing a date like 30/06/2014 as 30JUN2014 and i don't want to reconvert it later to right format. I just want the original text.
I don't know but it sounds like it is trying to be helpful. It sees what it guesses must be a date, you don't say anything, and it says OK, I'll make it a date because I am helpful.
I would guess if you import the Excel sheet as CSV you would get more control and coudl tell SAS what to do instead of defaulting and letting the program guess. If the data came in as text it might export as text. I would think you could convert it in SAS before exporting to whatever you want in any event.
Maybe seeing your PROC IMPORT statement would help?
Can you provide an example? In general I do not see SAS changing values on import. That is something that is much more likely to happen in Excel when trying to read in a text files like a CSV file.
When the import procedure sees something that looks like a date, it reads this into a numeric variable and assigns the default date9. format, which displays the date as you see it. You just need to assign the ddmmyy10. format before exporting.
You submit the proc import procedure and then you press F4. This will show you the entire code and you can change it as you wish.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.