Hi,
I want to compare two columns together using the highlighted syntax but SAS is not allowing me to do that. Is there an alternative for this?
select distinct A.OFFRG_N,
A.CRT_TS,
case when (A.OFFRG_N, A.CRT_TS) in
(select OFFRG_N, CRT_TS from CSTST231_PMRINSD
where BUSN_TY_SEG_C = 'New' or BURN_TY_SEG_C = 'Renl')
then A.PMR_BK_D
else NULL
end as PMR_BK_D
from CSTST231_PMRINSD A, CCTRP101_OFF_TERM B
where A.OFFRG_N = B.OFFRG_N
and A.CRT_TS = put(B.OFFRG_TM_CRT_TS,datetime26.)
log -
108 rsubmit;
NOTE: Remote submit to MYNODE commencing.
969 proc sql;
970 create table TEST_RESULT as
971 select distinct A.OFFRG_N,
972 A.CRT_TS,
973 case when (A.OFFRG_N, A.CRT_TS) in
-
22
76
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, ), *, **, +, -, /, <, <=,
<>, =, >, >=, ?, AND, BETWEEN, CONTAINS, EQ, EQT, GE, GET, GT, GTT, IN, IS, LE,
LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, ^, ^=, |, ||, ~, ~=.
ERROR 76-322: Syntax error, statement will be ignored.
974 (select OFFRG_N, CRT_TS from CSTST231_PMRINSD
975 where BUSN_TY_SEG_C = 'New' or BURN_TY_SEG_C = 'Renl')
976 then A.PMR_BK_D
977 else NULL
978 end as PMR_BK_D
979 from CSTST231_PMRINSD A, CCTRP101_OFF_TERM B
980 where A.OFFRG_N = B.OFFRG_N
981 and A.CRT_TS = put(B.OFFRG_TM_CRT_TS,datetime26.)
NOTE: Remote submit to MYNODE complete.
It is a syntax style that teradata supports but sas does not.
you could concatenate the columns OFFRG_N and CRT_TS
Try :
case when CATS(A.OFFRG_N, A.CRT_TS) in
(select CATS(OFFRG_N, CRT_TS) from CSTST231_PMRINSD
where BUSN_TY_SEG_C = 'New' or BURN_TY_SEG_C = 'Renl')
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!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.