Hi ,
I am looking for quick method to exactly find two string "CASE" AND PARTY in a field.
Example:my data looks like below and I want to pick count for below highlighted records having PARTY and CASE mentioned in the string.
CASE_11233108000001 1
CASE_11233108000004 1
CASE_11233108000005 1
CASE_11233108000006 1
CASE_11233108000013 1
CASE_11233108000015 1
CASE_11233108000016 1
CASE_11233108000018 1
CASE_11233108000019 1
CASE_11233108000020 1
INCIDENT_51233108000001 3
INCIDENT_51233108000004 3
INCIDENT_51233108000005 3
INCIDENT_51233108000006 3
INCIDENT_51233108000013 3
INCIDENT_51233108000015 3
INCIDENT_51233108000016 3
INCIDENT_51233108000018 3
INCIDENT_51233108000019 3
INCIDENT_51233108000020 3
PARTY_X234306CASE_11233108000005 1
PARTY_X2367375CASE_11233108000004 1
PARTY_X2412976CASE_11233108000006 1
PARTY_X242762CASE_11233108000001 1
PARTY_X234306INCIDENT_51233108000005 1
PARTY_X2367375INCIDENT_51233108000004 1
PARTY_X2412976INCIDENT_51233108000006 1
PARTY_X242762INCIDENT_51233108000001 1
Like this?
data WANT;
SET HAVE;
COUNT + ( index(VAR,'PARTY') & index(VAR,'CASE') );
run;
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 save with the early bird rate—just $795!
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.