BookmarkSubscribeRSS Feed
joon1
Quartz | Level 8

Dear Madam/Sir,

 

I would like to construct standard deviation of ROA with a rolling window of the past five years.

After referring several comments in this forum, I made the following command and had the error messages.

 

proc sql;

create table m24 as select *, (std(a.roa) from have where a.fyear between

a.fyear-6 and a.fyear-1 and a.gvkey) from m23 as a;

quit;

 

Any of your help will be highly appreciated.

 

Sincerely,

Joon

4 REPLIES 4
joon1
Quartz | Level 8
The error messages are as follows:


proc sql;

497 create table m24 as select *, (std(a.roa) from have where a.fyear
between

----

79

498 a.fyear-6 and a.fyear-1 and a.gvkey) from m23 as a;

-

22

76

ERROR 79-322: Expecting a ).



ERROR 22-322: Syntax error, expecting one of the following: ;, !, !!, &, *,
**, +, -, /, <, <=,

<>, =, >, >=, ?, AND, BETWEEN, CONTAINS, EQ, EQT, EXCEPT, GE,
GET, GROUP, GT, GTT,

HAVING, IN, INTERSECT, IS, LE, LET, LIKE, LT, LTT, NE, NET,
NOT, NOTIN, OR, ORDER,

OUTER, UNION, ^, ^=, |, ||, ~, ~=.



ERROR 76-322: Syntax error, statement will be ignored.
ballardw
Super User

Please post LOG results in a code box opened using the forum's {I} icon. As you can see the forum reformats text making the diagnostics from the error message move and making it very hard to read.

Also it should cut down on the extra blank lines.

 

The underscore characters should appear under where SAS detects the error.

 

 

joon1
Quartz | Level 8

Thank you so much for your response

I have attached the word file containing the error log. Your advice will be highly appreciated.

 

Thanks

Joon

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 4 replies
  • 1015 views
  • 0 likes
  • 3 in conversation