BookmarkSubscribeRSS Feed
SAS121
Fluorite | Level 6

Hello,

 

I was completing the Challenge Practice for Lesson 5 in SAS Programming 1 called "Identifying the Top Three Extreme Values with the Output Statistics". I continue to receive an error message saying "Variable PARKNAME not found" even when I run answer code listed in the solution.

 

Moreover, the only time the code runs to the output data tab is when I add a data step and even so, "TotalVisitors" and "Visitors" column are blank.

 

My questions are:

1. Can you please explain why I am receiving "Variable PARKNAME not found" error message?

2. Can you please explain why the code is only running when I add a data step?

 

Thank you.

 

The proposed solution:

 

SAS121_1-1676749851947.png

 

Error message when running the proposed solution

 

SAS121_2-1676749903125.png

Only time the code runs is when I add a data step

 

SAS121_3-1676750294296.png

1 REPLY 1
Rick_SAS
SAS Super FREQ

Check to see if PARKNAME is a valid variable in the data set:

proc contents data=pg1.np_multiyr;
run;

You are using the NOPRINT option, so the PROC MEANS call does not produce any output. Perhaps that is why you think it is not running? Clearly it is running because it is giving you an error. However, it is not creating an output data set because of the error, so fix the error first.

 

I am surprised that you are not seeing a WARNING such as 
WARNING: The data set WORK.TOP3PARKS may be incomplete. When this step was stopped there were 0
observations and 0 variables.
Double-check the log.

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
  • 1 reply
  • 199 views
  • 0 likes
  • 2 in conversation