The LM TSO command displays the directory (member list) from a Partitioned Dataset. A mask may be specified to select members to list based upon their name. The command may also be used to create a sequential dataset containing the name list for use by another program or command.
The source for LM is located in File #300 of the older version #249 CBT tape. It was written by Dick Szeide and this version has modifications by Rick Duvall and J. Schindler.
I have combined the provided installation JCL, the assembler source, and the help file into a single jobstream to install the command. The resulting jobstream - lm$.jcl - is contained in the archive lm.tgz [MD5: 0704A9389E5D6A48F16CE6F4DCE89C6E]. Download the archive and extract the jobstream (WinZip on Windows/?? or tar on Linux). Submit the jobstream to assemble and link the single load module for LM into SYS2.CMDLIB and copy the help text into SYS2.HELP. If you don't have SYS2.CMDLIB defined, you will need to modify the jobstream to specify a different target load library. Also if you do not have SYS2.HELP defined, you may modify the jobstream to place the help information into SYS1.HELP.
Here is the help text for the LM command:
The SHOWDIR command is used to print out part of all of the directory of a Partitioned Dataset. Optionally, it will produce a disk dataset suitable for manipulation with EDIT. SHOWDIR generates a return code of zero if successful. Should no members meet the requirements for listing (see MASK parameter) a return code of 4 is returned. The following return codes indicate unsuccessful completion of SHOWDIR:08 - output incomplete or output dataset not created 12 - input dataset unreadable or not partitioned 16 - parse error processing user's parametersWhenever a non-zero return code is generated, an appropriate message will be displayed at the user's terminal.Syntax -LM 'DSNAME' LINESIZE('SIZE') MASK('MASK') DA('DSN') ALIAS/NOALIASREQUIRED - DSNAME DEFAULTS - LINESIZE=7 MASK=ALL ALIAS ALIAS - SHOWDIR, LISTMEMOperands -'DSNAME' - THE PARTITIONED DATA SET FOR WHICH THE DIRECTORY LISTING IS REQUIRED. LINESIZE('SIZE') - THE NUMBER OF MEMBER NAMES TO BE DISPLAYED ON A SINGLE LINE. MAXIMUM IS 9. IF THE 'DA' OPTION IS TAKEN, THE FIRST MEMBER NAME ON EACH LINE WILL BEGIN IN POSITION 1. MASK('MASK') - AN OPTIONAL MASK OR PREFIX USED AS A SEARCH MASK. UP TO EIGHT CHARACTERS ON WHICH TO COMPARE FOR EQUAL BEFORE PRINTING. AN ASTERISK (*), IN ANY POSITION MAKES IT A NON-COMPARE POSITION. EXAMPLES: MASK(BPS) WILL RETURN ANY MEMBER NAME THAT BEGINS WITH 'BPS'. PRE(*****XYS) WILL RETURN ANY MEMBER NAME THAT ENDS IN 'XYZ' IN COLUMNS 6-8. M(BPS****7) WILL RETURN ANY MEMBER NAME THAT BEGINS 'BPS' AND ENDS IN A '7'. PREFIX('MASK') - SAME AS MASK PARAMETER DA('DSN') - WILL RETURN THE LIST OF MEMBER NAMES IN A SEQUENTIAL DATA SET NAMED, 'USERID.(DSN).DATA'. A DSNAME IN QUOTES WILL BE RESPECTED, AS WILL A VALID QUALIFIER (ASM, CLIST, CNTL, COBOL, DATA, FORT, PLI OR SPIT). THE DATA SET WILL HAVE SEQUENCE NUMBERS IN EDIT FORMAT. NOTE - DA(*) WILL BE TREATED AS IF THE DA PARAMETER WAS NOT ENTERED AT ALL (OUTPUT WILL GO TO THE USER'S TERMINAL). DS('DSN') - SAME AS DA PARAMETER ALIAS/NOALIAS - 'NOALIAS' WILL SUPPRESS THE SPECIAL FORMATTING GIVEN TO ALIAS NAMES. 'ALIAS' IS THE DEFAULT. NOTE -- AN '*ORPHAN*' IS AN ALIAS NAME THAT MATCHES NO MAIN MEMBER NAME. A SPURIOUS *ORPHAN* WILL BE GENERATED WHEN AN ALIAS MEMBER NAME MATCHES THE SEARCH MASK, BUT THE MAIN NAME DOES NOT. ALSO, AN ALIAS WILL NOT BE SHOWN IF IT DOES NOT MATCH THE SEARCH MASK EVEN THOUGH THE MAIN MEMBER NAME MATCHES AND IS DISPLAYED.
I hope that you have found my instructions useful. If you have questions that I can answer to help expand upon my explanations and examples shown here, please don't hesitate to send them to me:
Return to Site Home Page
This page was last updated on January 17, 2015 .