<?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: How do I keep a variable with a space in its name in the ods output line? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-keep-a-variable-with-a-space-in-its-name-in-the-ods/m-p/903034#M356863</link>
    <description>&lt;P&gt;I strongly suspect that you are seeing variable labels that you think are variable names.&lt;/P&gt;
&lt;P&gt;Run proc contents on your data set to confirm actual variable names and/or labels.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will also place a small wager that you have a warning similar to this in your log.&lt;/P&gt;
&lt;PRE&gt;WARNING: Output ''x diffs'' was not created.  Make sure that the output
         object name, label, or path is spelled correctly.  Also, verify
         that the appropriate procedure options are used to produce the
         requested output object.  For example, verify that the NOPRINT
         option is not used.
&lt;/PRE&gt;
&lt;P&gt;The syntax for the ODS output is&lt;/P&gt;
&lt;PRE&gt;ods output &amp;lt;source data&amp;gt;= the_name_of_your_dataset;&lt;/PRE&gt;
&lt;P&gt;And the the oppropriate source data set would be DIFFS, not "x diffs".&amp;nbsp; And if the name had actually been "x diffs" that would require the use of another name literal&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And I suspect that you actually want the Ods output lsmeans=somedataset; which will have&lt;/P&gt;
&lt;PRE&gt;        Alphabetic List of Variables and Attributes

#    Variable    Type    Len    Format       Label

2    Effect      Char      3
4    Estimate    Num       8    D8.4
7    Probz       Num       8    PVALUE6.4    Pr &amp;gt; |z|
5    StdErr      Num       8    D8.4         Standard Error
1    StmtNo      Num       8    BEST4.       Statement Number
3    mfg         Char      1
6    zValue      Num       8    7.2          z Value


&lt;/PRE&gt;
&lt;P&gt;Where you can see the label is "Standard Error" for the variable StdErr.&lt;/P&gt;</description>
    <pubDate>Tue, 14 Nov 2023 19:02:08 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2023-11-14T19:02:08Z</dc:date>
    <item>
      <title>How do I keep a variable with a space in its name in the ods output line?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-keep-a-variable-with-a-space-in-its-name-in-the-ods/m-p/903023#M356857</link>
      <description>&lt;P&gt;I am running a model using proc genmod and have run a lsmeans statement. I would like to save only some of the columns of the lsmeans table using the ods output.&lt;/P&gt;&lt;P&gt;General setup:&lt;/P&gt;&lt;PRE&gt;proc genmod data = data;
	class x;
	model y= x / dist = nb link = log offset = myoff;
	lsmeans x / pdiff;
	ods output 'x Diffs'=diffs(keep = x Estimate 'Standard Error'); 
run;&lt;/PRE&gt;&lt;P&gt;This gives the error that 'Standard Error' is not valid. This is not surprising because it has a space in the variable name.&lt;/P&gt;&lt;P&gt;I tried specifying as:&lt;/P&gt;&lt;PRE&gt;ods output 'x Diffs'=diffs(keep = x Estimate 'Standard Error'n);&lt;/PRE&gt;&lt;P&gt;which adds the 'n' as suggested &lt;A href="https://communities.sas.com/t5/SAS-Enterprise-Guide/dealing-with-space-in-variable/td-p/136173" target="_self"&gt;here&lt;/A&gt; but that also does not work. There are many variable names in output tables which contain spaces, so understanding how to do this would be very helpful. Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 18:31:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-keep-a-variable-with-a-space-in-its-name-in-the-ods/m-p/903023#M356857</guid>
      <dc:creator>rdemass</dc:creator>
      <dc:date>2023-11-14T18:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do I keep a variable with a space in its name in the ods output line?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-keep-a-variable-with-a-space-in-its-name-in-the-ods/m-p/903025#M356859</link>
      <description>&lt;P&gt;Are you sure such a variable exists?&amp;nbsp; Run it without the KEEP= and run a PROC CONTENTS on the resulting dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you sure that is the right name for the ODS output you want saved to a dataset?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do you see when you turn on&amp;nbsp; ODS TRACE and run the PROC without the ODS OUTPUT statement?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 18:41:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-keep-a-variable-with-a-space-in-its-name-in-the-ods/m-p/903025#M356859</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-11-14T18:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do I keep a variable with a space in its name in the ods output line?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-keep-a-variable-with-a-space-in-its-name-in-the-ods/m-p/903027#M356861</link>
      <description>&lt;P&gt;Yes, I see now that what I was trying to use were the labels. All the variable names are created to have no spaces (e.g., StdErr) and can be kept in the keep line easily.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 18:51:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-keep-a-variable-with-a-space-in-its-name-in-the-ods/m-p/903027#M356861</guid>
      <dc:creator>rdemass</dc:creator>
      <dc:date>2023-11-14T18:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I keep a variable with a space in its name in the ods output line?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-keep-a-variable-with-a-space-in-its-name-in-the-ods/m-p/903034#M356863</link>
      <description>&lt;P&gt;I strongly suspect that you are seeing variable labels that you think are variable names.&lt;/P&gt;
&lt;P&gt;Run proc contents on your data set to confirm actual variable names and/or labels.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will also place a small wager that you have a warning similar to this in your log.&lt;/P&gt;
&lt;PRE&gt;WARNING: Output ''x diffs'' was not created.  Make sure that the output
         object name, label, or path is spelled correctly.  Also, verify
         that the appropriate procedure options are used to produce the
         requested output object.  For example, verify that the NOPRINT
         option is not used.
&lt;/PRE&gt;
&lt;P&gt;The syntax for the ODS output is&lt;/P&gt;
&lt;PRE&gt;ods output &amp;lt;source data&amp;gt;= the_name_of_your_dataset;&lt;/PRE&gt;
&lt;P&gt;And the the oppropriate source data set would be DIFFS, not "x diffs".&amp;nbsp; And if the name had actually been "x diffs" that would require the use of another name literal&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And I suspect that you actually want the Ods output lsmeans=somedataset; which will have&lt;/P&gt;
&lt;PRE&gt;        Alphabetic List of Variables and Attributes

#    Variable    Type    Len    Format       Label

2    Effect      Char      3
4    Estimate    Num       8    D8.4
7    Probz       Num       8    PVALUE6.4    Pr &amp;gt; |z|
5    StdErr      Num       8    D8.4         Standard Error
1    StmtNo      Num       8    BEST4.       Statement Number
3    mfg         Char      1
6    zValue      Num       8    7.2          z Value


&lt;/PRE&gt;
&lt;P&gt;Where you can see the label is "Standard Error" for the variable StdErr.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 19:02:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-keep-a-variable-with-a-space-in-its-name-in-the-ods/m-p/903034#M356863</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-11-14T19:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do I keep a variable with a space in its name in the ods output line?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-keep-a-variable-with-a-space-in-its-name-in-the-ods/m-p/903044#M356864</link>
      <description>Yes, the problem was that I was using labels instead of true variable names. I omitted this but I ran multiple lsmeans /pdiff lines as I actually have more than one predictor variable. Hence why I specified 'x diffs', because there are also 'z diffs', for example. I had used the ods trace to figure this out. And I did in fact want the diffs table, not the lsmeans table (so I do not want output lsmeans).</description>
      <pubDate>Tue, 14 Nov 2023 19:33:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-keep-a-variable-with-a-space-in-its-name-in-the-ods/m-p/903044#M356864</guid>
      <dc:creator>rdemass</dc:creator>
      <dc:date>2023-11-14T19:33:19Z</dc:date>
    </item>
  </channel>
</rss>

