BookmarkSubscribeRSS Feed
allison93
Calcite | Level 5

What am I entering wrong in the following?  I am trying to make a graph of factor 2 vs factor 1 and factor 3 vs factor 1

 

 

386 proc plot;

387 plot factor2*factor1=brand factor3*factor1=brand;

ERROR: Variable FACTOR2 not found.

ERROR: Variable FACTOR1 not found.

ERROR: Variable BRAND not found.

ERROR: Variable FACTOR3 not found.

ERROR: Variable FACTOR1 not found.

ERROR: Variable BRAND not found.

 

 

3 REPLIES 3
Shmuel
Garnet | Level 18

You missed to write the dataset to be used.

Without data the variables are unknown.

 

The syntax should be like:

proc plot data=<my_data> <more options> ;

 

Reeza
Super User
PROC PLOT is still supported? I would suggest trying PROC SGPLOT instead, but the syntax is different.
GraphGuy
Meteorite | Level 14

For some procs, if you don't specify a data=, then it will use the last active dataset.

Here's an example:

 

proc sort data=sashelp.class;
by age;
run;

proc plot;
plot height*weight;
run;

 

But I would recommend always specifying the data=, so there is no uncertainty, like:

 

proc plot data=sashelp.class;
plot height*weight;
run;

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 3 replies
  • 703 views
  • 0 likes
  • 4 in conversation