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...
Can you post some example obs? Maybe lag/retain can be used.
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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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 save with the early bird rate—just $795!
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.
Ready to level-up your skills? Choose your own adventure.