ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

regarding the parameter passed in qcmdexc

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

  • regarding the parameter passed in qcmdexc

    hi

    i just submitted the program as batch using QCMDEXC in cobol , here there are two parametere one is numberic and another is reason(alpanumeric) . When the reason is given as some thing like (vinoth's) then the pgm EIE cos of the apostrophe(?) as shown below

    SBMJOB CMD(CALL (APB110) PARM('0000005005' 'VINTOH'S
    ')) JOB( RESEND ) OUTQ(*JOBD)

    please let me know if u have any idea

  • #2
    Re: regarding the parameter passed in qcmdexc

    Do it like this:
    Code:
    SBMJOB CMD(CALL (APB110) PARM('0000005005' 'VINTOH''S')) JOB( RESEND ) OUTQ(*JOBD)
    "Time passes, but sometimes it beats the <crap> out of you as it goes."

    Comment


    • #3
      Re: regarding the parameter passed in qcmdexc

      NO only two parameters will be used , second parameter is a alphanumeric
      so if the parameter contain an apostrophe(‘) then it boms

      SBMJOB CMD(CALL (APB110) PARM('parm1' 'parm2')) JOB( RESEND ) OUTQ(*JOBD)

      Comment


      • #4
        Re: regarding the parameter passed in qcmdexc

        I believe that is would be like:

        SBMJOB CMD(CALL (APB110) PARM('parm1' 'parm'''2')) JOB( RESEND ) OUTQ(*JOBD)

        Otherwise, you're going to need to do a var assigment:

        Parm2 = 'FastOne'''s'
        SBMJOB CMD(CALL (APB110) PARM('parm1' &Parm2)) JOB( RESEND ) OUTQ(*JOBD)

        Comment


        • #5
          Re: regarding the parameter passed in qcmdexc

          Originally posted by vinothkumar View Post
          NO only two parameters will be used , second parameter is a alphanumeric
          so if the parameter contain an apostrophe(?) then it boms

          SBMJOB CMD(CALL (APB110) PARM('parm1' 'parm2')) JOB( RESEND ) OUTQ(*JOBD)
          That is only two parameters. The way you represent the delimiter character within a delimited string is by doubling it. If a string is delimited by single quotes in CL, and you want to have a value that includes a single quote, you mst double up on the single quote character. The system reads this as only one quote.

          You'll see this in other languages as well. Not just CL.
          "Time passes, but sometimes it beats the <crap> out of you as it goes."

          Comment

          Working...
          X