OPEN p_resultset FORYou are opening a cursor and at the same time you are selecting the value into a variable. That is wrong. And you don't have to enclose variables with single quotes in the where clause.
SELECT MWAGTN into AgentNo FROM ext_lsp_CASMWAGT WHERE MWCO = '''|||p_CompanyCode|||''' And
select a.mwagtn as agentno , c.crcltn as clientno , d.cmname as agentname from ext_lsp_casmwagt a join ext_lsp_cascntrm b on a.mwco = b.mcco and a.mwpoln = b.mccntr left join ext_lsp_cmsusrel c on c.crctl1 = a.mwagtn and c.crco = a.mwco and c.cralph = 'AGT' join ext_lsp_cmsclntm d on d.cmcltn = c.crcltn where mwco = p_companycode and mwpoln = p_policyno;