<?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: how to create multiple dataset from one dataset? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/how-to-create-multiple-dataset-from-one-dataset/m-p/170160#M43970</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please use following if statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If country = "USA" then output usa;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if country = "usa then output usa;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you will get your desirable output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gnaneshwar,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Feb 2015 11:04:03 GMT</pubDate>
    <dc:creator>GnaneshwarChaudhari</dc:creator>
    <dc:date>2015-02-16T11:04:03Z</dc:date>
    <item>
      <title>how to create multiple dataset from one dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-create-multiple-dataset-from-one-dataset/m-p/170155#M43965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Can anyone tell me what would be the code for creating multiple dataset from one dataset in one data step?&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Example: I have the following info dataset&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Name&amp;nbsp; City&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Country &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;John&amp;nbsp;&amp;nbsp; New York&amp;nbsp; USA&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Albert Toronto&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Canada&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Alice&amp;nbsp; Sydney&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Australia&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I want to create 3 dataset called USA, Canada and Australia from info dataset above. I tried the following way, but it's not working:&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;data usa canada australia;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;set info;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;if country='usa' then output usa;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;if country='Canada' then output Canada;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;if country='Australia' then output Australia;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;run;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;can anyone help please. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Feb 2015 23:10:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-create-multiple-dataset-from-one-dataset/m-p/170155#M43965</guid>
      <dc:creator>mlogan</dc:creator>
      <dc:date>2015-02-15T23:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to create multiple dataset from one dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-create-multiple-dataset-from-one-dataset/m-p/170156#M43966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your code should work, other than the fact that you will get zero obs in the USA data set since the value of country in your example is USA not the usa that your IF statement is testing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2015 01:46:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-create-multiple-dataset-from-one-dataset/m-p/170156#M43966</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-02-16T01:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to create multiple dataset from one dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-create-multiple-dataset-from-one-dataset/m-p/170157#M43967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Character comparison is case sensitive. So usa is not equal to USA. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you'll have mixed case in between observations you can use upcase function. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2015 03:31:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-create-multiple-dataset-from-one-dataset/m-p/170157#M43967</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-02-16T03:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to create multiple dataset from one dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-create-multiple-dataset-from-one-dataset/m-p/170158#M43968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Hi,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;You can try below code. it should work.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data usa canada australia;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;set info;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;if upcase(country)='USA' then output usa;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;if &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333330154419px; background-color: #ffffff;"&gt;upcase(country)&lt;/SPAN&gt;='CANADA' then output Canada;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;if &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333330154419px; background-color: #ffffff;"&gt;upcase(country)&lt;/SPAN&gt;='AUSTRALIA' then output Australia;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;When you use upcase function. String should be in upper case as above. whatever case in data, it should be populated in the output.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Let me know if you need any help.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Thanks,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Yaswanth J.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2015 07:40:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-create-multiple-dataset-from-one-dataset/m-p/170158#M43968</guid>
      <dc:creator>yaswanthj</dc:creator>
      <dc:date>2015-02-16T07:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to create multiple dataset from one dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-create-multiple-dataset-from-one-dataset/m-p/170159#M43969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;data usa canada australia ;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;set info;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;select (upcase(country));&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp; when ('USA') output usa;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp; when ('CANADA') output canada;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp; when ('AUSTRALIA') output Australia;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp; otherwise;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;end;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2015 07:59:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-create-multiple-dataset-from-one-dataset/m-p/170159#M43969</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-02-16T07:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to create multiple dataset from one dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-create-multiple-dataset-from-one-dataset/m-p/170160#M43970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please use following if statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If country = "USA" then output usa;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if country = "usa then output usa;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you will get your desirable output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gnaneshwar,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2015 11:04:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-create-multiple-dataset-from-one-dataset/m-p/170160#M43970</guid>
      <dc:creator>GnaneshwarChaudhari</dc:creator>
      <dc:date>2015-02-16T11:04:03Z</dc:date>
    </item>
  </channel>
</rss>

