can you show the LOG you get when running that code? Copy the entire proc step with messages and paste into a code box opened on the forum with the </> icon.
CODE - proc sql; create table method as select distinct (methodofpayment) as consumernumber , case when ((METHODOFPAYMENT) not like "4%") then 'not selected' when ((METHODOFPAYMENT) not like "H%") then 'not selected' when ((METHODOFPAYMENT) not like "M%") then 'not selected' when ((METHODOFPAYMENT) not like "N%") then 'not selected' when ((METHODOFPAYMENT) not like "Q%") then 'not selected' else 'selection' end as selectionresult from TEMP;
THIS IS THE OUTPUT I AM GETTING:
consumernumber selectionresult HD not selected SX not selected 91 not selected S5 not selected W not selected 5 not selected H not selected SQ not selected ST not selected HX not selected H2 not selected
case when first(ConsumerNumber) IN ("4", "H", "M", "N", "Q", "R") then 'Selected' Else 'Not Selected ' end as selectionresult
PG
Register Today!
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.