BookmarkSubscribeRSS Feed
valarievil
Obsidian | Level 7

Hello, I have the following error: 

 

2191 proc print Math338.SE;
----------
22
201
ERROR 22-322: Syntax error, expecting one of the following: ;, BLANKLINE, CONTENTS, DATA,
DOUBLE, GRANDTOTAL_LABEL, GRANDTOT_LABEL, GRAND_LABEL, GTOTAL_LABEL, GTOT_LABEL,
HEADING, LABEL, N, NOOBS, NOSUMLABEL, OBS, ROUND, ROWS, SPLIT, STYLE, SUMLABEL,
UNIFORM, WIDTH.
ERROR 201-322: The option is not recognized and will be ignored.

 

When I run this code:

data Math338.SE;
set Math338.HW1 (drop = sale expense salesman);
if (region = 'Northeast') then delete;
if (region = 'Northwest') then delete;
if (region = 'Southwest') then delete;
else output Math338.SE;
run;
proc print Math338.SE;
title 'Southeast';
run;

But when I run this code:

 

data Math338.NE;
set Math338.HW1;
if region = 'Southeast' then delete;
if region = 'Northwest' then delete;
if region = 'Southwest' then delete;
else output Math338.NE;
run;
proc print data=Math338.NE;
title 'Northeast';
run;

Everything runs fine. The codes are very similar and I cant find anything wrong with the first one. Please help! I have attached the full file if it helps.

1 REPLY 1
SASKiwi
PROC Star

You are missing "data = " on your PROC PRINT statement;

proc print data = Math338.SE;
title 'Southeast';
run;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 596 views
  • 1 like
  • 2 in conversation