SQL/400: Call CL program

40 pts.
Tags:
AS/400
CL Program
SQL
From stored procedure in SQL/400, I want to call the CL program. I have created the wrapper program for calling CL as SQL procedure.(qcmd). How can I pass the param with quotes to CL program?
SBMJOB CMD(CALL PGM(abc) PARM('parm1' +'parm2 'prtn1')) JOB(prt1) + USER(braha1)
0

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.

Discuss This Question: 2  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.
  • TheRealRaven
    from stored procedure in sql/400 I want to call the cl program I have created the wrapper program for calling cl as sql procedure.(qcmd).

    Is that intended to be one sentence? Or is it two sentences? It looks like it should be "From stored procedure in sql/400, I want to call the cl program." And "I have created the wrapper program for calling cl as sql procedure.(qcmd)."

    If you have a stored proc, please show its definition. Also, please describe what it should do. What is "qcmd" in that sentence?

    How to I pass the param with quotes to cl program SBMJOB CMD(CALL PGM(abc) PARM('parm1' + 'parm2 'prtn1')) JOB(prt1) + USER(braha1

    Is the SBMJOB command a string that you want to pass to your stored proc? Or is it a command that is in your CL program?
    34,440 pointsBadges:
    report
  • gsnag2001
    Thanks I am able submit the job from sql/400
    by passing the string to procedure(EX1CMD).

    1. CREATE PROCEDURE EX1CMD                                    
      (IN CMD CHAR (32000), IN LEN DEC (15,5))                  
      LANGUAGE CL                                               
      NOT DETERMINISTIC                                         
      NO SQL                                                    
      EXTERNAL NAME QSYS/QCMDEXC                                
      PARAMETER STYLE GENERAL                                   

    Now I call this procedure with 

    set cmdvar=                                                          
    'SBMJOB CMD(CALL PGM(FNDPGM1) PARM("DTA" "A1PRINT" ' concat  
             '"fndpg1") JOB(prtbhusa) "USER(bhusa)"'
                 
    SET  LENCMD= LENGTH(TRIM(CMDCHAR));

    call ex1cmd(  cmdvar, LENCMD);    
    10 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.

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

Following

Share this item with your network: