<?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 format issues in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/format-issues/m-p/701842#M25823</link>
    <description>&lt;P&gt;the format of a numeric variable can be&lt;/P&gt;&lt;P&gt;format score comma10.2;&lt;/P&gt;&lt;P&gt;format capital dollar8.2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the format of a date is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;format sdate date9.;&lt;/P&gt;&lt;P&gt;format today_date MMDDYY10.,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;format a string variable:&lt;/P&gt;&lt;P&gt;format gender $genderf. average_score label.; /*genderf and label defined in the libname*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when a period should be added to the format (a date or string variable, anything else?) and when is a period unnecessary (only like a numeric variable?)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Nov 2020 15:19:37 GMT</pubDate>
    <dc:creator>anming</dc:creator>
    <dc:date>2020-11-26T15:19:37Z</dc:date>
    <item>
      <title>format issues</title>
      <link>https://communities.sas.com/t5/New-SAS-User/format-issues/m-p/701842#M25823</link>
      <description>&lt;P&gt;the format of a numeric variable can be&lt;/P&gt;&lt;P&gt;format score comma10.2;&lt;/P&gt;&lt;P&gt;format capital dollar8.2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the format of a date is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;format sdate date9.;&lt;/P&gt;&lt;P&gt;format today_date MMDDYY10.,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;format a string variable:&lt;/P&gt;&lt;P&gt;format gender $genderf. average_score label.; /*genderf and label defined in the libname*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when a period should be added to the format (a date or string variable, anything else?) and when is a period unnecessary (only like a numeric variable?)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 15:19:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/format-issues/m-p/701842#M25823</guid>
      <dc:creator>anming</dc:creator>
      <dc:date>2020-11-26T15:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: format issues</title>
      <link>https://communities.sas.com/t5/New-SAS-User/format-issues/m-p/701848#M25825</link>
      <description>&lt;P&gt;A dot is always required when using a format.&amp;nbsp; Notice all the formats you listed in your example contain a dot somewhere.&amp;nbsp; The dot might not appear at the end, but it always appears somewhere.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When creating your own format using PROC FORMAT, the dot is not needed as part of the format name.&amp;nbsp; Only when you later use the format is the dot required.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some programmers add a dot in a LENGTH statement, such as:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;length gender $1.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The LENGTH statement never requires a dot.&amp;nbsp; If you add one, SAS will forgive you, but it is not needed.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 16:02:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/format-issues/m-p/701848#M25825</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2020-11-26T16:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: format issues</title>
      <link>https://communities.sas.com/t5/New-SAS-User/format-issues/m-p/701851#M25826</link>
      <description>&lt;P&gt;&lt;FONT face="trebuchet ms,geneva"&gt;A period is needed with FORMAT statement for all data types.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 16:16:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/format-issues/m-p/701851#M25826</guid>
      <dc:creator>nrk1787db1</dc:creator>
      <dc:date>2020-11-26T16:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: format issues</title>
      <link>https://communities.sas.com/t5/New-SAS-User/format-issues/m-p/701852#M25827</link>
      <description>&lt;P&gt;thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 16:26:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/format-issues/m-p/701852#M25827</guid>
      <dc:creator>anming</dc:creator>
      <dc:date>2020-11-26T16:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: format issues</title>
      <link>https://communities.sas.com/t5/New-SAS-User/format-issues/m-p/701853#M25828</link>
      <description>thanks!</description>
      <pubDate>Thu, 26 Nov 2020 16:27:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/format-issues/m-p/701853#M25828</guid>
      <dc:creator>anming</dc:creator>
      <dc:date>2020-11-26T16:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: format issues</title>
      <link>https://communities.sas.com/t5/New-SAS-User/format-issues/m-p/701854#M25829</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A FORMAT statement always requires a period, so something in this format:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format variableName formatName.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can have something after the period as well, for numeric formats at least.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And the &lt;STRONG&gt;exception to the rule&lt;/STRONG&gt;, is when passing formats using PUTN() or PUTC() where the format can be just the string, no period, otherwise a period is usually required.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4 class="xisDoc-argument"&gt;&lt;EM class="xisDoc-userSuppliedValue"&gt;format-specification&lt;/EM&gt;&lt;/H4&gt;
&lt;DIV class="xisDoc-argumentDescription"&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;is a character format that you want to apply to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM class="xisDoc-userSuppliedValue"&gt;value&lt;/EM&gt;.&lt;/P&gt;
&lt;P class="xisDoc-paraSimple"&gt;Here are valid format forms:&lt;/P&gt;
&lt;UL class="xisDoc-listUnordered"&gt;
&lt;LI class="xisDoc-item"&gt;&lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;&lt;EM class="xisDoc-userSuppliedValue"&gt;format-name&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI class="xisDoc-item"&gt;&lt;EM class="xisDoc-userSuppliedValue"&gt;format-name.&lt;/EM&gt;&lt;/LI&gt;
&lt;LI class="xisDoc-item"&gt;&lt;EM class="xisDoc-userSuppliedValue"&gt;format-name&lt;/EM&gt;&lt;EM class="xisDoc-userSuppliedValue"&gt;w&lt;/EM&gt;.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 16:28:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/format-issues/m-p/701854#M25829</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-11-26T16:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: format issues</title>
      <link>https://communities.sas.com/t5/New-SAS-User/format-issues/m-p/701856#M25830</link>
      <description>&lt;P&gt;You need to include a period in your format specification so the compiler knows you mean a format and not variable name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your code examples you are using the format specifications of&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;comma10.2
dollar8.2
date9.
MMDDYY10.
$genderf.&lt;/PRE&gt;
&lt;P&gt;Which are references to the formats named&amp;nbsp;COMMA, DOLLAR, DATE, MMDDYY and $GENDERF.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you removed the period from the format specification then it looks like a variable name.&amp;nbsp; So this statement is attaching the DOLLAR format with a width of 8 characters of which 5 are before the decimal point and 2 after.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format capital dollar8.2;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But&amp;nbsp; this statement is removing the formats from two variables named capital and dollar82 .&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format capital dollar82;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Nov 2020 16:44:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/format-issues/m-p/701856#M25830</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-11-26T16:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: format issues</title>
      <link>https://communities.sas.com/t5/New-SAS-User/format-issues/m-p/701910#M25841</link>
      <description>&lt;P&gt;The digits after a dot in a format indicate how many decimal values to display. So really only applicable for numeric formats.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 21:07:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/format-issues/m-p/701910#M25841</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-11-26T21:07:44Z</dc:date>
    </item>
  </channel>
</rss>

