<?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: Leading zeros are removed when generating Excel output in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Leading-zeros-are-removed-when-generating-Excel-output/m-p/310911#M21009</link>
    <description>&lt;PRE&gt;
Yeah, That was supposed to be for Excel. Add comma or a TAB character before it.

data work.example;
   length Zero $ 4 Text $ 10;
   input Zero Text;
zero=cats('09'x,zero);
   datalines;
01 first
02 second
03 third
13 narf
42 perfect
run;

&lt;/PRE&gt;</description>
    <pubDate>Fri, 11 Nov 2016 10:55:23 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-11-11T10:55:23Z</dc:date>
    <item>
      <title>Leading zeros are removed when generating Excel output</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Leading-zeros-are-removed-when-generating-Excel-output/m-p/310716#M20988</link>
      <description>&lt;P&gt;Using EG 7.12 with latest hotfix applied. When setting result type to Excel leading zeros are removed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.example;
   length Zero $ 2 Text $ 10;
   input Zero Text;
   datalines;
01 first
02 second
03 third
13 narf
42 perfect
run;

proc print data=work.example noobs;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How to fix this &lt;STRONG&gt;without&lt;/STRONG&gt; coding Excel-output?&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13130iA9D71F54D044E3F3/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Bug_Excel_Result.PNG" title="Bug_Excel_Result.PNG" /&gt;</description>
      <pubDate>Thu, 10 Nov 2016 16:48:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Leading-zeros-are-removed-when-generating-Excel-output/m-p/310716#M20988</guid>
      <dc:creator>error_prone</dc:creator>
      <dc:date>2016-11-10T16:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: Leading zeros are removed when generating Excel output</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Leading-zeros-are-removed-when-generating-Excel-output/m-p/310730#M20990</link>
      <description>&lt;P&gt;This isn't a bug, this is normal Excel behaviour - just try typing 01 into an Excel cell yourself, press enter and watch the leading zero disappear.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One way to fix this is to add a single quote in front of the zero.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 18:38:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Leading-zeros-are-removed-when-generating-Excel-output/m-p/310730#M20990</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-11-10T18:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: Leading zeros are removed when generating Excel output</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Leading-zeros-are-removed-when-generating-Excel-output/m-p/310911#M21009</link>
      <description>&lt;PRE&gt;
Yeah, That was supposed to be for Excel. Add comma or a TAB character before it.

data work.example;
   length Zero $ 4 Text $ 10;
   input Zero Text;
zero=cats('09'x,zero);
   datalines;
01 first
02 second
03 third
13 narf
42 perfect
run;

&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Nov 2016 10:55:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Leading-zeros-are-removed-when-generating-Excel-output/m-p/310911#M21009</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-11-11T10:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: Leading zeros are removed when generating Excel output</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Leading-zeros-are-removed-when-generating-Excel-output/m-p/311000#M21025</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;This isn't a bug, this is normal Excel behaviour - just try typing 01 into an Excel cell yourself, press enter and watch the leading zero disappear.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One way to fix this is to add a single quote in front of the zero.&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Setting cell-type to text stops Excel from removing leading zeros. Changing values is not acceptable.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2016 15:12:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Leading-zeros-are-removed-when-generating-Excel-output/m-p/311000#M21025</guid>
      <dc:creator>error_prone</dc:creator>
      <dc:date>2016-11-11T15:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Leading zeros are removed when generating Excel output</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Leading-zeros-are-removed-when-generating-Excel-output/m-p/311199#M21030</link>
      <description>&lt;P&gt;Using EG version 7.12 HF5 (7.100.2.3472) (64-bit) with SAS under Windows and your sample data exactly as posted, things work for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How are you creating the Excel file?&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/5824iAA36DB807732BDC9/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="Capture.PNG" title="Capture.PNG" /&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/5825iB713832B21B08A0A/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="Capture.PNG" title="Capture.PNG" /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Nov 2016 00:24:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Leading-zeros-are-removed-when-generating-Excel-output/m-p/311199#M21030</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2016-11-13T00:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Leading zeros are removed when generating Excel output</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Leading-zeros-are-removed-when-generating-Excel-output/m-p/311408#M21047</link>
      <description>&lt;P&gt;I used the new result type "Excel" found in Program | Properties | Results.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2016 14:19:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Leading-zeros-are-removed-when-generating-Excel-output/m-p/311408#M21047</guid>
      <dc:creator>error_prone</dc:creator>
      <dc:date>2016-11-14T14:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Leading zeros are removed when generating Excel output</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Leading-zeros-are-removed-when-generating-Excel-output/m-p/311423#M21049</link>
      <description>&lt;P&gt;Yes, this way I'm also loosing the leading zeros even though it's in SAS a character variable. As the options says "Excel" I'd say it's a reasonable expectation that the leading zero's are kept - so agree: It's an undocumented feature.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just need a solution then use one of the other ways of creating an Excel. It wouldn't hurt though if you raise a SAS TechSupport track so that this gets fixed.&amp;nbsp;&lt;A href="https://support.sas.com/techsup/contact/&amp;nbsp;" target="_blank"&gt;https://support.sas.com/techsup/contact/&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2016 14:45:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Leading-zeros-are-removed-when-generating-Excel-output/m-p/311423#M21049</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2016-11-14T14:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: Leading zeros are removed when generating Excel output</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Leading-zeros-are-removed-when-generating-Excel-output/m-p/311851#M21066</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/43025"&gt;@error_prone﻿&lt;/a&gt;: "&lt;SPAN&gt;Changing values is not acceptable." Well welcome to the wonderful world of Excel then as it makes all sorts of assumptions about what you type into a "General" column &lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://communities.sas.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;My guess is you are getting the default action the way you are sending results to Excel. As others have stated there are other ways to export to Excel that send through more formatting info.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2016 21:08:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Leading-zeros-are-removed-when-generating-Excel-output/m-p/311851#M21066</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-11-15T21:08:28Z</dc:date>
    </item>
  </channel>
</rss>

