Hi.
I want to extract the most recent date from my data in each group. It's easy when I have a table ready. But when I want to extract from my metadata it doesn't work. especially with a where clause. My data is tooooooooo big. So I can't extract everything and then group it. Please help me. I used max(qtm.kalenderday) for the last data.
PROC SQL;
CONNECT TO ODBC AS mycon (datasrc=DMA_P);
CREATE TABLE work.Company AS
select *
FROM CONNECTION TO mycon
(SELECT
qtm. Day,
qtm. NR,
qtm.name,
qtm.kalenderday,
qvm.WGnumber
FROM dmameting_tr qvm,
dm_ameting qtm,
dmameting_wh WiK
where
qtm.qtmunitnr = WiK.meetunitnr
and qtm.unitnr = qvm.unitnr
and qtm.meettijdstip_dt = qvm.meettijdstip_dt
and max(qtm.kalenderday)
group by qvm.WGnumber
);
run;
DISCONNECT FROM mycon;
QUIT;
Since you are using SQL pass through, this is not a SAS question really.
You should redirect this optimization inquire to forum specific for your source database.
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 lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.