> Yes, in the final table.
Correct me if I'm wrong but this
%macro default;
%do i = 1 %to 12;
data pd.default_contratos_&i (rename=estado_cliente=estado&i drop = t compress = yes);
set pd.default_contratos /*(obs=10)*/;
fecha=t-&i;
run;
proc sql;
create index
nupfec on pd.default_contratos_&i(nup,fecha);
quit;
data pd.tabla_cliente_ (compress=yes);
set output.tabla_cliente_;
set pd.default_contratos_&i (keep= nup fecha estado&i) key = nupfec / unique;
if _iorc_ > 0 then do;
_ERROR_ = 0;
call missing(estado&i);
end;
run;
;
%end;
%mend default;
%default;
looks like the same logic as
proc sql;
create index NUPT on pd.default_contratos(NUP,T);
quit;
data PD.TABLA_CLIENTE_ (compress=yes);
set OUTPUT.TABLA_CLIENTE_ ;
array ESTADO_[12];
FECHA=T;
do T=1 to 12;
T=FECHA-I;
set PD.DEFAULT_CONTRATOS(keep= NUP ESTADO) key = NUPT / unique;
ESTADO_[I]=ESTADO;
if _IORC_ > 0 then do;
_ERROR_ = 0;
ESTADO_[I]=.;
end;
output;
end;
run;
Am I wrong?
> Am I wrong?
Once we have all the logic in a single data step, we can look at shrinking the lookup data and using a hash table.
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.