|
|||||||||||
|
Chicago-Soft
|
QUERYDD By Steve Myers
The QUERYDD command displays information about the data sets allocated to a specified DD name. Two forms of the QUERYDD function are provided. One is implemented as a TSO CLIST. The other is implemented as a TSO command processor written in Assembler. There are some differences. The command processor accepts multiple DD names, where the CLIST accepts only a single DD name. The output is basically identical. For example:
QUERYDD
SYSHELP SYSHELP SYS2.HELP SYS1.HELP The two commands have a different response to errors. For example, the command processor version prompts the terminal operator for a valid DD name if the requested DD name is not allocated. The CLIST just prints a message. The CLIST is an example of using output trapping. The CLIST "traps" the output from a LISTA STATUS command and then analyzes the output. It is a little complex because TSO uses more than one method to display information about a DD name. The command processor uses what I call the extended RDJFCB macro to obtain all of the JFCBs for a DD statement. A JFCB is an MVS control block that describes an allocation. A "regular" RDJFCB returns information only for the first JFCB of concatenated data sets. The extended RDJFCB returns information for all of the DD statements in a concatenation. However, the output from the extended RDJFCB is much different than for a regular RDJFCB, so it is not used very much. The command processor uses features available in recent High Level Assembler releases to simplify the task of analyzing the output from the extended RDJFCB macro. The Command Processor is presented as a sequence of SMP jobs in an unloaded partitioned data set. Use the following steps to load the program to your system.
//A EXEC PGM=IEFBR14
//Q DD DISP=(MOD,DELETE),UNIT=SYSALLDA,SPACE=(TRK,0), // DSN=&SYSUID..QUERYDD.CNTL //B EXEC PGM=IEBUPDTE,PARM=NEW //SYSPRINT DD SYSOUT=* //SYSUT2 DD DISP=(,CATLG),UNIT=SYSDA,SPACE=(TRK,(1,1,5)), // DCB=(RECFM=FB,LRECL=80,DSORG=PS), // DSN=*.A.Q //SYSIN DD DISP=SHR,DSN=&SYSUID..QUERYDD.IEBUPDTE The PDS data set userid.QUERYDD.CNTL contains a number of members.
The jobs will need some minor changes to tailor them to your environment. These changes should be pretty obvious to an experienced MVS programmer. By making minor changes you can install QUERYDD in your program products SMP CSI rather than the customer CSI used in this example. In addition to the program, the FMID includes help text in the standard help text format. The QUERYDD command processor is a regular Assembler application program. It uses no authorized services and is not link-edited as an authorized program. It can't hurt anything. In addition, it does not attempt to open any data sets, so it cannot violate your site's security standards. The QUERYDD CLIST is fairly compact, and it may be easier to read and understand than an equivalent function written in REXX. Although many people denigrate the TSO CLIST language as old-fashioned, this is simply not true. It is not the CLIST language introduced with TSO in 1971. That was a joke. Now, CLIST has all the bells and whistles of a modern scripting language: subroutines, a GOTO free block structure, and a number of internal functions that provide system information and other capabilities. Some capabilities of the CLIST language, string processing as an example, are less elegant than REXX. Other functions seem to work much better than REXX. For example, I/O to external data sets is much easier to use than the equivalent in REXX. CLIST does not have the multiple platform capabilities of REXX. However, how often is a REXX function moved to a different platform and actually works unchanged, anyway? Steve Myers has been programming since 1965 and writing TSO Command processors since the very beginning of TSO, circa 1971.
|
|
|||||||||
home · current
articles
· archives · forums · |