Hi all, I am having an issue with the IFC and IFN functions using SAS version 9.1.3. Based on the SAS documentation, these functions can be used to return 3 different values. The syntax is written as: IFC(logical-expression, value-returned-when-true, value-returned-when-false ,<value-returned-when-missing>) value-returned-when-true specifies a character expression that is returned when the value of logical-expression is true. value-returned-when-false specifies a character expression that is returned when the value of logical-expression is false. value-returned-when-missing specifies a character expression that is returned when the value of logical-expression is missing Just as an example here is some code I have tried out. I have created the class dataset: data class; input id name $5-9; datalines; 1 Henry 2 Alice 3 ; run; Then I create the class2 dataset, and use the IFC function to try assign 3 different values for a new variable data class2; set class; answer=ifc(name='Henry','Yes','No','Missing'); run; The created dataset looks like this: The first 2 records look as I expected. However I was expecting the 3rd record to have the answer 'Missing' instead of 'No'. Because this record has a blank value for the variable name I have tried out various ways of using the IFC and IFN functions, but so far have never managed to get the 3rd expression working to cover missing values Does anyone know what I am doing wrong? Or if there is a problem with these functions? Or has an example of how to correctly use these functions to return seperate values for true, false and missing? Hope that all makes sense! And ideas would be greatly appreciated Thanks, David
... View more