<?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: Please advise about comma and substr in Programming 1 and 2</title>
    <link>https://communities.sas.com/t5/Programming-1-and-2/Please-advise-about-comma-and-substr/m-p/826353#M1143</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/418389"&gt;@sann123&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;Does anyone know where 1 and 6 came from after YearMon?&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;/BLOCKQUOTE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class=""&gt;See&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n0n08xougp40i5n1xw7njpcy0a2b.htm" target="_self"&gt;SUBSTR (right of &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt; Function&lt;/A&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Aug 2022 00:55:06 GMT</pubDate>
    <dc:creator>mkeintz</dc:creator>
    <dc:date>2022-08-01T00:55:06Z</dc:date>
    <item>
      <title>Please advise about comma and substr</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Please-advise-about-comma-and-substr/m-p/826350#M1142</link>
      <description>&lt;OL&gt;&lt;LI&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;Does anyone know where 1 and 6 came from after YearMon?&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pic1.png" style="width: 687px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/73940iD6B21D78811E1E27/image-size/large?v=v2&amp;amp;px=999" role="button" title="pic1.png" alt="pic1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;Also in this one it said to include commas and zero decimal places how did they decide comma6. and comma10. instead of any other number?&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pic2.png" style="width: 915px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/73941i7F16E467E6DDF645/image-size/large?v=v2&amp;amp;px=999" role="button" title="pic2.png" alt="pic2.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;Lastly,&amp;nbsp;&lt;P&gt;Where am I supposed to be looking for How many storms are in &lt;STRONG&gt;PressureGroup &lt;/STRONG&gt;1?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did the following but wrote 3118 and it was wrong. Please advice what is correct answer and where you saw it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data storm_cat;&lt;/P&gt;&lt;P&gt;set pg1.storm_summary; keep Name Basin MinPressure StartDate PressureGroup;&lt;/P&gt;&lt;P&gt;*add ELSE keyword and remove final condition;&lt;/P&gt;&lt;P&gt;if MinPressure=. then PressureGroup=.;&lt;/P&gt;&lt;P&gt;else if MinPressure&amp;lt;=920 then PressureGroup=1;&lt;/P&gt;&lt;P&gt;else PressureGroup=0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Sun, 31 Jul 2022 23:21:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Please-advise-about-comma-and-substr/m-p/826350#M1142</guid>
      <dc:creator>sann123</dc:creator>
      <dc:date>2022-07-31T23:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: Please advise about comma and substr</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Please-advise-about-comma-and-substr/m-p/826353#M1143</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/418389"&gt;@sann123&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;Does anyone know where 1 and 6 came from after YearMon?&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;/BLOCKQUOTE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class=""&gt;See&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n0n08xougp40i5n1xw7njpcy0a2b.htm" target="_self"&gt;SUBSTR (right of &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt; Function&lt;/A&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 00:55:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Please-advise-about-comma-and-substr/m-p/826353#M1143</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2022-08-01T00:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Please advise about comma and substr</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Please-advise-about-comma-and-substr/m-p/826365#M1144</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; First, look at the YearMon values, such as with PROC FREQ:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1659316015258.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/73945i108CA23B15E0B148/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1659316015258.png" alt="Cynthia_sas_0-1659316015258.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Note that Year is specified in the first 4 positions of the variable and Month value is in positions 6-7, the constant letter M is in position 5. Then, as suggested, review the lecture or read the documentation on the use of the SUBSTR function and the MDY function. Here's the breakdown:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_1-1659316128262.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/73946iA5FF57A31E34A3E2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_1-1659316128262.png" alt="Cynthia_sas_1-1659316128262.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Regarding your second question about "how did they decide" which number to use with the format for comma -- either 6 or 10, that comes down to knowing your data well -- what is the largest possible value, how do you want that value to be displayed, how many extra punctuation characters will be needed to display the largest number. It never hurts to specify a larger value than you think you'll need. Let's say you have a variable called VarX that has a possible minimum value of 3 digits and a possible maximum value of 8 digits. To display the minimum and the maximum using commas as the thousand separator, you need at least 2 commas as shown below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_2-1659316620218.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/73949iAF5A7D07961EC874/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_2-1659316620218.png" alt="Cynthia_sas_2-1659316620218.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; The largest number that could be displayed without formatting problems is 99999999, which would need a format of comma10. to display as 99,999,999.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Last, 3118 is the total number of rows in the pg1.storm_summary data file. If all the storms were in Pressure Group 1, that would be the right answer. However, there is a procedure which will show you the number of rows that fall into Pressure Group 1 vs Pressure Group 0 or missing. You could either run PROC FREQ on your output data WORK.STORM_CAT or you could run some other procedure. But running PROC FREQ would be the method I would recommend.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps point you in the right direction,&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 01:25:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Please-advise-about-comma-and-substr/m-p/826365#M1144</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2022-08-01T01:25:41Z</dc:date>
    </item>
    <item>
      <title>Re: Please advise about comma and substr</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Please-advise-about-comma-and-substr/m-p/827516#M1156</link>
      <description>Thank you so much Cynthia. That was a really good answer that I was looking for with pictures and all. Really appreciate your help.</description>
      <pubDate>Sun, 07 Aug 2022 20:35:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Please-advise-about-comma-and-substr/m-p/827516#M1156</guid>
      <dc:creator>sann123</dc:creator>
      <dc:date>2022-08-07T20:35:59Z</dc:date>
    </item>
  </channel>
</rss>

