All Forums Database
SGIT 8 posts Joined 08/16
30 Aug 2016
Set multiple variable in one case statement

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;


CarlosAL 512 posts Joined 04/08
30 Aug 2016

What does it mean "Teradata code"? bteq script? Stored Procedure? Other?
CASE (SQL) won't work this way, maybe a SP will.

SGIT 8 posts Joined 08/16
31 Aug 2016

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

nealvenna 9 posts Joined 10/12
31 Aug 2016

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

You must sign in to leave a comment.