<?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: Labeling Variables based on other variable names in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Labeling-Variables-based-on-other-variable-names/m-p/247054#M46280</link>
    <description>&lt;P&gt;Thank you! &amp;nbsp;I looked at it differently and did make it much easier. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you :).&lt;/P&gt;</description>
    <pubDate>Sat, 30 Jan 2016 20:51:46 GMT</pubDate>
    <dc:creator>Katie</dc:creator>
    <dc:date>2016-01-30T20:51:46Z</dc:date>
    <item>
      <title>Labeling Variables based on other variable names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Labeling-Variables-based-on-other-variable-names/m-p/247051#M46278</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm working on creating a label for variables that are being created, but I'd like them to have the old names as their labels. &amp;nbsp;I keep gettin an error message saying there is a syntax error on the LABEL line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help is greatly appreciated!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DATA %SCAN(&amp;amp;DATA,&amp;amp;i); &lt;BR /&gt; SET %SCAN(&amp;amp;DATA,&amp;amp;i); &lt;BR /&gt; ARRAY %SCAN(&amp;amp;DATA,&amp;amp;i) [&amp;amp;Count] &amp;amp;List;&lt;BR /&gt; ARRAY BIN_%SCAN(&amp;amp;DATA,&amp;amp;i)[&amp;amp;Count] BIN_%SCAN(&amp;amp;DATA,&amp;amp;i)1 - BIN_%SCAN(&amp;amp;DATA,&amp;amp;i)&amp;amp;Count;&lt;BR /&gt; DO j = 1 TO &amp;amp;Count; &lt;BR /&gt; IF %SCAN(&amp;amp;DATA,&amp;amp;i)(j) = '' THEN BIN_%SCAN(&amp;amp;DATA,&amp;amp;i)(j) = 0;&lt;BR /&gt; ELSE BIN_%SCAN(&amp;amp;DATA,&amp;amp;i)(j) = 1;&lt;BR /&gt; LABEL BIN_%SCAN(&amp;amp;DATA,&amp;amp;i)(j) = %SCAN(&amp;amp;DATA,&amp;amp;i)(j);&lt;BR /&gt; END;&lt;BR /&gt; FORMAT BIN_%SCAN(&amp;amp;DATA,&amp;amp;i)1 - BIN_%SCAN(&amp;amp;DATA,&amp;amp;i)&amp;amp;Count Issues.;&lt;BR /&gt; RUN;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jan 2016 20:09:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Labeling-Variables-based-on-other-variable-names/m-p/247051#M46278</guid>
      <dc:creator>Katie</dc:creator>
      <dc:date>2016-01-30T20:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling Variables based on other variable names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Labeling-Variables-based-on-other-variable-names/m-p/247052#M46279</link>
      <description>&lt;P&gt;I don't think you can reference a variable to assign a label by using the array reference, ie this line:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;LABEL BIN_%SCAN(&amp;amp;DATA,&amp;amp;i)(j) = %SCAN(&amp;amp;DATA,&amp;amp;i)(j);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You'll need to either get the variables names which you may have in another macro variable (LIST)&lt;/P&gt;
&lt;P&gt;or you can do it in another step, using the metadata from SASHELP.VCOLUMN and PROC DATASETS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm looking at your code though and betting there's an easier way to accomplish what you're trying to do....so what are you trying to do &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jan 2016 20:13:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Labeling-Variables-based-on-other-variable-names/m-p/247052#M46279</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-30T20:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling Variables based on other variable names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Labeling-Variables-based-on-other-variable-names/m-p/247054#M46280</link>
      <description>&lt;P&gt;Thank you! &amp;nbsp;I looked at it differently and did make it much easier. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you :).&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jan 2016 20:51:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Labeling-Variables-based-on-other-variable-names/m-p/247054#M46280</guid>
      <dc:creator>Katie</dc:creator>
      <dc:date>2016-01-30T20:51:46Z</dc:date>
    </item>
  </channel>
</rss>

