Set multiple variable in one case statement

Database
Enthusiast

Set multiple variable in one case statement

Hello, 

I am converting some SAS code to TD : In SAS you can set multiple variables within a single case statement. Can we do the same in TD? Thanks in advance

if RFRL_SRC_CD = '039' then do; 

  var_first = 1; 

  var_second = prcd_amt;

end;

3 REPLIES
Junior Supporter

Re: Set multiple variable in one case statement

Hi.

What does it mean "Teradata code"? bteq script? Stored Procedure? Other?

CASE (SQL) won't work this way, maybe a SP will.

Cheers.

Carlos.

Enthusiast

Re: Set multiple variable in one case statement

Could you elaborate on how a SP could do the above?

Junior Supporter

Re: Set multiple variable in one case statement

Hi, 

Code in SAS is a do loop. If you want to achive same thing then use 2 case statements, which is simple and easy solution.

case when RFRL_SRC_CD = '039' then 1

end var_first, 

case when RFRL_SRC_CD = '039' then prcd_amt

end var_second

Thanks