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')
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.