BookmarkSubscribeRSS Feed
PaigeMiller
Diamond | Level 26

Jumping in late here, and I realize this is a made up problem, but I cannot imagine what a "real" problem would be that requires these techniques. Could you please @BrahmanandaRao tell us what the "real" problem is?

 

We have spent a lot of time without a solution so far, and the translation to the "real" problem, whatever it is, may not be trivial. In addition, this strikes me as another example of the XY Problem, and knowing what the "real" problem is would point us in the right direction. In addition, any method that takes a long data set and turns it into a wide data set is a red-flag to me (while there are a few situations where that is necessary, most of the time it is a poor approach that takes you in the wrong direction, and misses easier ways to handle the data).

 

So to sum up, I think we have spent a lot of time on this, and that time would be better spent working on the "real" problem, not this made-up problem.

--
Paige Miller
Kurt_Bremser
Super User
Use RETAINed variables (for max, start with 0, for min, start with 32767), use the MAX and MIN functions, and OUTPUT at the end (use the END= option in the SET statement).
Quite a simple problem, you can easily solve this on your own after 650+ posts here.
BrahmanandaRao
Lapis Lazuli | Level 10

Hi Kurt,

I am not getting solution in datastep

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!

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
  • 18 replies
  • 1604 views
  • 6 likes
  • 5 in conversation