<?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 Basic Problem! in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Basic-Problem/m-p/685851#M24337</link>
    <description>&lt;P&gt;Hello there,&lt;/P&gt;&lt;P&gt;I am new user, and got stock in a question which I couldnt get it to run on SAS, any help appreciated.&lt;/P&gt;&lt;P&gt;the question:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Create a dataset called “small” from main and store it in the lab library.&amp;nbsp; Do this problem in steps: first, use the following “keep” option to reduce the number of variables in this new data set.&amp;nbsp; Next, sort the data set by child’s gender (csex). Lastly, print a list of the first 10 records for the following variables: mrace frace.&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;keep dmage mrace dmar dlivord dfage frace csex dbirwt primac wtgain;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you so much in advance&lt;/P&gt;</description>
    <pubDate>Tue, 22 Sep 2020 19:52:54 GMT</pubDate>
    <dc:creator>Alex901</dc:creator>
    <dc:date>2020-09-22T19:52:54Z</dc:date>
    <item>
      <title>Basic Problem!</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Basic-Problem/m-p/685851#M24337</link>
      <description>&lt;P&gt;Hello there,&lt;/P&gt;&lt;P&gt;I am new user, and got stock in a question which I couldnt get it to run on SAS, any help appreciated.&lt;/P&gt;&lt;P&gt;the question:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Create a dataset called “small” from main and store it in the lab library.&amp;nbsp; Do this problem in steps: first, use the following “keep” option to reduce the number of variables in this new data set.&amp;nbsp; Next, sort the data set by child’s gender (csex). Lastly, print a list of the first 10 records for the following variables: mrace frace.&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;keep dmage mrace dmar dlivord dfage frace csex dbirwt primac wtgain;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you so much in advance&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2020 19:52:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Basic-Problem/m-p/685851#M24337</guid>
      <dc:creator>Alex901</dc:creator>
      <dc:date>2020-09-22T19:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Problem!</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Basic-Problem/m-p/685852#M24338</link>
      <description>&lt;P&gt;Show us what you have tried so far.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2020 19:54:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Basic-Problem/m-p/685852#M24338</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-09-22T19:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Problem!</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Basic-Problem/m-p/685861#M24339</link>
      <description>this is what i have tried, I know it is not correct so please excuse me.&lt;BR /&gt;&lt;BR /&gt;data main;&lt;BR /&gt;set small;&lt;BR /&gt;if csex = '1';&lt;BR /&gt;keep dmage mrace dmar dlivord dfage frace csex dbirwt primac wtgain;&lt;BR /&gt;run;&lt;BR /&gt;input dmage mrace dmar dlivord dfage frace csex dbirwt primac wtgain;&lt;BR /&gt;proc print data = small (obs 10);&lt;BR /&gt;run;&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Sep 2020 20:05:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Basic-Problem/m-p/685861#M24339</guid>
      <dc:creator>Alex901</dc:creator>
      <dc:date>2020-09-22T20:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Problem!</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Basic-Problem/m-p/685865#M24340</link>
      <description>&lt;P&gt;&lt;SPAN&gt;this is what i have tried, I know it is not correct so please excuse me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;data main;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;set small;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if csex = '1';&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;keep dmage mrace dmar dlivord dfage frace csex dbirwt primac wtgain;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;input dmage mrace dmar dlivord dfage frace csex dbirwt primac wtgain;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;proc print data = small (obs 10);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2020 20:09:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Basic-Problem/m-p/685865#M24340</guid>
      <dc:creator>Alex901</dc:creator>
      <dc:date>2020-09-22T20:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Problem!</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Basic-Problem/m-p/685866#M24341</link>
      <description>&lt;P&gt;What purpose do you think that third to last line is doing?&lt;BR /&gt;You don't seem to have anything that will sort the data as requested.&amp;nbsp; How do you propose to sort the data?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2020 20:13:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Basic-Problem/m-p/685866#M24341</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-09-22T20:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Problem!</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Basic-Problem/m-p/685901#M24352</link>
      <description>&lt;P&gt;okay so I was trying a little and this is what i got&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;title 'Lab 6 – Problem 5';&lt;BR /&gt;data main;&lt;BR /&gt;set small (keep dmage mrace dmar dlivord dfage frace csex dbirwt primac wtgain);&lt;BR /&gt;main = csex;&lt;BR /&gt;proc sort main;&lt;BR /&gt;by csex;&lt;BR /&gt;run;&lt;BR /&gt;proc print data = main;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2020 21:59:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Basic-Problem/m-p/685901#M24352</guid>
      <dc:creator>Alex901</dc:creator>
      <dc:date>2020-09-22T21:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Problem!</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Basic-Problem/m-p/686068#M24372</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; There are a few things wrong with your program. Here's a hint about one of them that should be generating errors. If you are going to reference a dataset in a procedure step you need data= -- so, for example, consider the difference in your PROC SORT versus your PROC PRINT. One is right and the other is not:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1600872133792.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/49707i6F71D18FEC9B7B47/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1600872133792.png" alt="Cynthia_sas_0-1600872133792.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your program, I recommend that you look up the difference between a KEEP statement and a KEEP= option and then correct your syntax accordingly. Also, what is the purpose of the &lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;main=csex;&lt;/STRONG&gt;&lt;/FONT&gt; assignment statement? Are you trying to create a new variable or column called &lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;MAIN &lt;/STRONG&gt;&lt;/FONT&gt;by assigning the current value of the variable &lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;CSEX&lt;/STRONG&gt;&lt;/FONT&gt;? Why is the name of the variable the same as the name of the dataset you are creating? What is this statement really doing and is it doing what you need to do??&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_1-1600872216409.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/49708iEB8C30690CD7446D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_1-1600872216409.png" alt="Cynthia_sas_1-1600872216409.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 14:47:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Basic-Problem/m-p/686068#M24372</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2020-09-23T14:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Problem!</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Basic-Problem/m-p/686577#M24442</link>
      <description>&lt;P&gt;THANK YOU SO MUCH!&lt;/P&gt;&lt;P&gt;I ran it now and it worked, sorry I just started to learn SAS and I am still new in this, I really appreciate your help Cynthia!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Data&lt;/STRONG&gt;&amp;nbsp;small;&lt;/P&gt;&lt;P&gt;Set main;&lt;/P&gt;&lt;P&gt;keep dmage mrace dmar dlivord dfage frace csex dbirwt primac wtgain;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;sort&lt;/STRONG&gt; data = small;&lt;/P&gt;&lt;P&gt;by csex;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;print&lt;/STRONG&gt; data = small (obs = &lt;STRONG&gt;10&lt;/STRONG&gt;);&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 23:58:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Basic-Problem/m-p/686577#M24442</guid>
      <dc:creator>Alex901</dc:creator>
      <dc:date>2020-09-24T23:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Problem!</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Basic-Problem/m-p/686730#M24454</link>
      <description>Hi: &lt;BR /&gt;Right now, the dataset SMALL is just a copy of MAIN, with certain variables kept in the new dataset. So, SMALL should have the same number of rows as MAIN. If you meant to subset MAIN based on some value, it looks like you forgot that statement. But I'm glad you got it working. I highly recommend our free Programming 1 e-learning class which would explain the DATA step, IF statements, KEEP statements, PROC statements and other essential things about SAS syntax and writing programs.&lt;BR /&gt;&lt;BR /&gt;Cynthia</description>
      <pubDate>Fri, 25 Sep 2020 15:21:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Basic-Problem/m-p/686730#M24454</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2020-09-25T15:21:16Z</dc:date>
    </item>
  </channel>
</rss>

