          SUBROUTINE (DDE.AGENT,DDE.DATA,RESULTS)
** Version# 5.0002[1] - 08/13/2012 - 03:35pm - TSMITH - eclipse
** Copied from CBP DDE.EXECUTE Version# 5.0001[4] - 08/12/2012 - 11:26pm - TSMITH - eclipse
*** V5.0001 Change - Custom Coding . - 08/12/2012 - TSMITH - eclipse

          UT.OPEN.COMMON.FILE 'DDE.AGENTS',HNDL
          IF HNDL > 0 THEN
             DDEFILE = FILES(HNDL)
          END ELSE
             RESULTS = 'ERROR : Cannot open DDE.AGENTS'
             RETURN
          END

          IF NOT(DDE.AGENT) THEN
             DDE = ''
          END ELSE
             READ DDE FROM DDEFILE,DDE.AGENT ELSE
                RESULTS = 'ERROR : DDE Agent not found : ':DDE.AGENT
                RETURN
             END
          END
          READ DFLT.SUBR.ID FROM CTRLFILE,'DFLT.PRD.XREF.SUBR' ELSE
             DFLT.SUBR.ID = ''
          END

          SUBR.ID = DDE<2>
          IF NOT(SUBR.ID) THEN SUBR.ID = DFLT.SUBR.ID

          DATA    = DDE.DATA
          IF DDE<3,1> THEN
             DCNT = DCOUNT(DDE<3>,@VM)
             DDE3 = ''
             FOR X = 1 TO DCNT
                IF TRIM(DDE<3,X>) THEN
                   DDE3 = DDE3:DDE<3,X>
                END
             NEXT X
             DATA = DDE3:DATA
          END

          READV TST FROM MDFILE,SUBR.ID,1 ELSE TST = ''
          IF TST[1,1] # 'V' THEN
             RESULTS = 'ERROR : DDE subroutine not found : ':SUBR.ID
             RETURN
          END

          RESULTS  = ''


          CALL @SUBR.ID(PC.FILENAME)
          *CALL @SUBR.ID(DATA,RESULTS)
          *DDE.MSEXCEL.EXPORT PC.FILENAME
          RETURN
!TSMITH~08/13/12~15:35
