<?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: Inconsistent variable name in ODS dataset (PROC GLM) in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499221#M25768</link>
    <description>&lt;P&gt;Compare the setting of VALIDVARNAME for users getting different results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps the one of the users has modified the template uses to create LSMEANS output.&lt;/P&gt;</description>
    <pubDate>Wed, 26 Sep 2018 18:59:57 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2018-09-26T18:59:57Z</dc:date>
    <item>
      <title>Inconsistent variable name in ODS dataset (PROC GLM)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499173#M25763</link>
      <description>&lt;P&gt;We find that different SAS users obtain different results when running identical PROC GLM code on our system. (SAS 9.4 TS Level 1M4; Windows Version 6.3.9600)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A typical&amp;nbsp;example is&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    ods output LSMeans = LSMeans1;
    
    proc glm data=temp;
      class trtseqpn subjid aperiod trta;
      model aval = trta 
                   trtseqpn
                   aperiod
                   subjid(trtseqpn)
                   /ss3;

      random subjid(trtseqpn) / test;

      estimate "Estimate1"  trta 1 -1        ;

      lsmeans trta  ;
      run;
      quit;
      
      &lt;/PRE&gt;&lt;P&gt;The resulting ODS dataset "LSMeans1" is slightly different for different users. For some, the least squares mean will appear in a variable called "LSMean"; for others, the variable name will be "avalLSMean." (Note&amp;nbsp;that "aval" comes from the name of the dependent model variable). Naturally this can cause errors later in the program if the variable name is not as expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there something we can do to ensure&amp;nbsp;a consistent result? (I can write&amp;nbsp;macro code to rename the variable conditionally, but would prefer a simpler solution.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The structure of the input data is straightforward, e.g.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data WORK.TEMP;
  
   input subjid $ aperiod trta $ trtseqpn aval;
 datalines;
 1 1 A 1 1.23456
 1 2 B 1 2.13632
 2 1 B 2 0.54719
 2 2 A 2 0.89158
[...]
;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 16:38:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499173#M25763</guid>
      <dc:creator>rmcneive</dc:creator>
      <dc:date>2018-09-26T16:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent variable name in ODS dataset (PROC GLM)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499185#M25765</link>
      <description>Can you verify everyone is on the same version of SAS? That’s what I’d expect if people were on different versions. &lt;BR /&gt;&lt;BR /&gt;You can compare the output from the following for differences. &lt;BR /&gt;&lt;BR /&gt;Proc setinit;run;&lt;BR /&gt;Proc product_status;run;&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Sep 2018 17:01:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499185#M25765</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-26T17:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent variable name in ODS dataset (PROC GLM)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499204#M25766</link>
      <description>&lt;P&gt;Thank&amp;nbsp;you for your response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We ran&amp;nbsp;the code you supplied and verified the resulting log output is the same. Actually, there is only one copy of SAS being used, so there isn't much room for discrepancies of this sort.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I should note that at least some of the affected users are in different regions. Some SAS behavior is region-specific&amp;nbsp;(for instance, the paper size for printed output defaults to 8.5"x11" for US users and A4 for many others)&amp;nbsp;though I would not expect this to be such a case.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 17:55:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499204#M25766</guid>
      <dc:creator>rmcneive</dc:creator>
      <dc:date>2018-09-26T17:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent variable name in ODS dataset (PROC GLM)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499215#M25767</link>
      <description>&lt;P&gt;The only other time I've seen this is when some use EG, some use Base/Studio.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're all using the exact same input and software versions, then I think you should raise this with SAS Tech Support.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 18:36:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499215#M25767</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-26T18:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent variable name in ODS dataset (PROC GLM)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499221#M25768</link>
      <description>&lt;P&gt;Compare the setting of VALIDVARNAME for users getting different results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps the one of the users has modified the template uses to create LSMEANS output.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 18:59:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499221#M25768</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2018-09-26T18:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent variable name in ODS dataset (PROC GLM)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499246#M25769</link>
      <description>&lt;P&gt;We both have VALIDVARNAME=V7 (good idea, though!) and are both running simply SAS, not EG/Studio.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help; we'll contact technical support.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 20:14:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499246#M25769</guid>
      <dc:creator>rmcneive</dc:creator>
      <dc:date>2018-09-26T20:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent variable name in ODS dataset (PROC GLM)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499254#M25770</link>
      <description>&lt;P&gt;You didn't say if you look to see if one of the users had modified the template.&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/173978"&gt;@rmcneive&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;We both have VALIDVARNAME=V7 (good idea, though!) and are both running simply SAS, not EG/Studio.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your help; we'll contact technical support.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 20:35:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499254#M25770</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2018-09-26T20:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent variable name in ODS dataset (PROC GLM)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499255#M25771</link>
      <description>&lt;P&gt;Sorry for the omission: the answer to this was also no.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 20:38:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499255#M25771</guid>
      <dc:creator>rmcneive</dc:creator>
      <dc:date>2018-09-26T20:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent variable name in ODS dataset (PROC GLM)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499602#M25778</link>
      <description>&lt;P&gt;"aval LSMean" (with a space) will be the LABEL associated&amp;nbsp;with that variable, as you can see by running&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
source stat.GLM.LSMeans;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If some users are using&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC PRINT data=LSMeans1; run;&lt;/P&gt;
&lt;P&gt;whereas others are showing the labels as&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC PRINT data=LSMeans1 LABEL; run;&lt;/P&gt;
&lt;P&gt;then some will see the label and others will see the variable name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't think there is a way to use the labels as the variable name in a SAS data set, but &lt;A href="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000316288.htm" target="_self"&gt;if you are using PROC EXPORT to write the data to an Excel file, you can do it by using the LABEL option&lt;/A&gt;. Are these "variable names" coming from some data that you exported?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In short, I think some of your analysts are seeing the label, not the variable name. If you run&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC CONTENTS data=LSMeans1 short varnum; run;&lt;/P&gt;
&lt;P&gt;you should see the TRUE variable&amp;nbsp;names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 16:59:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499602#M25778</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-09-27T16:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent variable name in ODS dataset (PROC GLM)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499609#M25779</link>
      <description>&lt;P&gt;Thanks for your reply. Unfortunately the answer is not that simple: it is actually the variable name which differs, and not the label. In subsequent DATA steps, some users must insert code such as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;RENAME avalLSMean = LSMean;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or else they will get errors like "Variable LSMean is not initialized."&amp;nbsp;Other users,&amp;nbsp;when running an identical program in a fresh SAS session, must omit this statement to avoid errors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 17:24:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499609#M25779</guid>
      <dc:creator>rmcneive</dc:creator>
      <dc:date>2018-09-27T17:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent variable name in ODS dataset (PROC GLM)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499612#M25780</link>
      <description>&lt;P&gt;Can you post the results of&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC CONTENTS data=LSMeans1 varnum; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;for one of the users who observes 'avalLSMeans'?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 17:29:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499612#M25780</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-09-27T17:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent variable name in ODS dataset (PROC GLM)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499620#M25781</link>
      <description>&lt;P&gt;Certainly; please see below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;                                          The CONTENTS Procedure

               Data Set Name        WORK.LSMEANS1                 Observations          24
               Member Type          DATA                          Variables             8
               Engine               V9                            Indexes               0
               Created              09/27/2018 13:41:47           Observation Length    48
               Last Modified        09/27/2018 13:41:47           Deleted Observations  0
               Protection                                         Compressed            NO
               Data Set Type                                      Sorted                NO
               Label
               Data Representation  WINDOWS_64
               Encoding             wlatin1  Western (Windows)


                                    Engine/Host Dependent Information

                Data Set Page Size          65536
                Number of Data Set Pages    1
                First Data Page             1
                Max Obs per Page            1361
                Obs in First Data Page      24
                Number of Data Set Repairs  0
                ExtendObsCounter            YES
                Filename                    D:\sastemp\_TD18204_PGHSAS2_\lsmeans1.sas7bdat
                Release Created             9.0401M4
                Host Created                X64_SR12R2
                Owner Name                  NOVUM\RM1132
                File Size                   128KB
                File Size (bytes)           131072


                                          The CONTENTS Procedure

                                        Variables in Creation Order

                         #    Variable      Type    Len    Format    Label

                         1    PARAMCD       Char      8    $PAR.     PK PARAMETER
                         2    Effect        Char     16
                         3    TRTA          Char      1
                         4    avalLSMean    Num       8    12.8      aval LSMEAN
                         5    APERIOD       Char      1
                         6    TRTSEQPN      Char      1
                         7    compnum       Num       8
                         8    comp          Char      3&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Sep 2018 17:45:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499620#M25781</guid>
      <dc:creator>rmcneive</dc:creator>
      <dc:date>2018-09-27T17:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent variable name in ODS dataset (PROC GLM)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499625#M25782</link>
      <description>&lt;P&gt;A quick addendum: you may notice the "compnum" and "comp" variables. These were added in a subsequent DATA step. As per the log data shown below, there are no other changes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;MPRINT(BEMODEL_PAIR):   data LSMeans1 ;
MPRINT(BEMODEL_PAIR):   set LSMeans1;
MPRINT(BEMODEL_PAIR):   compnum=1 ;
MPRINT(BEMODEL_PAIR):   comp="A-B" ;
MPRINT(BEMODEL_PAIR):   run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Sep 2018 17:51:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499625#M25782</guid>
      <dc:creator>rmcneive</dc:creator>
      <dc:date>2018-09-27T17:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent variable name in ODS dataset (PROC GLM)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499639#M25783</link>
      <description>&lt;P&gt;Quick confirmation, the GLM code&amp;nbsp;in your initial post is exactly what each person is running?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 18:15:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499639#M25783</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-27T18:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent variable name in ODS dataset (PROC GLM)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499651#M25784</link>
      <description>&lt;P&gt;I think I have discovered the answer: It appears that if you use ODS graphics that the variables in the LSMeans table can change names, as you report:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data A;
set sashelp.class;
run;

%macro body();
   class sex;
   model Height = sex /ss3;
   lsmeans sex;
%mend;


ods exclude all;
ods select LSMeans;
proc glm data=A PLOTS=NONE;
   %body;
   ods output LSMeans = LSMeans1;
run; quit;
ods exclude none;

proc contents data=LSMeans1 varnum short; run;

ods exclude all;
ods select LSMeans;
proc glm data=A PLOTS(only)=MeanPlot;
   %body;
   ods output LSMeans = LSMeans2;
run; quit;
ods exclude none;

proc contents data=LSMeans2 varnum short; run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Sep 2018 18:43:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499651#M25784</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-09-27T18:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent variable name in ODS dataset (PROC GLM)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499718#M25789</link>
      <description>&lt;P&gt;You're right: I can reproduce the issue by toggling ODS GRAPHICS ON.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 21:23:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Inconsistent-variable-name-in-ODS-dataset-PROC-GLM/m-p/499718#M25789</guid>
      <dc:creator>rmcneive</dc:creator>
      <dc:date>2018-09-27T21:23:45Z</dc:date>
    </item>
  </channel>
</rss>

