Click here for TSG sponsor message
Hidden Value details commands and procedures in MPE that can improve your productivity with HP 3000 systems. Get a free NewsWire HP 3000 Always Online cap — submit your MPE tip directly to us here at the NewsWire. Send your tips to editor@3000newswire.com, or fax them to 512.331.3807.

How much information can a 2400-foot reel of tape contain -- in theory? Maybe the better question is what’s the equation for calculating this?

John Zoltak replies:

The actual density is 6250BPI (bits per inch), so it would be 6250 x 12 inches x 2400 feet = 180,000,000, or 175.78 Mb (a Mb is 1,024,000 bytes).We can use this calculation as bytes, because the tape has nine tracks, one for each bit plus parity.

But practically, I measured and found that on good tapes I consistently got 140Mb.

Is there a way in MPE to compare the contents of two files to see if they are the same?

James Clark, Jr. replies:

Use the command:FCOPY FROM = <fromfilename>;TO=<tofilename>;COMPARE=###, with ### being the number of errors to have before halting compare.

Andreas Schmidt adds:

You can use comm from the Posix shell: comm [-123] file1 file2

comm locates identical lines within files sorted in the same collating sequence, and produces three columns; the first contains lines found only in the first file, the second lines only in the second file, and the third lines which are in both files. In the options, -1 suppresses lines that appear only in file1; -2 suppresses lines that appear only in file2; -3 suppresses lines that appear both in file1 and file2.

Is there any way to make a 3000 program execute when a user logs in, just like .profile does in many operating systems?

Jim Phillips replies:

On the HP 3000 you would set up a User Defined Command file (using a text editor) that looks like this:

OPTION NOBREAK,NOHELP,LOGON
CONTINUE
RUN MYPROG
BYE

Then you would hook the users you wanted to the UDC by issuing the SETCATALOG command: SETCATALOG UDC;USER=USERNAME

We have several processes which require us to copy files from one 3000 to the other. Are there any parameters (or other tools) which will allow DSCOPY to keep the creation dates and times from one system when copied to another? I was searching for a parameter similar to the KEEPAMDATES or KEEPATTR parms which can be used in Vesoft’s MPEX COPY command.

Donna Garverick replies:

DSCOPY all on it’s own won’t preserve the date and time stamps as far as I know. There are other free tools that might do this (quoting from Michael Hensley, Mark Bixby and others):

MOVER (formerly RYDER): Found in the TELESUP account, and several versions are in PUB.FREEWARE; various incompatible versions exist, some of them with the same version number! It fully preserves MPE file attributes and account structure.

LZW: On the FREEWARE tape, contributed by Telamon. Versions are available from Telamon for a large number of platforms. Preserves MPE file attributes, and some account structure.

POSIX tar and compress: Bundled with POSIX on MPE/iX 5.0 and later. Files can be exchanged with MPE, Unix, and PC’s. Does preserve MPE attributes as of MPE/iX 5.5 (including timestamps) but only if also unpacking on MPE/iX 5.5 or later. MPE/iX 5.0 tar is unable to extract and reconstruct MPE attributes from a 5.5 tar file.

John Burke adds:

The only way I know how to do it is via a STORE/RESTORE, using HP’s or third party utilities. Now, if their store/restore utility allows for store-to-disk, then they can “store” the files to disk, DSCOPY the resulting file to the archive machine and then restore with the “OLDDATE” option. Kind of kludgy, but should be workable.

How do I remove the UDC setting for a user if it is no longer necessary? Is there any way to make a message print on the screen such as “Loading XYZ program” within the UDC file?

Lee Gunter replies:

For your first question, SETCATALOG ;user=<user ID> To make the message print on the screen,iInclude the following just before your program’s :RUN statement:

ECHO Loading XYZ program ....

This assumes that you’re executing the UDC from a terminal. If you’re executing it from within a batch job, and you want the message to display on the system console, substitute TELLOP for the ECHO.

HP’s Jeff Vance adds:

SETCATALOG ;user=<user ID> will disable all user-level UDC files for “user ID.” You may wish to disable (or “uncatalog”) just a single UDC file, which can be accomplished with: SETCATALOG filename;DELETE. Note: this only works on your own logon, ie. the “;USER=name” parameter is not supported when DELETE is specified. Use SHOWCATALOG to see what UDC files are cataloged.

What do I do when I have to clear an MPE/iX session that would not otherwise clear through normal procedures? Is there a way to track down the originating session to kill that, and then clear the device that is hung?

John Burke replies:

Ah, an issue recently near and dear to me, since I am loath to reboot any of our systems just to clear up a hung session. You do not say though what you mean by a hung session; however, one piece of advice in general from bitter experience:

NEVER, NEVER, NEVER do an ABORTJOB on a VT session that may be in a compromised state; instead, use NSCONTROL KILLSESS=#Snnn

If you use ABORTJOB first and it does not work, then you are hosed. (That’s a highly technical term). I’ve never had NSCONTROL KILLSESS=#Snnn fail to abort a session when used first on VT sessions. By the way, if you do not know for sure if it is a VT or DTC session, NSCONTROL KILLSESS=#Snnn will do no harm to DTC sessions, giving you only a DSERR.

On DTC connections, some combination of ABORTJOB, ABORTIO, and, if all else fails, a reset of the port either through TERMDSM or OPENVIEW DTCMGR has always worked for me. (Well, at least since MPE/iX 5.0.)

I have a script that identifies compatibility mode KSAM files. I want to use GREP to scan the accounts where these files are located for any reference to KSAMUTIL. How do I ask GREP to scan all the files in an account from within MPE alone, not from the Posix shell?


Tim Ericson replies:

Try this command file:

parm file_set, search_string, entry_point=”main”
# grepem.xeq - uses grep to search a fileset for
# all occurances of a search string
# Tim Ericson
if “!entry_point” = “main”
listfile !file_set,6 > allfiles
!hpfile not_needed, !search_string, print < allfiles
purge allfiles,temp
purge thisfile,temp
deletevar allfiles_eof, record_counter, file_name
else
setvar allfiles_eof, finfo(“allfiles”,”eof”)
setvar record_counter, 0
while record_counter < allfiles_eof
input file_name
echo ==========================
echo !file_name
echo --------------------------
print !file_name;page=0 > thisfile
grep.hpbin.sys “-i ‘!search_string’” < thisfile
setvar record_counter, record_counter + 1
endwhile
endif

Michael Hensley adds:

This is an important POSIX/Unix concept: when you type a command in the shell (pretty much any Unix shell), the shell expands the wildcards. Utilities like grep do not know how to process filenames with embedded wildcards. They do handle a list of filenames, though.

For example, if you type:$ grep “mystring” foo* the shell expands this into $ grep “mystring” foo1 foo2 foo3 before executing it.

The MPE CI doesn’t do wildcard expansion. Some commands (like PURGE), and some utilities (like DSCOPY) handle wildcarded filenames on their own. Learning this concept is key to using the Posix utilities from the CI.

How do I get PSCREEN to output to disk?


Donna Garverick quotes from
Tim Ericson’s UDC Web page :

IF UPS(“!DEV”) = “DISC” THEN
IF FINFO(“FLAT”,0) THEN
ECHO FILE “Flat file already exists -
ECHO Check its contents, purge it, then redo PSCREEN”
RETURN
ENDIF
RUN PSCREEN.PUB.SYS;PARM=3

Note that parm = 3 is really parm 1 (partial screen) + parm 2 (out to disc)


How do I remove ‘ and “ characters from a text file, all from the CI command prompt? I have an input text file that may or may not contain the characters ‘ or”. I need to take the input from that file and create a run statement RUN ABC;INFO=”passed input”


Mark Bixby replies:

You could double the characters so they are preserved when passed via INFO=. The patch MPEKX44C (current) or MPEKX76A (PowerPatch 4, MPE/iX 5.5) or MPEJXQ1 (original) give you the QUOTE() CI string function.

Thus you should be able to do:

RUN ABC;INFO=”![QUOTE(passedinputvar)]”

QUOTE() returns the input string with all quotemarks doubled.

Is there a way to list files by date and time? I also want to see them in sequence of date and time.


Michael Hensley replies:

In the Posix shell, you can use “ls -lt”; from the CI (the “:” prompt), you can type “:ls.hpbin.sys -lt”; or, if HPBIN.SYS is in your HPPATH, simply type “:ls -lt”.


Leonard Berkowitz adds:

You can do this with MPEX, a third-party product from Vesoft. Even if your shop is not likely to purchase such products in the near future, this one is well worth any investment. It’s not tiered, so that the cost is reasonable no matterwhat size machine you have.

Out of the box even MPEX will not do it, but you could create customized routines for MPEX to do it. I have created MPEX routines that will produce sorted listings of a fileset by creation date, modification date, access date, sectors ascending and sectors descending.


Copyright 1998, The 3000 NewsWire. All rights reserved.