<?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: log transformation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/log-transformation/m-p/536877#M147591</link>
    <description>&lt;P&gt;Post your code.&lt;/P&gt;</description>
    <pubDate>Tue, 19 Feb 2019 19:39:34 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-02-19T19:39:34Z</dc:date>
    <item>
      <title>log transformation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/log-transformation/m-p/536791#M147563</link>
      <description>&lt;P&gt;Hi all&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have made this code to transform all my variable's data into log form.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my question&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is there any code to transform all data variables together in one single small code OR I need to do so individually&amp;nbsp;as my this code does?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data LOG;
   set have;
   logA = log(A_1);
   logB = log(B_1);
   logC = log(C_1);
   logD = log(D_1);
run; quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 15:41:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/log-transformation/m-p/536791#M147563</guid>
      <dc:creator>Barkamih</dc:creator>
      <dc:date>2019-02-19T15:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: log transformation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/log-transformation/m-p/536794#M147565</link>
      <description>&lt;P&gt;Retrieve the column names from sashelp.vcolumn, and use call execute:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
set sashelp.vcolumn end=eof;
where libname = 'WORK' and memname = 'HAVE' and type = 'num';
if _n_ = 1 then call execute('data log; set have;');
call execute('log' !! trim(name) !! ' = log(' !! trim(name) !! ');');
if eof then call execute('run;');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Feb 2019 15:47:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/log-transformation/m-p/536794#M147565</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-02-19T15:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: log transformation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/log-transformation/m-p/536796#M147566</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use arrays :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input A_1 B_1 C_1 D_1;
cards;
1 2 3 4
5 6 7 8
;
run;

proc sql noprint;
SELECT NAME, cats('Log',substr(NAME,1,1))
INTO :vars SEPARATED BY ' ', :logs SEPARATED BY ' '
FROM dictionary.columns
WHERE LIBNAME="WORK" AND MEMNAME="HAVE";
quit;

data want;
set have;
array A &amp;amp;vars.;
array B &amp;amp;logs.;

do over A;
   B=log(A);
end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Edit : I didn't use the same variables names as in your question =&amp;gt; added a request on dictionary columns to &lt;/P&gt;
&lt;P&gt;generate the arrays definitions.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 16:04:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/log-transformation/m-p/536796#M147566</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2019-02-19T16:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: log transformation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/log-transformation/m-p/536858#M147583</link>
      <description>&lt;P&gt;thanks for your response&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't get it yet&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I should to change if my data name Is Have and these are my variable (Samples&amp;nbsp; GROUP&amp;nbsp; ACTB&amp;nbsp; CCL2&amp;nbsp; FGF2&amp;nbsp; MMP1 NFKB2&amp;nbsp; &amp;nbsp;PTGES&amp;nbsp; &amp;nbsp;PTGI)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got this error&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: Variable libname is not on file WORK.HAVE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 18:39:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/log-transformation/m-p/536858#M147583</guid>
      <dc:creator>Barkamih</dc:creator>
      <dc:date>2019-02-19T18:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: log transformation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/log-transformation/m-p/536877#M147591</link>
      <description>&lt;P&gt;Post your code.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 19:39:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/log-transformation/m-p/536877#M147591</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-02-19T19:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: log transformation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/log-transformation/m-p/537394#M147804</link>
      <description>&lt;P&gt;Sorry was so busy,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using your code and I did not change anything, I got confused&amp;nbsp;about how to change it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How the code should look like if my data has a name of HAVE.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2019 13:57:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/log-transformation/m-p/537394#M147804</guid>
      <dc:creator>Barkamih</dc:creator>
      <dc:date>2019-02-21T13:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: log transformation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/log-transformation/m-p/537397#M147806</link>
      <description>&lt;P&gt;My code works for a dataset named "HAVE" in the work library.&lt;/P&gt;
&lt;P&gt;This line&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where libname = 'WORK' and memname = 'HAVE' and type = 'num';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;does all the selections. Library, dataset and variables. If you want to work on a specific set of variables that cannot be sufficiently determined jzst by type, use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;and name in('NAME1','NAME2')&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(just an example)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For further help, post an example of your data (in a data step with datalines, see my footnotes) and the code you tried.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2019 14:06:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/log-transformation/m-p/537397#M147806</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-02-21T14:06:48Z</dc:date>
    </item>
  </channel>
</rss>

