Hidden Value

HiddenValue details commands and programs in MPE that can improve productivity on HP 3000 systems. Get a free NewsWire "HP 3000 Always Online" cap -- submit an MPE tip to Hidden Value. E-mail your tips to rseybold@zilker.net, or fax them to 512.331.3807.
I need to know a simple way to alter the modification dates on IMAGE datasets so that all datasets will have the same modification date. We want all the datasets to have the same date so that a partial backup will store the entire database."Touch" does not seem to alter PRIV files. How can I do this?

Access the database in mode 1 using QUERY. PUB.SYS, and issue the command Form Sets.

We inherited a couple of 5-pin DTCs from one of the other groups at my company. Before we install these things, I need to know if they only be used with directly connected devices, or if can we use them through modems. Also, if those kinds of connections are possible, what is the part number for the 5-pin to DB25 cable?

Chris Bartram replies:

I don't know part numbers, but a while back when I wired up a bunch of cables for those myself, the pins are labelled 1-5, with 1 being ground (just like the 3 pin DTCs), 2 and 3 being send and receive, and 4 and 5 being secondary send and receive. They're designed for RS422, which allows longer supported cable runs than RS232. Interestingly though, you can cheat and just use pins 1-2-3 and use it as a straight RS232-type cable.

They don't support the standard modem signals that the 25-pin connectors do, though, so while you could hook up a modem to the line, I don't believe you're going to get it to disconnect when someone logs off.(The next person to dial up may find themselves in the middle of someone else's session if that last person didn't log off before hanging up).

Is there a way that an executing MPE/iX command file can determine its name (filename, group, account)?

You can use the "!-1" command to assign the last command executed by the CI to a variable (example, first line of the command file is: SETVAR cmdFileName "!-1"); you should parse the string bound to 'cmdFileName' to determine the group and account using !hpaccount and !hpgroup as/if needed; your code should look for "XEQ" string as well (just in case).

You may also need to look at !hppath as well to try to determine what command file is executing (most folks put them in a special group, like CMD and then add "CMD, to the start of !hppath); you can use the same logic as HP by running down the "!hppath" searching along each path for the first command file name which matches the one running.

I have a spoolfile that has been in a 'delete pending' state for almost a month. When I try to list/purge it using the corresponding MPE commands I get a FSERR 105 Bad variable block structure message. How can I purge this darn thing?

This probably happened when a spoolfile finished printing during backup. The way to clear it is to do a do a spoolf operation on it like spoolf xxx;dev=lp. This will usually get rid of the file.

If that doesn't work, the only other way to delete it is to use the purgefile command in FSCHECK, and do it while there are no other processes on the system. FSCHECK's potentially destructive commands -- purgefile, checkdirc, checkextents or unlockfile -- should never be done on an active system. Your session should be the only one, plus no jobs, user logging processes or network processes should be active. FSCHECK shouldn't be run while your system is active because it would give a false indication of directory or label corruptions.

If a terminal loses its echo, isn't supposed to turn it back on? I'm using Reflection 1 for Windows and am connecting thru a DTC. I'm wondering if R1 isn't somehow gobbling the escape sequence up.

Nope, you are remembering MPE/V. The MPE/iX way is set echo=on. Type slowly, since you can't see what you are typing!

Can I perform I/O on a file within a loop and read successive records? I tried a WHILE loop but I keep reading the same record. I think I know how to do this within MPEX using its FILE I/O FUNCTIONS, but I'd rather do it at the MPE/iX level.

One technique to use is to copy the file you wish to read into a 'temp' message file first and then read from the message file. Try this process:

  1. Use FINFO to get file attributes for 'file'.
  2. Store them in variables like recSize, fileBlk.
  3. Build WRKTMP as a message file in the temp domain using correct file attributes from above (!recSize, !fileBlk etc...).
  4. Do a file equate to set access to append for this 'temp', 'msg' file.
  5. Use FCOPY to copy what is in 'file' into 'WRKTMP' using the back-ref name in your file equate and then do something like what you had above (send output of FCOPY to $NULL).
Here's an example:
WHILE (FINFO("WRKTMP", "EOF") > 0) DO
        INPUT cmdFile_currRec < WRKTMP
        ...parse the string "!cmdFile_currRec" for your info
         ...do something else
ENDWHILE

Does MPE-iX require boundary alignment for longs or doubles or other data types? Is there a C compiler directive to either flag such code when recognizable, or even to accommodate such code via extra moves to/from aligned locations?

Steve Dirickson replies:

Yes. Quantities must be aligned on "natural" boundaries. i.e., 'int's must be 4-byte aligned, and 'double's on 8-byte boundaries. If you have code that does something like this:

struct {
        char value1[3];
        char value2[3];
        int ival;
        } mystruct;

the compiler will, by default, insert padding so that the 'ival' member is properly aligned. However, if you cast a non-4-byte-aligned 'char' pointer to an 'int' pointer and attempt to dereference it, you'll get an exception.

The HP_ALIGN #pragma has an undocumented parameter of "NOPADDING" that tells the compiler to allocate data types and structures exactly as declared, without inserting padding for alignment purposes. However, there's no way any compiler can know that a cast from a *char to a *int will or won't be properly aligned, since the actual address to which the pointer points is determined at run-time.

There is a partial reprieve if you have a lot of MPE/V code that, for example, accesses TurboIMAGE data containing a lot of 16-bit integral types: the "+u" compiler option, in conjunction with the MPE_16 parameter to the HP_ALIGN #pragma, will make this 16-bit-based code compile and run on 32-bit machines without blowing up. However, there's a performance hit associated with "+u", so only use it where you need it. Check out pages 9-8 through 9-15 of the C/iX manual for more detailed information.

I am running FTP from MPE/iX 5.0, connecting to a remote site, and getting a file in binary mode. I want the file to end up as a bytes stream file, preferrable with an HFS name. Right now it arrives as 128W VB with an MPE name. I can use tobyte to copy the file to a byte stream file with the HFS name, but can it be done directly with ftp?

Randy Medd replies:

Yes it can. The following commands will do the trick:

ftp> type bytestream
ftp> get remfile ./hfsfile

On my HP 3000 9x9 server , the job and sessions maximum limit is 60,60. I want to increase it to 80,80. How can I do it?

Stan Sieler replies:

You should logon as MANAGER.SYS and enter sysgen at the colon prompt. Then you can view current settings by entering the following commands in sysgen:

sysgen> misc
misc> show job
misc> show session

You can then change the JOB and SESSION limits as desired:

misc> job maxlimit=80
misc> session maxlimit=80
and then"hold" them (necessary):
misc> ho
misc> exit

Save the new configuration (or, cut a new SLT tape and UPDATE to it) with the keep command in sysgen. Sysgen will tell you it's Keeping to group CONFIG.SYS, and then ask: Purge old configuration (yes/no)? Answer Y, then exit sysgen. Do a control-A SHUTDOWN, reboot, and at ISL prompt (don't AUTOBOOT!), enter: start norecovery group=config

When up, you'll have your new limits.


Copyright 1996, The 3000 NewsWire.