Addstera

Thursday, February 18, 2016

TSO WHOHAS code in REXX

Sometimes we face job abends, or job waiting for resource owing to the fact that some datasets get into contention with some other jobs or some user is using that particular file. Most of the organizations use TSO WHOHAS command to check the user holding the dataset. In this post we will see the piece of code in REXX which makes the command work.

/* REXX*/
DSNAME = ARG(1)
IF DSNAME = ' ' THEN DO
          SAY  'ENTER DATASET NAME'
PARSE UPPER EXTERNAL DSNAME
END
ADDRESS TSO
IF SYSDSN("'"DSNAME"'") <>  'OK' THEN DO
    SAY "DATASET DOES NOT EXIST"
    ADDRESS ISREDIT
    EXIT
END
ADDRESS TSO "ISRDDN E  ' "DSNAME" ' "
EXIT
Simple piece of code and it uses ISRDDN utility. It is an IBM utility which lists all the allocated DDNAME for your current TSO session.

Without the rexx code also , we even can execute the command
TSO ISRDDN ENQ 'Data-set Name'
and it will show the corresponding information

2 comments:

  1. ⭐ Data Analyst Course
    A practical data analyst course helps you master analysis from basics to advanced.
    You learn Excel, SQL, Python, and visualization tools with real datasets.
    Hands-on projects improve your practical understanding.
    Live sessions make learning interactive and clear.
    Expert trainers guide you step by step.
    This course prepares you for real data analyst roles.

    ReplyDelete
  2. Best Django course online provides comprehensive backend learning. It emphasizes project-based training. This best django course online enhances implementation skills. It supports practical exercises. Learners gain job-ready expertise. It is valuable.

    ReplyDelete