DATA Step, Macro, Functions and more

Datastep cannot access degrees() and acos() functions: ERROR 68-185

Accepted Solution Solved
Reply
Contributor
Posts: 21
Accepted Solution

Datastep cannot access degrees() and acos() functions: ERROR 68-185

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;


Accepted Solutions
Solution
‎04-17-2015 02:13 PM
SAS Super FREQ
Posts: 3,756

Re: Datastep cannot access degrees() and acos() functions: ERROR 68-185

Posted in reply to charles_pignon1

degrees = radians * 180 / constant("pi");

View solution in original post


All Replies
Super User
Posts: 11,343

Re: Datastep cannot access degrees() and acos() functions: ERROR 68-185

Posted in reply to charles_pignon1

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.

Contributor
Posts: 21

Re: Datastep cannot access degrees() and acos() functions: ERROR 68-185

The degrees function should return the number of degrees for an angle in radians; here is a link describing it:

http://support.sas.com/documentation/cdl/en/fedsqlref/67364/HTML/default/viewer.htm#p1c8k83ftmqzbkn1...

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:

Function Descriptions : acos

Contributor dkb
Contributor
Posts: 53

Re: Datastep cannot access degrees() and acos() functions: ERROR 68-185

Posted in reply to charles_pignon1

The link given for the ACOS function leads to the documentation for SAS's version of the C language.

Super User
Posts: 19,878

Re: Datastep cannot access degrees() and acos() functions: ERROR 68-185

Posted in reply to charles_pignon1

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?

Contributor
Posts: 21

Re: Datastep cannot access degrees() and acos() functions: ERROR 68-185

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...

Super User
Posts: 19,878

Re: Datastep cannot access degrees() and acos() functions: ERROR 68-185

Posted in reply to charles_pignon1

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

SAS(R) 9.2 Language Reference: Dictionary, Fourth Edition

Contributor
Posts: 21

Re: Datastep cannot access degrees() and acos() functions: ERROR 68-185

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!

Solution
‎04-17-2015 02:13 PM
SAS Super FREQ
Posts: 3,756

Re: Datastep cannot access degrees() and acos() functions: ERROR 68-185

Posted in reply to charles_pignon1

degrees = radians * 180 / constant("pi");

Contributor
Posts: 21

Re: Datastep cannot access degrees() and acos() functions: ERROR 68-185

This worked perfectly. Thanks!

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 9 replies
  • 804 views
  • 3 likes
  • 5 in conversation