<?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: Create a macro that applies translate on multiple columns that you define in a dataset in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802234#M33260</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/415512"&gt;@Abelp9&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thank you very much !! but I need it in a macro to be able to call it easily in other programs without the need to be copying that code in the different programs&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you want to use this code easily in other programs, you can get rid of the %LET statements and then save what is left to a file, and then use %INCLUDE.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;So, let's assume the file you save the code to is named g:\myfolder\mysubfolder\translate_columns.sas&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, here is how you would use it&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%LET table = TEST_MACRO_TRNSLT;
%let column = marca column2 column3 column5;
%let name_output = COSAS;
%include "g:\myfolder\mysubfolder\translate_columns.sas";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Although certainly a macro would work as well (macro using the ARRAY statement logic), but why create a macro when it is not needed?&lt;/P&gt;</description>
    <pubDate>Tue, 15 Mar 2022 14:55:21 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-03-15T14:55:21Z</dc:date>
    <item>
      <title>Create a macro that applies translate on multiple columns that you define in a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802210#M33251</link>
      <description>&lt;P&gt;hello everyone, I'm new to programming in SAS and I would like to do 2 macros, the first one I have done and it consists of giving 3 parameters: name of the input table, name of the column, name of the output table. What this macro does is translate the rare or accented characters, passing it a table and specifying in which column you want the rare characters to be translated:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code to do this macro is this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro translate_column(table,column,name_output);

*%LET table = TEST_MACRO_TRNSLT;
*%let column = marca;
*%let name_output = COSAS;


PROC SQL;
CREATE TABLE TEST AS
SELECT *
FROM &amp;amp;table.;
QUIT;

data &amp;amp;NAME_OUTPUT;
set TEST;
&amp;amp;column.=tranwrd(&amp;amp;column., "Á", "A");
run;
%mend;
%translate_column(TEST_MACRO_TRNSLT,marca,COSAS);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem comes when I try to do the second macro, that I want to replicate what I do in the first one but instead of having the columns that I can introduce to 1, let it be infinite, that is, if in a data set I have 4 columns with characters rare, can you translate the rare characters of those 4 columns. I don't know if I have to put a previously made macro in a parameter and then make a kind of loop or something in the macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could someone give me a hand on this? I would be very grateful&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 14:10:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802210#M33251</guid>
      <dc:creator>Abelp9</dc:creator>
      <dc:date>2022-03-15T14:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Create a macro that applies translate on multiple columns that you define in a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802214#M33252</link>
      <description>&lt;P&gt;Over complicated. You can apply the translate you are looking at to ALL character variables in a data set using an array.&lt;/P&gt;
&lt;PRE&gt;data want;
   set have;
   array _c (*) _character_;
   do i = 1 to dim(_c);
     _c[i] = translate(_c[i],"Auea","Áüéâ");
   end;
   drop i;
run;

&lt;/PRE&gt;
&lt;P&gt;TRANSLATE is the function you want if you are doing single character replacements. You place the "to", the desired results first and matching "from" characters second. The first of the from, when encountered will be replaced by the first of the "to" variables for as many pairs as you provide. Tranwrd, while it will work requires many calls to replace single characters as you would need one for each character.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 14:25:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802214#M33252</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-03-15T14:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: Create a macro that applies translate on multiple columns that you define in a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802215#M33253</link>
      <description>&lt;P&gt;You don't really need a macro. The ARRAY feature of DATA steps allows you to execute the same code on many different variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%LET table = TEST_MACRO_TRNSLT;
%let column = marca column2 column3 column5;
%let name_output = COSAS;

data &amp;amp;NAME_OUTPUT;
    set &amp;amp;table;
    array t &amp;amp;columns;
    do i=1 to dim(t);
        t(i)=tranwrd(t(i), "Á", "A");
    end;
    drop i;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Good point by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;to use TRANSLATE instead of TRANWRD.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 14:29:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802215#M33253</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-03-15T14:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: Create a macro that applies translate on multiple columns that you define in a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802219#M33254</link>
      <description>&lt;P&gt;Thank you very much for your help, I have tried to execute this code but it returns strange characters:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set TEST_MACRO_TRNSLT;
   array _c (*) _character_;
   do i = 1 to dim(_c);
     _c[i] = translate(_c[i],"Auea","Áüéâ");
   end;
   drop i;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I like your idea of using the translate, although in the fields to which I want to apply the translate are words with several characters and I will want to change them because the ones that are rare, if a word is HÓLÁ I want it to return HOLA.&lt;/P&gt;
&lt;P&gt;_c what does it refer to? I don't have much experience in arrays but I find them very interesting&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 14:34:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802219#M33254</guid>
      <dc:creator>Abelp9</dc:creator>
      <dc:date>2022-03-15T14:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: Create a macro that applies translate on multiple columns that you define in a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802220#M33255</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/415512"&gt;@Abelp9&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you very much for your help, I have tried to execute this code but it returns strange characters:&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;We don't know what this means. SHOW US the "strange characters". Show us the LOG. Help us help you by being specific (not just here in this case, but in every situation)&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 14:36:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802220#M33255</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-03-15T14:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: Create a macro that applies translate on multiple columns that you define in a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802221#M33256</link>
      <description>Thank you very much !! but I need it in a macro to be able to call it easily in other programs without the need to be copying that code in the different programs</description>
      <pubDate>Tue, 15 Mar 2022 14:38:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802221#M33256</guid>
      <dc:creator>Abelp9</dc:creator>
      <dc:date>2022-03-15T14:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Create a macro that applies translate on multiple columns that you define in a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802226#M33257</link>
      <description>&lt;P&gt;This is my input table:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test2.PNG" style="width: 411px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/69475iCE84120BF0730C68/image-size/large?v=v2&amp;amp;px=999" role="button" title="test2.PNG" alt="test2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And this is what I get back when I run the code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test1.PNG" style="width: 429px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/69474iBE7B25E683D47E6D/image-size/large?v=v2&amp;amp;px=999" role="button" title="test1.PNG" alt="test1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 14:42:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802226#M33257</guid>
      <dc:creator>Abelp9</dc:creator>
      <dc:date>2022-03-15T14:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Create a macro that applies translate on multiple columns that you define in a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802228#M33258</link>
      <description>&lt;P&gt;Example with translate that does exactly as requested for&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From my log running similar example.&lt;/P&gt;
&lt;PRE&gt;
158  data example;
159     word = "HÓLÁ";
160     word = translate(word,'AO','ÁÓ');
161     put word=;
162  run;

word=HOLA
&lt;/PRE&gt;
&lt;P&gt;Since you have not provided any actual example data we cannot tell what " strange characters" might mean.&lt;/P&gt;
&lt;P&gt;If you data contains other than simple ASCII (or EBCDIC) characters then neither Translate or Tranwrd may be appropriate. I also did not provide a complete map of characters. It was expected that you identify the characters you need to replace along with the desired characters and use them in your code with your data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Arrays provide a quick tool. The _c is the name of the array, should not match any existing variable in your data. Then _c[i] refers to one of the character variables in your data set. The i will iterate over the number of your character variables and apply the same rule(s) to all of them.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 14:45:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802228#M33258</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-03-15T14:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: Create a macro that applies translate on multiple columns that you define in a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802232#M33259</link>
      <description>&lt;P&gt;Excuse me, I did not know that you could attach files, here I give you my test data set, all the columns are character, so I would have to change all the columns.&lt;/P&gt;
&lt;P&gt;In the example with which I opened the post, I only put the casuistry of an Á that passes to A, but in the excel, each row is a different one, so it would be worth seeing it only with the Á and I apply it to the rest of the characters.&lt;/P&gt;
&lt;P&gt;Thank you very much for the explanation, I am very grateful&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 14:52:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802232#M33259</guid>
      <dc:creator>Abelp9</dc:creator>
      <dc:date>2022-03-15T14:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: Create a macro that applies translate on multiple columns that you define in a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802234#M33260</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/415512"&gt;@Abelp9&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thank you very much !! but I need it in a macro to be able to call it easily in other programs without the need to be copying that code in the different programs&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you want to use this code easily in other programs, you can get rid of the %LET statements and then save what is left to a file, and then use %INCLUDE.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;So, let's assume the file you save the code to is named g:\myfolder\mysubfolder\translate_columns.sas&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, here is how you would use it&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%LET table = TEST_MACRO_TRNSLT;
%let column = marca column2 column3 column5;
%let name_output = COSAS;
%include "g:\myfolder\mysubfolder\translate_columns.sas";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Although certainly a macro would work as well (macro using the ARRAY statement logic), but why create a macro when it is not needed?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 14:55:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802234#M33260</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-03-15T14:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: Create a macro that applies translate on multiple columns that you define in a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802236#M33261</link>
      <description>&lt;P&gt;and being in another program, after putting the %include how could I call that block of code? to give it the data set that I want and the columns that I want it to translate for me?&lt;/P&gt;
&lt;P&gt;Thank you very much&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 14:56:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802236#M33261</guid>
      <dc:creator>Abelp9</dc:creator>
      <dc:date>2022-03-15T14:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Create a macro that applies translate on multiple columns that you define in a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802237#M33262</link>
      <description>&lt;P&gt;You cannot use TRANSLATE() with multi-byte characters like those.&lt;/P&gt;
&lt;P&gt;Either use KTANSLATE() or use a different method.&lt;/P&gt;
&lt;PRE&gt; 73         data example;
 74            length word word2-word5 $50;
 75            word  = "HÓLÁ";
 76            word2 = translate(word,'AO','ÁÓ');
 77            word3 = ktranslate(word,'AO','ÁÓ');
 78            word4 = basechar(word);
 79            word5 = htmlencode(word,'7bit');
 80            put (word:) (=/);
 81         run;
 
 word=HÓLÁ
 word2=HA LAO
 word3=HOLA
 word4=HOLA
 word5=H&amp;amp;#xD3;L&amp;amp;#xC1;
 NOTE: The data set WORK.EXAMPLE has 1 observations and 5 variables.&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Mar 2022 15:09:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802237#M33262</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-03-15T15:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Create a macro that applies translate on multiple columns that you define in a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802239#M33263</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/415512"&gt;@Abelp9&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;and being in another program, after putting the %include how could I call that block of code? to give it the data set that I want and the columns that I want it to translate for me?&lt;/P&gt;
&lt;P&gt;Thank you very much&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;There is nothing to do after %include, because %include EXECUTES the code in the included file. You just run the four lines of code in my previous reply.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 14:58:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802239#M33263</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-03-15T14:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: Create a macro that applies translate on multiple columns that you define in a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802240#M33264</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/415512"&gt;@Abelp9&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Excuse me, I did not know that you could attach files, here I give you my test data set, all the columns are character, so I would have to change all the columns.&lt;/P&gt;
&lt;P&gt;In the example with which I opened the post, I only put the casuistry of an Á that passes to A, but in the excel, each row is a different one, so it would be worth seeing it only with the Á and I apply it to the rest of the characters.&lt;/P&gt;
&lt;P&gt;Thank you very much for the explanation, I am very grateful&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Many of us will not download Excel files, as they are security risks. Do not attach files, use DATA step code to represent your data, you can type it in directly as working SAS data step, or (recommended) follow &lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;these instructions&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 15:01:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802240#M33264</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-03-15T15:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: Create a macro that applies translate on multiple columns that you define in a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802248#M33265</link>
      <description>&lt;P&gt;I have tried to do it, in a program I have put this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data &amp;amp;NAME_OUTPUT;
    set &amp;amp;table;
    array t &amp;amp;columns;
    do i=1 to dim(t);
        t(i)=tranwrd(t(i), "Á", "A");
    end;
    drop i;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In another program I run this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%LET table = TEST_MACRO_TRNSLT;
%let columns = marca cc_marca var3;
%let name_output = COSAS2;

%include "/opt/sas/data/xx/xx/xxx/macros/test_trnslt.sas";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and from another I have executed this statement but it returns the same table as the input, however when I go to the individual program where I have the code with the array and the loaded macrovariables it does return the table I expect, what could I be doing wrong ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I share the log:&lt;/P&gt;
&lt;PRE&gt;15             STYLESHEET=(URL="file:///C:/Program%20Files%20(x86)/SASHome/x86/SASEnterpriseGuide/7.1/Styles/HtmlBlue.css")
16             NOGTITLE
17             NOGFOOTNOTE
18             GPATH=&amp;amp;sasworklocation
19             ENCODING=UTF8
20             options(rolap="on")
21         ;
NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
22         
23         GOPTIONS ACCESSIBLE;
24         %LET table = TEST_MACRO_TRNSLT;
25         %let columns = marca cc_marca var3;
26         %let name_output = COSAS2;
27         
28         %include "/opt/sas/data/xx/xx/xx/macros/test_trnslt.sas";

NOTE: La compresión del conjunto de datos WORK.COSAS2  está deshabilitada porque aumentaría el tamaño del  conjunto de datos.
NOTE: There were 30 observations read from the data set WORK.TEST_MACRO_TRNSLT.
NOTE: MVA_DSIO.OPEN_CLOSE| _DISARM|         STOP| _DISARM| 2022-03-15T16:22:41,348+01:00| _DISARM| WorkspaceServer| _DISARM| SAS| 
      _DISARM| | _DISARM| 30| _DISARM| 21397504| _DISARM| 12| _DISARM| 16| _DISARM| 8| _DISARM| 6800| _DISARM| 0.000000| _DISARM| 
      0.001808| _DISARM| 1962976961.346445| _DISARM| 1962976961.348253| _DISARM| 0.000000| _DISARM| | _ENDDISARM 
NOTE: The data set WORK.COSAS2 has 30 observations and 4 variables.
NOTE: MVA_DSIO.OPEN_CLOSE| _DISARM|         STOP| _DISARM| 2022-03-15T16:22:41,349+01:00| _DISARM| WorkspaceServer| _DISARM| SAS| 
      _DISARM| | _DISARM| 30| _DISARM| 21397504| _DISARM| 12| _DISARM| 16| _DISARM| 136| _DISARM| 6928| _DISARM| 0.000000| _DISARM| 
      0.001564| _DISARM| 1962976961.347533| _DISARM| 1962976961.349097| _DISARM| 0.000000| _DISARM| | _ENDDISARM 
NOTE: PROCEDURE| _DISARM|         STOP| _DISARM| 2022-03-15T16:22:41,349+01:00| _DISARM| WorkspaceServer| _DISARM| SAS| _DISARM| | 
      _DISARM| 22974464| _DISARM| 21397504| _DISARM| 12| _DISARM| 16| _DISARM| 136| _DISARM| 6928| _DISARM| 0.000000| _DISARM| 
      0.003680| _DISARM| 1962976961.345588| _DISARM| 1962976961.349268| _DISARM| 0.000000| _DISARM| | _ENDDISARM 
NOTE: Sentencia DATA used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

53         
54         GOPTIONS NOACCESSIBLE;
55         %LET _CLIENTTASKLABEL=;
56         %LET _CLIENTPROCESSFLOWNAME=;
57         %LET _CLIENTPROJECTPATH=;
58         %LET _CLIENTPROJECTNAME=;
59         %LET _SASPROGRAMFILE=;
60         
61         ;*';*";*/;quit;run;
62         ODS _ALL_ CLOSE;
63         
2                                                           Sistema SAS                                16:01 Tuesday, March 15, 2022

64         
65         QUIT; RUN;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Mar 2022 15:24:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802248#M33265</guid>
      <dc:creator>Abelp9</dc:creator>
      <dc:date>2022-03-15T15:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: Create a macro that applies translate on multiple columns that you define in a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802250#M33266</link>
      <description>&lt;P&gt;Please re-run the %include with the SOURCE2 option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%include "/opt/sas/data/xx/xx/xxx/macros/test_trnslt.sas"/source2;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then show us the log.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 15:30:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-a-macro-that-applies-translate-on-multiple-columns-that/m-p/802250#M33266</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-03-15T15:30:15Z</dc:date>
    </item>
  </channel>
</rss>

