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
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.