ibm.ibm_zos_core.zos_job_output (1.3.6) — module

Display job output

| "added in version" 1.0.0 of ibm.ibm_zos_core"

Authors: Jack Ho (@jacklotusho)

Install collection

Install with ansible-galaxy collection install ibm.ibm_zos_core:==1.3.6


Add to requirements.yml

  collections:
    - name: ibm.ibm_zos_core
      version: 1.3.6

Description

Display the z/OS job output for a given criteria (Job id/Job name/owner) with/without a data definition name as a filter.

At least provide a job id/job name/owner.

The job id can be specific such as "STC02560", or one that uses a pattern such as "STC*" or "*".

The job name can be specific such as "TCPIP", or one that uses a pattern such as "TCP*" or "*".

The owner can be specific such as "IBMUSER", or one that uses a pattern like "*".

If there is no ddname, or if ddname="?", output of all the ddnames under the given job will be displayed.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Job output with ddname
  zos_job_output:
    job_id: "STC02560"
    ddname: "JESMSGLG"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: JES Job output without ddname
  zos_job_output:
    job_id: "STC02560"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: JES Job output with all ddnames
  zos_job_output:
    job_id: "STC*"
    job_name: "*"
    owner: "IBMUSER"
    ddname: "?"

Inputs

    
owner:
    description:
    - The owner who ran the job. (e.g "IBMUSER", "*")
    required: false
    type: str

ddname:
    description:
    - Data definition name. (e.g "JESJCL", "?")
    required: false
    type: str

job_id:
    description:
    - The z/OS job ID of the job containing the spool file. (e.g "STC02560", "STC*")
    required: false
    type: str

job_name:
    description:
    - The name of the batch job. (e.g "TCPIP", "C*")
    required: false
    type: str

Outputs

changed:
  description: Indicates if any changes were made during module operation
  returned: on success
  type: bool
jobs:
  contains:
    class:
      description: Identifies the data set used in a system output data set, usually
        called a sysout data set.
      sample: null
      type: str
    content_type:
      description: Type of address space.
      sample: JOB
      type: str
    ddnames:
      contains:
        byte_count:
          description: Byte size in a print data set.
          sample: 574
          type: int
        content:
          description: The ddname content.
          sample:
          - "\_\_\_\_\_\_\_\_ 1 //HELLO\_\_\_ JOB (T043JM,JM00,1,0,0,0),'HELLO WORLD\
            \ - JRM',CLASS=R,\_\_\_\_\_\_ JOB00134"
          - "\_\_\_\_\_\_\_\_\_\_\_    \"\_\_\_\_\_\_\_\_\_\_ //\_\_\_\_\_\_\_\_\_\
            \_\_\_ MSGCLASS=X"
          - MSGLEVEL=1
          - "NOTIFY=S0JM\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\
            \_\_ \""
          - "\_\_\_\_\_\_\_\_\_\_\_    \"\_\_\_\_\_\_ \_\_\_ //*\_\_\_\_\_\_\_\_\_\
            \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\
            \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ \""
          - "\_\_\_\_\_\_\_\_\_\_\_    \"\_\_\_\_\_\_\_\_\_\_ //* PRINT \\\"HELLO\
            \ WORLD\\\" ON JOB OUTPUT\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\
            \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\""
          - "\_\_\_\_\_\_\_\_\_\_\_    \"\_\_\_\_\_\_\_\_\_\_ //*\_\_\_\_\_\_\_\_\_\
            \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\
            \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ \""
          - "\_\_\_\_\_\_\_\_\_\_\_    \"\_\_\_\_\_\_\_\_\_\_ //* NOTE THAT THE EXCLAMATION\
            \ POINT IS INVALID EBCDIC FOR JCL\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\
            \ \""
          - "\_\_\_\_\_\_\_\_\_\_\_    \"\_\_\_\_\_\_\_\_\_\_ //*\_\_ AND WILL CAUSE\
            \ A JCL ERROR\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\
            \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ \""
          - "\_\_\_\_\_\_\_\_\_\_\_    \"\_\_\_\_\_\_\_\_\_\_ //*\_\_\_\_\_\_\_\_\_\
            \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\
            \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ \""
          - "\_\_\_\_\_\_\_\_\_\_\_    \"\_\_\_\_\_\_\_\_ 2 //STEP0001 EXEC PGM=IEBGENER\_\
            \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\
            \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ \""
          - "\_\_\_\_\_\_\_\_\_\_\_    \"\_\_\_\_\_\_\_\_ 3 //SYSIN\_\_\_ DD DUMMY\_\
            \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\
            \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ \""
          - "\_\_\_\_\_\_\_\_\_\_\_    \"\_\_\_\_\_\_\_\_ 4 //SYSPRINT DD SYSOUT=*\_\
            \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\
            \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ \""
          - "\_\_\_\_\_\_\_\_\_\_\_    \"\_\_\_\_\_\_\_\_ 5 //SYSUT1\_\_ DD *\_\_\_\
            \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\
            \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ \""
          - "\_\_\_\_\_\_\_\_\_\_\_    \"\_\_\_\_\_\_\_\_ 6 //SYSUT2\_\_ DD SYSOUT=*\_\
            \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\
            \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ \""
          - "\_\_\_\_\_\_\_\_\_\_\_    \"\_\_\_\_\_\_\_\_ 7 //\_\_\_\_\_\_\_\_\_\_\
            \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\
            \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ \" \_\
            \_\_\_\_\_\_\_\_"
          type: list[str]
        ddname:
          description: Data definition name.
          sample: JESMSGLG
          type: str
        id:
          description: The file ID.
          sample: 2
          type: str
        procstep:
          description: Identifies the set of statements inside JCL grouped together
            to perform a particular function.
          sample: PROC1
          type: str
        record_count:
          description: Count of the number of lines in a print data set.
          sample: 17
          type: int
        stepname:
          description: A step name is name that identifies the job step so that other
            JCL statements or the operating system can refer to it.
          sample: JES2
          type: str
      description: Data definition names.
      elements: dict
      type: list
    job_id:
      description: The z/OS job ID of the job containing the spool file.
      sample: JOB00134
      type: str
    job_name:
      description: The name of the batch job.
      sample: HELLO
      type: str
    ret_code:
      contains:
        code:
          description: Return code converted to integer value (when possible).
          sample: 0
          type: int
        msg:
          description: Return code or abend resulting from the job submission.
          sample: CC 0000
          type: str
        msg_code:
          description: Return code extracted from the `msg` so that it can better
            evaluated. For example , ABEND(S0C4) would yield ""S0C4".
          sample: S0C4
          type: str
        msg_txt:
          description: Returns additional information related to the job.
          sample: 'No job can be located with this job name: HELLO'
          type: str
      description: Return code output collected from job log.
      sample:
      - code: 0
      - msg: CC 0000
      - msg_code: '0000'
      - msg_txt: ''
      type: dict
    subsystem:
      description: The job entry subsystem that MVS uses to do work.
      sample: STL1
      type: str
  description: List of jobs output.
  elements: dict
  returned: success
  sample:
  - class: R
    content_type: JOB
    ddnames:
    - byte_count: '775'
      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 '
      - ' 10.25.48 JOB00134 ---- TUESDAY,   18 FEB 2020 ----'
      - ' 10.25.48 JOB00134  IRR010I  USERID OMVSADM  IS ASSIGNED TO THIS JOB.'
      - ' 10.25.48 JOB00134  $HASP375 JES2     ESTIMATED  LINES EXCEEDED'
      - ' 10.25.48 JOB00134  ICH70001I OMVSADM  LAST ACCESS AT 10:25:47 ON TUESDAY,
        FEBRUARY 18, 2020'
      - ' 10.25.48 JOB00134  $HASP375 HELLO    ESTIMATED  LINES EXCEEDED'
      - ' 10.25.48 JOB00134  $HASP373 HELLO    STARTED - INIT 3    - CLASS R        -
        SYS STL1'
      - ' 10.25.48 JOB00134  SMF000I  HELLO       STEP0001    IEBGENER    0000'
      - ' 10.25.48 JOB00134  $HASP395 HELLO    ENDED - RC=0000'
      - 0------ JES2 JOB STATISTICS ------
      - '-  18 FEB 2020 JOB EXECUTION DATE'
      - '-           16 CARDS READ'
      - '-           59 SYSOUT PRINT RECORDS'
      - '-            0 SYSOUT PUNCH RECORDS'
      - '-            6 SYSOUT SPOOL KBYTES'
      - '-         0.00 MINUTES EXECUTION TIME'
      ddname: JESMSGLG
      id: '2'
      procstep: ''
      record_count: '17'
      stepname: JES2
    - byte_count: '574'
      content:
      - '         1 //HELLO    JOB (T043JM,JM00,1,0,0,0),''HELLO WORLD - JRM'',CLASS=R,       JOB00134'
      - '           //             MSGCLASS=X,MSGLEVEL=1,NOTIFY=S0JM                                '
      - '           //*                                                                             '
      - '           //* PRINT "HELLO WORLD" ON JOB OUTPUT                                           '
      - '           //*                                                                             '
      - '           //* NOTE THAT THE EXCLAMATION POINT IS INVALID EBCDIC FOR JCL                   '
      - '           //*   AND WILL CAUSE A JCL ERROR                                                '
      - '           //*                                                                             '
      - '         2 //STEP0001 EXEC PGM=IEBGENER                                                    '
      - '         3 //SYSIN    DD DUMMY                                                             '
      - '         4 //SYSPRINT DD SYSOUT=*                                                          '
      - '         5 //SYSUT1   DD *                                                                 '
      - '         6 //SYSUT2   DD SYSOUT=*                                                          '
      - '         7 //                                                                              '
      ddname: JESJCL
      id: '3'
      procstep: ''
      record_count: '14'
      stepname: JES2
    - byte_count: '1066'
      content:
      - ' ICH70001I OMVSADM  LAST ACCESS AT 10:25:47 ON TUESDAY, FEBRUARY 18, 2020'
      - ' IEF236I ALLOC. FOR HELLO STEP0001'
      - ' IEF237I DMY  ALLOCATED TO SYSIN'
      - ' IEF237I JES2 ALLOCATED TO SYSPRINT'
      - ' IEF237I JES2 ALLOCATED TO SYSUT1'
      - ' IEF237I JES2 ALLOCATED TO SYSUT2'
      - ' IEF142I HELLO STEP0001 - STEP WAS EXECUTED - COND CODE 0000'
      - ' IEF285I   OMVSADM.HELLO.JOB00134.D0000102.?            SYSOUT        '
      - ' IEF285I   OMVSADM.HELLO.JOB00134.D0000101.?            SYSIN         '
      - ' IEF285I   OMVSADM.HELLO.JOB00134.D0000103.?            SYSOUT        '
      - ' IEF373I STEP/STEP0001/START 2020049.1025'
      - ' IEF032I STEP/STEP0001/STOP  2020049.1025 '
      - '         CPU:     0 HR  00 MIN  00.00 SEC    SRB:     0 HR  00 MIN  00.00
        SEC    '
      - '         VIRT:    60K  SYS:   240K  EXT:        0K  SYS:    11548K'
      - '         ATB- REAL:                     8K  SLOTS:                     0K'
      - '              VIRT- ALLOC:      10M SHRD:       0M'
      - ' IEF375I  JOB/HELLO   /START 2020049.1025'
      - ' IEF033I  JOB/HELLO   /STOP  2020049.1025 '
      - '         CPU:     0 HR  00 MIN  00.00 SEC    SRB:     0 HR  00 MIN  00.00
        SEC    '
      ddname: JESYSMSG
      id: '4'
      procstep: ''
      record_count: '19'
      stepname: JES2
    - byte_count: '251'
      content:
      - '1DATA SET UTILITY - GENERATE                                                                       PAGE
        0001             '
      - '-IEB352I WARNING: ONE OR MORE OF THE OUTPUT DCB PARMS COPIED FROM INPUT                                                  '
      - '                                                                                                                         '
      - ' PROCESSING ENDED AT EOD                                                                                                 '
      ddname: SYSPRINT
      id: '102'
      procstep: ''
      record_count: '4'
      stepname: STEP0001
    - byte_count: '49'
      content:
      - ' HELLO, WORLD                                                                    '
      ddname: SYSUT2
      id: '103'
      procstep: ''
      record_count: '1'
      stepname: STEP0001
    job_id: JOB00134
    job_name: HELLO
    owner: OMVSADM
    ret_code:
      code: 0
      msg: CC 0000
      msg_code: '0000'
      msg_txt: ''
    subsystem: STL1
  type: list