BookmarkSubscribeRSS Feed
deleted_user
Not applicable
hi,
i used the new IFC function to avoid division by 0, but it seems it does not work:
data test;
input a b ;
l=ifn(b=0 , 0 , a/B ) ;
cards;
10 2
10 5
8 0
8 4
;
run;

reason ????
3 REPLIES 3
deleted_user
Not applicable
i mean IFN function of course
Cynthia_sas
SAS Super FREQ
Hi:
Also, using the DIVIDE function
http://support.sas.com/kb/19/965.html

does not produce the "divide by zero" message that you get when you code your division this way divide(a,b) versus a/b

cynthia
KevinQin
Obsidian | Level 7
Not like IF/THEN/ELSE, IFN calculate 'a/b' in advance, then judge the logical statement 'b=0'. 🙂

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 1507 views
  • 2 likes
  • 3 in conversation