BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
dlsfetcu
Calcite | Level 5

I would be very grateful for anyone who can help me understand why I'm getting this error

ERROR: There are no valid observations. Could be caused by SUMVAR= or FREQ= variable.

GOPTIONS RESET = ALL;

ODS HTML FILE="C:\SASDATA\carsM.HTM";

PROC MEANS DATA= "C:\SASDATA\cars" MAXDEC=2 N MEAN STD;

VAR brand citympg;

WHERE brand="mazda";

TITLE 'Summary for GROUP A';

RUN;

ODS HTML FILE="C:\SASDATA\carsT.HTM";

PROC MEANS DATA= "C:\SASDATA\cars" MAXDEC=2 N MEAN STD;

VAR brand citympg;

WHERE brand="toyota";

TITLE 'Summary for GROUP B';

RUN;

ODS HTML FILE="C:\SASDATA\carsH.HTM";

PROC MEANS DATA= "C:\SASDATA\cars" MAXDEC=2 N MEAN STD;

VAR brand citympg;

WHERE brand="honda";

TITLE 'Summary for GROUP C';

RUN;

*.......................................CREATE THE BARCHART;

DATA BARCHART;SET "C:\SASDATA\SOMEDATA";

LENGTH HTMLLINK $40;

IF brand="mazda" THEN HTMLLINK='HREF="carsM.HTM"';

IF brand="toyota" THEN HTMLLINK='HREF="carsT.HTM"';

IF brand="honda" THEN HTMLLINK='HREF="carsH.HTM"';

ODS HTML FILE="C:\SASDATA\GCHART.HTM" GPATH="C:\SASDATA\";

ODS LISTING CLOSE;

PROC GCHART;

      HBAR brand/ HTML=HTMLLINK;

   TITLE 'Summary information for each GP.';

RUN; QUIT;

ODS HTML CLOSE;

ODS LISTING;

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

WHERE brand="toyota";


Check the case of your brand, it needs to match exactly.


Typically you can try and make everything upper or lower case.


where upcase(brand)="TOYOTA";


And for the rest of the brand= comparisons.

View solution in original post

1 REPLY 1
Reeza
Super User

WHERE brand="toyota";


Check the case of your brand, it needs to match exactly.


Typically you can try and make everything upper or lower case.


where upcase(brand)="TOYOTA";


And for the rest of the brand= comparisons.

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