BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Mandy5
Calcite | Level 5
Data..
Dataset xyz;
Input ID$ month checking expense;
Data lines;
X 2020/9 300 100
X. 2020/10 400 .
X 2020/11 . 60
Y 2020/9 400 .
Y 2020/10 200 50
Z 2020/19 . .
;
Run;


Result should be like this..
ID Monthsnum Average_ check averageexlense
X 3 350 80
Y 2 300 50
Z 1 . .

Any help would be greatly appreciated. I am beginner to sas programming. Proc sql is not allowed to use.
Thank you!!!
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

I believe the usual reply when someone asks for help with homework is: please give it a try first, on your own, and if you get stuck, please come back and show us the code you have created, and we will be happy to help.

 

Also, please answer the question from @Reeza 

--
Paige Miller

View solution in original post

6 REPLIES 6
HB
Barite | Level 11 HB
Barite | Level 11
Proc SQL is not allowed? So this is homework?
Mandy5
Calcite | Level 5
Yes, this is part of homework:)
PaigeMiller
Diamond | Level 26

I believe the usual reply when someone asks for help with homework is: please give it a try first, on your own, and if you get stuck, please come back and show us the code you have created, and we will be happy to help.

 

Also, please answer the question from @Reeza 

--
Paige Miller
Mandy5
Calcite | Level 5
Thank you!
I tried but couldn’t get it.. took help from friend and got it.. thank you for replying:))
Reeza
Super User

So your course has likely either taught you one of two methods - using a data step to calculate averages or proc means/summary/univariate. Which topic has been covered so far? Then google that term plus summary to find many, many examples and questions of this nature. 

 


@Mandy5 wrote:
Data..
Dataset xyz;
Input ID$ month checking expense;
Data lines;
X 2020/9 300 100
X. 2020/10 400 .
X 2020/11 . 60
Y 2020/9 400 .
Y 2020/10 200 50
Z 2020/19 . .
;
Run;


Result should be like this..
ID Monthsnum Average_ check averageexlense
X 3 350 80
Y 2 300 50
Z 1 . .

Any help would be greatly appreciated. I am beginner to sas programming. Proc sql is not allowed to use.
Thank you!!!

 

Mandy5
Calcite | Level 5
Yes, we have learned using proc means and summary.. haven’t learned about sql yet. Thank you!

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 1177 views
  • 0 likes
  • 4 in conversation