Where is &first defined? Any you probably want it to be
category = "&first"; unless you have previously quoted it.
If you have gotten messages about undefined variables, since you're not showing any log results, it would be due to the value of first resolving to something like Television (%let first=Television;) the Category=&first; resolves to
Category=Television; and if you don't have a variable named television then category is undefined.
I just noticed it in the proc sql. However, the proc sql code was designed to expect column names like a b c, etc.
Going with varnum, like Tom suggested, should get around the fact that some/all of the variables have names.
I'll stick with my last suggestion.
Hi Tom,
As Arthur said, I did make a small change in the proc import statement as follows and it worked great. Thanks to you and Arthur.
PROC IMPORT
DATAFILE= &testfile
OUT=&outdsn
REPLACE
DBMS=XLS;
SHEET="Sheet1";
GETNAMES=no;
datarow=2;
RUN;
LRN
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.