<?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: Validvarname Giving Generic Variable References in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Validvarname-Giving-Generic-Variable-References/m-p/529837#M144829</link>
    <description>&lt;P&gt;so the validvarname = any will pull the data into a dataset, but I can't call that data field based on the name "Sample (Y/N)" as that wouldn't be valid. &amp;nbsp;Obviously the next move I want to make is an if statement such as If Sample = 'Y' then ........&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, the data is probably not consistent enough to simply switch to a csv, plus there is need for me to pull data from different sheets within each workbook. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Jan 2019 20:09:50 GMT</pubDate>
    <dc:creator>Lost_Gary</dc:creator>
    <dc:date>2019-01-24T20:09:50Z</dc:date>
    <item>
      <title>Validvarname Giving Generic Variable References</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Validvarname-Giving-Generic-Variable-References/m-p/529794#M144813</link>
      <description>&lt;P&gt;I am using data from multiple sources that is not consistent. &amp;nbsp;This source furnishes information in Excel format. &amp;nbsp;Because my variable names are not universal I have been using the Validvarname option to import the data (using proc import, getnames=yes). &amp;nbsp;For some fields this returns a generic value, such as VAR1, VAR2, etc. &amp;nbsp;Is there anyway to get this to return a value? &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For instances, I have a variable called "Sample". &amp;nbsp;One source has listed this as "Sample (Y/N)". &amp;nbsp;This returns the generic value of VAR15 and I would like some form of the word "Sample" so i can understand the content. &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas are appreciated. &amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jan 2019 18:29:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Validvarname-Giving-Generic-Variable-References/m-p/529794#M144813</guid>
      <dc:creator>Lost_Gary</dc:creator>
      <dc:date>2019-01-24T18:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: Validvarname Giving Generic Variable References</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Validvarname-Giving-Generic-Variable-References/m-p/529800#M144815</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Validvarname=any option should read your column names that have special characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options validvarname=any;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Jan 2019 18:41:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Validvarname-Giving-Generic-Variable-References/m-p/529800#M144815</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2019-01-24T18:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: Validvarname Giving Generic Variable References</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Validvarname-Giving-Generic-Variable-References/m-p/529815#M144818</link>
      <description>&lt;P&gt;Why not just look at the LABEL on the variable?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC IMPORT from an XLSX file should put the original header value into the LABEL no matter what setting you have for the VALIDVARNAME option.&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="image.png" style="width: 592px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26548i67831C0F059AF390/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jan 2019 19:29:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Validvarname-Giving-Generic-Variable-References/m-p/529815#M144818</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-01-24T19:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Validvarname Giving Generic Variable References</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Validvarname-Giving-Generic-Variable-References/m-p/529818#M144820</link>
      <description>&lt;P&gt;Are the tables generally the same? Is there an option to convert, in batch, to csv and then read those in with the desired specifications.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, here's a vb script that will convert all files in a folder from xlsx to csv.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://gist.github.com/statgeek/878e585102c14e01581f55dbe972d27e" target="_blank"&gt;https://gist.github.com/statgeek/878e585102c14e01581f55dbe972d27e&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/208658"&gt;@Lost_Gary&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am using data from multiple sources that is not consistent. &amp;nbsp;This source furnishes information in Excel format. &amp;nbsp;Because my variable names are not universal I have been using the Validvarname option to import the data (using proc import, getnames=yes). &amp;nbsp;For some fields this returns a generic value, such as VAR1, VAR2, etc. &amp;nbsp;Is there anyway to get this to return a value? &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For instances, I have a variable called "Sample". &amp;nbsp;One source has listed this as "Sample (Y/N)". &amp;nbsp;This returns the generic value of VAR15 and I would like some form of the word "Sample" so i can understand the content. &amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any ideas are appreciated. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jan 2019 19:32:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Validvarname-Giving-Generic-Variable-References/m-p/529818#M144820</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-24T19:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: Validvarname Giving Generic Variable References</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Validvarname-Giving-Generic-Variable-References/m-p/529837#M144829</link>
      <description>&lt;P&gt;so the validvarname = any will pull the data into a dataset, but I can't call that data field based on the name "Sample (Y/N)" as that wouldn't be valid. &amp;nbsp;Obviously the next move I want to make is an if statement such as If Sample = 'Y' then ........&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, the data is probably not consistent enough to simply switch to a csv, plus there is need for me to pull data from different sheets within each workbook. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jan 2019 20:09:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Validvarname-Giving-Generic-Variable-References/m-p/529837#M144829</guid>
      <dc:creator>Lost_Gary</dc:creator>
      <dc:date>2019-01-24T20:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: Validvarname Giving Generic Variable References</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Validvarname-Giving-Generic-Variable-References/m-p/529851#M144836</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt; I can't call that data field based on the name "Sample (Y/N)"&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You have to use the string suffix &lt;STRONG&gt;n&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The best way to use it is generally&amp;nbsp;in a rename statement/option&amp;nbsp;so you don't carry these silly names in your program.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;rename 'Sample (Y/N)'n = SAMPLE;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Then set option &lt;FONT face="courier new,courier"&gt;validvarname&lt;/FONT&gt; back to V7.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jan 2019 20:34:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Validvarname-Giving-Generic-Variable-References/m-p/529851#M144836</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-01-24T20:34:42Z</dc:date>
    </item>
  </channel>
</rss>

