25 26 proc sql noprint; 27 create table armcd1 as 28 select distinct a.usubjid,a.arm,a.armcd,a.rfstdtc,a.sex, b.visit as vis1, b.visitnum as vis1num, b.svstdtc as vis1dtc 29 from armcd0 a left join 30 (select distinct usubjid, visit, visitnum, svstdtc 31 from sd.sv where visit='VISIT 1' 32 group by usubjid, visit having svstdtc=min(svstdtc)) b 33 on a.usubjid=b.usubjid 34 order by usubjid;
How to get rid of this note?
When you use group by and a summary function (like min()), but use variables in the select that are not in the group by and not summarized in some way, you get this note. And you get no reduction of the number of observations.
Something like:
proc sql noprint; create table armcd1 as select distinct a.usubjid, a.arm, a.armcd, a.rfstdtc, a.sex, b.visit as vis1, b.visitnum as vis1num, b.svstdtc as vis1dtc from armcd0 a left join (select usubjid, visit, visitnum, svstdtc from (select * from sd.sv where visit='VISIT 1') group by usubjid, visit, visitnum having svstdtc=min(svstdtc)) b on a.usubjid=b.usubjid; quit;
But its really hard to give any good advice, I have no test data to run against, have to have something to run against.
I would simplify it out to a proc sort, and a datastep merge.
Also, what is the point of grabbing visit and visitnum? They will always be VISIT 1, and 1?
options NONOTES;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.