BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Toni2
Lapis Lazuli | Level 10

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
2 REPLIES 2
Toni2
Lapis Lazuli | Level 10
thank you

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 509 views
  • 0 likes
  • 2 in conversation