BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
DavidPhillips2
Rhodochrosite | Level 12

I’m just starting to use the advanced options in the expression editor of Data Integration Studio.

Is there a way to do an if else statement in Data Integration Studio Expression editor?  Do I have to use a case statement, if so where is the case statement function on the interface?

1 ACCEPTED SOLUTION

Accepted Solutions
LinusH
Tourmaline | Level 20

Most transformations which allow you to enter columns level expressions is using SQL (verify by viewing the code generated).

Hence, if-then-else is not supported.

My own experience implementing ETL is that case expressions works as good as if-then-else. More complicated patterns requiring if-then-else is rare, and when occurs is either a signal of a faulty target model, or can be implemented by User Written code node.

Data never sleeps

View solution in original post

4 REPLIES 4
DavidPhillips2
Rhodochrosite | Level 12

There is a case button in the expression selection drop down although using it is inefficient.  I found how to manually write case syntax in the advanced expression screen.  You just type in it in like.

 

case
when W77MQJBD.AWARD_CATEGORY='24'
end

DavidPhillips2
Rhodochrosite | Level 12

If this could be done using if else in the expression editor it would save me a lot of time because my SAS code uses if else instead of case.

LinusH
Tourmaline | Level 20

Most transformations which allow you to enter columns level expressions is using SQL (verify by viewing the code generated).

Hence, if-then-else is not supported.

My own experience implementing ETL is that case expressions works as good as if-then-else. More complicated patterns requiring if-then-else is rare, and when occurs is either a signal of a faulty target model, or can be implemented by User Written code node.

Data never sleeps
DavidPhillips2
Rhodochrosite | Level 12

The reply I got from SAS technical support is that If / Else is not integrated into Data Integration Studio.  Unless you want to use a coded datastep.

 

Without the ability to use basic SAS code in the graphical areas the tool doesn't have much of a SAS feel to it.

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
  • 4 replies
  • 3197 views
  • 0 likes
  • 2 in conversation