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

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;

1 ACCEPTED SOLUTION

Accepted Solutions
9 REPLIES 9
ballardw
Super User

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.

charles_pignon1
Calcite | Level 5

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

dkb
Quartz | Level 8 dkb
Quartz | Level 8

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

Reeza
Super User

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?

charles_pignon1
Calcite | Level 5

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

Reeza
Super User

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

charles_pignon1
Calcite | Level 5

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!

Rick_SAS
SAS Super FREQ

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

charles_pignon1
Calcite | Level 5

This worked perfectly. Thanks!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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