<?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 Programing 1 Lesson 4 Level 3 practice_using Scan function in Programming 1 and 2</title>
    <link>https://communities.sas.com/t5/Programming-1-and-2/Programing-1-Lesson-4-Level-3-practice-using-Scan-function/m-p/671300#M554</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;below is code to get ParkType, as Monument or Park.&lt;/P&gt;&lt;PRE&gt;data np_summary2;
    set pg1.np_summary;
    ParkType=scan(parkname,-1);
    keep Reg Type ParkName ParkType;
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I would be interested to see ParkType, as National Monument or National Park.&lt;/P&gt;&lt;P&gt;How to do it using SCAN or other function?&lt;/P&gt;&lt;P&gt;I can created separate two column and then concatenate, but would want simple or short way to do the same.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jul 2020 07:42:42 GMT</pubDate>
    <dc:creator>baystanil</dc:creator>
    <dc:date>2020-07-22T07:42:42Z</dc:date>
    <item>
      <title>Programing 1 Lesson 4 Level 3 practice_using Scan function</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Programing-1-Lesson-4-Level-3-practice-using-Scan-function/m-p/671300#M554</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;below is code to get ParkType, as Monument or Park.&lt;/P&gt;&lt;PRE&gt;data np_summary2;
    set pg1.np_summary;
    ParkType=scan(parkname,-1);
    keep Reg Type ParkName ParkType;
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I would be interested to see ParkType, as National Monument or National Park.&lt;/P&gt;&lt;P&gt;How to do it using SCAN or other function?&lt;/P&gt;&lt;P&gt;I can created separate two column and then concatenate, but would want simple or short way to do the same.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 07:42:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Programing-1-Lesson-4-Level-3-practice-using-Scan-function/m-p/671300#M554</guid>
      <dc:creator>baystanil</dc:creator>
      <dc:date>2020-07-22T07:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: Programing 1 Lesson 4 Level 3 practice_using Scan function</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Programing-1-Lesson-4-Level-3-practice-using-Scan-function/m-p/671404#M557</link>
      <description>&lt;P&gt;Hi, take a look at the data in pg1.np_summary:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1595428646926.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/47508i5C79A635870A5064/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1595428646926.png" alt="Cynthia_sas_0-1595428646926.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Assuming that the word "National" is next to the last piece of ParkName, which it is in these records, then this code would do what you're asking:&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;data np_summary_alt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;set pg1.np_summary; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;ParkType=&lt;FONT color="#FF00FF"&gt;catx(' ',scan(parkname,-2),scan(parkname,-1))&lt;/FONT&gt;; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;keep Reg Type ParkName ParkType;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;proc print data=np_summary_alt(obs=10);&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;You can scan and concatenate without creating 2 new variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;BR /&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 14:39:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Programing-1-Lesson-4-Level-3-practice-using-Scan-function/m-p/671404#M557</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2020-07-22T14:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Programing 1 Lesson 4 Level 3 practice_using Scan function</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Programing-1-Lesson-4-Level-3-practice-using-Scan-function/m-p/671670#M567</link>
      <description>Thank You, Cynthia!!</description>
      <pubDate>Thu, 23 Jul 2020 05:48:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Programing-1-Lesson-4-Level-3-practice-using-Scan-function/m-p/671670#M567</guid>
      <dc:creator>baystanil</dc:creator>
      <dc:date>2020-07-23T05:48:38Z</dc:date>
    </item>
  </channel>
</rss>

