BookmarkSubscribeRSS Feed
saslover
Calcite | Level 5
I have an issue.. I am using the ODBC with proc sql. This is my code
proc sql noprint;
connect to odbc
as atest (noprompt="DRIVER=Microsoft Excel Driver (*.xls);
DBQ=xxxxx.xls;");
create table day4 as
select * from connection to atest
(
select * from "abc tensile test 6-2-11.is$"
);
disconnect from atest;
quit;

Now the excel file reads in, but in my original data file I have some values for id that have 201 202 203 R201 R202. So SAS gives me missing values for all the character variables but reads in only numeric.

How do I define conversion of numeric to character variable inside my data step above in proc sql.

Any help is appreciated

Thanks
3 REPLIES 3
Reeza
Super User
That seems cumbersome.

I suggest using proc import with type = mixed.
saslover
Calcite | Level 5
I cannot do that. My dataset has a whole lot of junk characters in the sheets and they are not similar across all excel files. So PROC IMPORT doesn't work.
Reeza
Super User
I think the dbtype= option might be what you want then.

I don't know exactly wwere/how but hopefully google can help some more.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

New Learning Events in April

 

Join us for two new fee-based courses: Administrative Healthcare Data and SAS via Live Web Monday-Thursday, April 24-27 from 1:00 to 4:30 PM ET each day. And Administrative Healthcare Data and SAS: Hands-On Programming Workshop via Live Web on Friday, April 28 from 9:00 AM to 5:00 PM ET.

LEARN MORE

Discussion stats
  • 3 replies
  • 1407 views
  • 0 likes
  • 2 in conversation