CL :: EDISSNDCL

EXTOL/VAI ::R50MODS CL :: EDISSNDCL -- Submit EDI outbound document processing

/* ******************************************************************/
/* * DEVELOPED BY : Vormittag Associates, Inc. Copyright 2011      **/
/* *                                                               **/
/* *   FOR          : System 2000                                  **/
/* *   PROGRAMMER   : Bob Moloney         Log: 287541 (66V9)       **/
/* *   DATE WRITTEN : 06/17/2011          PTF: 4                   **/
/* *                                                               **/
/* *   MODIFIED BY  : Bob Moloney         LOG: 279080 (oa01)       **/
/* *   DATE         : 10/23/2012          PTF:                     **/
/* *   DESCRIPTION  : Change default output queue from SALESS2K1   **/
/* *                  to EDI.                                      **/
/* *                                                               **/
/* *---------------------------------------------------------------**/
/* *   SYSTEM NAME  : AS/400                                       **/
/* *---------------------------------------------------------------**/
/* *   DESCRIPTION  : Submit EDI outbound document processing &    **/
/* *                  communications as a scheduled job.           **/
/* *                                                               **/
/* *          NOTE  : Must use single threaded job queue to work   **/
/* *                  properly. Need to specify job description    **/
/* *                  & job queue for submitted jobs to isolate    **/
/* *                  from other processing jobs and to keep jobs  **/
/* *                  in same queue.                               **/
/* *                                                               **/
/* *---------------------------------------------------------------**/
/* ******************************************************************/
PGM   /* EXTRACT & SEND OUTBOUND EDI DOCUMENTS */


             DCL        VAR(&JOB_DATE)   TYPE(*CHAR) LEN(8)
             DCL        VAR(&JOB_TIME)   TYPE(*CHAR) LEN(8)
             DCL        VAR(&JOB_NAME)   TYPE(*CHAR) LEN(10)
             DCL        VAR(&JOB_USER)   TYPE(*CHAR) LEN(10)
             DCL        VAR(&JOB_NUMBER) TYPE(*CHAR) LEN(6)
             DCL        VAR(&CMPA)       TYPE(*CHAR) LEN(3)
             DCL        VAR(&ATYP)       TYPE(*CHAR) LEN(1)
             DCL        VAR(&ACCT)       TYPE(*CHAR) LEN(7)
             DCL        VAR(&EDST)       TYPE(*CHAR) LEN(10)
             DCL        VAR(&XXNETW)     TYPE(*CHAR) LEN(4)
             DCL        VAR(&FRDTE)      TYPE(*CHAR) LEN(6)
             DCL        VAR(&TRDTE)      TYPE(*CHAR) LEN(6)
             DCL        VAR(&FREF )      TYPE(*CHAR) LEN(9)
             DCL        VAR(&TREF )      TYPE(*CHAR) LEN(9)
             DCL        VAR(&FORD )      TYPE(*CHAR) LEN(9)
             DCL        VAR(&TORD )      TYPE(*CHAR) LEN(9)
             DCL        VAR(&FBOCD)      TYPE(*CHAR) LEN(3)
             DCL        VAR(&TBOCD)      TYPE(*CHAR) LEN(3)
             DCL        VAR(&FAREF)      TYPE(*CHAR) LEN(20)
             DCL        VAR(&TAREF)      TYPE(*CHAR) LEN(20)
             DCL        VAR(&XXPREV)     TYPE(*CHAR) LEN(1)
             DCL        VAR(&XXTRANS)    TYPE(*CHAR) LEN(1)
             DCL        VAR(&XXSEND )    TYPE(*CHAR) LEN(1)
             DCL        VAR(&RPTDT)      TYPE(*CHAR) LEN(6)
             DCL        VAR(&PRTID)      TYPE(*CHAR) LEN(10)
             DCL        VAR(&NRCPY)      TYPE(*CHAR) LEN(2)
             DCL        VAR(&DFTCMP)     TYPE(*DEC) LEN(3 0)
             DCL        VAR(&DFTBNK)     TYPE(*DEC) LEN(2 0)
             DCL        VAR(&DFTLOC)     TYPE(*CHAR) LEN(4)
             DCL        VAR(&DFTCYN)     TYPE(*CHAR) LEN(1)
             DCL        VAR(&DFTLYN)     TYPE(*CHAR) LEN(1)
             DCL        VAR(&DFTGROUP)   TYPE(*CHAR) LEN(3)


/*-----------------------------------------------------------------------*/

             RTVJOBA    JOB(&JOB_NAME) USER(&JOB_USER) +
                          NBR(&JOB_NUMBER) DATE(&RPTDT)

             RTVSYSVAL  SYSVAL(QTIME) RTNVAR(&JOB_TIME)

             CVTDAT     DATE(&RPTDT) TOVAR(&JOB_DATE) TOFMT(*YYMD) +
                          TOSEP(*NONE)

    /* Retrieve Default User Company */
             CALL       PGM(*LIBL/XADFTS) PARM(&JOB_USER &DFTCMP &DFTBNK +
                          &DFTLOC &DFTCYN &DFTLYN &DFTGROUP)

/*-----------------------------------------------------------------------*/

             CHGVAR     VAR(&CMPA) VALUE(&DFTCMP)
             CHGVAR     VAR(&ATYP) VALUE(' ')
             CHGVAR     VAR(&ACCT) VALUE('*ALL   ')
             CHGVAR     VAR(&EDST) VALUE('*ALL      ')
             CHGVAR     VAR(&XXNETW) VALUE('*ALL')
             CHGVAR     VAR(&FRDTE) VALUE('000000')
             CHGVAR     VAR(&TRDTE) VALUE('999999')
             CHGVAR     VAR(&FREF) VALUE('000000000')
             CHGVAR     VAR(&TREF) VALUE('999999999')
             CHGVAR     VAR(&FORD) VALUE('000000000')
             CHGVAR     VAR(&TORD) VALUE('999999999')
             CHGVAR     VAR(&FBOCD) VALUE('000')
             CHGVAR     VAR(&TBOCD) VALUE('999')
             CHGVAR     VAR(&FAREF) VALUE('                    ')
             CHGVAR     VAR(&TAREF) VALUE('99999999999999999999')
             CHGVAR     VAR(&XXPREV) VALUE('Y')
             CHGVAR     VAR(&XXTRANS) VALUE('Y')
             CHGVAR     VAR(&XXSEND) VALUE('Y')
         /*  CHGVAR     VAR(&PRTID) VALUE('SALESS2K1 ')       oa01 */
             CHGVAR     VAR(&PRTID) VALUE('EDI')           /* oa01 */
             CHGVAR     VAR(&NRCPY) VALUE('01')


             SBMJOB     CMD(CALL PGM(EDUPDSC2) PARM(&JOB_DATE +
                          &JOB_TIME &JOB_NAME &JOB_USER &JOB_NUMBER +
                          &CMPA &ATYP &ACCT &EDST &XXNETW &FRDTE +
                          &TRDTE &FREF &TREF &FORD &TORD &FBOCD +
                          &TBOCD &FAREF &TAREF &XXPREV &XXTRANS +
                          &XXSEND &RPTDT &PRTID &NRCPY)) +
                          JOB(EDI_SEND) JOBD(*LIBL/EDIJOBD) +
                          JOBQ(*LIBL/EDIJOBS)

    /* CAPTURE EDI OUTQUE DATA BEGIN     O001                       */
             SBMJOB     CMD(CALL PGM(UR10025C)) JOB(&JOB_NAME) +
                          JOBD(*LIBL/EDIJOBD) JOBQ(*LIBL/EDIJOBS) +
                          JOBPTY(9) LOG(4 0 *SECLVL) LOGCLPGM(*YES)
    /* CAPTURE EDI OUTQUE DATA END       O001                       */
    ENDPGM



By: on