Updated February 10, 2001
If you've ever used the command line of Linux, 4DOS, 4OS2 or similar systems, you may have become addicted to the way that you can type a partial file name and press a single key to complete the name. This package provides a similar function within ISPF. With it, you can type part of a data set name (or data set and member name) and press a PF key to complete it automatically.
This function is superceded by ISPF's built-in AUTOTYPE command.
Change history:
|
|
August 10, 2000 : Minor bug fix... The message that says 'No matching names' was not coming out. It was saying 'No more names' even when there wereno matching names at all. This should be fixed. Only the load module changed. |
|
|
|
June 23, 2000 : An additional message was added and special handling for option 3.4 data set list. Also added an exec to change some of the more commonly used panels. |
|
|
|
June 20, 2000 :Update which adds support for library name fields. Installation instructions (what needs to be added to the panel(s)) has changed. Since this uses IGGCSI00, it will not run on older OS/390 systems (like V1.R2). |
|
|
|
February 10, 2001: Updated with various fixes and enhancements:
Note that messages have been added, so if you upgrade, please upgrade the messages too.
|
|
I'm looking for opinions on this. I'd prefer opinions from people who actually try it because the explanation makes it sound cumbersome and not worth the effort. It is actually pretty easy to use and to install.
** Many, many thanks to the kind folks who have sent
comments **
** Update 10/30/2000 **
By the way, I'm not looking to put up a list of names, just to auto-complete names. |
The only things I know it does not handle are data set alias names and GDGs, and it doesn't use the data set list name filter exit. At this point, source code will not be provided because it uses a few internal interfaces to do things your not supposed to be able to do within panel exits (setting variables). It uses the catalog search interface (IGGCSI00) for reading the catalog and QSAM for reading directories.
Here's how you would use it:
The rules for specifying the 'Other Data Set Name' field (it may seem overwhelming at first, but it should be what you'd expect):
|
|
The prefix or pattern you specify is only what is to the LEFT of the cursor. For example, if the field is CLIST(ABC), with the cursor under the letter S, then the pattern used is CLI. The reason for this is described below under Cursor position sensitivity. |
|
|
If the field does not start with a quote, your TSO prefix is added. If you don't have a prefix, your user id is added, and if your prefix is different than your user id, then prefix.userid is added. (that's standard ISPF naming conventions). If the field does begin with a quote, no prefix is added. |
|
|
The pattern can be any pattern similar to what you use in data set list (except that you don't have to specify your userid or prefix as described above). Trailing wildcards are automatically added. For example, typing CHR will use a pattern of userid.CHR*.** when searching the catalog. |
|
|
If you include a left parenthesis, followed optionally by a member name or pattern, the data set is assumed to be a PDS and the a member name is returned. For example, CLIST(XY would search 'userid.CLIST' for members matching the pattern XY*. A trailing * is always added to the member name to create a pattern). |
Rules for Library fields (Project/group/type/member):
|
|
If the cursor is in the project field, the other fields are not used as part of the data set name search (and are erased). |
|
|
If the cursor is on agroup field, the project name, and type name (if any) are added to create the search pattern. Each group name will come up only once, even if there are many types within that group. |
|
|
If the cursor is on the type field, the project and first group name will be added to create the pattern. |
|
|
If the cursor is on themember field, the project, 1st group and type are used as the data set name. The 2nd, 3rd and forth group are not used. |
The pattern or prefix used is only what is to the LEFT of the cursor. The reason for this is that you can refine your search by just moving the cursor. Lets say you have 100 datasets called 'SYS1.A234.RGG.*' and you are planning to use one that is named 'SYS1.A234.RGG.DBD0223.L422.FEB0299.TERRA'. Rather than typing the whole name, you could type 'SYS1.A234.RGG', and press the AUTOTYPE key. That might return 'SYS1.A234.RGG.DBD0211.X331.AUG0599.FIRMA'. You can refine the next name returned simply by typing a 2 over the first 1 in DBD0211 and then press the AUTOTYPE key again. Since the cursor will be after what you typed, the new pattern used is SYS1.A234.RGG.DBD021*.** so you'll get closer.
All these rules make more sense when you use it.
Trying to explain it just makes it sound difficult.
Installation instructions if you'd like to try it.
If you're not well versed in ISPF application installation and modification, you might want to skip it. These instructions only enable the function on the Option 2 Edit Entry panel. There is a REXX program available that will make the panel changes for you for edit, view, most of the option 3 utilities, SCLM view (10.1) and probably a few others that I've forgotten about.
1. Create a message member called NEXT00 in ISPMLIB, containing the following:
Message member NEXT00 NEXT000 'No matching names ' 'There were no data set names matching the specified pattern ' + '(&PATTERN).' NEXT000A 'Quotes Required ' 'AUTOTYPE can not process unquoted data set names when you are ' + 'running without a TSO prefix. To use AUTOTYPE without a TSO ' + 'PREFIX, use fully qualified data set names within single ' + 'quotes.' NEXT000B 'Member name not allowed ' 'AUTOTYPE will not retrieve a member name for this field because ' + 'this field requires a data set name without a member name.' NEXT001 ' ' 'The name &NEXTNAME was retrieved using pattern "&PATTERN".' NEXT002 'No more names ' 'There were no additional data set names matching the specified ' + 'pattern (&PATTERN).' NEXT003 'Invalid pattern ' 'A pattern is not allowed in the data set name when a member ' + 'name or pattern is also present.' NEXT004 'Authorization error ' 'The data set could not be opened to scan for members matching ' + 'your specified pattern. An ABEND 913 occurred.' NEXT005 'No members match ' 'No member names match your specified pattern. The data set may ' + 'not contain members which match the pattern, or an error ' + 'occurred reading the directory.' NEXT006 'Not partitioned ' 'No member name was returned because the data set is not ' + 'partitioned.' NEXT007 'Allocation failed ' 'No member name was returned because the data set could not be ' + 'allocated.' NEXT008 'Invalid Cursor position ' 'The AUTOTYPE function requires that the cursor be on an enabled ' + 'library or data set name field.' NEXT009 'Open failed ' 'The AUTOTYPE function was not able to open the data set in ' + 'order to read the directory.' /* (C) Copyright IBM CORP 2001 */2. Copy the load module AUTOTYPE to a data set in your STEPLIB or ISPLLIB concatenation.
AUTOTYPE is available here as an XMIT format data set (see the i nstallation notessection for info on XMIT format data sets).3. Modify panel ISREDM01 (in ISPPLIB) with these 2 changes as follows:
a) At the beginning of the )REINIT section add:
IF (&ZNXTMSG=NEXT) .CSRPOS = &CSRP .CURSOR = &CSRVb) At the beginning of the )PROC section, add:
&CSRV = .CURSOR &CSRP = .CSRPOS &NAMES='CSRV CSRP PRJ1 LIB1 LIB2 LIB3 LIB4 TYP1 MEM DSN ZCMD' PANEXIT((NAMES),LOAD,AUTOTYPE) IF (&ZNXTMSG='NEXT') EXITYou can enable other panels the same way. The &NAMES variable is a list of variable names on the panel. They must all be specified, but if they don't exist, you can use an asterisk (*) instead. They are:
- The variable containing the cursor field name (can be any name as long as you use the same name in the )REINIT section).
- The variable containing the cursor offset (can be any name as long as you use the same name in the )REINIT section).
- The name of the PROJECT variable on the panel
- The name of the first group variable.
- The name of the 2nd group variable
- The name of the 3rd group variable
- The name of the 4th group variable
- The name of the Type variable
- The name of the 'Other data set name' variable
- The name of the command line variable (the command line will be cleared).
Be sure that the lines following what you insert start in column 1 so that the IF statements don't change the existing panel logic.
4. Set a PF key to AUTOTYPE
5. Optionally, add a command table entry of AUTOTYPE 0 SETVERB
If you add the command table entry you won't get an error message on other panels if you accidentally press the PF key you assigned.6. If you are using a terminal emulator, it is nice to assign an easily reachable key to the same key you used in step 4. I use ctrl-L but you can use any key or combination that is in easy reach. Or you can just use the function key directly, of course.
I added a REXX EXEC to modify some common panels (step 3 above). It is very rough. Modify the data set names at the top and run it from an ISPF command line. (It must be invoked as a TSO command, not via EXEC 'dsname...' because it is recursive).