BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Jeff_DOC
Pyrite | Level 9

Hello.

Could someone help understand why I cannot get this very simple macro to execute? When I run it I do get the params data from that step but nothing within the macro executes. On the initial run I get no failure at all, just no execution. On all subsequent runs I get,

 

"The quoted string currently being processed has become more than 262 characters long. You might have unbalanced quotation marks."

 

This forces me to close SAS and reopen. 

 

Thank you very much.

 

 

data params;
	attrib 
		run_date		length = 8		format = mmddyy10.
		begin_date	length = 8		format = mmddyy10.
		ending_date 	length = 8		format = mmddyy10.
		rep_start_date length = $10
		rep_end_date	length = $10;

	run_date = today();
	run_month = month(run_date);
/*	begin_date = intnx('semiyear',run_date,1,"BEGIN");*/
/*	ending_date = intnx('semiyear',run_date,1,"END");*/
/*	rep_start_date = put(begin_date, mmddyy10.);*/
/*	rep_end_date = put(ending_date, mmddyy10.);*/

	call symput("run_month",run_month);
/*	call symput("begin_date",begin_date);*/
/*	call symput("ending_date",ending_date);*/
/*	call symput("rep_start_date",rep_start_date);*/
/*	call symput("rep_end_date",rep_end_date);*/
run;

%macro run_code;
	%if %eval(&run_month. = 1 or &run_month. = 7) %then %do;

data temp_01;
	test_var = 'This code actually ran.';
run;

	%end;
%mend;
%macro run_code;

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

The last command should be

 

%run_code

 

 

 

What you had written

 

%macro run_code;

 

 

defines the macro %RUN_CODE again, there is never a %MEND; and so %RUN_CODE is essentially an unfinished macro and can't be used. Any text that is executed after that line becomes part of the unfinished macro and won't execute at all.

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

The last command should be

 

%run_code

 

 

 

What you had written

 

%macro run_code;

 

 

defines the macro %RUN_CODE again, there is never a %MEND; and so %RUN_CODE is essentially an unfinished macro and can't be used. Any text that is executed after that line becomes part of the unfinished macro and won't execute at all.

--
Paige Miller
Jeff_DOC
Pyrite | Level 9
You did it. Thank you very much.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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