       module join
       newfile joinmod.1
       newfile joinmod.2
       newfile joinmod.3
       call pc_dbm(db1,open_dbf,joinmod.db1,joinmod.db3)
       call pc_dbm(db2,open_dbf,joinmod.db2)
       call pc_dbm(db3,join,db1,db2,lastname,firstname,,lastname,firstname,,env_no,join_env_no)
       call pc_dbm(db1,read)
       do while (pc_dbm_sts)
           if(ne("pc_dbm(db1,fldu,join_env_no)"," ")) then
               if(ne("pc_dbm(db1,fldu,env_no)","pc_dbm(db1,fldu,join_env_no)")) then
                   if(ne("pc_dbm(db1,fldu,join_env_no)","    0")) then
                       write joinmod.1 "pc_dbm(db1,fld,firstname) pc_dbm(db1,fld,lastname) from pc_dbm(db1,fld,env_no) to pc_dbm(db1,fld,join_env_no)"
                       call pc_dbm(db1,write,env_no,join_env_no)
                   else
                       write joinmod.2 "pc_dbm(db1,fld,firstname) pc_dbm(db1,fld,lastname) pc_dbm(db1,fld,env_no) with no envel in mar "
                   endif
               endif
           else if(ne("pc_dbm(db1,fldu,env_no)","    0")) then
               write joinmod.3 "pc_dbm(db1,fld,firstname) pc_dbm(db1,fld,lastname) pc_dbm(db1,fld,env_no) not found in mar"
           endif
           call pc_dbm(db1,read)
       end do
       end
