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;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 940 views
  • 1 like
  • 2 in conversation