Click here for TSG sponsor message
Hidden Value details commands and procedures in MPE (and some in Vesoft’s MPEX) 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.

We are FTPing (using FTP.APRA.SYS) a file from our 3000 to a 9000 owned by one of our sister companies. Our people on the 9000 end need this file with Posix permissions ala the 3000. Is there any way to achieve this with FTP, without manually changing the permissions on the 9000 each time a file is sent?

James Clark replies:

The owner and access rights are usually set by the login and current setting of the mask. If you send a umask statement to the 9000 server using the ftp SITE command, then send your files, then the access rights will be as you set them.

I’ve been trying to use the POSIX functions read() and write() to read and write to/from a /dev/tty (created using MKNOD command) I noticed that these commands throw in a newline after each call. Is there a way to keep this from happening?

Bill Bennett replies:

I’m not sure what happens with /dev/tty on the 3000, but to control line feeds take a look at FCONTROL 25 and 41. You will also need to use _MPE_FILENO (check the C manual for proper spelling/usage) to convert the C file number to an MPE file number.

I set the ctimeout value to 90 for the session parameter of the miscellaneous configurator. This works for terminals setting at a colon prompt and inactive for the 90 minutes, but it does not work for a terminal setting idle with a menu displayed. The other disadvantage is that it keeps logging off the operator console. Are there alternatives?

Michael Hensley replies:

1. Modify your menu program to do a timed read. If the timer expires, have the program set a JCW and exit. Modify the UDC the users use to run the program to test the JCW -- if the timer expired, log them off.

2. Create a program for the console that prompts for a password and train your operators to run this program whenever they walk away from the console. This gives you the advantage of added security, as well as preventing the CI timeout

3. You could have a UDC which checks the logon LDEV, and if it’s 20 sets the HPTIMEOUT variable to 0, but I like solution number 2 better.

I heard there’s a way to alter the message the console supplies during a tape mount request. What’s the trick?

Mark Bixby replies:

If you try to tar to /dev/tape, you’ll get a console message that looks like:

?13:53/#S2828/979/IS “TAPE” ON LDEV#7 (Y/N)?

Experimentation revealed that “TAPE” is taken from the basename portion of the device file name. So if I wanted to cause the console prompt to be for “MYTAPE”, I could create my own temporary device file with the desired name, and tar to that.

Here’s the solution in CI format:

xeq mknod.pub.sys “/tmp/MYTAPE.!HPPIN c 0 7”
xeq tar.hpbin.sys “cvf /tmp/MYTAPE.!HPPIN UDC”
purgelink /tmp/MYTAPE.!HPPIN

The reference to !HPPIN uniqifies the device file name, just in case multiple people want to use the same name prefix at the same time. The console prompt will only be for “MYTAPE”, and not the numeric uniqifier.

Here’s the solution in sh format:

/bin/mknod /tmp/MYTAPE.$$ c 0 7
/bin/tar cvf /tmp/MYTAPE.$$ UDC
/bin/rm /tmp/MYTAPE.$$

Like !HPPIN in the CI version, $$ is just another process-based uniqifier. I think HPPIN only became available on a post-5.5 PowerPatch tape.

What’s a good HP 3000 system variable or intrinsic that will return a julian date after I give it a year and a day?

Michael Hensley replies:

Try the new HPDATECONVERT and/or HPDATEFORMAT intrinsics (documented at www.docs.hp.com — see the MPE/iX COMMUNICATOR articles).

Or, if you are using COBOL, use the DATE-OF-INTEGER, INTEGER-OF-DATE, DAY OF- INTEGER, and INTEGER-OF-DAY functions. Vesoft’s MPEX has a very rich set of date operators and functions.

Finally, (last-but-not-least), you might want to check out Robelle’s SmartDate library product at www.robelle.com.

I’ve heard you need a floating point coprocessor in your HP 3000 to use the new Just In Time Java compiler. Is there a way to tell if an HP 3000 has a floating point co-processor installed?

Lee Gunter replies:

SYSINFO will tell you this. Run sysinfo.prvxl.telesup, and the report should show a FPU (if any) under the “Coprocessors:” section in the “SYSTEM CPU MAP.”

Stan Sieler adds:

While running debug,

= ccr
$c0

If the left two bits are 0 (they’re both on in my example), you have no arithmetic coprocessor. On some machines, you might see $80 with an arithmetic coprocessor.

My company has a stream job on our HP 3000 that can only run if all sessions are logged off a specific account. The only way we can check to see if there are any sessions logged on is to use the HP variable HPSESCOUNT in an IF test (IF HPSESCOUNT = 0 THEN ...) in a stream job. This doesn’t work when a person forgets to log off the console. How can I check for sessions (not jobs) in a specific account that can be used like our IF test?

HP’s Pete Crosby replies:

You could do a TELL to “@.accountname” and then check the HPCIERR variable. The value of it would vary depending on whether there were a job or session or both logged on. Then it is a simple matter of looping until the condition is met or stopping if that is what you want to do.

You don’t say if the test is performed in a UDC/COMMANDFILE to determine if the job should be streamed or if it is done by the job itself to determine if it should continue, wait, or abort. That information would be helpful.

Is there any string function in MPEX that can parse a particular string in a file? I need to list out all files which come with verb ACCESS. I want only the file name to be listed out and not the whole line.

Chris Bartram replies;:

See %help fcontains and %help fsearchexp in MPEX. Both can be used in a LISTF command to search for files containing a certain string — and you can even specify start/end line#s to search, and I believe something equivalent to “find this string as long as it’s within ‘n’ lines of this <other> string”

How can I get an Image/SQL database to allow “null” items — inserted as null or updated to null?

Wirt Atmar replies:

Null entries, although never officially defined anywhere, already exist in IMAGE for text items. In both IMAGE and Query, an undefined text field is filled with binary zeros, not blanks, thus it has all of the qualities of a NULL. A field filled with blanks is not equivalent to a field filled with binary zeroes. One has a specific value; the other has an non-defined (or not yet defined) quality to it.

Similarly, the idea of negative zeroes representing nulls is an old one. Languages such as BASIC use a negative zero (or more accurately, the largest negative number the range will support) as a NULL. For example, the bit pattern for such a NULL would be: 10000000, if the word size was 8 bits (and would thus be equivalent to a -128). Doing this clearly eliminates one data value from the total range of all expressable values, but that would be true in any case for any representation of nulls.

While IEEE reals have various forms of null values already defined as part of their specifications, the other IMAGE datatype forms don’t. But there are ready suggestions. A null should be a bit pattern that is otherwise “illegal”, thus a field filled with binary zeroes makes a perfect (and perfectly obvious) NULL definition for X, U, P, and Z datatypes.

Similarly, a negative zero (max negative number) makes a good NULL for I, J, K, and R datatypes (with a max negative being especially good for J datatypes because it too is an illegal bit pattern).


Copyright 1998, The 3000 NewsWire. All rights reserved.