turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- Base SAS Programming
- /
- Datastep cannot access degrees() and acos() functi...

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-17-2015 10:54 AM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to charles_pignon1

04-17-2015 02:13 PM

All Replies

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to charles_pignon1

04-17-2015 11:00 AM

I suspect you are looking for a**r**cos 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.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ballardw

04-17-2015 01:18 PM

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:

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to charles_pignon1

04-19-2015 07:45 PM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to charles_pignon1

04-17-2015 01:25 PM

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?

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

04-17-2015 01:44 PM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to charles_pignon1

04-17-2015 01:50 PM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

04-17-2015 02:01 PM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to charles_pignon1

04-17-2015 02:13 PM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rick_SAS

04-17-2015 02:46 PM

This worked perfectly. Thanks!