. Hi I have 2 tables one has 7k. Records table 2 has 14k
i want to bring every thing from table one 7k records and only the data from table 2 matches...enclose is my code
proc sql;
create table temp2 as
select one.*, two.atm as b_atm, two.date as b_date
from one,two
where one.id=two.id and two.date gt one.date
group by one.id
having two.date-one.date =min(two.date-one.date);
create table want2 as
select temp2.*,two.id as c_id ,two.date as c_date
From temp2,two
where temp2.id =two.id and two.date gt temp2.date
group by temp2.id
having two.date- temp2.date=min(two.date-temp2.date);
quit;
thanks for assistance
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.