<?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: Categorizing SAS dataset with some missing observations and other errors. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Categorizing-SAS-dataset-with-some-missing-observations-and/m-p/879361#M347401</link>
    <description>&lt;P&gt;Run the code you posted, and examine the sas log.&amp;nbsp; That should help you understand what is needed for a "fix".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your approach of running a PROC SORT and PROC PRINT assumes that the preceding data step produced the data you wish to view.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Jun 2023 14:40:18 GMT</pubDate>
    <dc:creator>mkeintz</dc:creator>
    <dc:date>2023-06-06T14:40:18Z</dc:date>
    <item>
      <title>Categorizing SAS dataset with some missing observations and other errors.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Categorizing-SAS-dataset-with-some-missing-observations-and/m-p/879358#M347400</link>
      <description>&lt;P&gt;Good day All,&lt;/P&gt;&lt;P&gt;I am new on SAS&amp;nbsp; community, I am preparing for base certification exam and I came across this code that I am expected to fix and run.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the example someone posted but each time i run my code it writes notes in the log but after sorting the data, I am not able to do a proc print, to enable me visualize the output so i can answer the questions that follow, rather when I run the code it loops forever and does not give me any result. This is the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;data work.lowchol work.highchol;&lt;/P&gt;&lt;P&gt;&amp;nbsp;set sashelp.heart;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if cholesterol lt 200 output work.lowchol;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if cholesterol ge 200 output work.highchol;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if cholesterol is missing output work.misschol;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;Thank You.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 14:35:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Categorizing-SAS-dataset-with-some-missing-observations-and/m-p/879358#M347400</guid>
      <dc:creator>Rebecca7</dc:creator>
      <dc:date>2023-06-06T14:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: Categorizing SAS dataset with some missing observations and other errors.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Categorizing-SAS-dataset-with-some-missing-observations-and/m-p/879361#M347401</link>
      <description>&lt;P&gt;Run the code you posted, and examine the sas log.&amp;nbsp; That should help you understand what is needed for a "fix".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your approach of running a PROC SORT and PROC PRINT assumes that the preceding data step produced the data you wish to view.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 14:40:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Categorizing-SAS-dataset-with-some-missing-observations-and/m-p/879361#M347401</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2023-06-06T14:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Categorizing SAS dataset with some missing observations and other errors.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Categorizing-SAS-dataset-with-some-missing-observations-and/m-p/879398#M347411</link>
      <description>&lt;P&gt;When you run the code posted you should get a bunch of errors. Here's the log I receive.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You then need to fix the errors in the order they appear.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;69          data work.lowchol work.highchol;
 70         
 71          set sashelp.heart;
 72         
 73              if cholesterol lt 200 output work.lowchol;
                                       ______
                                       79
 ERROR 79-322: Expecting a ;.
 
 74         
 75              if cholesterol ge 200 output work.highchol;
                                       ______
                                       79
 ERROR 79-322: Expecting a ;.
 
 76         
 77              if cholesterol is missing output work.misschol;
                                __
                                388
                                76
 ERROR 388-185: Expecting an arithmetic operator.
 
 ERROR 76-322: Syntax error, statement will be ignored.
 
 78         
 79         run;
 
 NOTE: The SAS System stopped processing this step because of errors.
 WARNING: The data set WORK.LOWCHOL may be incomplete.  When this step was stopped there were 0 observations and 17 variables.
 WARNING: The data set WORK.HIGHCHOL may be incomplete.  When this step was stopped there were 0 observations and 17 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       user cpu time       0.00 seconds
       system cpu time     0.01 seconds
       memory              1622.84k
       OS Memory           20652.00k
       Timestamp           06/06/2023 04:34:21 PM
       Step Count                        24  Switch Count  4
       Page Faults                       0
       Page Reclaims                     389
       Page Swaps                        0
       Voluntary Context Switches        18
       Involuntary Context Switches      0
       Block Input Operations            0
       Block Output Operations           528
       
 &lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are at least 5 mistakes in the code above, three are the 'same'.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 16:36:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Categorizing-SAS-dataset-with-some-missing-observations-and/m-p/879398#M347411</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-06-06T16:36:52Z</dc:date>
    </item>
  </channel>
</rss>

