ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

SBMJOB Command

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SBMJOB Command

    Hi!

    I created a source for a command, woth the name MYCMD


    CMD
    PARM KWD(YEARMI1) TYPE(*DEC) LEN(8 0)
    PARM KWD(YEARMF1) TYPE(*DEC) LEN(8 0)
    PARM KWD(YEARMI2) TYPE(*DEC) LEN(8 0)
    PARM KWD(YEARMF2) TYPE(*DEC) LEN(8 0)

    CRTCMD CMD(MYLIB/MYCMD) PGM(MYLIB/MYCLPGM) SRCFILE(MYLIB/QCMDS
    RC)


    Then i created a CL program, with the name MYCLPGM, that make's de sbmjob of that command :
    PGM
    DCLF FILE(MYDSPF)
    DCL VAR(&YEARMI1) TYPE(*DEC) LEN(8 0)
    DCL VAR(&YEARMF1) TYPE(*DEC) LEN(8 0)
    DCL VAR(&YEARMI2) TYPE(*DEC) LEN(8 0)
    DCL VAR(&YEARMF2) TYPE(*DEC) LEN(8 0)
    SNDRCVF RCDFMT(RMYDSPF)
    SBMJOB CMD(MYCMD YEARMI1(&YEARMI1) +
    YEARMF1(&YEARMF1) YEARMI2(&YEARMI2) +
    YEARMF2(&YEARMF2))
    ENDPGM

    When i execute the CL program, apears in the spool a log:

    The number of parameters in the definition of the command does not correspond to the
    number of parameters in the processing of the command or in the program of the verifiyer of the validity
    MYCLPGM in the library MYLIB.


    I have already wasted much time whit this CL and i cannot see where's the problem. Is the command not be executed correctly?

    Need help, urgently

  • #2
    Re: SBMJOB Command

    Hi, in your command you have 4 parms.
    Your cl needs to accept these parms;
    PHP Code:
    pgm  Pamr(&YEARMI1 &YEARMF1 &YEARMI2&YEARMF2
    that should do it.
    Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

    Comment


    • #3
      Re: SBMJOB Command

      Thanks, your hint is correct but since i have a command that is in the sbmjob and the values are obtained from the dspf (user entry), i can not have parameters in the cl.

      However, i already saw what was wrong. When i made the CRTCMD i put a wrong CPP (comand process program). It must be another then the CL. After all, it must be the program that the sbmjob call's.

      Sorry for my mistake. It was like the times, that when we go away is when we find the solution.

      Thanks anyway.

      Comment

      Working...
      X