ibm.ibm_zos_core.zos_job_output (1.9.0) — module

Display job output

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

Authors: Jack Ho (@jacklotusho), Demetrios Dimatos (@ddimatos), Rich Parker (@richp405)

Install collection

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


Add to requirements.yml

  collections:
    - name: ibm.ibm_zos_core
      version: 1.9.0

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 (show only this DD on a found job). (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:
    asid:
      description: The address Space Identifier (ASID) that is a unique descriptor
        for the job address space. Zero if not active.
      sample: 0
      type: int
    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
    creation_date:
      description: Date, local to the target system, when the job was created.
      sample: '2023-05-04'
      type: str
    creation_time:
      description: Time, local to the target system, when the job was created.
      sample: '14:15:00'
      type: str
    ddnames:
      contains:
        byte_count:
          description: Byte size in a print data set.
          sample: 574
          type: int
        content:
          description: The ddname content.
          elements: str
          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
        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_class:
      description: Job class for this job.
      sample: A
      type: str
    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
    priority:
      description: A numeric indicator of the job priority assigned through JES.
      sample: 4
      type: int
    program_name:
      description: The name of the program found in the job's last completed step
        found in the PGM parameter. Returned when Z Open Automation Utilities (ZOAU)
        is 1.2.4 or later.
      sample: IEBGENER
      type: str
    queue_position:
      description: The position within the job queue where the jobs resides.
      sample: 3
      type: int
    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 be 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
        steps:
          contains:
            step_cc:
              description: The CC returned for this step in the DD section.
              sample: 0
              type: int
            step_name:
              description: Name of the step shown as "was executed" in the DD section.
              sample: STEP0001
              type: str
          description: Series of JCL steps that were executed and their return codes.
          elements: dict
          type: list
      description: Return code output collected from job log.
      sample:
        ret_code:
          code: 0
          msg: CC 0000
          msg_code: '0000'
          msg_txt: ''
          steps:
          - step_cc: 0
            step_name: STEP0001
      type: dict
    subsystem:
      description: The job entry subsystem that MVS uses to do work.
      sample: STL1
      type: str
    svc_class:
      description: Service class for this job.
      sample: C
      type: str
  description: The output information for a list of jobs matching specified criteria.
    If no job status is found, this will return ret_code dictionary with parameter
    msg_txt = The job could not be found.
  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
    duration: 0
    job_class: R
    job_id: JOB00134
    job_name: HELLO
    owner: OMVSADM
    priority: '1'
    program_name: IEBGENER
    queue_position: '58'
    ret_code:
      code: 0
      msg: CC 0000
      msg_code: '0000'
      msg_txt: ''
      steps:
      - step_cc: 0
        step_name: STEP0001
    subsystem: STL1
  type: list