Hello everyone,
I hope you'll help me to figure out the fastest way to do the following:
I have a big data set with many columns. I would like to apply the idea such as 'for each column 'user' and for each column 'ID', if the column 'Position' is negative then delete it IF AND ONLY IF it's the first entry according to each 'user' and each 'ID' '.
Basically, I want to delete every first entry for each 'user' AND for each 'ID' which have 'position' lower than 0.
I attach a data sample for user=56 and one only ID. in this case, since it's sorted for proc sort data=trial; by user ID day; run; AND the first position is negative AND transtype='S', I would want to delete it. But I am not sure how to do it in the best way for when I have many users and many different IDs.
Thank you in advance for your suggestions!
@aiste :
I do have a suggestion: show a sample of data, in the form of a sas data step, and then show, in the fomr of a sas data step, what the results should look like. There are some might smart people on this forum, but don't assume they are mind readers.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.