Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] [zos_job_submit] When TYPRUN=SCAN is added to a job the response uses the full wait_time_s #685

Closed
2 tasks done
ddimatos opened this issue Mar 24, 2023 · 1 comment
Assignees
Labels
Bug Something isn't working as designed.

Comments

@ddimatos
Copy link
Collaborator

Is there an existing issue for this?

  • There are no existing issues.

Are the dependencies a supported version?

  • The dependencies are supported.

IBM Z Open Automation Utilities

v1.2.2

IBM Enterprise Python

v3.11.x

IBM z/OS Ansible core Version

v1.5.0

ansible-version

v2.14.x

z/OS version

v2.5

Ansible module

zos_job_submit

Bug description

When submitting JCL that performs only syntax checks by using TYPRUN=SCAN, the submit module did not anticipate the behavior and would fall into the logic that manages the timeout and return a message that is not completely incorrect but could be better. In the timeout logic it runs the duration of time then returns.

JCL:

//TYPESCAN JOB (T043JM,JM00,1,0,0,0),'HELLO WORLD - JRM',CLASS=R,
//             MSGCLASS=X,MSGLEVEL=1,NOTIFY=S0JM,TYPRUN=SCAN
//STEP0001 EXEC PGM=IEBGENER
//SYSIN    DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD *
HELLO, WORLD
/*
//SYSUT2   DD SYSOUT=*
//

Message:

{
   "changed":false,
   "checksum":"426b7e217e4f7954e37c1cd6ec89c4b96c8518fd",
   "dest":"/tmp/ansible.3f_kr_63",
   "duration":20,
   "gid":1,
   "group":"OMVSGRP",
   "jobs":[
      {
         "class":"",
         "content_type":"",
         "ddnames":[
            {
               "byte_count":"133",
               "content":[
                  "1                       J E S 2  J O B  L O G  --  S Y S T E M  S T L 1  --  N O D E  S T L 1",
                  "0     ",
                  " 08.59.00 JOB00575 ---- FRIDAY,    24 MAR 2023 ----",
                  " 08.59.00 JOB00575  IRR010I  USERID OMVSADM  IS ASSIGNED TO THIS JOB.",
                  " 08.59.00 JOB00575  $HASP375 JES2     ESTIMATED  LINES EXCEEDED",
                  "0------ JES2 JOB STATISTICS ------",
                  "0           16 CARDS READ",
                  "0           28 SYSOUT PRINT RECORDS",
                  "0            0 SYSOUT PUNCH RECORDS",
                  "0            1 SYSOUT SPOOL KBYTES",
                  "0         0.00 MINUTES EXECUTION TIME"
               ],
               "ddname":"JESMSGLG",
               "id":"2",
               "proctep":null,
               "record_count":"11",
               "stepname":"JES2"
            },
            {
               "byte_count":"136",
               "content":[
                  "        1 //TYPESCAN    JOB (T043JM,JM00,1,0,0,0),'HELLO WORLD - JRM',            JOB00575",
                  "          //             MSGCLASS=X,MSGLEVEL=1,NOTIFY=&SYSUID,TYPRUN=SCAN",
                  "          //*",
                  "          //* PRINT \"HELLO WORLD\" ON JOB OUTPUT",
                  "          //*",
                  "          //* NOTE THAT THE EXCLAMATION POINT IS INVALID EBCDIC FOR JCL",
                  "          //*   AND WILL CAUSE A JCL ERROR",
                  "          //*",
                  "          IEFC653I SUBSTITUTION JCL - (T043JM,JM00,1,0,0,0),'HELLO WORLD - JRM',MSGCLASS=X,MSGLEVEL=1,NOTIFY=OMVSADM,",
                  "          TYPRUN=SCAN",
                  "        2 //STEP0001 EXEC PGM=IEBGENER",
                  "        3 //SYSIN    DD DUMMY",
                  "        4 //SYSPRINT DD SYSOUT=*",
                  "        5 //SYSUT1   DD *",
                  "        6 //SYSUT2   DD SYSOUT=*",
                  "        7 //SYSIN     DD *               GENERATED STATEMENT"
               ],
               "ddname":"JESJCL",
               "id":"3",
               "proctep":null,
               "record_count":"16",
               "stepname":"JES2"
            }
         ],
         "duration":20,
         "job_id":"JOB00575",
         "job_name":"TYPESCAN",
         "owner":"OMVSADM",
         "ret_code":{
            "code":null,
            "msg":"? ?",
            "msg_code":"?",
            "msg_text":"?",
            "steps":[
               
            ]
         },
         "subsystem":"STL1",
         "system":"STL1"
      }
   ],
   "md5sum":"631eb40dd956540fafc51fe25aebbd95",
   "mode":"0600",
   "msg":"The JCL submitted with job id JOB00575 but appears to be a long running job that exceeded its maximum wait time of 20 second(s). Consider using module zos_job_query to poll for a long running job or increase option 'wait_times_s` to a value greater than 20.",
   "owner":"OBAGAOI",
   "size":1014,
   "src":"/.ansible/tmp/ansible-tmp-1679673535.558648-37436-52490435523066/source",
   "state":"file",
   "uid":0
}

Playbook verbosity output.

No response

Ansible configuration.

No response

Contents of the inventory

No response

Contents of group_vars or host_vars

No response

@ddimatos ddimatos added the Bug Something isn't working as designed. label Mar 24, 2023
@ddimatos ddimatos moved this to 🔍 Validation in IBM Ansible z/OS Core Collection Mar 24, 2023
@ddimatos
Copy link
Collaborator Author

Updated fix not returns:

   "msg":"The JCL submitted with job id JOB00620 but there was an error, please review the error for further details: The job return code was not available in the job log, please review the job log and error ? ?.",

Full response:

{
   "changed":false,
   "checksum":"426b7e217e4f7954e37c1cd6ec89c4b96c8518fd",
   "dest":"/tmp/ansible.phthp3gl",
   "duration":0,
   "gid":1,
   "group":"OMVSGRP",
   "jobs":[
      {
         "class":"",
         "content_type":"",
         "ddnames":[
            {
               "byte_count":"133",
               "content":[
                  "1                       J E S 2  J O B  L O G  --  S Y S T E M  S T L 1  --  N O D E  S T L 1",
                  "0     ",
                  " 11.41.16 JOB00620 ---- FRIDAY,    24 MAR 2023 ----",
                  " 11.41.16 JOB00620  IRR010I  USERID OMVSADM  IS ASSIGNED TO THIS JOB.",
                  " 11.41.16 JOB00620  $HASP375 JES2     ESTIMATED  LINES EXCEEDED",
                  "0------ JES2 JOB STATISTICS ------",
                  "0           16 CARDS READ",
                  "0           28 SYSOUT PRINT RECORDS",
                  "0            0 SYSOUT PUNCH RECORDS",
                  "0            1 SYSOUT SPOOL KBYTES",
                  "0         0.00 MINUTES EXECUTION TIME"
               ],
               "ddname":"JESMSGLG",
               "id":"2",
               "proctep":null,
               "record_count":"11",
               "stepname":"JES2"
            },
            {
               "byte_count":"136",
               "content":[
                  "        1 //TYPESCAN    JOB (T043JM,JM00,1,0,0,0),'HELLO WORLD - JRM',            JOB00620",
                  "          //             MSGCLASS=X,MSGLEVEL=1,NOTIFY=&SYSUID,TYPRUN=SCAN",
                  "          //*",
                  "          //* PRINT \"HELLO WORLD\" ON JOB OUTPUT",
                  "          //*",
                  "          //* NOTE THAT THE EXCLAMATION POINT IS INVALID EBCDIC FOR JCL",
                  "          //*   AND WILL CAUSE A JCL ERROR",
                  "          //*",
                  "          IEFC653I SUBSTITUTION JCL - (T043JM,JM00,1,0,0,0),'HELLO WORLD - JRM',MSGCLASS=X,MSGLEVEL=1,NOTIFY=OMVSADM,",
                  "          TYPRUN=SCAN",
                  "        2 //STEP0001 EXEC PGM=IEBGENER",
                  "        3 //SYSIN    DD DUMMY",
                  "        4 //SYSPRINT DD SYSOUT=*",
                  "        5 //SYSUT1   DD *",
                  "        6 //SYSUT2   DD SYSOUT=*",
                  "        7 //SYSIN     DD *               GENERATED STATEMENT"
               ],
               "ddname":"JESJCL",
               "id":"3",
               "proctep":null,
               "record_count":"16",
               "stepname":"JES2"
            }
         ],
         "duration":1,
         "job_id":"JOB00620",
         "job_name":"TYPESCAN",
         "owner":"OMVSADM",
         "ret_code":{
            "code":null,
            "msg":"? ?",
            "msg_code":"?",
            "msg_text":"?",
            "steps":[
               
            ]
         },
         "subsystem":"STL1",
         "system":"STL1"
      }
   ],
   "md5sum":"631eb40dd956540fafc51fe25aebbd95",
   "mode":"0600",
   "msg":"The JCL submitted with job id JOB00620 but there was an error, please review the error for further details: The job return code was not available in the job log, please review the job log and error ? ?.",
   "owner":"OBAGAOI",
   "size":1014,
   "src":"/.ansible/tmp/ansible-tmp-1679683270.5449758-47921-167891778315519/source",
   "state":"file",
   "uid":0
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working as designed.
Projects
Development

No branches or pull requests

2 participants