Create a comois variable in the first table, and join on that:
data table1;
input comax :$5. coopu :$20. daopu :yymmdd10.;
comois = put(daopu,yymmn6.);
datalines;
37351 OPUCTC00046D2CW 2019-07-02
42235 OPUCTC0004TOCFP 2019-11-05
42235 OPUCTC0004UJ9RI 2019-12-26
;
data table2;
input comax :$5. comois :$6.;
datalines;
37351 201907
42235 201911
;
proc sql;
create table want as
select t1.comax, t2.comois, t1.coopu
from table1 t1, table2 t2
where t1.comax = t2.comax and t1.comois = t2.comois;
quit;
Please supply example data in usable form (see the above for reference), so we know exactly what you're talking about.