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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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