<?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 to set the length of variable name to 8 in ODS in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-set-the-length-of-variable-name-to-8-in-ODS/m-p/4671#M1502</link>
    <description>Hi:&lt;BR /&gt;
&lt;BR /&gt;
I was talking about the first scenario: I want the variable names (in the dataset created by ODS OUTPUT) to be &amp;lt;=  8 characters long.&lt;BR /&gt;
There is a cute method. But I do not remember the method. &lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
&lt;BR /&gt;
Gary</description>
    <pubDate>Wed, 12 Sep 2007 20:25:37 GMT</pubDate>
    <dc:creator>Gary</dc:creator>
    <dc:date>2007-09-12T20:25:37Z</dc:date>
    <item>
      <title>How to set the length of variable name to 8 in ODS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-set-the-length-of-variable-name-to-8-in-ODS/m-p/4669#M1500</link>
      <description>Dear friends,&lt;BR /&gt;
&lt;BR /&gt;
How to set the length of variable name to 8 when using ODS to generate output dataset?&lt;BR /&gt;
&lt;BR /&gt;
Your help will be appreciated!&lt;BR /&gt;
&lt;BR /&gt;
Gary</description>
      <pubDate>Wed, 12 Sep 2007 15:09:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-set-the-length-of-variable-name-to-8-in-ODS/m-p/4669#M1500</guid>
      <dc:creator>Gary</dc:creator>
      <dc:date>2007-09-12T15:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to set the length of variable name to 8 in ODS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-set-the-length-of-variable-name-to-8-in-ODS/m-p/4670#M1501</link>
      <description>Hi:&lt;BR /&gt;
I'm confused about what you mean. Do you mean using the ODS OUTPUT statement to create a SAS dataset -- and you want the resulting variable names to only be 8 characters? So, for example, if you used ODS OUTPUT with PROC MEANS, one of the created variables might be SALES_MEAN -- which is NOT 8 characters. If this is what you mean, then you might have to change the code generated in EG to use a RENAME option to rename SALES_MEAN to something like SALE_AVG.&lt;BR /&gt;
&lt;BR /&gt;
You might be also be referrring to a usage of ODS to create another type of file (CSV, HTML, etc) --  that I have heard some folks refer to as a dataset although it is not a SAS dataset -- and you want the column headers in the resulting file to be only 8 characters?&lt;BR /&gt;
&lt;BR /&gt;
So depending on what you mean -- you'd either use RENAME for the ODS OUTPUT scenario or some other technique if you were creating a CSV or HTML file.&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 12 Sep 2007 18:10:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-set-the-length-of-variable-name-to-8-in-ODS/m-p/4670#M1501</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2007-09-12T18:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to set the length of variable name to 8 in ODS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-set-the-length-of-variable-name-to-8-in-ODS/m-p/4671#M1502</link>
      <description>Hi:&lt;BR /&gt;
&lt;BR /&gt;
I was talking about the first scenario: I want the variable names (in the dataset created by ODS OUTPUT) to be &amp;lt;=  8 characters long.&lt;BR /&gt;
There is a cute method. But I do not remember the method. &lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
&lt;BR /&gt;
Gary</description>
      <pubDate>Wed, 12 Sep 2007 20:25:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-set-the-length-of-variable-name-to-8-in-ODS/m-p/4671#M1502</guid>
      <dc:creator>Gary</dc:creator>
      <dc:date>2007-09-12T20:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to set the length of variable name to 8 in ODS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-set-the-length-of-variable-name-to-8-in-ODS/m-p/4672#M1503</link>
      <description>Hi, Gary:&lt;BR /&gt;
  Here's an example you can try in a code node. The RENAME= dataset option will allow you to do the rename right in the ODS OUTPUT statement. Do pay attention to the bunches of parentheses that all have to be matched up.&lt;BR /&gt;
 &lt;BR /&gt;
If you examine the PROC CONTENTS output, you will see that the variable names have been changed.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
 &lt;BR /&gt;
[pre]&lt;BR /&gt;
** Default names longer than 8 characters;&lt;BR /&gt;
ods output summary=work.sum_default;&lt;BR /&gt;
proc means data=sashelp.shoes min mean max sum std;&lt;BR /&gt;
var sales;&lt;BR /&gt;
class region;&lt;BR /&gt;
run;&lt;BR /&gt;
   &lt;BR /&gt;
proc contents data=work.sum_default;&lt;BR /&gt;
title 'Default Var Names from ODS OUTPUT';&lt;BR /&gt;
run;&lt;BR /&gt;
    &lt;BR /&gt;
** Use RENAME= to change;&lt;BR /&gt;
** RENAME= syntax is ;&lt;BR /&gt;
**  dataset-name(rename=(bad_var_name=good_var_name  bad_var_name2=good_var_name2));&lt;BR /&gt;
  &lt;BR /&gt;
ods output summary=work.sum_change(rename=(Sales_Max=Sale_Max &lt;BR /&gt;
           Sales_StdDev=Sale_Std &lt;BR /&gt;
           Sales_Sum=Sale_Sum &lt;BR /&gt;
           Sales_Min=Sale_Min &lt;BR /&gt;
           Sales_Mean=Sale_Avg));&lt;BR /&gt;
proc means data=sashelp.shoes min mean max sum std;&lt;BR /&gt;
var sales;&lt;BR /&gt;
class region;&lt;BR /&gt;
run;&lt;BR /&gt;
   &lt;BR /&gt;
proc contents data=work.sum_change;&lt;BR /&gt;
title 'After Using the RENAME option';&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Wed, 12 Sep 2007 21:36:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-set-the-length-of-variable-name-to-8-in-ODS/m-p/4672#M1503</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2007-09-12T21:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to set the length of variable name to 8 in ODS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-set-the-length-of-variable-name-to-8-in-ODS/m-p/4673#M1504</link>
      <description>I can't identify any current data manipulation package that wants 8-byte variable names Cynthia, so I wondered why this would be needed.  However, my first thought was that SAS might have coded some backward compatibility into a system option, and I went looking at  ValidVarName  to see whether it had a V6 option available.&lt;BR /&gt;
&lt;BR /&gt;
Sadly, the documentation doesn't report anything other than V7, UPCASE and ANY.  Still, that would have been an easy solution.&lt;BR /&gt;
&lt;BR /&gt;
Kind regards&lt;BR /&gt;
&lt;BR /&gt;
David</description>
      <pubDate>Thu, 13 Sep 2007 01:29:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-set-the-length-of-variable-name-to-8-in-ODS/m-p/4673#M1504</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-09-13T01:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to set the length of variable name to 8 in ODS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-set-the-length-of-variable-name-to-8-in-ODS/m-p/4674#M1505</link>
      <description>David:&lt;BR /&gt;
  Actually, that IS a brilliant idea (it has a downside -- but still brilliant).&lt;BR /&gt;
&lt;BR /&gt;
 VALIDVARNAME=V6 is a possible option. It was designed so that "VALIDVARNAME=V6 indicates that only those variable names that are considered valid in Version 6 are considered valid SAS variable names.", then THIS does work:&lt;BR /&gt;
[pre]&lt;BR /&gt;
options validvarname=V6;&lt;BR /&gt;
** Default names longer than 8 characters;&lt;BR /&gt;
ods output summary=work.sum_default;&lt;BR /&gt;
proc means data=sashelp.shoes min mean max sum std;&lt;BR /&gt;
var returns;&lt;BR /&gt;
class product;&lt;BR /&gt;
run;&lt;BR /&gt;
    &lt;BR /&gt;
proc contents data=work.sum_default;&lt;BR /&gt;
title 'Default Var Names from ODS OUTPUT';&lt;BR /&gt;
run;&lt;BR /&gt;
                                           &lt;BR /&gt;
[/pre]&lt;BR /&gt;
               &lt;BR /&gt;
BUT, the downside of this approach is that the INVENTORY variable is on SASHELP.SHOES. So with the VALIDVARNAME=V6 option set, &lt;BR /&gt;
then INVENTORY is NOT a valid name. So in that case, you'd have to use the RENAME= option. In the long run, I think RENAME= might be the best way to go because it will work under all situations -- and you don't then have to worry about your V8 and V9 datasets with longer variable names (which you might want to use for analysis).&lt;BR /&gt;
 &lt;BR /&gt;
Great idea!&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 13 Sep 2007 03:39:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-set-the-length-of-variable-name-to-8-in-ODS/m-p/4674#M1505</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2007-09-13T03:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to set the length of variable name to 8 in ODS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-set-the-length-of-variable-name-to-8-in-ODS/m-p/4675#M1506</link>
      <description>I made a newbie mistake then Cynthia.  I expected that the documentation would be complete, which was a poor assumption.  I thought as a Developer, and decided that would be a valid option, but when I checked the book of words, it wasn't there.&lt;BR /&gt;
&lt;BR /&gt;
I should have tested it, as I intended to, but time and other demands got in the way.  Your point on the table name is well taken, and it wasn't a problem I envisaged because I assumed that wanting 8-byte column names also meant table names would conform to the same requirement.  Not good; two bad assumptions in one day &lt;GRIN&gt;.&lt;BR /&gt;
&lt;BR /&gt;
So the lesson is: not to assume and to test your ideas.&lt;BR /&gt;
&lt;BR /&gt;
Kind regards&lt;BR /&gt;
&lt;BR /&gt;
David&lt;/GRIN&gt;</description>
      <pubDate>Sun, 16 Sep 2007 01:40:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-set-the-length-of-variable-name-to-8-in-ODS/m-p/4675#M1506</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-09-16T01:40:44Z</dc:date>
    </item>
  </channel>
</rss>

