Hello,
I am unable to access the functions degrees() and acos() within the datastep. When I try to run them the following error message appears:
ERROR 68-185: The function DEGREES is unknown, or cannot be accessed.
ERROR 68-185: The function ACOS is unknown, or cannot be accessed.
Here is the code I used:
data hello;
testdegrees=degrees(.5);
testacos=acos(.5);
run;
degrees = radians * 180 / constant("pi");
I suspect you are looking for arcos instead of acos. What is the function Degrees supposed to do? There is no such function in SAS, which is what the error message is saying.
The degrees function should return the number of degrees for an angle in radians; here is a link describing it:
I tried arcos and it worked, though, so maybe I'm just not getting functions from the right place... Here is the link that I found describing the acos function:
The link given for the ACOS function leads to the documentation for SAS's version of the C language.
You're looking at the FEDSQL SAS 9.4 documentation for first link and the second is SAS 7 documentation I think.
What version of SAS are you on?
SAS (r) Proprietary Software 9.3 (TS1M0)
I had noticed the SAS (r) Proprietary Software 9.3 (TS1M0) mentioned, but I thought the functions would have the same names across procedures...
For PROC SQL they do, though some of the summary functions such as mean, min, max, sum, and median operate differently.
FEDSQL is almost a different language introduced in SAS 9.4. Also, each version will have new functions.
I like how the 9.2 documentation is laid out personally, but the 9.3 documentation is here
SAS(R) 9.3 Language Reference by Name, Product, and Category
You're looking for BASE SAS functions.
SAS 9.2 documentation
Hello,
Thanks for that clarification. Unfortunately, there appears to be no equivalent to the degrees function I was looking for in the SAS datastep (based on the functions in the 'trigonometric' category). I should be able to get it elsewhere though. Thanks!
degrees = radians * 180 / constant("pi");
This worked perfectly. Thanks!
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 25. 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.