How can I perform an sql join using a dataset cretaed by the sql group-by statement. Example:
input id $1. period sale;
A 1 100
A 2 200
B 1 150
B 2 250
input id $1. name $7.;
input id $1. sum_sales name $7.;
A 300 nameA
B 400 nameB
I've tried to use the following code but it doesn't work. I know I could first merge the datasets sales and names and then run proc sql (or proc means) to obtain sum, but I wonder what is the problem with the code below.
create table want as
(select id, sum(sale) as sum_sale
group by id) A
left join names B
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.