| Front Page | News Headlines | Technical Headlines | Planning Features | Advanced Search |

     

Powerful Definitions

By Steve Hammond

Inside VESOFT covers tips and techniques you can use with VESOFT’s products, especially MPEX.

My first of many careers was as a sportswriter. I learned so much in that job — how to turn an interesting phrase, how to develop black-and-white film, the subtle nuances of the role of the first baseman cutting off a throw from right on a play at the plate and that, believe it or not, there is strategy to winning a cross country meet, other than “run faster than the other guy.”

But I also learned how to read things, particularly at that time, press and media guides. I learned that if there were numerous pages devoted to one subject early in a document (such as a press guide), it was very important to whomever had produced it. I can remember a Yankees’ press guide that had its first 10 pages exclusively featuring the life of George Steinbrenner. In the early 1990s, the Orioles’ media guide had 15 pages on the career of Cal Ripken, Jr. The year I covered the Redskins’ training camp, I was inundated with page upon page about George Allen. That’s what was the most important thing to those respective organizations.

Well, sports fans, grab your VEsoft manual and look for the section on File Attributes. There you will find many pages devoted to ways you can better ‘define’ your fileset. That’s because it’s the really important stuff! Know how to use these variables and you unleash the power of MPEX. We’ll spend a couple of columns talking about how to use file attributes to define your filesets.

MPE gives us a very limited means of defining filesets — usually the exact name is required. Otherwise you can use the ol’ @ or # or ? in a few commands. MPEX gives you a whole range of ways to define your fileset. The most helpful, in my case, is the means of using dates. How many times have you tried to remember the name of a file you created, but can’t recall the name? But you do know the day you created it or know another file created by the same process. MPEX solves that crisis with the CREDATE variable:

%LISTF @.STEVE.DEV(CREDATE=12/02/01),3

There’s also a variable for access date (ACCDATE) and modification date (MODDATE). You can go a step further to deal with the creation, access and modification times, with the variables CRETIME (just the time it was created), CREDATETIME (the creation date and time in the YYMMDDhhmmss format), ACCTIME, ACCDATETIME, MODTIME and MODDATETIME.

Want to find out every file on LDEV 32 (one of my favorite commands after I got a couple of bad disc drives)? Then your best friend might just be: %LISTF @.@.@(ONDEVICE(32))

That’s right — there are Boolean along with string and integer comparisons in these variables. (Next month we’ll get into the Boolean variables.) Do you need to know if any files are open exclusively? %LISTF @.@.@(EXCLUSIVE)

Or loaded? %LISTF @.@.@(LOADED)

Are you looking for any files created after a specific file? %LISTF @.@.@(NEWERTHAN(“file.group.account”) — the quotes there are very important! This one gets a little tricky — if you declare a non-existent file in the NEWERTHAN clause, the command returns a true condition since everything is newer than a file that’s not there!!

Any of these variables can be combined with a simple ‘AND’ or ‘OR’ in the definition. And you can make things as simple or as complicated as you want. I know — I’ve been there.

Whenever we needed to change passwords (see earlier mea culpa on not using STREAMX), we would look for any files that contained a specific password or portion of a password. We would run a job that would do an MPEX LISTF looking for the password. As a policy, all jobs were supposed to be in groups named JOBS (clever, huh?). Or had the word ‘job’ in the name of the group. That job that reads in part:

!comment ****
!comment * this job will search for a string in files using MPEX
!comment ****
!purge stevetmp
!build stevetmp;dev=disc;disc=1000;rec=-30,1,f,ascii
!file stevetmp=stevetmp,old
!run mpex.pub.vesoft;parm=1
LISTF @.@jo@.@((CODE=”“or CODE=’EDTDT’) and RECSIZE<256 and &
FSEARCHEXP(“CL’xxxxx’”)>0),6>*stevetmp
exit
!showvar mpexnumsucceeded
!eoj

I regularly do a LISTF,6 into a file (in this case STEVETMP), so that I have a list of fully qualified file names that I can later use as an indirect file. The job examines any group on the system that has ‘JO’ in the group name (this would get groups named JOBS, but could also account for PRODJOBS, etc). It then looks for a file code of blank or of ‘EDTDT’ and has a record size of less than 256. This was the group of variables we had come up with to whittle down the number of files to examine and there could have been more variables, but we found these worked.

The key to the whole command is the FSEARCHEXP variable. This is one of a trio of related variables that examine the contents of the file looking for a specific string. FSEARCHSTRING(“string”) will look for the exact string in the quotes. It’s better than that, though. The exact command is: %LISTF @.@.DEV(FSEARCHSTRING(“Steve”)>0)

This will find any file in any group in the DEV account that contains the string “Steve” — not “STEVE” and not “steve”. If you want to find a file that contains at least three occurrences of the string, then make it (FSEARCHSTRING(“Steve”)>2).

One companion to this variable is FCONTAINS. If you want to do the same thing with this, it’s: %LISTF @.@.DEV(FCONTAINS(“Steve”)),1

This time there’s no greater than value, but it is still an exact match! Again, this is case sensitive.

The final command of the trio is what appears in the segment of the job above. FSEARCHEXP allows a caseless search (EXP means expression) — the ‘CL’ in the parentheses indicates a caseless search. Since I don’t use upper case letters, while my co-workers do, this is the only way to find all the passwords to change.

This last group of variables is very powerful and I can’t do it justice in a short column, so grab your MPEX manual and read up. And furthermore, every example I gave was with a LISTF, but you can use variables to define your fileset for any MPEX command. This is similar to the PRINT...;SEARCH= command, but gives you just the file names instead of the line or lines in the file with the specific string.

Next month, we’ll explore what ‘IS’ is.

Steve Hammond, who works for a trade association in Washington, DC, was expelled from the field of sports journalism when it was learned he neither smoked or drank coffee! 


Copyright The 3000 NewsWire. All rights reserved.