10-17-2014 12:35 PM
I just imported comma delimited data into SAS Enterprise Guide using the Import Data wizard. One of the fields defaulted to numeric and I should have changed it to Character but didn't. Now that the table has already been imported, is there a way of changing the field type? I tried right clicking the table and selecting Properties but that didn't work. I also tried opening the table, selecting the column I want to change, right-clicking, and selecting Properties. That brought up what appears to be the correct dialog box, but the drop down menu for Type is greyed out and won't allow me to make the change.
10-17-2014 01:02 PM
You'll need to copy your dataset, and move your column into a new column. Something like this;
set have(rename=(NeededVar = OldNeededVar));
length NeededVar $15;
NeededVar = input(OldNeededVar, best15.);
10-30-2014 09:15 AM
Just to note Tom, your code will pop a note in the log for conversion. Your better off using the put(OldNeededVar,best15.).
For the OP - fix your import. I.e. take the generated code from the proc import (I don't use EG, so can't help where it would be - maybe there is a checkbox or something), and modify it to properly import the data - note you don't mention the file import format, but I assume Excel as this is the one that causes most problems. Switch to CSV and write a datastep import program which gives you full control over the import.
10-30-2014 08:18 AM
When you open datasets you cannot change values or the data type because of read access. If you try to change a value a popup window opens and asks if you want to switch to update mode. Now you can change the properties of the column and the drop down menu for Type is not greyed out any more.