BookmarkSubscribeRSS Feed
Henriquemont
Fluorite | Level 6
Hi Everyone!!

I would like to know how to do the following count in SAS System ( example attached) summing rows as Statement Income

Thank you in advance!!



2 REPLIES 2
Tom
Super User Tom
Super User

In this case a picture is not worth a thousand words.  I cannot tell from the picture you posted (hidden inside of the PDF file you attached) what you want to sum.

 

Please post the data as text. (Preferably as a data step that can re-create the data.)

Post the result you want as text also.

 

Describe in words what you want to do to get from the input to the output.

 

And if you do want to share another picture do not go to the trouble of making a PDF file and attaching the PDF file.  You can either use the Insert Photos icon to upload a photo file.  Or just copy and paste the image directly.

 

 

ballardw
Super User

Sounds like you are attempting to duplicate the way a SPREADSHEET does things.

The "picture" you show would be easy to accomplish in SAS if the "rows" were variables (columns).

 

It is a poor idea to place summary values in the middle of a data set by  "row" as almost anything else done with that data set will contaminated by using summary values.

 

If you have a SAS data set: Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the </> icon or attached as text to show exactly what you have and that we can test code against.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 10680 views
  • 0 likes
  • 3 in conversation