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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 3 replies
  • 1425 views
  • 2 likes
  • 3 in conversation