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
Diamond | Level 26
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'. 🙂
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
  • 1902 views
  • 2 likes
  • 3 in conversation