<?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: help with this code in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/help-with-this-code/m-p/592720#M169970</link>
    <description>I've modified your subject line and put your code in a code block to make it legible. Please add the details requested in the post (use the Edit button) or Reply with more information. &lt;BR /&gt;&lt;BR /&gt;You haven't told us what you need here and since we don't have your data, we can't run your code, and therefore we don't know what you need.</description>
    <pubDate>Mon, 30 Sep 2019 15:33:49 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-09-30T15:33:49Z</dc:date>
    <item>
      <title>help with this code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-with-this-code/m-p/592550#M169914</link>
      <description>&lt;P&gt;&lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;{INSERT QUESTION HERE}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname tt "E:\工作\05无锡Viya\sasdata";

data air;
set air_2014-air_2018;
if find(type,'_')&amp;gt;0 then type=scan(type,1,'_');
run;

proc freq data=air;
tables type;
run;

data tt._03_realtime_air_initial;
set air;
run;

proc transpose data=air out=tt._03_realtime_air_trans;
by date;
id type;
var '1188a'n '1189a'n '1190a'n '1191a'n '1192a'n '1193a'n '1194a'n '1195a'n;
run;

proc contents data=tt._03_realtime_air_trans out=tmp noprint;
run;

proc sql noprint;
select cat("min('",strip(name),"'n) as '",strip(name),"_min'n, ",
"mean('",strip(name),"'n) as '",strip(name),"_mean'n, ",
"max('",strip(name),"'n) as '",strip(name),"_max'n, ",
"sum('",strip(name),"'n) as '",strip(name),"_sum'n") into:vars
separated by ","
from tmp
where upcase(strip(name)) not in("_NAME_","DATE")
order by varnum
;quit;
%put vars=&amp;amp;vars.;

proc sql noprint;
create table tt._03_realtime_air_summary as
select date,&amp;amp;vars.
from tt._03_realtime_air_trans
group by date
;quit;

data a;
set tt._03_realtime_air_summary;
week=year(date)*100+week(date);
month=year(date)*100+month(date);
run;

proc sql;
create table tt._03_realtime_air_week as
select week, min(date) as date format=yymmddn8.,
mean(aqi_mean) as AQI,
mean('PM2.5_min'n) as 'PM2.5'n,
mean('PM10_min'n) as 'PM10'n,
mean(so2_mean) as SO2,
mean(NO2_mean) as NO2,
mean(O3_mean) as O3,
mean(CO_mean) as CO
from a
group by week
;quit;

proc sql;
create table tt._03_realtime_air_month as
select month, min(date) as date format=yymms7.,
mean(aqi_mean) as AQI,
mean('PM2.5_min'n) as 'PM2.5'n,
mean('PM10_min'n) as 'PM10'n,
mean(so2_mean) as SO2,
mean(NO2_mean) as NO2,
mean(O3_mean) as O3,
mean(CO_mean) as CO
from a
group by month
;quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 15:32:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-with-this-code/m-p/592550#M169914</guid>
      <dc:creator>duLAT1</dc:creator>
      <dc:date>2019-09-30T15:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: hi guys, help with this code, the University was given to understand, in addition there are 4 mo</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-with-this-code/m-p/592555#M169915</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292875"&gt;@duLAT1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You throw a lot of code without explanations at us. No idea what you need help with as you don't tell us.&lt;/P&gt;
&lt;P&gt;Please ask a proper question using the message body and not the subject line.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You don't provide the data so we can't execute the code you've posted. If there are syntax errors you can't resolve then please also post the full SAS log (eventually as attachment).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 04:08:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-with-this-code/m-p/592555#M169915</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-09-30T04:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: help with this code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-with-this-code/m-p/592720#M169970</link>
      <description>I've modified your subject line and put your code in a code block to make it legible. Please add the details requested in the post (use the Edit button) or Reply with more information. &lt;BR /&gt;&lt;BR /&gt;You haven't told us what you need here and since we don't have your data, we can't run your code, and therefore we don't know what you need.</description>
      <pubDate>Mon, 30 Sep 2019 15:33:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-with-this-code/m-p/592720#M169970</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-09-30T15:33:49Z</dc:date>
    </item>
  </channel>
</rss>

