This routine is used to create a new indexed file. It will overwrite any existing file. This routine will not overwrite a file that is currently in use. If the file is in use, the error E_FILE_LOCKED will be returned. The MAKE routine has six parameters, name, comment, p_parms, l_parms, keys, and trans.
This routine does not automatically terminate its parameters with LOW-VALUES, you must insure that the parameters are correctly terminated yourself. If you do not wish to supply an alternate collating sequence in the trans parameter to MAKE, then simply omit the parameter. The I$IO routine does not allow you to specify a NULL parameter which is what is expected by the MAKE routine. Instead, by omitting the parameter, the I$IO routine will construct a NULL parameter for you.
The host file system may ignore any or all of the values specified by comment, p_parms and trans. If the host system cannot perform the requested operation, it is ignored (however, if the trans value is ignored, F-ERRNO is set to W_NO_SUPPORT). If the host system cannot support one of the values specified in l_parms or keys, then MAKE fails and RETURN-CODE is set to the error condition E_NO_SUPPORT. If any of the parameters are ill-formed or contain values outside of the legal range of values, E_PARAM_ERR is returned.
Name | points to the name of the file. This must be null-terminated. |
Comment | may be NULL or may point to comment string that describes the file. This comment is stored in the file, but has no other functional use. The comment may be up to 30 characters long and must be null-terminated. Many host file systems cannot store comments. On these systems, this parameter is ignored. |
P_parms | points to a string that describes various physical characteristics of the file. This string consists of five numeric fields
separated by commas and must be null-terminated. Each of these fields advises the file system of desired treatment for the
physical storage of the file. Individual file systems may ignore some or all of these fields. Furthermore, p_parms may be
NULL to imply
0 for each of the fields.
The filesys.def COPY file has a data item containing these fields. The fields are as follows:
|
l_parms | points to a string that describes various logical characteristics of the file. The string consists of three numeric fields
separated by commas. The string must be null-terminated.
The filesys.def COPY file has a data item containing these fields. The fields are as follows:
|
keys | points to a null-terminated string that describes the key structure for the file. keys is a string of numbers separated by
commas. The first key described is the primary key. It may not allow duplicate values. The primary key is called key
0. The next key described is key
1 and so on. There should be as many keys described as the "number of keys" field of l_parms indicates.
The filesys.def COPY file has a data item containing these fields. Each key description contains the following information:
For example, a file with two keys, the first one having two segments (offset zero, length 10 and offset 50, length 5) and the second one with one segment (offset 20, length 15) and allowing duplicates would be written: 2,0,10,0,5,50,1,1,15,20 |
trans | This parameter specifies an alternate collating sequence for the keys. If this parameter is NULL, then keys are ordered in ascending sequence based on their native unsigned value. If trans is not NULL, it must point to a 256 byte region of memory. Unlike other strings, this need not be null-terminated and is likely to contain nulls within it. This 256 byte region is used as a translation table on the bytes of each key to arrive at a new key-ordering. Each byte is used as an index into this table, and the resulting value is used to order the keys. Some host file systems cannot do key translations. On these systems, this parameter is ignored. |