<?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 ODS ExcelXP tagset - writing out a text field that is sometimes numeric in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69828#M8016</link>
    <description>I have a field in my dataset that is 8 characters long.  Sometimes, all of the characters are numeric and in fact, the first observation in the dataset is 00000001.  I use style={tagattr='type:String'} to force the field to be text in Excel, but it still seems to be getting picked up as numeric.  &lt;BR /&gt;
&lt;BR /&gt;
The worst part is that I try a small test program and it works ok.  I do a proc contents on the dataset that doesn't work and on the one that works in my test program and both are type char and len 8.  So I don't think there's a difference there. &lt;BR /&gt;
&lt;BR /&gt;
Does anyone have any thoughts on a workaround or a way for me to diagnose or do it differently?  I am an XML novice, no doubt.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
--Charlie</description>
    <pubDate>Fri, 16 Jan 2009 22:20:43 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-01-16T22:20:43Z</dc:date>
    <item>
      <title>ODS ExcelXP tagset - writing out a text field that is sometimes numeric</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69828#M8016</link>
      <description>I have a field in my dataset that is 8 characters long.  Sometimes, all of the characters are numeric and in fact, the first observation in the dataset is 00000001.  I use style={tagattr='type:String'} to force the field to be text in Excel, but it still seems to be getting picked up as numeric.  &lt;BR /&gt;
&lt;BR /&gt;
The worst part is that I try a small test program and it works ok.  I do a proc contents on the dataset that doesn't work and on the one that works in my test program and both are type char and len 8.  So I don't think there's a difference there. &lt;BR /&gt;
&lt;BR /&gt;
Does anyone have any thoughts on a workaround or a way for me to diagnose or do it differently?  I am an XML novice, no doubt.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
--Charlie</description>
      <pubDate>Fri, 16 Jan 2009 22:20:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69828#M8016</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-16T22:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: ODS ExcelXP tagset - writing out a text field that is sometimes numeric</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69829#M8017</link>
      <description>Try &lt;BR /&gt;
&lt;BR /&gt;
style={tagattr='format:text'}&lt;BR /&gt;
&lt;BR /&gt;
That should do what you want.</description>
      <pubDate>Mon, 19 Jan 2009 15:59:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69829#M8017</guid>
      <dc:creator>Eric_SAS</dc:creator>
      <dc:date>2009-01-19T15:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: ODS ExcelXP tagset - writing out a text field that is sometimes numeric</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69830#M8018</link>
      <description>I was thinking I had tried that, but gave it another shot.  It unfortunately does not do the trick.  Any other ideas?</description>
      <pubDate>Wed, 21 Jan 2009 19:39:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69830#M8018</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-21T19:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: ODS ExcelXP tagset - writing out a text field that is sometimes numeric</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69831#M8019</link>
      <description>Hi:&lt;BR /&gt;
  When I try this code:&lt;BR /&gt;
[pre]&lt;BR /&gt;
data charstr;&lt;BR /&gt;
  infile datalines;&lt;BR /&gt;
  input name $ charstr $ state $;&lt;BR /&gt;
  format name charstr $8. state $2.;&lt;BR /&gt;
return;&lt;BR /&gt;
datalines;&lt;BR /&gt;
Alan 0000001 OH&lt;BR /&gt;
Bob  0000002 AL&lt;BR /&gt;
Carl 0000003 NC&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
                                       &lt;BR /&gt;
proc contents data=charstr;&lt;BR /&gt;
run;&lt;BR /&gt;
                                           &lt;BR /&gt;
ods tagsets.excelxp file='c:\temp\charstr.xls'&lt;BR /&gt;
    style=sasweb;&lt;BR /&gt;
proc print data=charstr;&lt;BR /&gt;
  var name;&lt;BR /&gt;
  var charstr /&lt;BR /&gt;
      style(data)={tagattr="Format:text"};&lt;BR /&gt;
  var state;&lt;BR /&gt;
run;&lt;BR /&gt;
ods _all_ close;&lt;BR /&gt;
                                &lt;BR /&gt;
[/pre]&lt;BR /&gt;
   &lt;BR /&gt;
and open the resulting Spreadsheet Markup Language file with Excel, my number is stored as text. Excel (in Office 2007) shows me that the number is stored as text with a little green triangle in the upper left hand corner of the cell. Excel is not happy about storing a number as text.&lt;BR /&gt;
  &lt;BR /&gt;
If I change the DATALINES to this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
datalines;&lt;BR /&gt;
Alan 0000001 OH&lt;BR /&gt;
Bob  0000002 AL&lt;BR /&gt;
Carl 0000003 NC&lt;BR /&gt;
Dave Nothing GA&lt;BR /&gt;
;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                         &lt;BR /&gt;
Then Excel does NOT put the green triangle in the cell for the string "Nothing", but still does put the green triangle (warning of number stored as text) for the first 3 observations.&lt;BR /&gt;
 &lt;BR /&gt;
If by "not work" you mean that you're getting the green triangle, this is the expected behavior. As far as I know, you have to manually "clear" that triangle by selecting a drop down box and choosing "Ignore Error" on the cells with the green triangle.&lt;BR /&gt;
&lt;BR /&gt;
If by "not work" you mean that you're getting the numbers without leading zeroes, as numbers in the Excel worksheet, then you might consider working with Tech Support on this issue.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 21 Jan 2009 20:24:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69831#M8019</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-01-21T20:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: ODS ExcelXP tagset - writing out a text field that is sometimes numeric</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69832#M8020</link>
      <description>Thanks Cynthia.  By "not works", I mean that it trims the leading zeros, not the green triangle thing.  I'll talk to Tech Support.&lt;BR /&gt;
&lt;BR /&gt;
--Charlie</description>
      <pubDate>Wed, 21 Jan 2009 22:13:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69832#M8020</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-21T22:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: ODS ExcelXP tagset - writing out a text field that is sometimes numeric</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69833#M8021</link>
      <description>OK, I got it.  I was also overriding the width of the column with:&lt;BR /&gt;
&lt;BR /&gt;
style(data)={cellwidth=250}&lt;BR /&gt;
&lt;BR /&gt;
For some reason, it doesn't like that.  When I remove that, it works.  I tried out your (Cynthia's) test code and it worked for me, so was able to back into the diagnosis.&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your help.&lt;BR /&gt;
&lt;BR /&gt;
--Charlie</description>
      <pubDate>Wed, 21 Jan 2009 22:47:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69833#M8021</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-21T22:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: ODS ExcelXP tagset - writing out a text field that is sometimes numeric</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69834#M8022</link>
      <description>I'm not going to belabor this because I don't have a business need for it at the moment, but running Cynthia's code as-is I get numbers in my Excel spreadsheet.  I'm using Excel 2003 and SAS v 9.1.3 in case that matters.</description>
      <pubDate>Thu, 22 Jan 2009 20:07:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69834#M8022</guid>
      <dc:creator>genkiboy</dc:creator>
      <dc:date>2009-01-22T20:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: ODS ExcelXP tagset - writing out a text field that is sometimes numeric</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69835#M8023</link>
      <description>Yes, that was my last post.  I get it to work as well with Cynthia's code.  That helped me figure out that the problem has something to do with setting the width of the column.  When I put that override on, it doesn't work, but I'm ok with taking it off.  So thanks.</description>
      <pubDate>Thu, 22 Jan 2009 20:55:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69835#M8023</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-22T20:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: ODS ExcelXP tagset - writing out a text field that is sometimes numeric</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69836#M8024</link>
      <description>Hi:&lt;BR /&gt;
  I no longer have Excel 2003 to test with. All my computers have Excel 2007. It's possible this is an issue with 2003 vs 2007. (Most likely)&lt;BR /&gt;
 &lt;BR /&gt;
  If and when you do have a need for this, you should work with Tech Support if my code does not give you the results you expect (number as text). As far as I know, they could test in Excel 2003 for you and help pinpoint the likely cause.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Fri, 23 Jan 2009 03:26:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69836#M8024</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-01-23T03:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: ODS ExcelXP tagset - writing out a text field that is sometimes numeric</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69837#M8025</link>
      <description>I have EXECL 2003 and get the proper result with when using the updated TAGSET.  &lt;BR /&gt;
&lt;BR /&gt;
With this really old verion NOTE: This is the Excel XP tagset (SAS 9.1.3, v1.28, 08/29/05). TAGATTR seems to be ignored.&lt;BR /&gt;
&lt;BR /&gt;
Upgrading to NOTE: This is the Excel XP tagset (SAS 9.1.3, v1.86, 04/15/08). I get the correct result.</description>
      <pubDate>Fri, 23 Jan 2009 12:48:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69837#M8025</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2009-01-23T12:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: ODS ExcelXP tagset - writing out a text field that is sometimes numeric</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69838#M8026</link>
      <description>Thanks, Cynthia and data _null_.  I updated my tagset, and now Cynthia's code gets me the desired results.</description>
      <pubDate>Fri, 23 Jan 2009 14:34:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69838#M8026</guid>
      <dc:creator>genkiboy</dc:creator>
      <dc:date>2009-01-23T14:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: ODS ExcelXP tagset - writing out a text field that is sometimes numeric</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69839#M8027</link>
      <description>Charlieh,&lt;BR /&gt;
&lt;BR /&gt;
I have run into this problem frequently with 10 digit account numbers that often begin with leading zeroes.  My solution is by no means elegant, but it works.  I simply create a new variable with an apostrophe in the first position followed by the account number.  That forces Excel to treat it as the character value it is, and the leading zeroes are retained.&lt;BR /&gt;
&lt;BR /&gt;
HTH&lt;BR /&gt;
Paul</description>
      <pubDate>Thu, 29 Jan 2009 18:17:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69839#M8027</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-29T18:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: ODS ExcelXP tagset - writing out a text field that is sometimes numeric</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69840#M8028</link>
      <description>Thank you.  This issue has been resolved.  It had to do with my overriding the cellwidth.  When I remove that override, Cynthia's sample code works just fine.  So does my final code.&lt;BR /&gt;
&lt;BR /&gt;
As to putting the apostrophe on the end, that's exactly where I first went but didn't like it as a long-term solution.</description>
      <pubDate>Thu, 29 Jan 2009 18:58:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-ExcelXP-tagset-writing-out-a-text-field-that-is-sometimes/m-p/69840#M8028</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-29T18:58:01Z</dc:date>
    </item>
  </channel>
</rss>

