<?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: log window full and datastep stops in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/log-window-full-and-datastep-stops/m-p/948887#M371222</link>
    <description>yes, my mistake writing monyy7 and missed the dot generated the problem.  Thanks so much for pointing this to me&lt;BR /&gt;</description>
    <pubDate>Thu, 24 Oct 2024 13:41:07 GMT</pubDate>
    <dc:creator>rykwong</dc:creator>
    <dc:date>2024-10-24T13:41:07Z</dc:date>
    <item>
      <title>log window full and datastep stops</title>
      <link>https://communities.sas.com/t5/SAS-Programming/log-window-full-and-datastep-stops/m-p/948717#M371170</link>
      <description>&lt;P&gt;Hi i ran this datastep and it keeps stating "log window full" and cannot go further.&amp;nbsp; I tried manually clearing the log window but it still gets stuck on this step.&amp;nbsp; Any thoughts on how to set up the option so it wont happen again?&amp;nbsp; thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data lab_bnp_ntbnp lab_trop; set lab; &lt;BR /&gt;monthyear_test=seq_date_time;&lt;BR /&gt;put monthyear_test=monyy7;&lt;BR /&gt;testname=lowcase(group_id);&lt;BR /&gt;if index(testname,'bnp')&amp;gt;0 then output lab_bnp_ntbnp;&lt;BR /&gt;if index(testname,'trop')&amp;gt;0 then output lab_trop;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rykwong_0-1729681965018.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/101725i8C4E6E5EB81E0433/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rykwong_0-1729681965018.png" alt="rykwong_0-1729681965018.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2024 11:13:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/log-window-full-and-datastep-stops/m-p/948717#M371170</guid>
      <dc:creator>rykwong</dc:creator>
      <dc:date>2024-10-23T11:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: log window full and datastep stops</title>
      <link>https://communities.sas.com/t5/SAS-Programming/log-window-full-and-datastep-stops/m-p/948718#M371171</link>
      <description>&lt;P&gt;Usually this means you have flooded the log with messages.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you really want to collect all the messages, you can use PROC PRINTTO to send the log to a file, instead of the log window.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc printto log="C:\mylog.log"&amp;nbsp; new;
run;

*code here;

proc printto log=log;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then you can open the log with a text editor.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a reason you're using the PUT statement to print messages to the log?&amp;nbsp; If your dataset has 1,000 records, this will print 1,000 lines to your log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to see a few rows of data you can do stuff like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if _n_ &amp;lt;=10 then put monthyear_test= monyy7.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note I added the missing dot after monyy7.&amp;nbsp; The dot is needed to tell SAS that monyy7 is the name of a format, not the name of a variable.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2024 11:31:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/log-window-full-and-datastep-stops/m-p/948718#M371171</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-10-23T11:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: log window full and datastep stops</title>
      <link>https://communities.sas.com/t5/SAS-Programming/log-window-full-and-datastep-stops/m-p/948720#M371173</link>
      <description>&lt;P&gt;You have PUT statement that will write to the LOG for every observation. Why?&lt;/P&gt;
&lt;P&gt;You can limit the number of observations processed with the OBS= option and actually see what is in the log for just a few:&lt;/P&gt;
&lt;PRE&gt;data lab_bnp_ntbnp lab_trop; 
set lab (obs=50);
monthyear_test=seq_date_time;
&lt;FONT color="#800080"&gt;&lt;STRONG&gt;put monthyear_test=monyy7;&lt;/STRONG&gt;&lt;/FONT&gt;
testname=lowcase(group_id);
if index(testname,'bnp')&amp;gt;0 then output lab_bnp_ntbnp;
if index(testname,'trop')&amp;gt;0 then output lab_trop;
run;&lt;/PRE&gt;
&lt;P&gt;I suspect that you may see a bunch of "monthyear_test = *******" because if seq_date_time is a datetime value, which contains number of seconds, that trying to display the value with a date format, which is number of days, exceeds the range of values that the date format monyy7 will display.&lt;/P&gt;
&lt;P&gt;If that is the case and you want "monthyear_test" to have a date value you need to use&lt;/P&gt;
&lt;PRE&gt;monthyear_test= datepart(seq_date_time);&lt;/PRE&gt;
&lt;P&gt;OR use a format intended to display the date portion of datetime value&lt;/P&gt;
&lt;PRE&gt;put monthyear_test= dtmon7. ;&lt;/PRE&gt;
&lt;P&gt;But either one of them will continue to fill up the LOG if the data set Lab has many observations because you have told SAS to write a line for every observation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2024 12:07:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/log-window-full-and-datastep-stops/m-p/948720#M371173</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-10-23T12:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: log window full and datastep stops</title>
      <link>https://communities.sas.com/t5/SAS-Programming/log-window-full-and-datastep-stops/m-p/948885#M371220</link>
      <description>so helpful! the MONYY7 was supposed to be monyy7. to format the date variable.  many thanks !</description>
      <pubDate>Thu, 24 Oct 2024 13:39:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/log-window-full-and-datastep-stops/m-p/948885#M371220</guid>
      <dc:creator>rykwong</dc:creator>
      <dc:date>2024-10-24T13:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: log window full and datastep stops</title>
      <link>https://communities.sas.com/t5/SAS-Programming/log-window-full-and-datastep-stops/m-p/948887#M371222</link>
      <description>yes, my mistake writing monyy7 and missed the dot generated the problem.  Thanks so much for pointing this to me&lt;BR /&gt;</description>
      <pubDate>Thu, 24 Oct 2024 13:41:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/log-window-full-and-datastep-stops/m-p/948887#M371222</guid>
      <dc:creator>rykwong</dc:creator>
      <dc:date>2024-10-24T13:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: log window full and datastep stops</title>
      <link>https://communities.sas.com/t5/SAS-Programming/log-window-full-and-datastep-stops/m-p/948900#M371225</link>
      <description>&lt;P&gt;I have the dataset with these variables&lt;/P&gt;
&lt;P&gt;patient_id pt_name lab_date,&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lab_type result normal_range visit_description HD date_HD&lt;/P&gt;
&lt;P&gt;01234&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Smith, J&amp;nbsp; &amp;nbsp;2023-10-23&amp;nbsp; &amp;nbsp; gfr&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 30&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;60-100&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;chest pain 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.&lt;/P&gt;
&lt;P&gt;01234&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Smith, J&amp;nbsp; &amp;nbsp;2024-02-23&amp;nbsp; &amp;nbsp;gfr&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;60-100&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dyspnea&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.&lt;/P&gt;
&lt;P&gt;01234&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Smith, J&amp;nbsp; &amp;nbsp;2024-10-21&amp;nbsp; &amp;nbsp; gfr&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 60-100&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;asymptomatic&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; 2023_10_30&lt;/P&gt;
&lt;P&gt;01234&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Smith, J&amp;nbsp; &amp;nbsp;2023-07-23&amp;nbsp; &amp;nbsp; trop&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.06&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;0.010&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;chest pain 5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.&lt;/P&gt;
&lt;P&gt;01234&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Smith, J&amp;nbsp; &amp;nbsp;2024-01-20&amp;nbsp; &amp;nbsp; trop&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.08&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;0.010&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dyspnea&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.&lt;/P&gt;
&lt;P&gt;01226&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;wong, J&amp;nbsp; &amp;nbsp;2023-04-23&amp;nbsp; &amp;nbsp; gfr&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 15&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;0.010&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;chest pain 4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;2023_04_30&lt;/P&gt;
&lt;P&gt;01226&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; wong, J&amp;nbsp; &amp;nbsp;2024-2-20&amp;nbsp; &amp;nbsp; trop&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.08&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;0.010&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dyspnea&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.&lt;/P&gt;
&lt;P&gt;the dataset has several millions lines from several thousand pts&lt;/P&gt;
&lt;P&gt;would like to organize the data so that each line represents the range of a lab type in a given month with range and mean values such as this;&lt;/P&gt;
&lt;P&gt;patient_id patient_name lab_month lab_type low high mean max date_max&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; normal_range visit_des&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;HD date date_hd&lt;/P&gt;
&lt;P&gt;01234&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Smith, J&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Oct2023&amp;nbsp; &amp;nbsp; gfr&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10&amp;nbsp; &amp;nbsp; 30&amp;nbsp; &amp;nbsp; &amp;nbsp;20&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;30&amp;nbsp; &amp;nbsp; 2023_10-23&amp;nbsp; &amp;nbsp; 60-100&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;chest pain 1, asymptomatic&amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2023-10-30&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried proc SQL but could not achieve all the results&amp;nbsp;&lt;/P&gt;
&lt;P&gt;many thansk for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2024 14:14:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/log-window-full-and-datastep-stops/m-p/948900#M371225</guid>
      <dc:creator>rykwong</dc:creator>
      <dc:date>2024-10-24T14:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: log window full and datastep stops</title>
      <link>https://communities.sas.com/t5/SAS-Programming/log-window-full-and-datastep-stops/m-p/948915#M371231</link>
      <description>&lt;P&gt;You "example" doesn't show any repeats of values for "lab month" so I am not quite sure what you mean. Your example output seems to imply that the high low and mean are calculated regardless of "month".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a way to get the the min, max and mean plus an identification date for the high value.&lt;/P&gt;
&lt;P&gt;Please note that I made a LOT of guesses about the content of your data to make a working data step example. The data step would is only needed to have some data that works with the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data work.have;
   infile datalines dlm='|' dsd;
   input patient_id :$6. pt_name :$10. lab_date :yymmdd10. lab_type :$5. result normal_range :$15. visit_description :$15. HD date_HD :yymmdd10.;
   format lab_date date_HD yymmdd10.;
datalines;
01234|Smith, J|2023-10-23|gfr|30|60-100|chest pain 1|0|.
01234|Smith, J|2024-02-23|gfr|20|60-100|dyspnea|0|.
01234|Smith, J|2024-10-21|gfr|10|60-100|asymptomatic|1|2023_10_30
01234|Smith, J|2023-07-23|trop|0.06|&amp;lt;0.010|chest pain 5|0|.
01234|Smith, J|2024-01-20|trop|0.08|&amp;lt;0.010|dyspnea|0|.
01226|wong, J|2023-04-23|gfr|15|&amp;lt;0.010|chest pain 4|1|2023_04_30
01226|wong, J|2024-2-20|trop|0.08|&amp;lt;0.010|dyspnea|0|.
;

proc sort data=work.have;
   by patient_id Pt_name lab_type lab_date;
run;

proc summary data=work.have nway;
   by patient_id Pt_name lab_type ;
   var result;
   output out=work.examplesummary (drop=_type_) min = mean= max=
      idgroup (max(result) out[1] (lab_date) = date_max)
      /autoname autolabel

   ;
run; &lt;/PRE&gt;
&lt;P&gt;The Sort is so we can process like lab_type values together per patient as that appears to be what you want.&lt;/P&gt;
&lt;P&gt;Proc summary is used to get the min/mean/max (and other statistics if desired like STD, RANGE, percentiles) and uses the IDGROUP option to get the date for the max resulting score.&lt;/P&gt;
&lt;P&gt;The Autoname means the output variables are named by suffixing the statistic to the variable (in case you have multiple variables that might need summary at the same time then you don't have to be verbose in your code unless you want to). The Autoname applies to any statistic or option output requested that yo u do not supply a name for. Without specific requests per variable all VAR variables would have the MAX MIN and MEAN calculated&lt;/P&gt;
&lt;P&gt;The IDGroup will allow getting one or more id variables associated with one or more max or min values of the var variable(s).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect that what you want is this data set and then merge it back to your original data by Patient_id Pt_name and Lab_type.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only way to stick multiple values into a single variable is a data step and has been answered on this forum multiple times. So perhaps do that as a step by Patient_id Pt_name and Lab_type and combine this output with that result.&lt;/P&gt;
&lt;P&gt;Since you didn't provide any rules about what that HD variable is supposed to be I am not sure where to place it. It might belong is the Proc Summary as a var variable asking for the max which would require some modification to the OUTPUT statement.&lt;/P&gt;
&lt;P&gt;The Drop removes a variable that indicates which combinations of the BY and Class variables (if any) are in the output.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2024 15:17:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/log-window-full-and-datastep-stops/m-p/948915#M371231</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-10-24T15:17:45Z</dc:date>
    </item>
  </channel>
</rss>

