MainframeSupports
tip week 29/2005:

Ugens tip holder sommerferie. Det næste tip vil blive udgivet den 15. august 2005

The weekly tip is on summer holidays. The next tip will be published the 15th of august 2005.

Because of law suits in United States it has become a habit everywhere to write that you cannot be held responsible for anything. I don't want to be held responsible for the subject of the tip of this week, because it is about wildcards.

Wildcards on the IBM mainframe are unfortunately neither unambiguous nor standardized in any way. As far as I can see there are three kind of wildcards. A wildcard substituting a single character, another wildcard substituting zero to many characters and a wildcard substituting zero to many qualifiers in a datasetname.

The following table shows the different wildcards used in a series of IBM mainframe products:

Produkt Single character 0 to N characters 0 to N DSN qualifiers
DB2/SQL LIKE_%n/a
CICS CEMT/CEDA+*n/a
ISPF member names%*n/a
ISPF dataset names%***
HSM dataset names%***
DFDSS dataset names%***
CSI dataset names%***

As you can see DB2 varies a lot compared to the other products. What on earth happened in the minds of the DB2 developers, something like "we want to be different at any cost". Why is _ a wildcard character when it also can be used in DB2 names. This is beyond my imagination.

There is a general agreement about using * as the wildcard for zero to many characters in most products and the wildcard for a single character is also the same except for CICS. The CICS developers thought that % was better, maybe just to irritate the DB2 developers (I am almost sure CICS were around before DB2 was even thought of). Are you confused? Well, there is only one thing to do about it and that is to use the above table, when you are in doubt and don't ask questions about the logic behind it, because I am afraid there isn't one.

A surprise for many of you might be that ** in ISPF dataset names covers 0 to many qualifiers. Most of you will claim that a single * works the same way, but * only works like ** when it is the last character in a wildcard string. A surprising detail, because the * at the end only works this way in ISPF, and it has confused me more than once. It is possible to disable the special * feature at the entry panel to DSLIST in newer version of ISPF.

Previous tip in english        Sidste danske tip        Tip list