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

Hi everyone,

 

I'm new to SAS and hoping you could help as I keep getting this ERROR 22-322 when I try creating a new output doc. I'll bet the answer is simple but cannot figure it out at all, such as when I do this: 

 

ods excel file="&outpath/StormStats.xlsx"
style=snow
options(sheet_name='South Pacific Summary');
ods noproctitle;
title;

proc means data=pg1.storm_detail maxdec=0 median max;
class Season;
var Wind;
where Basin='SP' and Season in (2014,2015,2016);
run;

ods excel options(sheet_name='Detail');

proc print data=pg1.storm_detail noobs;
where Basin='SP' and Season in (2014,2015,2016);
by Season;
run;


ods excel close;
ods proctitle;

 

Any help would be greatly appreciated!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

I think the error is how you're creating your outpath macro variable, specifically, do you have quotes on that variable? How is it created?

From the log it looks like you have quotes on that macro variable that then interfere with the quotes in the path. Remove the quotes from the macro variable.

View solution in original post

4 REPLIES 4
tacosta3
Calcite | Level 5

It's followed by a ERROR 200-322 and here is also the log:

 

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
NOTE: ODS statements in the SAS Studio environment may disable some output features.
73
74 ods powerpoint file="&outpath/pressure.pptx" style=powerpointlight;
NOTE: Line generated by the macro variable "OUTPATH".
74 ""/home/u49923793/Output"
_
22
200
ERROR 22-322: Syntax error, expecting one of the following: ;, AUTHOR, BOX_SIZING, CATEGORY, CLOSE, COMMENTS, DOM, DPI, FILE,
GFOOTNOTE, GTITLE, IMAGE_DPI, KEYWORDS, LAYOUT, NOGFOOTNOTE, NOGTITLE, OPTIONS, SASDATE, STARTPAGE, STATUS, STYLE,
TITLE, WORK.
 
ERROR 200-322: The symbol is not recognized and will be ignored.
 
75
76 title "Minimum Pressure Statistics by Basin";
77 ods noproctitle;
78 proc means data=pg1.storm_final mean median min maxdec=0;
79 class BasinName;
80 var MinPressure;
81 run;
 
NOTE: There were 3092 observations read from the data set PG1.STORM_FINAL.
NOTE: PROCEDURE MEANS used (Total process time):
real time 0.04 seconds
user cpu time 0.04 seconds
system cpu time 0.00 seconds
memory 10380.48k
OS Memory 44480.00k
Timestamp 11/16/2020 07:50:21 PM
Step Count 205 Switch Count 1
Page Faults 0
Page Reclaims 2122
Page Swaps 0
Voluntary Context Switches 34
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 8
 
 
82
83 title "Correlation of Minimum Pressure and Maximum Wind";
84 proc sgscatter data=pg1.storm_final;
85 plot minpressure*maxwindmph;
86 run;
 
NOTE: PROCEDURE SGSCATTER used (Total process time):
real time 0.45 seconds
user cpu time 0.28 seconds
system cpu time 0.02 seconds
memory 22127.17k
OS Memory 55724.00k
Timestamp 11/16/2020 07:50:21 PM
Step Count 206 Switch Count 1
Page Faults 0
Page Reclaims 5258
Page Swaps 0
Voluntary Context Switches 264
Involuntary Context Switches 2
Block Input Operations 0
Block Output Operations 4808
 
NOTE: There were 3092 observations read from the data set PG1.STORM_FINAL.
 
87 title;
88
89 ods powerpoint close;
90
91
92 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
104

 

Reeza
Super User

I think the error is how you're creating your outpath macro variable, specifically, do you have quotes on that variable? How is it created?

From the log it looks like you have quotes on that macro variable that then interfere with the quotes in the path. Remove the quotes from the macro variable.

tacosta3
Calcite | Level 5
Thanks for your reply. I created the macro variable like this:

%let outpath="/home/u49923793/Output";
tacosta3
Calcite | Level 5
Fixed! Thanks so much!

sas-innovate-white.png

🚨 Early Bird Rate Extended!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Lock in the best rate now before the price increases on April 1.

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 3255 views
  • 0 likes
  • 2 in conversation