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
2025 SAS Hackathon: There is still time!
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!