Hi all,
I have a csv dataset that includes an account number, a date, and 24 hours of data per day. Each row contains one day of a month of the year. All account numbers have 365 days.
So the sample data set is as follows:
account# date hour1 hour2 hour3 ...............hour24
There are around 50 account numbers in the data set totaling somewhere in the range of 4000 or so rows. I need to find the maximum value by MONTH and return that value for each account number for each month. So, in the end I will have 12 max values for each account number. HELP! PLEASE. The code, minus the import that I have so far is as follows :
data usagesum;
set kva end = eof;
retain maxuse;
month = month(date);
if (day(date) = 1) and not (_n_ = 1) then do;
maxuse=0;
end;
maxuse= max(of hour1 - hour24);
if last.account or month ne month(date+1) then output;
run;
I am getting the max but not of the entire month.
Message was edited by: Aar684