I have a code that checks for me if there is any record for the last day of the month. However, I would need it to show me only one item, i.e. one record, not 148,000 dates as in the photo below
proc sql;
create table BH_D_ZAB_X_ALOK as
select DATA_DANYCH as DATA_DANYCH from cmz.BH_D_ZAB_X_ALOK_&thismonth
where DATA_DANYCH eq intnx('month',DATA_DANYCH,0,'e')
group by DATA_DANYCH
;
quit;
Easily handled in a DATA step
data want;
set bh_d_zab_x_alok;
by data_danych;
if first.data_danych;
run;
proc sql;
create table BH_D_ZAB_X_ALOK as
select max(DATA_DANYCH) as DATA_DANYCH
from cmz.BH_D_ZAB_X_ALOK_&thismonth
where DATA_DANYCH eq intnx('month',DATA_DANYCH,0,'e')
;
quit;
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!
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.