<?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 Add pop up help text when user defined macros are invoked in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Add-pop-up-help-text-when-user-defined-macros-are-invoked/m-p/415807#M26733</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm using EG 5.1&amp;nbsp; .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've written a few macros, each with several parameters. Now, when I calll the macros from different programs I find I don't verbatim remember the parameters for each macro and their position.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I noticed that in the program where I created the macros, I could insert comments which appear as pop-up help text when the macro is invoked. But outside that particular program that help does not appear. E.g in below macro&amp;nbsp;the text "libname without quotes e.g. source" appears as a pop-up when the macro is invoked, BUT only in the same program where the macro is written. If I invoke it from a different program in the same project, then no pop-up appears.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro dir (libname /*libname without quotes e.g. source*/);
	TITLE 'Directory listing for library ' %upcase("&amp;amp;libname") ;

	PROC SQL;
		select libname ,
			memname,
			memlabel,
			nobs,
			nvar,
			modate

		FROM DICTIONARY.TABLES
			WHERE LIBNAME = %upcase( "&amp;amp;libname" ) 
				ORDER BY modate desc;
	QUIT
	;
	TITLE;
%mend dir;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas apprecited.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Nov 2017 12:12:16 GMT</pubDate>
    <dc:creator>constliv</dc:creator>
    <dc:date>2017-11-23T12:12:16Z</dc:date>
    <item>
      <title>Add pop up help text when user defined macros are invoked</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Add-pop-up-help-text-when-user-defined-macros-are-invoked/m-p/415807#M26733</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm using EG 5.1&amp;nbsp; .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've written a few macros, each with several parameters. Now, when I calll the macros from different programs I find I don't verbatim remember the parameters for each macro and their position.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I noticed that in the program where I created the macros, I could insert comments which appear as pop-up help text when the macro is invoked. But outside that particular program that help does not appear. E.g in below macro&amp;nbsp;the text "libname without quotes e.g. source" appears as a pop-up when the macro is invoked, BUT only in the same program where the macro is written. If I invoke it from a different program in the same project, then no pop-up appears.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro dir (libname /*libname without quotes e.g. source*/);
	TITLE 'Directory listing for library ' %upcase("&amp;amp;libname") ;

	PROC SQL;
		select libname ,
			memname,
			memlabel,
			nobs,
			nvar,
			modate

		FROM DICTIONARY.TABLES
			WHERE LIBNAME = %upcase( "&amp;amp;libname" ) 
				ORDER BY modate desc;
	QUIT
	;
	TITLE;
%mend dir;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas apprecited.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 12:12:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Add-pop-up-help-text-when-user-defined-macros-are-invoked/m-p/415807#M26733</guid>
      <dc:creator>constliv</dc:creator>
      <dc:date>2017-11-23T12:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: Add pop up help text when user defined macros are invoked</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Add-pop-up-help-text-when-user-defined-macros-are-invoked/m-p/415810#M26734</link>
      <description>&lt;P&gt;Well, first off, this is where named parameters should really be used.&amp;nbsp; Named parameters such as:&lt;/P&gt;
&lt;PRE&gt;%macro temp (in_file=,out_file=);&lt;/PRE&gt;
&lt;P&gt;Then have some descriptive to tell you what they are, and positioning on the call does not matter as you could call the above:&lt;/P&gt;
&lt;PRE&gt;%temp (in_file=abc,out_file=def);&lt;/PRE&gt;
&lt;P&gt;Or&lt;/P&gt;
&lt;PRE&gt;%temp (out_file=def,in_file=abc);&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Next off, its really not a good idea to use SAS reserved words, like libname, as parameters (or macro variables, or variable names, or anything else).&amp;nbsp; Just look at the color of your code, it recognises that as a reserved keyword.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Next, try using some sort of consistent casing in the code, it will make it far more readable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And you can use Base SAS functions to reduce code, for instance:&lt;/P&gt;
&lt;PRE&gt;%macro dir (lib=);

  title "Directory listing for Library: %upcase(&amp;amp;lib.)";

  proc print data=sashelp.vtables;
    var libname memlabel nobs nvar modate;
    where libname=upcase("&amp;amp;lib.");
  run;

%mend dir;
&lt;/PRE&gt;
&lt;P&gt;Also, if your writing a generalised macro, then you would have a user guide, some sort of testing document etc. so the user could refer to these for help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And finally, you can setup in Base SAS Abbreviations which can pre-populate text for you - although I really don't find those helpful.&amp;nbsp; I am afraid an editor such as Visual Studio where code completion tips pop up is not in SAS releases (at least the ones I have used).&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 12:22:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Add-pop-up-help-text-when-user-defined-macros-are-invoked/m-p/415810#M26734</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-11-23T12:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Add pop up help text when user defined macros are invoked</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Add-pop-up-help-text-when-user-defined-macros-are-invoked/m-p/415815#M26735</link>
      <description>&lt;P&gt;RW9,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for the helpful inputs. Valuable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your idea on Base SAS Abbreviations pointed me to exactly what I'm looking for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In SAS EG 5.1&amp;nbsp; I found there's a feature Program &amp;gt; Add Abbrevation Macro that fully resolves my issue.&amp;nbsp; And Program &amp;gt; Editor Macros is very handy to list out all macros put under Add Abbreviation Macro&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 12:59:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Add-pop-up-help-text-when-user-defined-macros-are-invoked/m-p/415815#M26735</guid>
      <dc:creator>constliv</dc:creator>
      <dc:date>2017-11-23T12:59:25Z</dc:date>
    </item>
  </channel>
</rss>

