hi, the below macro is a part from a complex huge macro code. I have copied only the first part of the macro. (it is not complete)
What i don't understand is if the &prefix._continuous_bands_count_&i._&j. dataset needs to pre-exist before i run the macro below or it is created by the macro?
When i tried to run it i received an error that the dataset does not exist but i am not very sure if the macro creates empty dataset to be used later
%macro continuous_psi(prefix=,vars=,output=);
%let num_vars = %sysfunc(countw(%superq(vars)));
%do i = 1 %to &num_vars.;
%let var&i. = %qscan(%superq(vars), &i., %str( ));
%put var&i. = &&var&i..;
data &prefix._continuous_bands_count_&i.;
set
%do j = 1 %to 6;
&prefix._continuous_bands_count_&i._&j. (in = a&j.)
%end;
;
%do j = 1 %to 6;
if a&j. = 1 then band = &j.;
%end;
volume = max(0, volume);
run;
These datasets
&prefix._continuous_bands_count_&i._&j.
are used in the SET statement and need to exist before the macro is called.
These datasets
&prefix._continuous_bands_count_&i._&j.
are used in the SET statement and need to exist before the macro is called.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.