HI, Can't figure out how to fix this warning message
proc sql noprint; create table ae as select * from adam.adsl as a left join (select count(*) as var_E, usubjid, 'Y' as var_P from ae_summary group by usubjid) as b on a.usubjid = b.usubjid where actarm in ('Placebo', 'S rS') order by actarm, usubjid; quit;
The "select *" takes usubjid from both a and b - hence the warning.
It looks like the only vars you want from b are var_E and var_P, so change your "select *" to
select a.*, b.var_E, b.var_P
The "select *" takes usubjid from both a and b - hence the warning.
It looks like the only vars you want from b are var_E and var_P, so change your "select *" to
select a.*, b.var_E, b.var_P
Don't use the asterisk when joining tables, use a discrete list of variables for at least one of.the datasets.
Please refer to the appropriate aliases-
select a.* from adam.adsl as a left join
Followed by a.*, var1,var2....varN properly
proc sql noprint;
create table ae as
select a.* from adam.adsl as a left join
(select count(*) as var_E, usubjid, 'Y' as var_P from ae_summary group by usubjid) as b
on a.usubjid = b.usubjid
where actarm in ('Placebo', 'S rS')
order by actarm, usubjid;
quit;
The problem is in ambiguous reference for SQL processor to choose and pick the variable from respective tables
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.