IFN and division by zero

Discussion in 'SAS (Statistical Analysis Software)' started by Daniel Schuster, Jul 22, 2009.

  1. I have the following code:

    data PIRsum2A;
    set PIRsum2;
    pirrev=ifn(nights=0,0,revenue/nights);
    run;

    I thought that the ifn statement would prevent division by zero but it
    generates a note in the log anyway.

    NOTE: Division by zero detected at line 16 column 32.
    CLUB_RESERVATIO_NO=85589101 CLUB_OWNERSHIP_ID=290009001 nights=0 revenue=0
    pirrev=0 _ERROR_=1 _N_=4723

    Then the error "Limit set by ERRORS= option reached. Further errors of this
    type will not be printed."

    The output is unaffected but the errors are not acceptable.

    Have others had this problem?

    Thanks.
     
    Daniel Schuster, Jul 22, 2009
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.