BookmarkSubscribeRSS Feed
jeremy4
Quartz | Level 8

Hi,

 

Can someone please help me to reference a numeric variable when the variable name is mix of letters and numbers? Thanks!

 

Variable name: TEST10

Type: Numeric

Group: Numeric

 

Current code:

proc print data=test;

   var TEST10;

   sum TEST10;

run;

 

3 REPLIES 3
jeremy4
Quartz | Level 8

Hi Tom,

I have checked that there is a TEST10 variable in the 'test' dataset (the Name is TEST10 and there is no label to the variable) but there is an error when I run the code - 'ERROR: Variable TEST10 not found' so is there a way to correctly reference the numeric variable, despite the name being a mixture of characters and numbers?

Reeza
Super User
Your reference is correct, you're likely having a different error or the variable label is test10, not the variable name.

Run a proc contents on the data set and check the variable name and label. If you're still having trouble, show us your code, log and the results from proc contents.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 3 replies
  • 667 views
  • 1 like
  • 3 in conversation