Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2003
    Location
    Am Ende der Welt
    Posts
    12

    Unanswered: Use of SYSIBM.ADMIN_JOB_SUBMIT stored procedure (DB2 for z/Os)

    I would appreciate if someone can provide examples on how to use the stored procedure SYSPROC.ADMIN_JOB_SUBMIT to submit the execution of a JCL.
    I couldn't find useful examples within the official IBM documentation.

    Thanks!

    César

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Have a look at the manual. There is a full example in there: DB2 10 - Administration - ADMIN_JOB_SUBMIT stored procedure

    Basically, you create the JCL and insert into into SYSIBM.JOB_JCL. Then you call the stored proc. Pretty straight-forward.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  3. #3
    Join Date
    Nov 2003
    Location
    Am Ende der Welt
    Posts
    12

    Use of SYSPROC.ADMIN_JOB_SUBMIT stored procedure (DB2 for z/Os)

    Knut, thank you for your reply.

    Unfortunately the only example in the documentation is a C program and I just want to execute only SQL code, without having to compile source code written in a different language than SQL.

    I've tried inserting a row in the SYSIBM.JOB_JCL global temporary table before the line that executes SYSPROC.ADMIN_JOB_SUBMIT but it didn't work. This is the code I'm testing:

    insert into sysibm.job_jcl values (1, 'DB2.SAPP.JCLLIB(LISTDEF)');
    call sysproc.admin_job_submit(<user>, <password>, ?, ?, ?);

    and this is the error I get:

    1 row(s) affected.

    JOB_ID RETURN_CODE MSG
    [NULL] 12 DSNA618I DSNADMJS SQL ERROR DURING SQL STATEMENT FETCH, TABLE=SYSIBM.JOB_JCL…DSNT404I SQLCODE = 100, NOT FOUND: ROW NOT FOUND FOR FETCH, UPDATE, OR DELETE, OR THE RESULT OF A QUERY IS AN EMPTY…TABLE…DSNT418I SQLSTATE = 02000 SQLSTATE RETURN CODE…DSNT415I SQLERRP = DSNXRFF SQL PROCEDURE DETECTING ERROR…DSNT416I SQLERRD = -110 0 0 -1 0 0 SQL DIAGNOSTIC INFORMATION…DSNT416I SQLERRD = X'FFFFFF92' X'00000000' X'00000000' X'FFFFFFFF' X'00000000' X'00000000' SQL DIAGNOSTIC…INFORMATION…

    Any suggestions?

    Thanks

    César

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by cbuzzo View Post
    insert into sysibm.job_jcl values (1, 'DB2.SAPP.JCLLIB(LISTDEF)');
    Does not look like a valid JCL statement to me.

  5. #5
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    The thing is that you can't call stored procs via SPUFI, for example. The C code is just the vehicle for that. You can extract the SQL statements and run them on a DB2 client or whichever way you like.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  6. #6
    Join Date
    Nov 2003
    Location
    Am Ende der Welt
    Posts
    12

    Use of SYSPROC.ADMIN_JOB_SUBMIT stored procedure (DB2 for z/Os)

    But I can execute for example other stored procedures in the same way, for example ADMIN_COMMAND_DB2. For example I use this code to get thread information, with a call to a stored procedure:

    call sysproc.admin_command_db2('-dis thd(*) detail limit(*)',27,THD,null,?,?,?,?,?,?,?,?);

    Now, going back to ADMIN_JOB_SUBMIT, I've made some progress with this and as n_i correctly pointed out, the text I was trying to insert into SYSIBM.JOB_JCL was not JCL code, so I tried with this code:

    delete from sysibm.job_jcl;
    insert into sysibm.job_jcl values ( 1, '//PS39LIST JOB CLASS=A,MSGCLASS=X,NOTIFY=PS39,COND=(04,LT),REGION =64M');
    insert into sysibm.job_jcl values ( 2, '/*JOBPARM S=SAP3');
    insert into sysibm.job_jcl values ( 3, '//LISTDEF EXEC DB2UPROC,SYSTEM=E1P1,UTPROC='',');
    insert into sysibm.job_jcl values ( 4, '// UID=E1P1LDEF');
    insert into sysibm.job_jcl values ( 5, '//SYSPRINT DD SYSOUT=*');
    insert into sysibm.job_jcl values ( 6, '//LISTA DD SYSOUT=*');
    insert into sysibm.job_jcl values ( 7, '//SYSIN DD *');
    insert into sysibm.job_jcl values ( 8, 'OPTIONS LISTDEFDD LISTA PREVIEW');
    insert into sysibm.job_jcl values ( 9, 'LISTDEF MOLINA');
    insert into sysibm.job_jcl values (10, 'INCLUDE DATABASE A2* TABLESPACES BASE');

    call sysproc.admin_job_submit(PS38, <password>, ?, ?, ?);

    And I got this new error message:

    DSNA626I DSNADMJS THE __login() FUNCTION CALL IS UNSUCCESSFUL, IDENTITY=PS38, EDC5139I Operation not permitted. (errno2=0x130102AF)

    With this message in hand, I found this related link:

    IBM II13698: USING THE DB2 STORED PROCEDURES DSNACCJF, DSNACCJP, DSNACCJQ, DSNACCJS, AND DSNACCUC. - United States

    So, I'm going to ask the RACF administrator if there's anything he can do about it.

    Yes, it seem's a long way to get there!

    Any suggestions are always welcome.

    César

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •