When working with partitioned files, it is useful to quickly locate the first (the "oldest" when partitioning by date) and last ("newest") partition members for administrative purposes. Two modes have been added to the GetCtFileInfo() function to support this ability.
If GETFIL() returns -1, check the value of uerr_cod. If uerr_cod is zero, the file has no active partitions. If uerr_cod is non-zero, an error occurred. For example, if the specified file number does not correspond to a partition host file, GETFIL() returns -1 and sets uerr_cod to PHST_ERR.
Example
COUNT datno;
NINT rc;
LONG partno;
if ((partno = GETFIL(datno, FRSACTPRT)) == -1L) {
if ((rc = uerr_cod))
printf(
"Error: Failed to get first active partition number: %d\n",
rc);
else
printf("The file has no active partitions.\n");
} else
printf("first active partition: %d\n", partno);
if ((partno = GETFIL(datno, LSTACTPRT)) == -1L) {
if ((rc = uerr_cod))
printf(
"Error: Failed to get last active partition number: %d\n",
rc);
else
printf("The file has no active partitions.\n");
} else
printf("last active partition: %d\n", partno);