BookmarkSubscribeRSS Feed
Coa_SAs
Fluorite | Level 6

Hi All,

 

I am trying to calculate Angle by using Degrees(ARCOS) functions in SAS, But Data step getting an errror.Please advice 

 

26 Degrees=DEGREES(ARCOS(Theta/(Len_A+Len_B)));
_______
68
ERROR 68-185: The function DEGREES is unknown, or cannot be accessed.

4 REPLIES 4
Reeza
Super User
What version of SAS do you have?
Coa_SAs
Fluorite | Level 6

I am on SAS 9.4_M1 and   SAS EG 6.1

Reeza
Super User
I'm only finding documentation for the function under SAS 9.4 and in PROC FEDSQL. You may need to use a PROC FEDSQL statement to use this function.

The conversion from radians to degrees is fairly straightforward, you should be able to write a basic function or formula if you don't like using FEDSQL.
PGStats
Opal | Level 21

Define your own function, callable from data steps and SQL:

 

proc fcmp outlib=sasuser.fcmp.math;
function degrees(radians);
if missing(radians) then return(.);
r = mod(radians, 2*constant("PI"));
return (r*360/(2*constant("PI")));
endsub;
run;

options cmplib=sasuser.fcmp;

data _null_;
do x = -2 to 2 by 0.125;
    r = x*2*constant("PI");
    d = degrees(r);
    put r= d=;
    end;
run; 
PG

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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