next up previous contents
Next: OBJDESC Up: Record Type Format Specifications Previous: Record Type Format Specifications   Contents


TEST


This must be the first record in any dataset. This contains all of the information needed to determine how to read the dataset. The information is stored in 8-bit bytes so that it is machine-independent. A reader program on any computer system should be able to determine the format of the dataset, whether or not it can read that dataset, and how to read it.

The dataset is defined to begin at the TEST record, no matter what information appears before it. It is permissible to include miscellaneous information before this record in the dataset (such as a Standard Format Data Unit label); such prepended information will not be considered to be a part of the dataset for the purposes of this standard. If the dataset is written with some sort of header bytes before the TEST record (e.g., the byte array header in the XDR format) then the dataset is defined to start with that header. The presence of these headers can be deduced from the contents of the TEST record. Thus, when trying to identify a dataset of unknown type, a program should scan until it encounters the magic number, read the next 20 bytes, and determine whether header bytes are present

The record consists of a total of 24 bytes.

name

bytes
description
MAGIC

MACHID

5
contains an identification number of the machine that generated the dataset. This field is for tracking the history of the dataset and is not needed for interpreting the dataset. The codes are as follows:

0 = unknown (free use of this code is discouraged)
1 = DEC VAX running VMS
2 = Silicon Graphics running IRIX
3 = Cray Y-MP running UNICOS
4 = IBM mainframe running MVS
5 = MS-DOS personal computer
6 = Apple Macintosh running Mac OS
7 = Sun workstation running SunOS
8 = DEC Ultrix workstation
9 = Hewlett-Packardrunning HP-UX
10 = IBM running AIX
11 = Convex
12 = Linux
13 = Microsoft Windows
14 = A/UX or Mac OS X
15 = OSF
15 = RISC OS
NUMOBJECTS

6
is the number of data objects contained in the dataset. If zero, then there is assumed to be one data object
SPECA

7
contains information about the byte and word formats of the data. Bits are specified as follows (counting from the least significant bit):

CHARSET
(bits 0-1) indicates which character set is used for text as follows:
0 = XDR (subsequent bits in this byte are ignored)
1 = ASCII
2 = EBCDIC
BSWAP
(bit 2) indicates what kind of byte-swapping is used as follows:
0 = most significant byte is stored in the lower of the two machine word addresses
1 = most significant byte is stored in the higher of the two machine word addresses
WSWAP
(bit 3) indicates what kind of word-swapping is used as follows:
0 = most significant word is stored in the lower of the two machine word addresses
1 = most significant word is stored in the higher of the two machine word addresses
RESERVE
(bits 4-7) is reserved for future expansion
RESERVED1

8
is reserved for future expansion
RECHDR

9
indicates what kind of operating system and language record headers are present. The intent here is to specify which algorithm to use in tracing through any headers present, not to specify which machine wrote the dataset. This field is completely independent of the MACHID field. A machine may be able to read and write headers from foreign machines. The codes are specified as follows:

0 = XDR
1 = none (pure stream file)
2 = VMS Fortran segmented variable length
3 = f77 Fortran
4 = Cray COS
5 = IBM VBS
RESERVED2

10
is reserved for future expansion
SPECB

11
contains information about array ordering and index references. Bits are specified as follows (counting from the least significant bit):

ARRORD
(bit 0) indicates the ordering of elements in multidimensional arrays:
0 = fastest-varying index is last (most languages)
1 = slowest-varying index is last (Fortran, IDL)
IDXSTART
(bit 1) indicates the starting value of indices:
0 = start from 0
1 = start from 1
RESERVE
(bits 2-7) is reserved for future expansion
SLEN

12
indicates the length in bits of a short integer

0 = XDR
LLEN

13
indicates the length in bits of a long integer

0 = XDR
FLEN

14
indicates the length in bits of a single precision floating-point number

0 = XDR
DLEN

15
indicates the length in bits of a double precision floating-point number

0 = XDR
FPFORM

16
contains information about the form of floating-point numbers. Bits are specified as follows (counting from the least significant bit):

SP
(bits 0-3) indicates the format code of a single precision floating-point number:
0 = XDR
1 = IEEE
2 = VAX
3 = IBM mainframe
4 = Cray
DP
(bits 4-7) indicates the format code of a double precision floating-point number:
0 = XDR
1 = IEEE
2 = VAX D
3 = IBM mainframe
4 = Cray
5 = VAX G
RESERVED3

17
is reserved for future expansion
RESERVED4

18
is reserved for future expansion
RESERVED5

19
is reserved for future expansion
RESERVED6

20
is reserved for future expansion
RESERVED7

21
is reserved for future expansion
RESERVED8

22
is reserved for future expansion
RESERVED9

23
is reserved for future expansion
RESERVED10

24
is reserved for future expansion


next up previous contents
Next: OBJDESC Up: Record Type Format Specifications Previous: Record Type Format Specifications   Contents
Eric Nash 2003-09-25