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

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.

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
  • 32 replies
  • 8997 views
  • 9 likes
  • 6 in conversation