If the abort occurred during execution of an in trinsic, a subsystem library routine, or a user library routine, then the location is giv en within the appropriate routine and the program ￿le location indicates the location from whic h the routine was called in the user's program.

For detailed information on reading an abort message, refer to MPE/iX Intrinsics R eference Manual (32650-90028) j or the MPE/iX Commands Reference Manual Volumes 1 and 2 (32650-90003 and 32650-90364).

Typical Causes of Program Aborts

Two causes of abort that occur frequen tly are data memory protection traps and aborts in library routines.

A data memory protection trap occurs when a program attempts to address outside the bounds of the code/data area. This can be caused b y a faulty address or index used for a subscript. For example, a parameter address ma y be passed as a b yte address, rather than a word-aligned address expected b y the called routine. Address corruption can occur if an array subscript goes out of the bounds of the array , but is still inside the bounds of the stac k.

When an abort occurs in a library routine, the problem is most frequen tly in the user program. Examine the program for ￿le equations that y ou may have overlooked. It is possible, although considerably less frequen t, that a bug actually exists in the library routine itself.

File Information Display (Tombstone)

It is frequently necessary to obtain status information on a ￿le to determine the cause of an error. A ￿le information displa y is frequently called a tom bstone. It pro vides:

Actual physical and operational ￿le c haracteristics.

Current ￿le information, pertaining to end of ￿le, record poin ter, and logical and ph ysical transfer count.

Information on the last error for the ￿le and the last HPFOPEN or FOPEN error.

When a ￿le is opened, the ￿nal c haracteristics ma y be di￿erent from those originally requested because of defaults, o verrides, :FILE commands, and the ￿le label.

You can use the PRINTFILEINFO intrinsic to prin t a tombstone. It requires that y ou specify the ￿le number returned when the ￿le is opened b y HPFOPEN or FOPEN . The tombstone can display either a full or short format. If the ￿le is open, it pro vides a full displa y. Otherwise, it provides a short displa y. Calling this in trinsic does not automatically abort the program.

You can call the PRINTFILEINFO intrinsic from programs written in COBOL II/XL and HP FORTRAN 77/iX. When calling from COBOL II/XL, use the FD ￿lename. Y ou can call the name PRINTFILEINFO directly from HP F ORTRAN 77/iX programs. You can obtain the required ￿le number by using the FNUM intrinsic.

3-20 Program Development