addjobscde

20 pts.
Tags:
ADDJOBSCDE
hi: i'm trying execute addjobscde inside a cl program. it run ok when scdday has an only day (*mon by example), when scdday has several days it reports an cpf0001. i'm using the below cl, and parameters' values before the call are : - &nombre = 'JSTJOLLOL' - &lib = 'ALMV20' - &prog = 'DCAB10B ' - &ndes = 'EXPEDICIONES@JOLCA.ES' - &frec = '*MONTHLY ' - &dias = '*TUE *WED ' ' ' - &hor = '190000' - &orden = '1 ' best regards. thanks very much beforehand. *********************************************************************************** PGM PARM(&INF &CLI &DES &NDES &FEC &HOR &DIAS + &TP &DRM) DCL VAR(&INF) TYPE(*CHAR) LEN(3) DCL VAR(&CLI) TYPE(*CHAR) LEN(3) DCL VAR(&DES) TYPE(*CHAR) LEN(3) DCL VAR(&NDES) TYPE(*CHAR) LEN(30) DCL VAR(&FEC) TYPE(*CHAR) LEN(10) DCL VAR(&HOR) TYPE(*CHAR) LEN(6) DCL VAR(&DIAS) TYPE(*CHAR) LEN(70) DCL VAR(&TP) TYPE(*CHAR) LEN(1) DCL VAR(&DRM) TYPE(*CHAR) LEN(50) DCL VAR(&ORDEN) TYPE(*CHAR) LEN(50) /* */ DCL VAR(&NOMBRE) TYPE(*CHAR) LEN(9) DCL VAR(&FREC) TYPE(*CHAR) LEN(10) DCL VAR(&DIAP) TYPE(*CHAR) LEN(70) DCL VAR(&MANDATO) TYPE(*CHAR) LEN(220) DCL VAR(&LIB) TYPE(*CHAR) LEN(6) VALUE('ALMV20') DCL VAR(&PROG) TYPE(*CHAR) LEN(8) /* */ CHGVAR VAR(&NOMBRE) VALUE(' ') CHGVAR VAR(&MANDATO) VALUE(' ') CHGVAR VAR(&FREC) VALUE(' ') CHGVAR VAR(&DIAP) VALUE(' ') CHGVAR VAR(&ORDEN) VALUE(' ') CHGVAR VAR(&NOMBRE) VALUE(&INF *CAT &CLI *CAT &DES) /* LLAMADAS A PROGRAMAS */ IF COND(&INF *EQ 'JST') THEN(DO) CHGVAR VAR(&PROG) VALUE('DCAB10B') ENDDO IF COND(&INF *EQ 'SRV') THEN(DO) CHGVAR VAR(&PROG) VALUE('DCAB80B') ENDDO /* PLANIF. MENSUAL */ IF COND(&TP *EQ 'M') THEN(DO) CHGVAR VAR(&FREC) VALUE('*MONTHLY') IF COND(&DRM *EQ 'U') THEN(DO) CHGVAR VAR(&ORDEN) VALUE('*LAST') ENDDO ELSE DO CHGVAR VAR(&ORDEN) VALUE(&DRM) ENDDO ADDJOBSCDE JOB(&NOMBRE) CMD(CALL PGM(&LIB/&PROG) + PARM(&NDES)) FRQ(&FREC) SCDDATE(*NONE) SCDDAY(*TUE) + SCDTIME(&HOR) RELDAYMON(&ORDEN) MONMSG MSGID(CPF9999) ENDDO /* */ RCLRSC /* */ DLTOVR FILE(*ALL) /* */ ENDPGM 

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    ...when scdday has several days it reports an cpf0001. i'm using the below cl, and parameters' values before the call are : ... &dias = '*TUE *WED '   Your example CL doesn't show that variable &DIAS is used. Since it isn't used, there shouldn't be any error at all. What line signals the error?   Tom
    125,585 pointsBadges:
    report
  • ToddN2000
    My question is why add the entries with a CL program? The scheduled jobs should not be changing much once set up to run.  I doubt you will be running this program more than once. Let me know if I'm wrong thinking that. Are you trying to load a lot of jobs programmatically instead of manually ?  It looks like you are running this with passed parameters. Where are the coming from? If a job is already in the scheduler how do you handle the error?  Just curious
    11,245 pointsBadges:
    report
  • WoodEngineer
    I suspect the problem occurs because there are multiple days coded in a single variable.  If you are using that variable directly in the ADDJOBSCDE command it will not pass the commands edit check.  It treats the parm as a single day value which of course fails when it contains multiple days.  A technique we use is to assemble the command in a long character variable, then execute this code in your CL: CALL       PGM(QCMDEXC) PARM(&CMD &CmdLen)  
    6,680 pointsBadges:
    report
  • TomLiotta
    I suspect the problem occurs because there are multiple days coded in a single variable.   That's a common cause, but it's not what's happening in the code that's shown.. I'd like the OP to participate, though, so that a good explanation of why the problem happens and a couple of techniques for fixing it can be added while making sure the OP learns from it.   The first major item would be seeing code from the OP that actually causes the error. What was posted shouldn't do it. However, the problem reported by the OP might be on the CALL to this program. Without more contribution of effort, it's not going to be fixed when we don't know what's wrong.   Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following