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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 33 replies
  • 3360 views
  • 0 likes
  • 8 in conversation