BookmarkSubscribeRSS Feed
nannà
Calcite | Level 5

Hi, I want translate matlab code in sas.

Below the matlab code:

if isinf(delta_VaR),

    delta_VaR=.9*sign(delta_VaR)*VaR;

end

My problem is the function isinf.

What do I do?

1 REPLY 1
Astounding
PROC Star

SAS is only going to use 8 bytes to store numerics, so there will be a limit to what SAS can consider to be infinite.  Here is a sample program to illustrate an approach:

data _null_;

x = 1234567890123456789;

y = x + 1;

if x = y then put 'Match';

run;

The program writes "Match", because the values of x and y are too large to store exactly in 8 bytes.  So this might be one version of "infinite" in the SAS world:

if int(var) = int(var) + 1 then do;

Good luck.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 2855 views
  • 3 likes
  • 2 in conversation