BookmarkSubscribeRSS Feed
Howles
Quartz | Level 8

I think it's simpler to do all in the SQL step.

proc sql noprint ;

select case type when "char"

                 then "input("||name||",32.) as "

                 else ""

                 end

       ||

       name

  into :renames separated by ","

  from dictionary.columns

  where libname="WORK" and memname="HAVE"

  ;

create table want as select &renames from have ;

quit;

Ksharp
Super User

Howles

But you still create a new variable in this case.

To OP :

If you are using EG, then in EG's wizard of importing data, there is a function you can change the type of variables when you import data.

Ksharp

LarryWorley
Fluorite | Level 6

Please examine proc contents for the input table.

What columns are alpha where you expect to be numeric?  Examine those columns to see if you have some kind of data error.  For example, a single value of 'unknown date' in the excel spreadsheet would cause that column to be read as character and not datetime.

Raghs_Newbee
Calcite | Level 5

If I was in your position, I would think of a very simple macro in Excel.

Select the Range Cell( A,B) - Cell (X,Y) - Fromat them as Number if store as Text.

Simple the job gets done in mater of minutes.

You can also convert the headers to DATE format in Excel Macro - select the right rigne is what matters.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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
  • 33 replies
  • 3254 views
  • 0 likes
  • 8 in conversation