Hi All,
The following is my original code:
data _null_;
merge test1 (in=A) test2 (in=B);
by pgname;
index="&inexpmg";
if index="1" then do;
if A then call execute (' %include " C:\Program Files\......\..........\..................\...\' ||pgname|| ' "; '); end;
if index="2" then do;
if A & B then call execute (' %include " C:\Program Files\......\..........\..................\...\' ||pgname|| ' "; '); end;
if index="3" then do;
if A & ^B then call execute (' %include " C:\Program Files\......\..........\..................\...\' ||pgname|| ' "; '); end;
run;
However, I got the warning message
" WARNING: The quoted string currently being processed has become more than 262 characters long."
C:\Program Files\......\..........\..................\...\' ||pgname|| ' is longer than 262 characters.
This caused my including program did not process.
If I shorter my path in the testing situation, then the warning message will be gone and solved,
however, I can't shorter this path in the final version.
Also, I tried to use macro with do loop in it, however, the same error message came out.
Does anyone have suggestions to me in this case?
I'll be very appreciate it!
use the system option noquotelenmax; will supress the warning and code will execute.
Hi Sudhakar_A,
I know "option noquotelenmax" can help to ignore the warning message, however, my program is still not working.
Thanks!
you can store the path in the variable and concatenate with PGNAME then you can pass as a single variable to Cal execute. try this.
Or else
you have to use the relative path to include the file.
use a fileref:
filename Project "<path>";
%include Project(MyProgram);
Hi Ron,
Thanks for suggestion.
I tested your method, but didn't work on my case.
Finally, I did them step by step, and get my result.
data loop;
merge test1 (in=A) test2 (in=B);
by pgname;
index="&inexpmg";
if index="1" then do;
if A; end;
if index="2" then do;
if A & B; end;
if index="3" then do;
if A & ^B; end;
run;
proc sql noprint;
select pgname into :pgnameok separated by " "
from loop;
quit;
%macro loop;
%let i=1;
%let ds = %scan(&pgnameok.,&i.);
%do %while ( &ds ^= () );
%inc "C:\Program Files\......\..........\..................\...\\&ds..sas";
%let i=%eval(&i+1);
%let ds = %scan(&pgnameok.,&i.);
%end;
%mend;
Thanks for everyone's join for creating different ideas 😄
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!
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.