🔒 This topic is solved and locked.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 03-16-2022 09:10 AM
(689 views)
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;
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
These datasets
&prefix._continuous_bands_count_&i._&j.
are used in the SET statement and need to exist before the macro is called.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
These datasets
&prefix._continuous_bands_count_&i._&j.
are used in the SET statement and need to exist before the macro is called.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
thank you