<?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 How to change the variable name in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-change-the-variable-name/m-p/817493#M34527</link>
    <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;There is a variable DAI with values WEEK 2, WEEK 4, WEEK 8, WEEK 12, ..&lt;/P&gt;&lt;P&gt;If I transpose DAI variable then I get WEEK 2, WEEK 4,.. as variable&lt;/P&gt;&lt;P&gt;how can I change variable name from WEEK 2 to WEEK_2 ,...&lt;/P&gt;&lt;P&gt;As space is not accepted in variable name&lt;/P&gt;&lt;P&gt;But If i do before transpose like if DAI="WEEK 2" then dai_ "WEEK_2;&lt;/P&gt;&lt;P&gt;But it gives error when i transpose dai_ variable&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ERROR: The ID value "WEEK_2" occurs twice in the same BY group&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;can someone please give me solution?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jun 2022 15:45:51 GMT</pubDate>
    <dc:creator>yogita_patel</dc:creator>
    <dc:date>2022-06-10T15:45:51Z</dc:date>
    <item>
      <title>How to change the variable name</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-change-the-variable-name/m-p/817493#M34527</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;There is a variable DAI with values WEEK 2, WEEK 4, WEEK 8, WEEK 12, ..&lt;/P&gt;&lt;P&gt;If I transpose DAI variable then I get WEEK 2, WEEK 4,.. as variable&lt;/P&gt;&lt;P&gt;how can I change variable name from WEEK 2 to WEEK_2 ,...&lt;/P&gt;&lt;P&gt;As space is not accepted in variable name&lt;/P&gt;&lt;P&gt;But If i do before transpose like if DAI="WEEK 2" then dai_ "WEEK_2;&lt;/P&gt;&lt;P&gt;But it gives error when i transpose dai_ variable&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ERROR: The ID value "WEEK_2" occurs twice in the same BY group&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;can someone please give me solution?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 15:45:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-change-the-variable-name/m-p/817493#M34527</guid>
      <dc:creator>yogita_patel</dc:creator>
      <dc:date>2022-06-10T15:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the variable name</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-change-the-variable-name/m-p/817495#M34528</link>
      <description>&lt;P&gt;Please, when you are talking about data, show us a portion of the actual SAS data set, as SAS data step code (&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;instructions&lt;/A&gt;). That would be very helpful. Do not attach Excel files, or provide the data in other formats.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, when you get errors in the log, SHOW US the log (all of it, every single line, every single character, for the PROC or DATA step that has the error)&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 16:03:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-change-the-variable-name/m-p/817495#M34528</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-06-10T16:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the variable name</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-change-the-variable-name/m-p/817496#M34529</link>
      <description>Add this before your code:&lt;BR /&gt;&lt;BR /&gt;option validvarname=v7;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 10 Jun 2022 15:54:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-change-the-variable-name/m-p/817496#M34529</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-06-10T15:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the variable name</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-change-the-variable-name/m-p/817497#M34530</link>
      <description>&lt;P&gt;Without an example it is hard to tell what you are actually doing.&lt;/P&gt;
&lt;P&gt;You seem to be asking two different questions.&lt;/P&gt;
&lt;P&gt;To force PROC TRANSPOSE to generate valid variable names make sure you have set the option VALIDVARNAME=v7.&amp;nbsp; You might have accidentally had it set to VALIDVARNAME=any before.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have the same ID value in multiple times you need to decide how you want that transposed.&lt;/P&gt;
&lt;P&gt;Perhaps you just need to add an extra BY variable so that you now longer have duplicate ID values for the same target observation.&lt;/P&gt;
&lt;P&gt;Or perhaps you want eliminate the duplicate observation before calling PROC TRANSPOSE.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 15:56:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-change-the-variable-name/m-p/817497#M34530</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-06-10T15:56:34Z</dc:date>
    </item>
  </channel>
</rss>

