Sum duplicate values in text file through awk between dates

I need to sum values in text file in case duplicate row are present with same name and different value below is example of data in file i have and format i need.

Data in text file

20170308
PM,U,2
PM,U,113
PM,I,123
DA,U,135
DA,I,113
DA,I,1
20170309
PM,U,2
PM,U,1
PM,I,123
PM,I,1
DA,U,135
DA,I,1

Output i need in file

20170308
PM,U,115
PM,I,123
DA,U,135
DA,I,114
20170309
PM,U,3
PM,I,124
DA,U,135
DA,I,1 

Try:

awk '
  {
    i=$1 FS $2
  } 
  i!=p || NF==1 {
    if(t) print p, t
    p=t=x
  }
  NF==1 {
    print
    next
  }
  {
    p=i
    t+=$3
  } 
  END {
    if(t)print p, t
  }
' FS=, OFS=, file

Output:

20170308
PM,U,116
PM,I,123
PM,U,123
DA,U,135
DA,I,114
DA,U,22
20170309
PM,U,26
PM,I,124
PM,U,123
DA,I,114
DA,U,22

I am sorry i have typed wrong example.I have corrected example now please check.

Have you tried the code?
With that new input file I get:

20170308
PM,U,115
PM,I,123
DA,U,135
DA,I,114
20170309
PM,U,3
PM,I,124
DA,U,135
DA,I,1