BookmarkSubscribeRSS Feed
nickcampanale
Calcite | Level 5

I have three tables, a Master calendar table, Accrued points table, and Redeemed Points table. 

Users can redeem points and not accrue and vice versa.

 

I need to create records to fill in a data set for months where no points accrued.

 

EX:

Month      ID

SEP         -

OCT        -

NOV       A

 

Desired OutCome

Month      ID

SEP      A

OCT      A

NOV     A

2 REPLIES 2
ballardw
Super User

You mention three input tables and show one, and don't even provide a data set name to boot.

Probably should show examples of all three.

 

You imply that what ever that ID might be that it could have values before a user is actually active. Is that in fact what you want?

What determines the actual value to "fill in"? Closest other value? Before? After?

I suspect you are leaving out details that are obvious to you but not mentioned while we can only use what you show us.

 

A trivial and almost certainly incorrect approach would be like this:

data want;
   set datawithmissing;
   id = 'A';
run;

Probably incorrect because it sets everything to 'A'. But you haven't provided any example why a value other than 'A' would appear.

andreas_lds
Jade | Level 19

Is there always only obs without missing ID? If not: please describe the rule to choose the right value.

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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