<?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: ODS TAGSETS EXCELXP DROPPING LEADING ZEROES ON CHARACTER VARIABLE in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-TAGSETS-EXCELXP-DROPPING-LEADING-ZEROES-ON-CHARACTER/m-p/513156#M21988</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;As Reeza suggests, Excel is notorious for not showing leading zeroes unless you explicitly use a TAGATTR style override in PRINT, REPORT or TABULATE. Just using a Z. format at the SAS end or padding your character variable with zeroes is not enough -- Excel treats any number -- whether character value or numeric value -- with the "general" format that is an Excel format without leading zeroes. I recommend checking all the things that Reeza suggests as far as TAGSETS.EXCELXP version and I'd also recommend fixing the length mismatch. But if your leading zeroes don't show, then look at the paper reference (Thanks, Reeza!)&amp;nbsp; and follow the TAGSETS.EXCELXP examples for TAGATTR. There is a leading zero example in the paper.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
    <pubDate>Wed, 14 Nov 2018 23:59:28 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2018-11-14T23:59:28Z</dc:date>
    <item>
      <title>ODS TAGSETS EXCELXP DROPPING LEADING ZEROES ON CHARACTER VARIABLE</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-TAGSETS-EXCELXP-DROPPING-LEADING-ZEROES-ON-CHARACTER/m-p/513086#M21982</link>
      <description>&lt;P&gt;I am using ods tagsets excelxp to create a .xls from a sas dataset. One of the fields from the input data source has length 16, format $16., and informat $16. This field has&amp;nbsp;loan number&amp;nbsp;values that contain a leading zero (i.e. 0123456). Ods tagsets excelxp is stripping off the leading zero resulting in (123456). I have tried several different variations of the define statement for that particular field, but nothing seems to work. Does anyone have any ideas? My goal is to keep the leading zero.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;define LOAN_NUM  /  'LOAN_NUM' style={tagattr="format:@"} center;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Nov 2018 20:15:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-TAGSETS-EXCELXP-DROPPING-LEADING-ZEROES-ON-CHARACTER/m-p/513086#M21982</guid>
      <dc:creator>ijmoorejr</dc:creator>
      <dc:date>2018-11-14T20:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: ODS TAGSETS EXCELXP DROPPING LEADING ZEROES ON CHARACTER VARIABLE</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-TAGSETS-EXCELXP-DROPPING-LEADING-ZEROES-ON-CHARACTER/m-p/513111#M21983</link>
      <description>Try explicitly specifying the format on the DEFINE statement as well.</description>
      <pubDate>Wed, 14 Nov 2018 21:07:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-TAGSETS-EXCELXP-DROPPING-LEADING-ZEROES-ON-CHARACTER/m-p/513111#M21983</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-11-14T21:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: ODS TAGSETS EXCELXP DROPPING LEADING ZEROES ON CHARACTER VARIABLE</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-TAGSETS-EXCELXP-DROPPING-LEADING-ZEROES-ON-CHARACTER/m-p/513132#M21984</link>
      <description>&lt;P&gt;Additionally, I walked through the code that leads up to the final dataset that gets used with the ods tagsets excelxp to make the .xls. There are several joins along the way and this particular loan number field has a length of $16. from one source and a length of $20. Could the varying lengths be causing the problem with the dropping of the leading zeroes?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 22:34:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-TAGSETS-EXCELXP-DROPPING-LEADING-ZEROES-ON-CHARACTER/m-p/513132#M21984</guid>
      <dc:creator>ijmoorejr</dc:creator>
      <dc:date>2018-11-14T22:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: ODS TAGSETS EXCELXP DROPPING LEADING ZEROES ON CHARACTER VARIABLE</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-TAGSETS-EXCELXP-DROPPING-LEADING-ZEROES-ON-CHARACTER/m-p/513151#M21987</link>
      <description>&lt;P&gt;Check your input data. If it has the leading zeros then no and I highly doubt that’s the issue&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you’re on SAS 9.4 M3+ ODS EXCEL is easier.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is commonly asked actually and I always thought that TAGATTR works. Can you verify your tagsets version is the latest? That’s also a common issue. The version is in the log after you use it. Should be 1.131&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise instructions on how to update it are here.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/rnd/base/ods/odsmarkup/" target="_blank"&gt;https://support.sas.com/rnd/base/ods/odsmarkup/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See the solution here otherwise&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings11/266-2011.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings11/266-2011.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 23:48:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-TAGSETS-EXCELXP-DROPPING-LEADING-ZEROES-ON-CHARACTER/m-p/513151#M21987</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-11-14T23:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: ODS TAGSETS EXCELXP DROPPING LEADING ZEROES ON CHARACTER VARIABLE</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-TAGSETS-EXCELXP-DROPPING-LEADING-ZEROES-ON-CHARACTER/m-p/513156#M21988</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;As Reeza suggests, Excel is notorious for not showing leading zeroes unless you explicitly use a TAGATTR style override in PRINT, REPORT or TABULATE. Just using a Z. format at the SAS end or padding your character variable with zeroes is not enough -- Excel treats any number -- whether character value or numeric value -- with the "general" format that is an Excel format without leading zeroes. I recommend checking all the things that Reeza suggests as far as TAGSETS.EXCELXP version and I'd also recommend fixing the length mismatch. But if your leading zeroes don't show, then look at the paper reference (Thanks, Reeza!)&amp;nbsp; and follow the TAGSETS.EXCELXP examples for TAGATTR. There is a leading zero example in the paper.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 23:59:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-TAGSETS-EXCELXP-DROPPING-LEADING-ZEROES-ON-CHARACTER/m-p/513156#M21988</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-11-14T23:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: ODS TAGSETS EXCELXP DROPPING LEADING ZEROES ON CHARACTER VARIABLE</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-TAGSETS-EXCELXP-DROPPING-LEADING-ZEROES-ON-CHARACTER/m-p/514154#M22000</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;This code creates an XML file&amp;nbsp;with the leading zero retained, so check your data and version of the ExcelXP tagset.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.test;
loan_num = '0123456';
run;

ods _all_ close;

ods tagsets.ExcelXP path='C:\temp' file='temp.xml' style=HTMLBlue;

  proc report data=work.test;
    columns loan_num;
    define loan_num / 'LOAN_NUM' style={tagattr="format:@"} center;
  run; quit;
ods tagsets.ExcelXP close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: This is the Excel XP tagset (Compatible with SAS 9.1.3 and above, v1.131, 04/23/2015). Add options(doc='help') to the ods statement for more information.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Nov 2018 20:34:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-TAGSETS-EXCELXP-DROPPING-LEADING-ZEROES-ON-CHARACTER/m-p/514154#M22000</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2018-11-17T20:34:45Z</dc:date>
    </item>
  </channel>
</rss>

