BookmarkSubscribeRSS Feed
bharath86
Obsidian | Level 7

@Kurt_Bremser @PeterClemmensen @hhinohar 

Hi,

 

Data I have

ID parameter miles age value
2 1 . . 9
2 2 . . 156
2 3 . .  
2 . 0 2 .
2 . 0 2 .
2 . 1 9 .
2 . 5 16 .
2 . 3 17 .
2 . 7 48 .
2 . 5 48 .
2 . 9 60 .
2 . 9 72 .
2 . 9 96 .
2 . 9 108 .
2 . 9 132 .
2 . 9 156 .
12 1 . . 5
12 2 . . 5.5
12 3 . . .
12 . 0 5 .
12 . 0 10 .
10 1 . . 2
10 2 . . 12
10 3 . .  

 

Data I want

ID parameter miles age value
2 1 . . 9
2 2 . . 156
2 3 . . 17
2 . 0 2 .
2 . 0 2 .
2 . 1 9 .
2 . 5 16 .
2 . 3 17 .
2 . 7 48 .
2 . 5 48 .
2 . 9 60 .
2 . 9 72 .
2 . 9 96 .
2 . 9 108 .
2 . 9 132 .
2 . 9 156 .
12 1 . . 5
12 2 . . 5.5
12 3 . . 10
12 . 0 5 .
12 . 0 10 .
10 1 . . 2
10 2 . . 12
10 3 . . .

 

1. Valid miles (between 2 to 9)

2. If the parameter is 3 and miles is between 2 to 9 then pick the age value of earliest miles (which is 3 and age is 17 in case of ID 2).

3. If the parameter is 3 and miles not in 2 to 9 then assign max age for each ID  (which is 10 incase of ID 12)

4. If there are miles or age leave the value of parameter 3 to blank. (incase of ID 10)

1 REPLY 1
hhinohar
Quartz | Level 8

Hi bharath86,

Thank you for sharing your logic in this thread.
In the description,only parameter 3 is described but apparently there are logics for other parameter 1 and 2 as well but these are not fully described.
Parameter 3 logic can be added to your code but it might be better to share the other parameter logic as well to better address the problem you are facing.
By sharing the entire logic, someone knowledgeable might be able to help.

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

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 825 views
  • 0 likes
  • 2 in conversation