<?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 kindly let me know why i am getting error in LOG section?? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/kindly-let-me-know-why-i-am-getting-error-in-LOG-section/m-p/925308#M364165</link>
    <description>&lt;PRE&gt;&lt;CODE class=""&gt;data out;
	set INPUT.input44;
	drop bp_status weight_status smoking_status;

	if cholesterol lt 200 then
		do;
			chol="SAFE";
			output safe;
		end;
	Else if cholesterol le 239 then
		do;
			chol="HIGH_BORDRLINE";
			output high_bord;
		end;
	else if cholesterol ge 240 then
		do;
			chol="HIGH";
			output high;
		end;
	where cholesterol is not missing;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Log Section:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PriyaB_0-1713838346474.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95761i9B0951B5F14ACB72/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PriyaB_0-1713838346474.png" alt="PriyaB_0-1713838346474.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please let me know in simple way where i am lacking as I am new to SAS and learning it .&lt;/P&gt;</description>
    <pubDate>Tue, 23 Apr 2024 02:14:23 GMT</pubDate>
    <dc:creator>PriyaB</dc:creator>
    <dc:date>2024-04-23T02:14:23Z</dc:date>
    <item>
      <title>kindly let me know why i am getting error in LOG section??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/kindly-let-me-know-why-i-am-getting-error-in-LOG-section/m-p/925308#M364165</link>
      <description>&lt;PRE&gt;&lt;CODE class=""&gt;data out;
	set INPUT.input44;
	drop bp_status weight_status smoking_status;

	if cholesterol lt 200 then
		do;
			chol="SAFE";
			output safe;
		end;
	Else if cholesterol le 239 then
		do;
			chol="HIGH_BORDRLINE";
			output high_bord;
		end;
	else if cholesterol ge 240 then
		do;
			chol="HIGH";
			output high;
		end;
	where cholesterol is not missing;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Log Section:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PriyaB_0-1713838346474.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95761i9B0951B5F14ACB72/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PriyaB_0-1713838346474.png" alt="PriyaB_0-1713838346474.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please let me know in simple way where i am lacking as I am new to SAS and learning it .&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 02:14:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/kindly-let-me-know-why-i-am-getting-error-in-LOG-section/m-p/925308#M364165</guid>
      <dc:creator>PriyaB</dc:creator>
      <dc:date>2024-04-23T02:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: kindly let me know why i am getting error in LOG section??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/kindly-let-me-know-why-i-am-getting-error-in-LOG-section/m-p/925309#M364166</link>
      <description>&lt;P&gt;You cannot output to a dataset that you did not tell SAS the data step was going to create.&amp;nbsp; If you want to write to three different datasets then you must list all of them in the DATA statement, just as the message says.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also do not put the WHERE statement so far away from the SET statement that it applies to.&amp;nbsp; You will just confuse yourself.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data safe high_bord high;
  set INPUT.input44;
  where cholesterol is not missing;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 02:21:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/kindly-let-me-know-why-i-am-getting-error-in-LOG-section/m-p/925309#M364166</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-04-23T02:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: kindly let me know why i am getting error in LOG section??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/kindly-let-me-know-why-i-am-getting-error-in-LOG-section/m-p/925310#M364167</link>
      <description>&lt;P&gt;If you use an OUTPUT statement with a data set name to write to then you need this output data set also in your DATA statement.&lt;/P&gt;
&lt;PRE&gt;data SAFE HIGH_BORD HIGH;
  .....
      output safe;
  .....
      output high_bord;
  .....
      output high;
  .....
run;&lt;/PRE&gt;
&lt;P&gt;Looking at your code I feel that it might be better to just populate a variable and write all the data to a single table.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data out;
  set INPUT.input44;
  drop bp_status weight_status smoking_status;

  length chol $14;
  if cholesterol lt 200 then
    do;
      chol="SAFE";
    end;
  else if cholesterol le 239 then
    do;
      chol="HIGH_BORDRLINE";
    end;
  else if cholesterol ge 240 then
    do;
      chol="HIGH";
    end;

  where cholesterol is not missing;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;One neat and easy to maintain option for recoding values is the use of a format.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
  value chol_group
    low-&amp;lt;200 = 'SAFE'
    200-&amp;lt;240 = 'HIGH_BORDRLINE'
    240-high = 'HIGH'
    other    = 'not defined'
    ;
run;

data out;
  set INPUT.input44;
  where cholesterol is not missing;
  drop bp_status weight_status smoking_status;
  chol=put(cholesterol,chol_group.);
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 02:32:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/kindly-let-me-know-why-i-am-getting-error-in-LOG-section/m-p/925310#M364167</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-04-23T02:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: kindly let me know why i am getting error in LOG section??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/kindly-let-me-know-why-i-am-getting-error-in-LOG-section/m-p/925317#M364170</link>
      <description>Thank you Tom &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Tue, 23 Apr 2024 04:43:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/kindly-let-me-know-why-i-am-getting-error-in-LOG-section/m-p/925317#M364170</guid>
      <dc:creator>PriyaB</dc:creator>
      <dc:date>2024-04-23T04:43:41Z</dc:date>
    </item>
  </channel>
</rss>

