I'm using "by group" processing for a healthcare claims dataset containing records sorted by member ID and service date to determine eligibility for my analysis dataset.
Once I've determined if a particular member is eligible or ineligible, I output the member ID and an eligibility flag to a dataset and then no longer need to process the rest of the claim records for that member.
How can I skip to the first claim for the next member in the dataset? I've tried RETURN, STOP and LEAVE statements with limited success.
This skips (if then delete) additional processing for the by group once ELIG is true. The ELIG criteria in my example is N eq 2;
If you are using 'by group' processing, the simple answer is 'No'. The only way to skip obs in data step is to use point=, but then it is not compatible with 'by group'.
You maybe able to do it using a Hash object, but then you need to read in all of the obs into Hash first, beat the purpose anyway.
Good Luck,
Haikuo
This skips (if then delete) additional processing for the by group once ELIG is true. The ELIG criteria in my example is N eq 2;
Just a matter of style and possibly readability ... I would replace the last 4 lines of the DATA step with 2 lines:
if x eq 2;
elig = 1;
As always, beauty is in the eye of the beholder.
Thank you, this was very helpful!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.