<?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: Q about Lesson 4 Demo: Using Expressions to Create New Columns in Programming 1 and 2</title>
    <link>https://communities.sas.com/t5/Programming-1-and-2/Q-about-Lesson-4-Demo-Using-Expressions-to-Create-New-Columns/m-p/617051#M403</link>
    <description>&lt;P&gt;When you wrote &lt;STRONG&gt;StormType='Tropical Storm'&lt;/STRONG&gt; you told it. The program only knows that because of you, the programmer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For fun, change 'Tropical Storm' to any other string. Just put your name in it for instance. When you run the program you will now have a column full of your name as the value. Now obviously that is not correct when analyzing storm data, but hopefully you see what you are doing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this specific demo, we are telling you to do it. When working with real world data at work you will have to know about your data, and what abbreviations mean.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helped.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Peter&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jan 2020 20:41:01 GMT</pubDate>
    <dc:creator>Panagiotis</dc:creator>
    <dc:date>2020-01-13T20:41:01Z</dc:date>
    <item>
      <title>Q about Lesson 4 Demo: Using Expressions to Create New Columns</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Q-about-Lesson-4-Demo-Using-Expressions-to-Create-New-Columns/m-p/617031#M398</link>
      <description>&lt;P&gt;Is&amp;nbsp;&lt;EM&gt;StormType="Tropical Storm; &lt;/EM&gt;necessary to create the new column &lt;EM&gt;MaxWindKM&lt;/EM&gt;?&amp;nbsp; If not, what information is &lt;EM&gt;StormType&lt;/EM&gt; pulling from to make the new column&amp;nbsp;&lt;EM&gt;Tropical Storm&lt;/EM&gt;?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data tropical_storm;&lt;/P&gt;&lt;P&gt;set pg1.storm_summary;&lt;/P&gt;&lt;P&gt;drop Hem_EW HEM_NS Lat Lon;&lt;/P&gt;&lt;P&gt;where Type="TS";&lt;/P&gt;&lt;P&gt;MaxWindKM=MaxWindMPH*1.60934;&lt;/P&gt;&lt;P&gt;format MaxWindKM 3.;&lt;/P&gt;&lt;P&gt;StormType="Tropical Storm";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 19:59:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Q-about-Lesson-4-Demo-Using-Expressions-to-Create-New-Columns/m-p/617031#M398</guid>
      <dc:creator>AJS1</dc:creator>
      <dc:date>2020-01-13T19:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: Q about Lesson 4 Demo: Using Expressions to Create New Columns</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Q-about-Lesson-4-Demo-Using-Expressions-to-Create-New-Columns/m-p/617040#M399</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Is&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;StormType="Tropical Storm;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;necessary to create the new column&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;MaxWindKM&lt;/EM&gt;&lt;SPAN&gt;?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;No, they are independent statements.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt; If not, what information is&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;StormType&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;pulling from to make the new column&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;Tropical Storm&lt;/EM&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;No information is being 'pulled' it's what you can a manual coding or hard coded value.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I'm assuming someone is creating a label that will make sense when the file is combined with other files to indicate the other storm types.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/304846"&gt;@AJS1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Is&amp;nbsp;&lt;EM&gt;StormType="Tropical Storm; &lt;/EM&gt;necessary to create the new column &lt;EM&gt;MaxWindKM&lt;/EM&gt;?&amp;nbsp; If not, what information is &lt;EM&gt;StormType&lt;/EM&gt; pulling from to make the new column&amp;nbsp;&lt;EM&gt;Tropical Storm&lt;/EM&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data tropical_storm;&lt;/P&gt;
&lt;P&gt;set pg1.storm_summary;&lt;/P&gt;
&lt;P&gt;drop Hem_EW HEM_NS Lat Lon;&lt;/P&gt;
&lt;P&gt;where Type="TS";&lt;/P&gt;
&lt;P&gt;MaxWindKM=MaxWindMPH*1.60934;&lt;/P&gt;
&lt;P&gt;format MaxWindKM 3.;&lt;/P&gt;
&lt;P&gt;StormType="Tropical Storm";&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 20:13:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Q-about-Lesson-4-Demo-Using-Expressions-to-Create-New-Columns/m-p/617040#M399</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-01-13T20:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: Q about Lesson 4 Demo: Using Expressions to Create New Columns</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Q-about-Lesson-4-Demo-Using-Expressions-to-Create-New-Columns/m-p/617042#M400</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/304846"&gt;@AJS1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me see if I understand your question correct. You are asking if the statement &lt;SPAN&gt;&lt;STRONG&gt;StormType="Tropical Storm";&lt;/STRONG&gt; is required to create the new column&amp;nbsp;&lt;STRONG&gt;MaxWindKM&lt;/STRONG&gt;?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The answer is no, it's not necessary. The &lt;STRONG&gt;StormType='Tropical Storm'&lt;/STRONG&gt; creates another column that essentially explains what the &lt;STRONG&gt;Type&lt;/STRONG&gt; column means. If you look at the &lt;STRONG&gt;Type&lt;/STRONG&gt; column you will see a &lt;STRONG&gt;TS&lt;/STRONG&gt;. &lt;STRONG&gt;TS&lt;/STRONG&gt; is an abbreviation, so you decided to add another column that explains &lt;STRONG&gt;TS&lt;/STRONG&gt; (or Tropical Storm).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;One way to check is to break everything down and test it. First I suggestion run the DATA step without the &lt;STRONG&gt;StormType='Tropical Storm'&lt;/STRONG&gt; and see what happens. In this example I commented out&amp;nbsp;&lt;STRONG&gt;StormType='Tropical Storm'.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data tropical_storm;
  set pg1.storm_summary;
  drop Hem_EW HEM_NS Lat Lon;
  where Type="TS";
  MaxWindKM=MaxWindMPH*1.60934;
  format MaxWindKM 3.;
  *StormType="Tropical Storm";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="reuslts1.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35308i8D69E520FC93716B/image-size/large?v=v2&amp;amp;px=999" role="button" title="reuslts1.jpg" alt="reuslts1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can see that the &lt;STRONG&gt;MaxWindKM&lt;/STRONG&gt; was still created from the assignment statement in yourcode&amp;nbsp;(MaxWindKM=MaxWindMPH*1.60934). However you don't have the &lt;STRONG&gt;StormType&lt;/STRONG&gt; column.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So let's add back in &lt;STRONG&gt;StormType='Tropical Storm'&lt;/STRONG&gt; and see our results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data tropical_storm;
  set pg1.storm_summary;
  drop Hem_EW HEM_NS Lat Lon;
  where Type="TS";
  MaxWindKM=MaxWindMPH*1.60934;
  format MaxWindKM 3.;
  StormType="Tropical Storm";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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="results2.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35310i3ED3EBC7D4AB445C/image-size/large?v=v2&amp;amp;px=999" role="button" title="results2.jpg" alt="results2.jpg" /&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All you are doing with those assignment statements is creating a new column. In the case of the &lt;STRONG&gt;MaxWindKM&lt;/STRONG&gt; you are creating a new column based on a calculation for each row. The new &lt;STRONG&gt;StormType&lt;/STRONG&gt; column is being created with a static string. Try adding another column or two and see the different results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps. Please let me know if you have any other questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Peter&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 20:17:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Q-about-Lesson-4-Demo-Using-Expressions-to-Create-New-Columns/m-p/617042#M400</guid>
      <dc:creator>Panagiotis</dc:creator>
      <dc:date>2020-01-13T20:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Q about Lesson 4 Demo: Using Expressions to Create New Columns</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Q-about-Lesson-4-Demo-Using-Expressions-to-Create-New-Columns/m-p/617049#M401</link>
      <description>&lt;P&gt;How does the program know that TS is the same as Tropical Storm?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 20:36:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Q-about-Lesson-4-Demo-Using-Expressions-to-Create-New-Columns/m-p/617049#M401</guid>
      <dc:creator>AJS1</dc:creator>
      <dc:date>2020-01-13T20:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Q about Lesson 4 Demo: Using Expressions to Create New Columns</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Q-about-Lesson-4-Demo-Using-Expressions-to-Create-New-Columns/m-p/617050#M402</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/304846"&gt;@AJS1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;How does the program know that TS is the same as Tropical Storm?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The program does not know that.&amp;nbsp; The &lt;STRONG&gt;programmer&lt;/STRONG&gt; knew that and so that is why they wrote the program in this way.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 20:40:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Q-about-Lesson-4-Demo-Using-Expressions-to-Create-New-Columns/m-p/617050#M402</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-01-13T20:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: Q about Lesson 4 Demo: Using Expressions to Create New Columns</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Q-about-Lesson-4-Demo-Using-Expressions-to-Create-New-Columns/m-p/617051#M403</link>
      <description>&lt;P&gt;When you wrote &lt;STRONG&gt;StormType='Tropical Storm'&lt;/STRONG&gt; you told it. The program only knows that because of you, the programmer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For fun, change 'Tropical Storm' to any other string. Just put your name in it for instance. When you run the program you will now have a column full of your name as the value. Now obviously that is not correct when analyzing storm data, but hopefully you see what you are doing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this specific demo, we are telling you to do it. When working with real world data at work you will have to know about your data, and what abbreviations mean.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helped.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Peter&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 20:41:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Q-about-Lesson-4-Demo-Using-Expressions-to-Create-New-Columns/m-p/617051#M403</guid>
      <dc:creator>Panagiotis</dc:creator>
      <dc:date>2020-01-13T20:41:01Z</dc:date>
    </item>
  </channel>
</rss>

