Could you just use the suggestion SAS provided in your log, namely use having rather than where?
Of course, I, personally, wouldn't try to create temp2 from temp2 thus in my example, below, create temp3:
data temp2;
set sashelp.class (rename=(
age=bank_id
height=tran_dt
weight=tran_am
));
run;
proc sql;
create table TEMP3 as
select
bank_id /* bank id */
, MAX(tran_dt) as max_tran_dt /* latest transaction date */
, MIN(tran_dt) as min_tran_dt /* earliest transaction date */
, SUM(tran_am) as sum_tran_am /* total transaction amount */
from TEMP2
group by bank_id
having tran_dt between CALCULATED min_tran_dt
and CALCULATED max_tran_dt
order by bank_id
;
quit;
HTH,
Art
Could you just use the suggestion SAS provided in your log, namely use having rather than where?
Of course, I, personally, wouldn't try to create temp2 from temp2 thus in my example, below, create temp3:
data temp2;
set sashelp.class (rename=(
age=bank_id
height=tran_dt
weight=tran_am
));
run;
proc sql;
create table TEMP3 as
select
bank_id /* bank id */
, MAX(tran_dt) as max_tran_dt /* latest transaction date */
, MIN(tran_dt) as min_tran_dt /* earliest transaction date */
, SUM(tran_am) as sum_tran_am /* total transaction amount */
from TEMP2
group by bank_id
having tran_dt between CALCULATED min_tran_dt
and CALCULATED max_tran_dt
order by bank_id
;
quit;
HTH,
Art
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.