DATA Step, Macro, Functions and more

degrees() and acos() functions in SAS DataStep

Accepted Solution Solved
Reply
Contributor
Posts: 20
Accepted Solution

degrees() and acos() functions in SAS DataStep

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


Accepted Solutions
Solution
‎04-27-2016 10:09 AM
Trusted Advisor
Posts: 1,117

Re: degrees() and acos() functions in SAS DataStep

[ Edited ]

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


All Replies
Super User
Posts: 19,815

Re: degrees() and acos() functions in SAS DataStep

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?

Contributor
Posts: 20

Re: degrees() and acos() functions in SAS DataStep

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.
Solution
‎04-27-2016 10:09 AM
Trusted Advisor
Posts: 1,117

Re: degrees() and acos() functions in SAS DataStep

[ Edited ]

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]

Contributor
Posts: 20

Re: degrees() and acos() functions in SAS DataStep

Posted in reply to FreelanceReinhard

Hi 

☑ This topic is solved.

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

Discussion stats
  • 4 replies
  • 281 views
  • 0 likes
  • 3 in conversation