<?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: Width specified for format invalid in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Width-specified-for-format-invalid/m-p/159816#M31118</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you check out the documentation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/leforinforref/63324/HTML/default/viewer.htm#p1og22ny80wqj5n1a1oxayemz4bt.htm"&gt;http://support.sas.com/documentation/cdl/en/leforinforref/63324/HTML/default/viewer.htm#p1og22ny80wqj5n1a1oxayemz4bt.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will see that the maximum length for the mmddyy format is 10, hence the error you are getting. Also specify a format in SQL like so: select date1 format = mmddyy10. as date2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Aug 2014 22:28:08 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2014-08-13T22:28:08Z</dc:date>
    <item>
      <title>Width specified for format invalid</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Width-specified-for-format-invalid/m-p/159814#M31116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings again all! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using the ODS Tagset ExcelXP and ProcPrint multiple tables to multiple sheets in excel (well first to XML then Excel).&amp;nbsp; My problem is that when my dataset comes back blank no sheet is written, and my work book is considerably smaller.&amp;nbsp; To fix this problem I use the following MACRO (thnx SAS forum!):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro IFz1(data=&amp;amp;syslast) /des= 'if Zero make 1 obs' ;&lt;/P&gt;&lt;P&gt;data &amp;amp;data ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if nobs then stop ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; output ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; modify &amp;amp;data nobs=nobs ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; stop ;&lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;P&gt;%mend&amp;nbsp; IFz1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This inserts one observation when there are no observations.&amp;nbsp; The problem is that it can't add an observation when a date is involved; example: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CREATE TABLE foo AS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date1 format mmddyy11. AS date2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM foo2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%IFz1 will then run but come back with ERROR: Width specified for format MMDDYY is invalid, when I comment out the "format mmddyy11." it works fine and inserts a blank observation.&amp;nbsp; I believe that my column "date1" in my example is a DateTime data type.&amp;nbsp; If I change the format to mmddyyyy the column says: "5at1946" and is a "custom" data type in excel.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone encountered this before, and is there a work around?&amp;nbsp; I would love to know!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loving the SAS community so far, I hope to contribute at some point &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Aug 2014 22:04:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Width-specified-for-format-invalid/m-p/159814#M31116</guid>
      <dc:creator>Putt_Ka</dc:creator>
      <dc:date>2014-08-13T22:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Width specified for format invalid</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Width-specified-for-format-invalid/m-p/159815#M31117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;According to the documentation for SAS 9.3 mmddyy only has a range of 2 to 10 allowed. Change the 11 to 10 and it should work. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Aug 2014 22:21:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Width-specified-for-format-invalid/m-p/159815#M31117</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-08-13T22:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: Width specified for format invalid</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Width-specified-for-format-invalid/m-p/159816#M31118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you check out the documentation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/leforinforref/63324/HTML/default/viewer.htm#p1og22ny80wqj5n1a1oxayemz4bt.htm"&gt;http://support.sas.com/documentation/cdl/en/leforinforref/63324/HTML/default/viewer.htm#p1og22ny80wqj5n1a1oxayemz4bt.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will see that the maximum length for the mmddyy format is 10, hence the error you are getting. Also specify a format in SQL like so: select date1 format = mmddyy10. as date2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Aug 2014 22:28:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Width-specified-for-format-invalid/m-p/159816#M31118</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2014-08-13T22:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: Width specified for format invalid</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Width-specified-for-format-invalid/m-p/159817#M31119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Magic! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks all!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2014 14:29:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Width-specified-for-format-invalid/m-p/159817#M31119</guid>
      <dc:creator>Putt_Ka</dc:creator>
      <dc:date>2014-08-14T14:29:39Z</dc:date>
    </item>
  </channel>
</rss>

