perror("open Error");
CleanUpOnError(5);
return ;
}
printf("Opened %s for reading.\n",TEST_FILE);
7
/ᑍ Read from the TEST_FILE file, via FilDes, into Buffer. ᑍ/
BytesRead = read(FilDes,Buffer,sizeof(Buffer));
if ( -1 == BytesRead )
{
perror("read Error");
CleanUpOnError(6);
return ;
}
printf("Read %s from %s.\n",Buffer,TEST_FILE);
if ( BytesRead != BytesWritten )
{
printf("WARNING: the number of bytes read is "\
"not equal to the number of bytes written.\n");
}
8
/ᑍ Close the TEST_FILE file via FilDes. ᑍ/
if ( -1 == close(FilDes) )
{
perror("close Error");
CleanUpOnError(7);
return ;
}
FilDes = -1;
printf("Closed %s.\n",TEST_FILE);
9
/ᑍ Unlink the file TEST_FILE ᑍ/
if ( -1 == unlink(TEST_FILE) )
{
perror("unlink Error");
CleanUpOnError(8);
return ;
}
printf("Unlinking file %s.\n",TEST_FILE);
printf("Program completed successfully.\n");
return ;
}
Using the Integrated File System—ILE COBOL Example
This example program uses the integrated file system from ILE COBOL.
PROCESS NOMONOPRC.
IDENTIFICATION DIVISION.
ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
ᑍ
B-178 System API Programming V4R1