BookmarkSubscribeRSS Feed
thanikondharish
Fluorite | Level 6

id

sale

101

5

101

14

101

.

102

45

102

78

102

58

102

69

102

89

102

.

 

assign sum id wise into missing values like see below

 

id

new

101

5

101

14

101

19

102

45

102

58

102

69

102

78

102

89

102

339

3 REPLIES 3
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Post test data in the form of a datastep, we have asked you this time and time again.

As such no code, retain a variable, add value to this each row, if row is . then set to retained value and then set retained value back to zero.

thanikondharish
Fluorite | Level 6
how to assign mean value in missing places
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Retain sum of values and count of items, mean is sum/count

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

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
  • 3 replies
  • 1447 views
  • 0 likes
  • 2 in conversation