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;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

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