<?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: ERROR: Invalid value for width specified - width out of range in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Invalid-value-for-width-specified-width-out-of-range/m-p/707131#M217106</link>
    <description>&lt;P&gt;Buried in your select statement is the expression:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put(ID,z2.)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which precedes the clause&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where ID = &amp;amp;xrow;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So your macro call&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MYC(input.data_new,100);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;means that the put(ID,z2.) will attempt to write the value 100 in a 2-digit character space.&amp;nbsp; &amp;nbsp;Change the z2. to a format that can accommodate the 3-digit value of 100.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 19 Dec 2020 05:22:35 GMT</pubDate>
    <dc:creator>mkeintz</dc:creator>
    <dc:date>2020-12-19T05:22:35Z</dc:date>
    <item>
      <title>ERROR: Invalid value for width specified - width out of range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Invalid-value-for-width-specified-width-out-of-range/m-p/707126#M217103</link>
      <description>&lt;P&gt;I have this below macro that runs fine for when xrow=1 to 99, but as soon as I put in anything over 100 it keeps generating this error that I don't understand.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: Invalid value for width specified - width out of range&lt;BR /&gt;NOTE: At least one W.D format was too small for the number to be printed. The decimal may be shifted by the "BEST" format.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I looked up some helpful articles that say it may be a format issue, but I am not sure what format I would need to allow it to read &amp;gt; 100 and all the ones I have tried have not worked. Any help is much appreciated!! Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%Macro MYC(xdata,xrow);&lt;BR /&gt;proc sql noprint;&lt;BR /&gt;select filter,biomarks, group, exclude, number, title,&lt;BR /&gt;strip("TAB"||strip(put(ID,z2.))||"A") as tab, strip("Table "||strip(number)||": "||strip(title)) as ftabtitle,&lt;BR /&gt;strip(tranwrd(title,'Endpoints – ',' ')) as stabtitle&lt;BR /&gt;into: xfilters, :xbiomark, :xgroup,&amp;nbsp; :xexclude, :xtabnum, :xtabtitle, :xtab, :xftabtitle, :xstabtitle&lt;BR /&gt;from input.data&lt;BR /&gt;where ID = &amp;amp;xrow;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;%mend MYC;&lt;/P&gt;&lt;P&gt;%MYC(input.data_new,100);&lt;/P&gt;</description>
      <pubDate>Sat, 19 Dec 2020 04:23:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Invalid-value-for-width-specified-width-out-of-range/m-p/707126#M217103</guid>
      <dc:creator>kmardinian</dc:creator>
      <dc:date>2020-12-19T04:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Invalid value for width specified - width out of range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Invalid-value-for-width-specified-width-out-of-range/m-p/707131#M217106</link>
      <description>&lt;P&gt;Buried in your select statement is the expression:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put(ID,z2.)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which precedes the clause&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where ID = &amp;amp;xrow;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So your macro call&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MYC(input.data_new,100);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;means that the put(ID,z2.) will attempt to write the value 100 in a 2-digit character space.&amp;nbsp; &amp;nbsp;Change the z2. to a format that can accommodate the 3-digit value of 100.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Dec 2020 05:22:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Invalid-value-for-width-specified-width-out-of-range/m-p/707131#M217106</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-12-19T05:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Invalid value for width specified - width out of range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Invalid-value-for-width-specified-width-out-of-range/m-p/707136#M217109</link>
      <description>&lt;P&gt;Thank you so much, I definitely missed that! Works perfectly now!&lt;/P&gt;</description>
      <pubDate>Sat, 19 Dec 2020 06:20:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Invalid-value-for-width-specified-width-out-of-range/m-p/707136#M217109</guid>
      <dc:creator>kmardinian</dc:creator>
      <dc:date>2020-12-19T06:20:39Z</dc:date>
    </item>
  </channel>
</rss>

