BookmarkSubscribeRSS Feed
Sven4IBM
Fluorite | Level 6

I have a currency rates table with any dates. On the other site I've a table with any dates, weekdays, Weekend or Holiday. Now I join this table with currency rates by date. But for Weekend/Holiday I didn't got any results, so I would like to take the day before Weekend/Holiday.

 

Have you any ideas...

2 REPLIES 2
andreas_lds
Jade | Level 19

Can you post some example obs? Maybe lag/retain can be used.

s_lassen
Meteorite | Level 14

I guess what you want to do is something like this:

data want;
  merge rates table2;
  by date;
  rate=coalesce(rate,prev_rate);
  output;
  prev_rate=rate;
  retain prev_rate;
  drop prev_rate;
run;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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