how can i find the credit card numbers which range from A1-A100 for all the 3 types Gold, Platinum and Titanium, if there is any card holder with any other value, i need to create a dataset and excel file “Invalid_Cards”. Remove these invalid customers from the list of Individual cards list.
Post your data as text NOT picture.
data have;
input id x $20.;
cards;
1 Gold
1 Platinum
1 Titanium
2 Gold
2 Platinum
2 Titanium
2 xxxx
;
run;
proc sql;
create table invalid as
select *
from have
group by id
having sum(x not in ('Gold' 'Platinum' 'Titanium')) ne 0;
quit;
Is this a SAS question or and Excel question? From what you have posted you haven't even imported the data into SAS. If you need to do this in Excel, best place would be an Excel forum. If you need to use SAS, then start by importing your data to three datasets, then apply your logic in a datastep (where 1 <= input(compress(customer,,"a),best.) <= 100, for instance). Then you export the data again using proc export or ods tagsets or libname excel etc.
Post your data as text NOT picture.
data have;
input id x $20.;
cards;
1 Gold
1 Platinum
1 Titanium
2 Gold
2 Platinum
2 Titanium
2 xxxx
;
run;
proc sql;
create table invalid as
select *
from have
group by id
having sum(x not in ('Gold' 'Platinum' 'Titanium')) ne 0;
quit;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.