I have this dataset, and I want to flag the instance where the status changes. I want to see at the first time the status changes, what is the number of tests received.
Please post data as text rather than pics for us to copy paste easily
Also, post a sample of what you HAVE and what you WANT with your description
Is this what you have, or what you want? Have you tried anything so far to solve this, if so please include that.
I'm assuming you also want this for each SUBJECT? How do you want them identified, in a separate data set, in a new variable, what value should it be? What about the other records?
If you post data as an image we can't work with that, but we can work with text. Otherwise, you'll get general approaches rather than code.
In general, You can look at RETAIN to hold a value across rows, so you can set some flags once certain conditions are met.
The NOTSORTED option is great with BY GROUPS to identify groups that may not be in a conventional sort order but where the sequence is important.
@kt_080517 wrote:
I have this dataset, and I want to flag the instance where the status changes. I want to see at the first time the status changes, what is the number of tests received.
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!
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.