data sales; input product $ date :date9. sales; format date date9.; datalines; a 1Jan2012 200 b 4Jan2012 300 c 2Feb2012 200 d 3Mar2012 200 d 5Mar2012 100 ; run; proc summary data=have nway; class product; var date sales ; output out=summary (drop=_:) sum=; run; proc sql; select product,sum(sales) as total_salees from have group by product; quit;
Required output using proc sql
What is the question? You never explain, you just throw data at us and give us no clue about what you are doing; please stop doing this. Please ask clear questions from now on and give clear explanations of what you are doing and why you are doing it.
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.
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.