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.
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 lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.