06-05-2018 09:23 AM
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?
06-05-2018 09:48 AM
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.
06-05-2018 09:53 AM - edited 06-05-2018 09:55 AM
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?