BookmarkSubscribeRSS Feed
eagles_dare13
Obsidian | Level 7

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.

4 REPLIES 4
HB
Barite | Level 11 HB
Barite | Level 11

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?

Tom
Super User Tom
Super User

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.

Kurt_Bremser
Super User

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.

loredana_cornea
Obsidian | Level 7

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

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.

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
  • 4 replies
  • 914 views
  • 0 likes
  • 5 in conversation