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

Hi, I am trying to calculate Dregress(ACOS(Value)) in SAS data step, Please let me know syntax by using PROC FEDSQL.

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hi @Coa_SAs,

 

I think there is no DEGREES function available in the data step (as opposed to FedSQL), but who would really need a function that multiplies its argument by a constant?

 

The ACOS function is named ARCOS in the data step.

 

So, in a data step the calculation could be done as follows:

data _null_;
c=sqrt(.5); /* example */
a=180*arcos(c)/constant('pi');
put a;
run; /* result: 45 */

 

[Edit: improved wording]

View solution in original post

4 REPLIES 4
Reeza
Super User

You say SAS data step but then FEDSQL, which one are you looking to do? 

 

I'm assuming the function, as is, is not working in someway?

Coa_SAs
Fluorite | Level 6
Hi, Thanks for quick response,eaither way I am fine,I am trying to compute
in data step and getting error so looking for alternatives.
FreelanceReinh
Jade | Level 19

Hi @Coa_SAs,

 

I think there is no DEGREES function available in the data step (as opposed to FedSQL), but who would really need a function that multiplies its argument by a constant?

 

The ACOS function is named ARCOS in the data step.

 

So, in a data step the calculation could be done as follows:

data _null_;
c=sqrt(.5); /* example */
a=180*arcos(c)/constant('pi');
put a;
run; /* result: 45 */

 

[Edit: improved wording]

Coa_SAs
Fluorite | Level 6

Hi 

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
  • 1379 views
  • 0 likes
  • 3 in conversation