<?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: sas formats in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sas-formats/m-p/899284#M355457</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I looked up the $charw. format in the&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/n1oily9h2mwp5cn1dtb5qu8tcj7u.htm" target="_blank" rel="noopener"&gt;documentation&lt;/A&gt;&amp;nbsp;and found the below. Would you mind sharing the link are you using?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Amir_0-1697729791413.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/88972i12ACBAA606DDE875/image-size/large?v=v2&amp;amp;px=999" role="button" title="Amir_0-1697729791413.png" alt="Amir_0-1697729791413.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;</description>
    <pubDate>Thu, 19 Oct 2023 15:44:30 GMT</pubDate>
    <dc:creator>Amir</dc:creator>
    <dc:date>2023-10-19T15:44:30Z</dc:date>
    <item>
      <title>sas formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-formats/m-p/899271#M355451</link>
      <description>&lt;P&gt;what is the difference between $4. and $char4. formats in sas?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 14:49:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-formats/m-p/899271#M355451</guid>
      <dc:creator>Sathya3</dc:creator>
      <dc:date>2023-10-19T14:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: sas formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-formats/m-p/899273#M355453</link>
      <description>&lt;P&gt;From the online help for $charw. format:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV class="xis-refDictEntry"&gt;
&lt;DIV id="p0xtdmakvjowe0n1jvjge13i4du9" class="xis-comparisons"&gt;
&lt;H2 class="xis-title"&gt;Comparisons&lt;/H2&gt;
&lt;DIV id="p12wuc94e15ujan1nwp33t91tdkl" class="xis-paragraph"&gt;
&lt;DIV class="xis-listUnordered"&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV id="p185eycljdc4phn1xr39755aoec6" class="xis-item"&gt;
&lt;DIV id="p1hx1rivxyskoen1fq8ncst9xnfe" class="xis-paraSimpleFirst"&gt;The $CHAR&lt;SPAN class="xis-userSuppliedValue"&gt;w&lt;/SPAN&gt;. format is identical to the $&lt;SPAN class="xis-userSuppliedValue"&gt;w.&lt;/SPAN&gt; format.&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 14:51:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-formats/m-p/899273#M355453</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-10-19T14:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: sas formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-formats/m-p/899284#M355457</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I looked up the $charw. format in the&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/n1oily9h2mwp5cn1dtb5qu8tcj7u.htm" target="_blank" rel="noopener"&gt;documentation&lt;/A&gt;&amp;nbsp;and found the below. Would you mind sharing the link are you using?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Amir_0-1697729791413.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/88972i12ACBAA606DDE875/image-size/large?v=v2&amp;amp;px=999" role="button" title="Amir_0-1697729791413.png" alt="Amir_0-1697729791413.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 15:44:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-formats/m-p/899284#M355457</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2023-10-19T15:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: sas formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-formats/m-p/899286#M355459</link>
      <description>&lt;P&gt;There is not much difference between the FORMATs of $ and $CHAR.&lt;/P&gt;
&lt;PRE&gt;1    data test ;
2      x='   X';
3      put '|' x $4. '|'
4        / '|' x $char4. '|'
5      ;
6    run;

|   X|
|   X|
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;There is a difference in how the INFORMATs of $ and $CHAR behave.&amp;nbsp;&lt;/STRONG&gt; The $CHAR informat will preserve the leading spaces.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test ;
  input @1 x $char4. @1 y $4. ;
  put (x y) (= $quote.);
cards;
   4
  34
 234
1234
;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;1    data test ;
2      input @1 x $char4. @1 y $4. ;
3      put (x y) (= $quote.);
4    cards;

x="   4" y="4"
x="  34" y="34"
x=" 234" y="234"
x="1234" y="1234"
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect that the $CHAR format only exists so you could use a FORMAT name that matches the INFORMAT name you used when creating the variable.&amp;nbsp; &amp;nbsp; Just like we frequently see code posted here (and even included in code generated by SAS) that use BEST as if it was an INFORMAT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 15:56:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-formats/m-p/899286#M355459</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-10-19T15:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: sas formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-formats/m-p/899288#M355460</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/22588"&gt;@Amir&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I looked up the $charw. format in the&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/n1oily9h2mwp5cn1dtb5qu8tcj7u.htm" target="_blank" rel="noopener"&gt;documentation&lt;/A&gt;&amp;nbsp;and found the below. Would you mind sharing the link are you using?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Amir_0-1697729791413.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/88972i12ACBAA606DDE875/image-size/large?v=v2&amp;amp;px=999" role="button" title="Amir_0-1697729791413.png" alt="Amir_0-1697729791413.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That was from my local 9.4.4 online help. Apparently they changed it sometime after that in the documentation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 15:58:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-formats/m-p/899288#M355460</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-10-19T15:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: sas formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-formats/m-p/899298#M355464</link>
      <description>&lt;P&gt;I suspect you found this definition.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/n1oily9h2mwp5cn1dtb5qu8tcj7u.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/n1oily9h2mwp5cn1dtb5qu8tcj7u.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which appears to almost be a copy of the definition of the INFORMAT named $CHAR.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/n06dgsx9u83oren1answzdrj9e3h.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/n06dgsx9u83oren1answzdrj9e3h.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The only actual difference between $ and $CHAR as formats is when you include the $CHAR. format specification (without any WIDTH included) in the PUT statement.&amp;nbsp;&lt;/STRONG&gt; There the $CHAR format behaves differently from the $ format in two ways:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;You cannot do the same think with the $ format as you cannot use it without a WIDTH included.&lt;/LI&gt;
&lt;LI&gt;The leading and trailing spaces are written.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 16:41:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-formats/m-p/899298#M355464</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-10-19T16:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: sas formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-formats/m-p/899302#M355465</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;UL&gt;
&lt;LI&gt;You cannot do the same think with the $ format as you cannot use it without a WIDTH included.&lt;/LI&gt;
&lt;/UL&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You could use the alias $F&lt;EM&gt;w&lt;/EM&gt;. to omit the width specification. (I wouldn't regard the single dollar sign in a PUT statement as a format specification. It supports &lt;EM&gt;list&lt;/EM&gt; PUT.) But even $F. does &lt;EM&gt;not&lt;/EM&gt; trim trailing blanks (at least in my SAS 9.4M5). I think the behavior of the two formats has not changed since SAS 6 (why should it?) and the newly added statement in the documentation about $&lt;EM&gt;w&lt;/EM&gt;. and trailing blanks seems just wrong.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 17:41:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-formats/m-p/899302#M355465</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2023-10-19T17:41:07Z</dc:date>
    </item>
  </channel>
</rss>

