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!
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.