<?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 PS match - Variable name not recognized in SAS Studio in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PS-match-Variable-name-not-recognized-in-SAS-Studio/m-p/850217#M336039</link>
    <description>&lt;P&gt;Dear all&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm facing a problem with the new SAS OnDemand. I've already performed PS matching analyses on the virtual machine and everything was working good.&lt;/P&gt;&lt;P&gt;Now, when I run the same programmes OnDemand, I'm encountering some problems.&lt;/P&gt;&lt;P&gt;More in details:&lt;/P&gt;&lt;P&gt;1) I've created a psmatched dataset with all the variables of interest&lt;/P&gt;&lt;P&gt;2) I can pair the data creating two different datasets (matched_continuous and matched_categorical)&lt;/P&gt;&lt;P&gt;3) now the problem! when I write the program for matched analysis (group variables are named as 1 and 2)&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;DATA mAge;
	SET dswi.pairedcontinuous;
	WHERE Variables='Age_recalc';
RUN;

PROC TTEST data= mAge;
	PAIRED _1*_2 ;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I found in the Log&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;         PAIRED _1*_2 ;
 ERROR: Variable _1 not found.
 ERROR: Variable _2 not found.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This code was well functioning when running SAS on the virtual maching. What's going wrong now?&lt;/P&gt;&lt;P&gt;Thank You all in advance for Your precious help and support!!!&lt;/P&gt;</description>
    <pubDate>Sat, 17 Dec 2022 20:51:08 GMT</pubDate>
    <dc:creator>antor82</dc:creator>
    <dc:date>2022-12-17T20:51:08Z</dc:date>
    <item>
      <title>PS match - Variable name not recognized in SAS Studio</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PS-match-Variable-name-not-recognized-in-SAS-Studio/m-p/850217#M336039</link>
      <description>&lt;P&gt;Dear all&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm facing a problem with the new SAS OnDemand. I've already performed PS matching analyses on the virtual machine and everything was working good.&lt;/P&gt;&lt;P&gt;Now, when I run the same programmes OnDemand, I'm encountering some problems.&lt;/P&gt;&lt;P&gt;More in details:&lt;/P&gt;&lt;P&gt;1) I've created a psmatched dataset with all the variables of interest&lt;/P&gt;&lt;P&gt;2) I can pair the data creating two different datasets (matched_continuous and matched_categorical)&lt;/P&gt;&lt;P&gt;3) now the problem! when I write the program for matched analysis (group variables are named as 1 and 2)&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;DATA mAge;
	SET dswi.pairedcontinuous;
	WHERE Variables='Age_recalc';
RUN;

PROC TTEST data= mAge;
	PAIRED _1*_2 ;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I found in the Log&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;         PAIRED _1*_2 ;
 ERROR: Variable _1 not found.
 ERROR: Variable _2 not found.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This code was well functioning when running SAS on the virtual maching. What's going wrong now?&lt;/P&gt;&lt;P&gt;Thank You all in advance for Your precious help and support!!!&lt;/P&gt;</description>
      <pubDate>Sat, 17 Dec 2022 20:51:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PS-match-Variable-name-not-recognized-in-SAS-Studio/m-p/850217#M336039</guid>
      <dc:creator>antor82</dc:creator>
      <dc:date>2022-12-17T20:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: PS match - Variable name not recognized in SAS Studio</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PS-match-Variable-name-not-recognized-in-SAS-Studio/m-p/850218#M336040</link>
      <description>&lt;P&gt;You are showing the wrong part of the code.&amp;nbsp; We need to see the code that created the dataset&amp;nbsp;dswi.pairedcontinuous to understand why the variables are not named _1 and _2.&lt;/P&gt;
&lt;P&gt;Perhaps it is as simple as you accidentally run it with validvarname=any and it created variables named '1'n and '2'n instead.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Dec 2022 20:54:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PS-match-Variable-name-not-recognized-in-SAS-Studio/m-p/850218#M336040</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-12-17T20:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: PS match - Variable name not recognized in SAS Studio</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PS-match-Variable-name-not-recognized-in-SAS-Studio/m-p/850219#M336041</link>
      <description>&lt;P&gt;Dear Tom&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is the code&lt;/P&gt;&lt;PRE&gt;PROC SORT data=dswi.matchedunpaired out=matchedsorted;
BY _MatchID Group;
RUN;

PROC TRANSPOSE data=matchedsorted out=dswi.pairedcontinuous name=Variables;
BY _MatchID;
VAR Age_recalc EuroScoreII ICU LenghtOfStay;
ID Group;
RUN;&lt;/PRE&gt;&lt;P&gt;In the output dataset, the variables are named 1 and 2.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Dec 2022 21:02:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PS-match-Variable-name-not-recognized-in-SAS-Studio/m-p/850219#M336041</guid>
      <dc:creator>antor82</dc:creator>
      <dc:date>2022-12-17T21:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: PS match - Variable name not recognized in SAS Studio</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PS-match-Variable-name-not-recognized-in-SAS-Studio/m-p/850220#M336042</link>
      <description>Or, probably more easily….. if variables are named 1 and 2, why cannot I use their real name (although numerical) for the analyses?&lt;BR /&gt;When I tried&lt;BR /&gt;PAIRED 1*2&lt;BR /&gt;It returned an invalid name error (because they were recognised as numbers instead of variable names)…&lt;BR /&gt;</description>
      <pubDate>Sat, 17 Dec 2022 21:24:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PS-match-Variable-name-not-recognized-in-SAS-Studio/m-p/850220#M336042</guid>
      <dc:creator>antor82</dc:creator>
      <dc:date>2022-12-17T21:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: PS match - Variable name not recognized in SAS Studio</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PS-match-Variable-name-not-recognized-in-SAS-Studio/m-p/850223#M336044</link>
      <description>&lt;P&gt;So different values of the VALIDVARNAME option is the issue.&amp;nbsp; If you have it set to the normal VALIDVARNAME=v7 then values of GROUP that look like the numbers 1 and 2 will be converted into _1 and _2 so that the resulting variable names are valid SAS names.&amp;nbsp; But if instead you have told SAS you are fine if it makes variables names that are not valid SAS names then the names will just be the single digits 1 and 2.&amp;nbsp; Which means that to reference the names in the code you need to use name literals.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;paired '1'n*'2'n; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You could also just tell PROC TRANSPOSE to always use underscore as the prefix when defining the varible names.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC TRANSPOSE data=matchedsorted out=dswi.pairedcontinuous name=Variables prefix=_;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then it won't generated invalid names for values like 1 and 2 (although it might for other values).&lt;/P&gt;</description>
      <pubDate>Sat, 17 Dec 2022 21:49:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PS-match-Variable-name-not-recognized-in-SAS-Studio/m-p/850223#M336044</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-12-17T21:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: PS match - Variable name not recognized in SAS Studio</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PS-match-Variable-name-not-recognized-in-SAS-Studio/m-p/850224#M336045</link>
      <description>Thank You very much! Now it works perfectly!!!</description>
      <pubDate>Sat, 17 Dec 2022 22:03:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PS-match-Variable-name-not-recognized-in-SAS-Studio/m-p/850224#M336045</guid>
      <dc:creator>antor82</dc:creator>
      <dc:date>2022-12-17T22:03:35Z</dc:date>
    </item>
  </channel>
</rss>

