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_find] Cannot find VSAM index or data if it does not end with ".INDEX" or ".DATA" respectively #1777

Open
1 task done
fernandofloresg opened this issue Oct 31, 2024 · 0 comments
Labels
Backlog Bug Something isn't working as designed.

Comments

@fernandofloresg
Copy link
Collaborator

fernandofloresg commented Oct 31, 2024

Is there an existing issue for this?

  • There are no existing issues.

Bug description

zos_find will not find a vis index if is not named "INDEX". 'Just changing the name into "KSINDEX" will break it.

Create a VSAM data set with custom INDEX and DATA components

//CREKSDS    JOB (T043JM,JM00,1,0,0,0),'CREATE KSDS',CLASS=R,
//             MSGCLASS=X,MSGLEVEL=1,NOTIFY=OMVSADM
//STEP1  EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=A
//SYSIN    DD  *
   DEFINE CLUSTER (NAME(OMVSADM.TEST.KSDS) -
   INDEXED                                 -
   KEYS(6 1)                               -
   RECSZ(80 80)                            -
   TRACKS(1,1)                             -
   CISZ(4096)                              -
   FREESPACE(3 3)                          -
   VOLUMES(000000) )                       -
   DATA (NAME(OMVSADM.TEST.KSDS.KSDATA))     -
   INDEX (NAME(OMVSADM.TEST.KSDS.KSINDEX))
/*

The following is a playbook finding a cluster

---
- hosts: zvm
  collections:
    - ibm.ibm_zos_core
  gather_facts: false
  vars:
    ZOAU: "/zoau/v1.3.3"
    PYZ: "/allpython/3.11/usr/lpp/IBM/cyp/v3r11/pyz"

  environment: "{{ environment_vars }}"

  tasks:
    - name: Archive multiple data sets into a new GDS
      zos_find:
        patterns:
          - OMVSADM.TEST.*
        resource_type: cluster
      register: result

    - name: print zos_job_submit return values
      debug:
        msg: "{{ result }}"
---
- hosts: zvm
  collections:
    - ibm.ibm_zos_core
  gather_facts: false
  vars:
    ZOAU: "/zoau/v1.3.3"
    PYZ: "/allpython/3.11/usr/lpp/IBM/cyp/v3r11/pyz"

  environment: "{{ environment_vars }}"

  tasks:
    - name: Archive multiple data sets into a new GDS
      zos_find:
        patterns:
          - OMVSADM.TEST.*
        resource_type: index
      register: result

    - name: print zos_job_submit return values
      debug:
        msg: "{{ result }}"

this is the result

TASK [Archive multiple data sets into a new GDS] ****************************************************************************************

ok: [zvm]

TASK [print zos_job_submit return values] ***********************************************************************************************
ok: [zvm] => {
    "msg": {
        "changed": false,
        "data_sets": [
            {
                "name": "OMVSADM.TEST.KSDS",
                "type": "CLUSTER"
            },
            {
                "name": "OMVSADM.TEST.KSDS.KSDATA",
                "type": "CLUSTER"
            },
            {
                "name": "OMVSADM.TEST.KSDS.KSINDEX",
                "type": "CLUSTER"
            }
        ],
        "examined": 3,
        "failed": false,
        "matched": 3
    }
}

PLAY RECAP ******************************************************************************************************************************
zvm                        : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   



But when you search for the same INDEX component

PLAY [zvm] ******************************************************************************************************************************

TASK [Archive multiple data sets into a new GDS] ****************************************************************************************



ok: [zvm]

TASK [print zos_job_submit return values] ***********************************************************************************************
ok: [zvm] => {
    "msg": {
        "changed": false,
        "data_sets": [],
        "failed": false,
        "matched": 0
    }
}

PLAY RECAP ******************************************************************************************************************************
zvm                        : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

The same is true when resource_type is data

This can be modified in the following function :

def _vls_wrapper(pattern, details=False, verbose=False):

dls with option type can be used for this purpose, in the future, ZOAU vls will be just a wrapper for dls

[ OMVSADM:/u/omvsadm: ]dls -tCLUSTER omvsadm.*
OMVSADM.TEST.KSDS
OMVSADM.TEST.KSDS.KSDATA
OMVSADM.TEST.KSDS.KSINDEX
[ OMVSADM:/u/omvsadm: ]dls -l -tCLUSTER omvsadm.*
[ OMVSADM:/u/omvsadm: ]dls -tDATA omvsadm.*
BGYSC2402I Invalid catalog entry type: DATA.
[ OMVSADM:/u/omvsadm: ]dls -tINDEX omvsadm.*
BGYSC2402I Invalid catalog entry type: INDEX.
[ OMVSADM:/u/omvsadm: ]dls -F -tCLUSTER omvsadm.*
OMVSADM.TEST.KSDS                            C
OMVSADM.TEST.KSDS.KSDATA                     D
OMVSADM.TEST.KSDS.KSINDEX                    I
[ OMVSADM:/u/omvsadm: ]dls -F -tCLUSTER omvsadm.TEST.KSDS
OMVSADM.TEST.KSDS                            C
[ OMVSADM:/u/omvsadm: ]dls -F -tCLUSTER omvsadm.TEST.KSDS*
OMVSADM.TEST.KSDS                            C
OMVSADM.TEST.KSDS.KSDATA                     D
OMVSADM.TEST.KSDS.KSINDEX                    I

IBM z/OS Ansible core Version

v1.12.0-beta.1

IBM Z Open Automation Utilities

v1.3.3

IBM Enterprise Python

v3.11.x (default)

ansible-version

v2.16.x (default)

z/OS version

v2.5 (default)

Ansible module

No response

Playbook verbosity output.

No response

Ansible configuration.

No response

Contents of the inventory

No response

Contents of group_vars or host_vars

No response

@fernandofloresg fernandofloresg added Bug Something isn't working as designed. Needs Triage Issue need assessment by a team member(s) labels Oct 31, 2024
@fernandofloresg fernandofloresg changed the title [Bug] [zos_find] Cannot find VSAM index if is not named "INDEX" [Bug] [zos_find] Cannot find VSAM index or data if it does not end with ".INDEX" or ".DATA" respectively Nov 4, 2024
@fernandofloresg fernandofloresg added this to the [Q4] [2024] Bugs milestone Nov 12, 2024
@richp405 richp405 added Backlog and removed Needs Triage Issue need assessment by a team member(s) labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backlog Bug Something isn't working as designed.
Projects
Status: Backlog
Development

No branches or pull requests

3 participants