BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ballardw
Super User

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.

art297
Opal | Level 21

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.

LRN
Calcite | Level 5 LRN
Calcite | Level 5

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: 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!

How to Concatenate Values

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 32 replies
  • 10183 views
  • 9 likes
  • 6 in conversation