|
I did get this to work. I created the following two programs: SBMCOSTCL - This one is called on the job scheduler and sets up the MAPICS environment. SBMCOST - This one is called by SBMCOSTCL and calls the program that submits the job to perform the cost roll. I have set this one up to perform a current cost roll of everything in the site you specify. Hope this helps. /*--------------------------------------------------------------*/ /* DESCRIPTION: SSBCOSTCL */ /* REVISION LOG: */ /* */ /* DATE INITIALS DESCRIPTION */ /* ---- -------- -----------------------------------------*/ /* */ /*--------------------------------------------------------------*/ PGM PARM(&ENDS &SITE) DCL &ENDS TYPE(*CHAR) LEN(2) /*D12346*/ DCL &SITE TYPE(*CHAR) LEN(3) /*D12346*/ STRMAPICS ENDS(&ENDS) CALL PGM(SBMCOST) PARM(&ENDS &SITE) ENDMAPICS ENDPGM: ENDPGM /*************************************************************************** ***/ /* SBMCOST */ /*************************************************************************** ***/ /*MOD03*/ PGM PARM(&ENDS &SITE) /*MOD03*/ DCL &ENDS TYPE(*CHAR) LEN(2) /*D12346*/ DCL &SITE TYPE(*CHAR) LEN(3) /*D12346*/ DCL VAR(&COIBM) TYPE(*CHAR) LEN(115) VALUE('5728-M7B + (C) COPYRIGHT IBM CORP. 1981, 1985, 1989 ALL RIGHTS + RESERVED, LICENSED MATERIALS - PROPERTY OF IBM') DCL VAR(&VERMOD) TYPE(*CHAR) LEN(37) VALUE('VERSION + 01/MODIFICATION 03/PTF 030000') /*MOD03*/ /* */ /* DECLARE VARIABLE(S). */ /*MOD03*/ /* */ /*MOD03*/ DCLVAR: /*MOD03*/ DCL &HLLESCID TYPE(*CHAR) LEN(7) /*D12346*/ DCL &RTCD TYPE(*CHAR) LEN(8) /*D12346*/ /*D12346*/ DCL VAR(&LDA) TYPE(*CHAR) LEN(1024) /*MOD03*/ DCL &MBRNAME TYPE(*CHAR) LEN(10) /*D03254*/ DCL &QDATE TYPE(*CHAR) LEN(6) /*D03254*/ DCL &SMDAT TYPE(*CHAR) LEN(6) /*D03254*/ DCL &QDATEJUL TYPE(*CHAR) LEN(5) /*D03254*/ DCL &QTIME TYPE(*CHAR) LEN(6) /*D03254*/ DCL &SWS TYPE(*CHAR) LEN(8) /*D03254*/ DCL &EXIST TYPE(*CHAR) LEN(1) /*P03298*/ /*D00073*/ /*D00073*/ /*D00073*/ MONMSG MSGID(CPF0000 AXX0000 RPG0000) EXEC(GOTO + CMDLBL(ESCAPE)) /*D12346*/ VLDENV: CALL PGM(AMZVME0R) PARM(&ENDS &HLLESCID) /*D12346*/ IF COND(&HLLESCID *NE ' ') THEN(GOTO + CMDLBL(EXITPGM)) /*D12346*/ /*D12346*/ CALL PGM(AXZLDA0R) PARM('*CURR' 000000 '*LAST' + 000 &LDA '*RTV' &RTCD) /*D12346*/ /*D12346*/ CHGVAR (%SST(&LDA 245 1)) VALUE('D') /*D12346*/ /*D12346*/ /*D12346*/ CHGVAR VAR(%SST(&LDA 463 10)) VALUE('AMDM1001 ') /*P17633*/ CHGVAR VAR(%SST(&LDA 473 10)) VALUE(' ') /*P17633*/ /* */ /* */ /* * /*D03254*/ CHGJOB SWS(00000000) /*P17065*/ CHGVAR (%SUBSTRING(&LDA 30 008)) VALUE('CURRENT ') /*P17065*/ /* * /*D03254*/ /* * /*D03254*/ FUNCT60: RTVSYSVAL SYSVAL(QDATE) RTNVAR(&QDATE) /*D03254*/ RTVSYSVAL SYSVAL(QTIME) RTNVAR(&QTIME) /*D03254*/ CVTDAT DATE(&QDATE) TOVAR(&QDATEJUL) + FROMFMT(*SYSVAL) TOFMT(*JUL) TOSEP(*NONE) /*D03254*/ CHGVAR VAR(&MBRNAME) VALUE('M' || + (%SUBSTRING(&QDATEJUL 3 3)) || &QTIME) /*D03254*/ CHGVAR (%SUBSTRING(&LDA 113 010)) VALUE(&MBRNAME) /*D03254*/ /* * /*D03254*/ CHGVAR VAR(&EXIST) VALUE('Y') /*D00073*/ CHKOBJ OBJ(COSTWK) OBJTYPE(*FILE) MBR(&MBRNAME) /*P03298*/ MONMSG MSGID(CPF9815) EXEC(CHGVAR VAR(&EXIST) + VALUE('N')) /*P03298*/ IF COND(&EXIST *EQ 'Y') THEN(GOTO CMDLBL(FUNCT60)) /*P03298*/ /* * /*P03298*/ RTVJOBA SWS(&SWS) /*D00073*/ ADDPFM FILE(COSTWK) MBR(&MBRNAME) /*P03298*/ MONMSG MSGID(CPF7306 CPF3213) EXEC(GOTO + CMDLBL(FUNCT60)) /*D00073*/ CALL AXZP20 PARM(&LDA COSTWK01 &MBRNAME + COSTWK & & & & & & & & & & & & & & &) /*P03298*/ /* * /*P03298*/ /*D03254*/ /* * /*D03254*/ OVRDBF FILE(COSTWK) TOFILE(COSTWK) MBR(&MBRNAME) /*D03254*/ /* * /*D03254*/ /* CALL AMDJ7 PARM(&LDA) */ /*D00073*/ /* MANUALLY UPDATE LDA INSTEAD OF CALLING AMDJ7 * /*D03254*/ CVTDAT DATE(&QDATE) TOVAR(&SMDAT) FROMFMT(*SYSVAL) + TOFMT(*YMD) TOSEP(*NONE) CHGVAR (%SUBSTRING(&LDA 26 001)) VALUE('C ') /*P17065*/ CHGVAR (%SUBSTRING(&LDA 26 001)) VALUE('N ') /*P17065*/ CHGVAR (%SUBSTRING(&LDA 30 006)) VALUE('CURREN') /*P17065*/ CHGVAR (%SUBSTRING(&LDA 36 006)) VALUE(&SMDAT) /*P17065*/ CHGVAR (%SUBSTRING(&LDA 42 001)) VALUE('C') /*P17065*/ CHGVAR VAR(%SUBSTRING(&LDA 44 025)) + VALUE('0000000000000000000000000') CHGVAR VAR(%SUBSTRING(&LDA 69 025)) + VALUE('0000000000000000000000000') CHGVAR (%SUBSTRING(&LDA 96 001)) VALUE('2') /*P17065*/ CHGVAR (%SUBSTRING(&LDA 97 001)) VALUE('0') /*P17065*/ CHGVAR (%SUBSTRING(&LDA 123 003)) VALUE(&SITE) /*P17065*/ /* * /*D03254*/ /* * /*D03254*/ /* * /*D00073*/ CALL AXZPSJ PARM(&LDA AMDP41 ) /*D00073*/ IF (%SUBSTRING(&LDA 242 1 ) *EQ 'C') THEN(DO) /*D00073*/ CALL AXZP09 PARM(&LDA & REPORT & & & & &) /*D00073*/ GOTO CMDLBL(ESCAPE) /*D00073*/ ENDDO /*D00073*/ /* */ /*MOD03*/ /* */ /*MOD03*/ /* JOB COMPLETION PROCESSING AND RETURN TO CALLER. */ /*MOD03*/ /* */ /*MOD03*/ ENDCLPGM: /*MOD03*/ CALL PGM(AXZP15) PARM(&LDA) /*MOD03*/ MONMSG MSGID(CPF0000 MCH0000 RPG0000 AXX0000) /*MOD03*/ CHGJOB SWS(00000000) /*P17065*/ EXITPGM: RETURN /*D12346*/ /* */ /*MOD03*/ /* MESSAGE HANDLING. */ /*MOD03*/ /* */ ESCAPE: /*MOD03*/ IF COND(%SUBSTRING(&LDA 270 1) *NE E) THEN(DO) /*MOD03*/ CHGVAR VAR(%SUBSTRING(&LDA 270 1)) VALUE(C) CHGVAR VAR(%SUBSTRING(&LDA 242 1)) VALUE(C) ENDDO /*MOD03*/ GOTO CMDLBL(ENDCLPGM) /*MOD03*/ /*MOD03*/ COPYRGHT: /*MOD03*/ CHGVAR VAR(&COIBM) VALUE(&COIBM) /*MOD03*/ CHGVAR VAR(&VERMOD) VALUE(&VERMOD) ENDPGM /* END CL PGM AMMPWG */ -----Original Message----- From: Ron Hankey/PEMSTAR Inc [mailto:Ron.Hankey@pemstar.com] Sent: Thursday, September 26, 2002 3:11 PM To: MAPICS-L@midrange.com Subject: Submit EPDM cost rollup from the AS/400 job scheduler This is a multipart message in MIME format. -- [ Picked text/plain from multipart/alternative ] Hello We run a current cost rollup once a week and wanted to automate the process by adding an entry to the AS/400 job scheduler. I tried following the MAPICS suggestion which can be found on E-INFO by entering the phrase: Submit MAPICS batch jobs outside of a MAPICS environment This process did not work. So I created a driver program that built the correct LDA values and called AMDP40 which then submitted AMDP41. This works fine as long as I call my driver program from an interactive session. The problem occurs when I add an entry to the job scheduler or try calling the driver from a batch job. When it runs from batch it does not work, I get a JOB TERMINATION LOG with error: AMX0186 JOBACT record deleted for abnormally ended job I can find absolutely nothing in the joblog that looks like a problem. My next step is to strip the MAPICS architecture code out of AMDP41 and call it directly but before I do that. Has anyone else gotten the EPDM cost rollup code to work from the AS/400 job scheduler? Thank You Ron Hankey - CPIM Applications Programmer _______________________________________________ This is the MAPICS ERP System Discussion (MAPICS-L) mailing list To post a message email: MAPICS-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/mapics-l or email: MAPICS-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/mapics-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.