<?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: How to get different titles for multiple tables using macros in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-different-titles-for-multiple-tables-using-macros/m-p/309158#M66471</link>
    <description>&lt;P&gt;Change what variables? For what use?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It may be that what you want for some of your variables are labels.&lt;/P&gt;
&lt;P&gt;Your proc print with the variables al ay for instance. If you had&lt;/P&gt;
&lt;P&gt;Label&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; al = "Some description of AL"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; ay = "Some description of AY"&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;then you can display very detailed column headers in proc print with the LABEL option and by default most other procedures would display the labels.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unless you are doing something to create entirely different documents or have more procedures than you show this could well be a case of using BY Group processing. You could then use #byvar and or #byval in a title.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Nov 2016 22:24:34 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-11-03T22:24:34Z</dc:date>
    <item>
      <title>How to get different titles for multiple tables using macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-different-titles-for-multiple-tables-using-macros/m-p/309153#M66466</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i need help on how i can give different titles to multiple tables where most of my diffinations are in macros. A short program is below. i would like to also change the variable names to something else. There are as many as 10 tables for 5 countries with one for imports and the other for exports. the Arguments argn stands for the 5 countries and the &amp;nbsp;amx are for imports and exports. the rgn1fmt are the country format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need a code inside this program that can give the headings and rename my variables.&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro mk_table1(argn,amx);&lt;/P&gt;&lt;P&gt;data tmp;&lt;BR /&gt;set tbl1data;&lt;BR /&gt;by ctry_rgn descending mx; &amp;nbsp; &amp;nbsp;/*All imports and exports*/&lt;/P&gt;&lt;P&gt;if mx=&amp;amp;amx;&lt;/P&gt;&lt;P&gt;if ctry_rgn=put(&amp;amp;argn,rgn1fmt.);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc print data=tmp( drop=mx) noobs;&lt;BR /&gt;Format cal year. al comma12. ay negparen9.1 vl &amp;nbsp;comma12. vy negparen9.1&lt;BR /&gt;ol &amp;nbsp;comma12. oy negparen9.1 tl &amp;nbsp;comma12. ty negparen9.1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%mend mk_table1;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 21:23:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-different-titles-for-multiple-tables-using-macros/m-p/309153#M66466</guid>
      <dc:creator>Kinston</dc:creator>
      <dc:date>2016-11-03T21:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to get different titles for multiple tables using macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-different-titles-for-multiple-tables-using-macros/m-p/309155#M66467</link>
      <description>&lt;P&gt;Sure, you can use the macro variables in your title as required.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need to apply a format, make sure to use %sysfunc() and PUTC/N as applicable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title "Imports from %sysfunc(putn(&amp;amp;argn, rgn1fmt))";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Nov 2016 21:40:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-different-titles-for-multiple-tables-using-macros/m-p/309155#M66467</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-03T21:40:42Z</dc:date>
    </item>
    <item>
      <title>splitting a table into two and give different titles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-different-titles-for-multiple-tables-using-macros/m-p/309156#M66469</link>
      <description>&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i need a program that can split a table into two. i have five tables and each one is to be split into two with different titles: imports and exports. &amp;nbsp;the argn is for imports and exports, ctry_rgn are the countries andrgn1fmt is the country format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i already have the the codes that outputs the tables but i need a code in the program below that can split the tables into two with different titles.&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro mk_table3(argn);&lt;/P&gt;&lt;P&gt;data tmp;&lt;BR /&gt;set tbl3data;&lt;BR /&gt;by ctry_rgn descending mx;&lt;/P&gt;&lt;P&gt;if ctry_rgn=put(&amp;amp;argn,rgn1fmt.);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%mend mk_table3;&lt;/P&gt;&lt;P&gt;typical example is pasted below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;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&lt;P&gt;68&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;98&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;4&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 22:14:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-different-titles-for-multiple-tables-using-macros/m-p/309156#M66469</guid>
      <dc:creator>Kinston</dc:creator>
      <dc:date>2016-11-03T22:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: splitting a table into two and give different titles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-different-titles-for-multiple-tables-using-macros/m-p/309157#M66470</link>
      <description>&lt;P&gt;Which part are you having problems with?&lt;/P&gt;
&lt;P&gt;What do you have in terms of data, what do you want as output and what do you have so far in terms of code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I made some assumptions with my initial answer, but since you reposted the question I assume it didn't answer your question.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 22:18:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-different-titles-for-multiple-tables-using-macros/m-p/309157#M66470</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-03T22:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to get different titles for multiple tables using macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-different-titles-for-multiple-tables-using-macros/m-p/309158#M66471</link>
      <description>&lt;P&gt;Change what variables? For what use?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It may be that what you want for some of your variables are labels.&lt;/P&gt;
&lt;P&gt;Your proc print with the variables al ay for instance. If you had&lt;/P&gt;
&lt;P&gt;Label&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; al = "Some description of AL"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; ay = "Some description of AY"&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;then you can display very detailed column headers in proc print with the LABEL option and by default most other procedures would display the labels.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unless you are doing something to create entirely different documents or have more procedures than you show this could well be a case of using BY Group processing. You could then use #byvar and or #byval in a title.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 22:24:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-different-titles-for-multiple-tables-using-macros/m-p/309158#M66471</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-11-03T22:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: splitting a table into two and give different titles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-different-titles-for-multiple-tables-using-macros/m-p/309205#M66486</link>
      <description>&lt;P&gt;You don;'t need to split datasets, nor use macro code. &amp;nbsp;There is in built Base SAS syntax for this tpe of task called by grou processing:&lt;/P&gt;
&lt;PRE&gt;proc print data=tbl3data;
  by ctry_rgn;
  title "City is: #byval1";
run;&lt;/PRE&gt;
&lt;P&gt;Its rarely a good idea to go splitting your data out, it will just make your code longer and more complicated.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2016 08:32:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-different-titles-for-multiple-tables-using-macros/m-p/309205#M66486</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-11-04T08:32:20Z</dc:date>
    </item>
  </channel>
</rss>

