IBM Z and LinuxONE IBM Z

  • 1.  How to check return code of completed job on MVS from USS script?

    Posted Mon October 09, 2023 09:52 AM

    Hi,

    I am dynamically generating a job from a script on USS and submitting the same on MVS using 'submit j <Jobpath/jclfile.jcl>' command. I am able to validate that the job is submitted successfully from within the script.
    I need to check the return code of this job before I proceed with further operations in the script. Can anyone suggest how to get the return code of this completed job from SDSF spool from within the script?



    ------------------------------
    Jayesh Patel
    ------------------------------


  • 2.  RE: How to check return code of completed job on MVS from USS script?

    Posted Tue October 10, 2023 04:17 AM

    Hi,

    I can suggest you to look for SDSF itself, any PANEL you have there you can see the REXX can do the same,

    just type RGEN.

    other way is create a file which you will read from your script with return code, guarantee always run to update the RC.

    Regards



    ------------------------------
    Joao Bertuzzi
    ------------------------------



  • 3.  RE: How to check return code of completed job on MVS from USS script?

    Posted Tue October 10, 2023 05:05 AM

    Hi Joao Bertuzzi,
    Thank you for your reply. I need to see if I can route the job listing to a file and then read the file to get correct RC.



    ------------------------------
    Jayesh Patel
    ------------------------------



  • 4.  RE: How to check return code of completed job on MVS from USS script?

    Posted Tue October 10, 2023 06:43 PM

    I am not saying it is easy, but I *know* that this will work. I use this technique in a product.

     

    I will not post every necessary detail here. This is all documented. Please follow up if you can't find something or if I am unclear.

     

    If you upload your JCL to some dataset on the server system, you can then do SITE FILETYPE JES and GET jcl.dataset local.listing.file. Your FTP client will wait for the job to complete, and then download the three "system" files that you see at the top if you do a ? in SDSF H and put them in local.listing.file.

     

    You can then parse that listing for the remote job return code. Not trivial, but it works perfectly, with no changes to the remote job.

     

    Charles A. Mills | Chief Development Officer

    Phone: 707-291-0908
    Toll Free: 877-245-4322
    Email: Charles.Mills@CloudCompiling.com
    www.CloudCompiling.com

     

     






  • 5.  RE: How to check return code of completed job on MVS from USS script?

    Posted Tue October 10, 2023 10:24 AM

    Hello Jayesh,

    I imagine this is not the exact answer you are looking for, but an alternative way could be to have a final step in your JCL to write a USS file and your scrip will be waiting for that file.

    Paulo Tiziano



    ------------------------------
    Paulo Roberto Pontin Tiziano
    ------------------------------



  • 6.  RE: How to check return code of completed job on MVS from USS script?

    Posted Wed October 11, 2023 09:18 AM

    I suggest you use the jls command from ZOAU.  All you need to provide is the job ID, and you can get the return code, along with other information.

    angio ~> jsub -f short_job.jcl
    J0410176
    angio ~> jls J0410176
    ANGIO HLQ0 J0410176 CC 0000


    ------------------------------
    Anthony Giorgio
    Senior Software Engineer
    IBM
    Poughkeepsie NY
    ------------------------------