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.
You are missing "data = " on your PROC PRINT statement;
proc print data = Math338.SE;
title 'Southeast';
run;
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 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: