Sorry, you'll have to show us a (portion of) your data. I don't understand what you want.
Also show us the desired output.
Don't show us one and not the other.
@cm3 wrote:
Correction typo mistake below
E031000. 4 2 5 E03. 303
303
312
E03100S. 1 1 4 E03. 309
300
304
Get your text, in a plain text editor like the SAS editor or Notepad. The paste into a code box using the forum's {I} to preserve the format. Otherwise the forum strips a lot of blanks, tabs and such. I am guessing that you intended something like:
E031000. 4 2 5 E03. 303 303 312 E03100S. 1 1 4 E03. 309 300 304
which would indeed be a bad structure for an actual data set. If you are wanting a REPORT that is read by people and not data fed into other procedures then say so.
The reason this would be bad as a data set is that the value of the variable userformid is no longer available for grouping for any purpose on most records. So summarizations and such are likely to be off.
It feels wrong to create such a data structure but here you go.
data want;
set have;
by Userformid;
if not first.Userformid then
do;
call missing(Userformid, RS, min_rs, max_rs, grade);
end;
run;
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.