<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Sign % in text of macro variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674766#M203224</link>
    <description>&lt;P&gt;Let's spell the issue out in more detail.&amp;nbsp; &amp;nbsp;You want to use macro variables to generate a string constant in a call to some object method in a data step.&amp;nbsp; If you add double quotes around the value then the macro processor will try to evaluate the string value for possible macro references (% and/or &amp;amp; characters).&amp;nbsp; If you build the string with single quotes instead then the macro processor will ignore the value of the string constant so % and/or &amp;amp; will be left alone.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are attempting to add the quotes after generating the macro variable.&amp;nbsp; You have no need for the unquoted string in your current program. So instead you could just add the quotes into the value of the macro variable when you create it.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;EM&gt;Note there is no need to create the &amp;amp;ith macro variable &amp;amp;i times by processing observations 1 to &amp;amp;i.&amp;nbsp; Just use the one observation.&lt;/EM&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
	set RESULTAT (firstobs=&amp;amp;i obs=&amp;amp;i);
	call symputx('PROFILE',quote(trim(PROFILE_NAME),"'"));
	call symputx('PROFILE_OBJECTIVES',quote(trim(PROFILE_OBJECTIVES),"'"));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then just use the macro variable, no need to add any quotes since they are already in the macro variable value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;obj.format_cell(data: &amp;amp;profile&amp;nbsp;
...
obj.format_cell(data: &amp;amp;PROFILE_OBJECTIVES
...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;But best method is to just skip making the macro variables and use the actual dataset variables by reading in the observation you want in the data step that is making the object calls.&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  set RESULTAT (firstobs=&amp;amp;i obs=&amp;amp;i);
  declare odsout obj();
  ...
  obj.format_cell(data: PROFILE_NAME&amp;nbsp;
  ...
  obj.format_cell(data: PROFILE_OBJECTIVES
  ...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 05 Aug 2020 19:11:49 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2020-08-05T19:11:49Z</dc:date>
    <item>
      <title>Sign % in text of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674320#M203039</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to resolve the macrovariable &amp;amp;PROFILE that has a text: "ne devra représenter plus de 20 %du profil de gestion".&lt;/P&gt;
&lt;P&gt;I get the Warning message:&amp;nbsp;WARNING: Apparent invocation of macro DU not resolved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you know please how to avoid this message?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Marie&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 11:52:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674320#M203039</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2020-08-04T11:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: Sign % in text of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674325#M203041</link>
      <description>&lt;P&gt;Use a proper macro quoting function&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   call symputx('profile', 'ne devra représenter plus de 20 %du profil de gestion');
run;

%put %superq(profile);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Aug 2020 12:03:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674325#M203041</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-08-04T12:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: Sign % in text of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674326#M203042</link>
      <description>&lt;P&gt;try &lt;A href="https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=p0pmye6h6tx7chn115p4sl9h0hkc.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;%superq()&lt;/A&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  call symputX('PROFILE', 'ne devra représenter plus de 20 %du profil de gestion', "G");
run;

%put %superq(PROFILE);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Aug 2020 12:03:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674326#M203042</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-08-04T12:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Sign % in text of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674328#M203043</link>
      <description>haha! We have almost exactly the same answers &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;B-)</description>
      <pubDate>Tue, 04 Aug 2020 12:04:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674328#M203043</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-08-04T12:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: Sign % in text of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674331#M203046</link>
      <description>I still have the same warning, my code is:&lt;BR /&gt;&lt;BR /&gt;obj.row_start();&lt;BR /&gt;	obj.format_cell(data:&lt;BR /&gt;			"OBJECTIFS :" ,	overrides: "font_face=Calibri just=left font_weight=bold color=cx338AFF font_size=10pt width=2.6 cm");&lt;BR /&gt;	obj.format_cell(data: %sysfunc(quote(%superq(PROFILE))) ,	overrides: "font_face=Calibri just=left color=black font_size=10pt ");&lt;BR /&gt;			obj.row_end();</description>
      <pubDate>Tue, 04 Aug 2020 12:29:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674331#M203046</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2020-08-04T12:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: Sign % in text of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674332#M203047</link>
      <description>Thank you!&lt;BR /&gt;&lt;BR /&gt;I still have the same warning, my code is:&lt;BR /&gt;&lt;BR /&gt;obj.row_start();&lt;BR /&gt;obj.format_cell(data:&lt;BR /&gt;"OBJECTIFS :" , overrides: "font_face=Calibri just=left font_weight=bold color=cx338AFF font_size=10pt width=2.6 cm");&lt;BR /&gt;obj.format_cell(data: %sysfunc(quote(%superq(PROFILE))) , overrides: "font_face=Calibri just=left color=black font_size=10pt ");&lt;BR /&gt;obj.row_end();</description>
      <pubDate>Tue, 04 Aug 2020 12:30:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674332#M203047</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2020-08-04T12:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Sign % in text of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674333#M203048</link>
      <description>Thank you!</description>
      <pubDate>Tue, 04 Aug 2020 12:31:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674333#M203048</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2020-08-04T12:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: Sign % in text of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674336#M203051</link>
      <description>&lt;P&gt;hmmm..&lt;/P&gt;
&lt;P&gt;try with %qsysfunc()&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  call symputX('PROFILE', 'ne devra représenter plus de 20 %du profil de gestion', "G");
run;

%put %qsysfunc(quote(%superq(PROFILE)));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Aug 2020 12:44:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674336#M203051</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-08-04T12:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: Sign % in text of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674337#M203052</link>
      <description>&lt;P&gt;The first argument to %SYSFUNC &lt;STRONG&gt;must&lt;/STRONG&gt; be a data step function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Belay that, somehow the coffee must not have worked today.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 12:52:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674337#M203052</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-08-04T12:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Sign % in text of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674353#M203058</link>
      <description>Hello Kurt, &lt;BR /&gt;Thank you for your answer! &lt;BR /&gt;I didn't understand , %sysfunc(quote(%superq(PROFILE_NAME))) worked in my code for another problem.&lt;BR /&gt;I can't use %sysfunc?</description>
      <pubDate>Tue, 04 Aug 2020 13:48:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674353#M203058</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2020-08-04T13:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: Sign % in text of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674361#M203065</link>
      <description>Hello, thank you!&lt;BR /&gt;%qsysfunc need a put, beacause I get the error:&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant, &lt;BR /&gt;              a missing value, arrayname, (, +, -, INPUT, NOT, PUT, ^, _NEW_, ~.  &lt;BR /&gt;I can't write a put, beacause I have an ods object code:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;obj.row_start();&lt;BR /&gt;	obj.format_cell(data:&lt;BR /&gt;			"OBJECTIFS :" ,	overrides: "font_face=Calibri just=left font_weight=bold color=cx338AFF font_size=10pt width=2.6 cm");&lt;BR /&gt;	obj.format_cell(data: %sysfunc(quote(%superq(PROFILE))) ,	&lt;BR /&gt;        overrides: "font_face=Calibri just=left color=black font_size=10pt ");&lt;BR /&gt;			obj.row_end();</description>
      <pubDate>Tue, 04 Aug 2020 14:11:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674361#M203065</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2020-08-04T14:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Sign % in text of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674367#M203068</link>
      <description>&lt;P&gt;Not sure what this statement is. Why does the first line end in a comma and not a semi-colon?&amp;nbsp; So assuming you want to run this statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;obj.format_cell(data: %sysfunc(quote(%superq(PROFILE))) 
               ,overrides: "font_face=Calibri just=left color=black font_size=10pt ")
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Does that statement allow you to use single quotes instead of double quotes?&amp;nbsp; Those will prevent the macro process from trying to evaluate the % and &amp;amp; triggers in the string.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;obj.format_cell(data: %sysfunc(quote(%superq(PROFILE),%str(')))
               ,overrides: "font_face=Calibri just=left color=black font_size=10pt ")
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also does the syntax of that statement allow a variable or function instead of a string literal?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;obj.format_cell(data: symget('PROFILE') 
               ,overrides: "font_face=Calibri just=left color=black font_size=10pt ")
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 15:39:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674367#M203068</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-08-04T15:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: Sign % in text of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674380#M203075</link>
      <description>&lt;P&gt;and how about this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  call symputX('PROFILE', 'ne devra représenter plus de 20 %du profil de gestion', "G");
run;

obj.row_start();
obj.format_cell(data:
"OBJECTIFS :" , overrides: "font_face=Calibri just=left font_weight=bold color=cx338AFF font_size=10pt width=2.6 cm");
obj.format_cell(data: %str(%')%superq(PROFILE)%str(%') ,
overrides: "font_face=Calibri just=left color=black font_size=10pt ");
obj.row_end();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;for the &lt;CODE class=" language-sas"&gt;format_cell&lt;/CODE&gt;&amp;nbsp;data portion(according to the doc) can be enclosed in single quotes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 15:02:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674380#M203075</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-08-04T15:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Sign % in text of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674390#M203081</link>
      <description>&lt;P&gt;or approach with `_temporary_variable_`?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  call symputX('PROFILE', 'ne devra représenter plus de 20 %du profil de gestion', "G");
run;


filename out "%sysfunc(pathname(WORK))";
ods html close;
ods html path=Out file="test.html";

data _null_;

  dcl odsout obj();
  obj.table_start();

  _temporary_variable_ = symget("PROFILE");
  drop _temporary_variable_;

  obj.row_start();
  obj.format_cell(data: "OBJECTIFS :", 
    overrides: "font_face=Calibri just=left font_weight=bold color=cx338AFF font_size=10pt width=2.6 cm");
  obj.format_cell(data: _temporary_variable_,
    overrides: "font_face=Calibri just=left color=black font_size=10pt ");
  obj.row_end();


  obj.table_end();
run;
ods html close;
ods html;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 15:21:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674390#M203081</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-08-04T15:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: Sign % in text of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674671#M203174</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc import 
	datafile="XXXXXXX\Exemple.xlsx"
	out=RESULTAT
	replace dbms=xlsx;
	getnames=yes;
run;


%macro publi;

	DATA _null_;
		SET RESULTAT end=eof;

		IF eof THEN
			DO;
				CALL SYMPUT('nombre',put(_N_,8.));
			END;
	run;


	%do i=1 %to &amp;amp;nombre.;

		/*****************************************************/
		/*****Narratifs rélatids aus données calculées *******/
		/*****************************************************/
		data _NULL_;
			set RESULTAT (obs=&amp;amp;i);
			call symputx('PROFILE',PROFILE_NAME);
			call symputx('PROFILE_OBJECTIVES',PROFILE_OBJECTIVES);
		run;
	
       OPTION NODATE NONUMBER;
		OPTIONS PAPERSIZE=LETTER;
		OPTIONS TOPMARGIN=0 in BOTTOMMARGIN=0 in LEFTMARGIN=0 in RIGHTMARGIN=0 in;
		ODS NORESULTS;
		ODS PDF FILE = "XXXXXXXX\Doc_&amp;amp;i..pdf" dpi=1800;
		ODS ESCAPECHAR = "^";

		data _NULL_;
			declare odsout obj();
			obj.layout_absolute(overrides :"borderwidth=0");
			obj.line(style_attr: "bordercolor=blue", size:'0.8mm');
            obj.table_start(name:

			"table1",
			label: "Notre Première Table",
			overrides: "width=19 cm frame=void rules=none" );

			obj.row_start();
	obj.format_cell(data:

			"NOM:" ,
			overrides: "font_face=Calibri just=left font_weight=bold color=blue font_size=10pt");
	obj.format_cell(data:

			%sysfunc(quote(%superq(PROFILE))) ,
			overrides: "just=left font_face=Calibri color=black font_size=10pt");
			obj.row_end();
			obj.row_start();
	obj.format_cell(data:
			"OBJECTIFS :" ,	overrides: "font_face=Calibri just=left font_weight=bold color=blue font_size=10pt width=2.5 cm");
	obj.format_cell(data:
			"&amp;amp;PROFILE_OBJECTIVES." ,overrides: "font_face=Calibri just=left color=black font_size=10pt width=15 cm");
			obj.row_end();
			obj.table_end();
			obj.layout_end();
		Run;


		ODS PDF CLOSE;
	%end;
%mend;

%publi;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Aug 2020 09:46:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674671#M203174</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2020-08-05T09:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: Sign % in text of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674672#M203175</link>
      <description>Hello experts,&lt;BR /&gt;I added the code.&amp;nbsp;&lt;BR /&gt;I can't understand why&amp;nbsp;%sysfunc(quote(%superq(&amp;amp;PROFILE_OBJECTIVES.))) doesn't works&amp;nbsp;and&amp;nbsp;I&amp;nbsp;get&amp;nbsp;the&amp;nbsp;warning: WARNING: Apparent invocation of macro DU not resolved.&lt;BR /&gt;&lt;BR /&gt;Thank you!</description>
      <pubDate>Wed, 05 Aug 2020 09:49:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674672#M203175</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2020-08-05T09:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Sign % in text of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674674#M203177</link>
      <description>Hello Tom,&lt;BR /&gt;&lt;BR /&gt;Thank you for your suggestions.&lt;BR /&gt;Unfortunately it doesn't work. (&lt;BR /&gt;I added the code and xlsx file.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Marie&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Aug 2020 09:51:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674674#M203177</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2020-08-05T09:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: Sign % in text of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674700#M203190</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%sysfunc(quote(%superq(PROFILE)))&lt;/PRE&gt;
&lt;P&gt;is giving the warning because it resolves to the following text&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;"ne devra représenter plus de 20 %du profil de gestion"&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;including double quotation&lt;/STRONG&gt; symbols. So, since text is surrounded by double quotes, SAS[macro processor + wordscaner] scans it and it treats % as macro trigger.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Simpler example would be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
 x = "%ABC";
 y = '%EFG';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;in the log we will see warning for %ABC macro but not for %EFG.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you would use version proposed by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;:&lt;/P&gt;
&lt;PRE&gt;%sysfunc(quote(%superq(PROFILE), %str(%')))&lt;/PRE&gt;
&lt;P&gt;the resolved text would be:&lt;/P&gt;
&lt;PRE&gt;'ne devra représenter plus de 20 %du profil de gestion'&lt;/PRE&gt;
&lt;P&gt;but with &lt;STRONG&gt;single quotation&lt;/STRONG&gt; marks hence&amp;nbsp;SAS[macro processor + wordscaner] won't treat % as macro trigger.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So Doc. references:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=n0700fspmubii5n1vecutttwz93n.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#n1uvx72itk1akhn0zy4d67ec4ky8"&gt;https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=n0700fspmubii5n1vecutttwz93n.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#n1uvx72itk1akhn0zy4d67ec4ky8&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope it helps&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2020 11:57:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674700#M203190</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-08-05T11:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Sign % in text of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674717#M203197</link>
      <description>Thank you!&lt;BR /&gt;I see, but this is not working, I need the double quotation in my code: "&amp;amp;PROFILE_OBJECTIVES." &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Marie</description>
      <pubDate>Wed, 05 Aug 2020 13:34:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674717#M203197</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2020-08-05T13:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: Sign % in text of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674733#M203205</link>
      <description>&lt;P&gt;No, you don't need double quotations. Documentation says that it doesn't have to be a text string but it could be a character variable (&lt;A href="https://documentation.sas.com/?docsetId=odsadvug&amp;amp;docsetTarget=p12q0pykppxbz8n1200luexgbz4t.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=odsadvug&amp;amp;docsetTarget=p12q0pykppxbz8n1200luexgbz4t.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;)&lt;/P&gt;
&lt;P&gt;From the doc:&lt;/P&gt;
&lt;H4 class="xisDoc-argument"&gt;DATA:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="xisDoc-optional"&gt;&amp;lt;&lt;SPAN class="xisDoc-choice"&gt;&lt;EM class="xisDoc-userSuppliedValue"&gt;'string'&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN class="xisDoc-choice"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;|&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM class="xisDoc-userSuppliedValue"&gt;number&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN class="xisDoc-choice"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;|&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM class="xisDoc-userSuppliedValue"&gt;character-variable&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN class="xisDoc-choice"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;|&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM class="xisDoc-userSuppliedValue"&gt;numeric-variable&lt;/EM&gt;&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;/H4&gt;
&lt;DIV class="xisDoc-argumentDescription"&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;specifies the data to display.&lt;/P&gt;
&lt;SECTION class="xisDoc-tableWrap"&gt;
&lt;TABLE class="xisDoc-listValueDescription"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="xisDoc-value"&gt;'&lt;EM class="xisDoc-userSuppliedValue"&gt;string&lt;/EM&gt;'&lt;/TD&gt;
&lt;TD class="xisDoc-valueDescription"&gt;specifies a text string.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/SECTION&gt;
&lt;SECTION class="xisDoc-tableWrap"&gt;
&lt;TABLE class="xisDoc-listValueDescription"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="xisDoc-value"&gt;&lt;EM class="xisDoc-userSuppliedValue"&gt;number&lt;/EM&gt;&lt;/TD&gt;
&lt;TD class="xisDoc-valueDescription"&gt;specifies a numeric value.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/SECTION&gt;
&lt;SECTION class="xisDoc-tableWrap"&gt;
&lt;TABLE class="xisDoc-listValueDescription"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="xisDoc-value"&gt;&lt;EM class="xisDoc-userSuppliedValue"&gt;character-variable&lt;/EM&gt;&lt;/TD&gt;
&lt;TD class="xisDoc-valueDescription"&gt;specifies the name of a character variable. The value of the character variable from the input data set is written to the output.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="xisDoc-value"&gt;&lt;EM class="xisDoc-userSuppliedValue"&gt;numeric-variable&lt;/EM&gt;&lt;/TD&gt;
&lt;TD class="xisDoc-valueDescription"&gt;specifies the name of a numeric variable. The value of the numeric variable from the input data set is written to the output.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/SECTION&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See the code below which uses temporary_variables to solve the issue.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Btw.&lt;/P&gt;
&lt;P&gt;this code can be done more efficient:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA _null_;
		SET RESULTAT end=eof;

		IF eof THEN
			DO;
				CALL SYMPUT('nombre',put(_N_,8.));
			END;
	run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA _null_;
 CALL SYMPUTX('nombre',nobs);
 stop;		 
 SET RESULTAT nobs=nobs;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is your code modified with temporary variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data RESULTAT;
  PROFILE_NAME = 'ne devra représenter plus de 20 %du profil de gestion';
  PROFILE_OBJECTIVES = "A B C D";
  output;
run;

%macro publi;

	DATA _null_;
		SET RESULTAT end=eof;

		IF eof THEN
			DO;
				CALL SYMPUT('nombre',put(_N_,8.));
			END;
	run;


	%do i=1 %to &amp;amp;nombre.;

		/*****************************************************/
		/*****Narratifs rélatids aus données calculées *******/
		/*****************************************************/
		data _NULL_;
			set RESULTAT (obs=&amp;amp;i);
			call symputx('PROFILE',PROFILE_NAME);
			call symputx('PROFILE_OBJECTIVES',PROFILE_OBJECTIVES);
		run;
	
       OPTION NODATE NONUMBER;
		OPTIONS PAPERSIZE=LETTER;
		OPTIONS TOPMARGIN=0 in BOTTOMMARGIN=0 in LEFTMARGIN=0 in RIGHTMARGIN=0 in;
		ODS NORESULTS;
		ODS PDF FILE = "%sysfunc(pathname(WORK))\Doc_&amp;amp;i..pdf" dpi=1800;
		ODS ESCAPECHAR = "^";

		data _NULL_;

      /* TEMPORARY variables to replace MACRO variables */
      _temporary_variable_1 = symget('PROFILE');
      _temporary_variable_2 = symget('PROFILE_OBJECTIVES');
      drop _temporary_variable_:;
      
			declare odsout obj();
			obj.layout_absolute(overrides :"borderwidth=0");
			obj.line(style_attr: "bordercolor=blue", size:'0.8mm');
            obj.table_start(name:

			"table1",
			label: "Notre Première Table",
			overrides: "width=19 cm frame=void rules=none" );

			obj.row_start();
	obj.format_cell(data:

			"NOM:" ,
			overrides: "font_face=Calibri just=left font_weight=bold color=blue font_size=10pt");
	obj.format_cell(data: _temporary_variable_1,
			overrides: "just=left font_face=Calibri color=black font_size=10pt");
			obj.row_end();
			obj.row_start();
	obj.format_cell(data:
			"OBJECTIFS :" ,	overrides: "font_face=Calibri just=left font_weight=bold color=blue font_size=10pt width=2.5 cm");
	obj.format_cell(data:
			_temporary_variable_2 ,overrides: "font_face=Calibri just=left color=black font_size=10pt width=15 cm");
			obj.row_end();
			obj.table_end();
			obj.layout_end();
		Run;


		ODS PDF CLOSE;
	%end;
%mend;

%publi;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All the best&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2020 14:30:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sign-in-text-of-macro-variable/m-p/674733#M203205</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-08-05T14:30:24Z</dc:date>
    </item>
  </channel>
</rss>

