Desktop productivity for business analysts and programmers

Using Compound Conditional Logic to Recode Values

Reply
Contributor
Posts: 62

Using Compound Conditional Logic to Recode Values

All -

I have run into a situation where I need to recode a value in a data set using compound logic (if location ne land and water_depth gt 1500) then my recoded value is equal to deep water. The issue that I have is that the Recode Option in the Computer Field Wizard appears to be able to handle conditional logic statements that reference a single variable. Does anyone have any experience in Enterprise Guide 4.2 recoding values using conditional logic that makes use of multiple conditions that reference multiple variables? Any help would be great appreciated.

jm
Trusted Advisor
Posts: 2,114

Re: Using Compound Conditional Logic to Recode Values

just use the advanced expression builder and manually code your CASE clause for PROC SQL. It's a little more tedious than using the recode wizard, but works fine.
SAS Employee
Posts: 149

Re: Using Compound Conditional Logic to Recode Values

Agreed with Doc - write a CASE expressions and build the column as an advanced expression. Documentation on the CASE syntax is here:
http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/a002473682.htm

FYI, if you already started the column as a recode, in EG 4.2 there's the ability from the computed column window to switch the column over to an advanced expression (a recode is just a CASE expression with a point-and-click front end).
Ask a Question
Discussion stats
  • 2 replies
  • 159 views
  • 0 likes
  • 3 in conversation