Using KSAM/XL and KSAM 64 (32650-90886)

266 AppendixC
HP C/iX Example Program
dump_file();
close_file();
return EXIT_SUCCESS;
}
static void close_file(void)
{
/* Close file */
FCLOSE(filenum, 0, 0);
assert(ccode()==CCE);
}
static void create_file(void)
{
/* Create sample KSAM XL file and load initial test data */
int status; short cmderror;
const int ksamxl=3, out=1, recsize=sizeof(record_t),
filesize=100, save=1, ascii=1;
const struct
{
short filler_1[10];
unsigned short language_id : 16;
short filler_2[4];
struct
{
unsigned short filler_1 : 10;
unsigned short chg_primary : 1;
unsigned short kslang : 1;
unsigned short ksreuse : 1;
unsigned short seq_random : 1;
unsigned short rec_numbering : 1;
unsigned short filler_2 : 1;
} flagword;
unsigned short filler_3 : 8;
unsigned short num_keys : 8;
struct
{
unsigned short key_type : 4;
unsigned short key_length : 12;
unsigned short key_location : 16;
unsigned short dflag : 1;
unsigned short filler_1 : 15;
unsigned short filler_2 : 8;
unsigned short rflag : 1;
unsigned short filler_3 : 7;
} keyparms[16];
} ksamparam = { {0}, 0, {0}, {0,0,1,0,0,0,0}, 0, 3,
{ {1, 5, 1,0,0,0,0,0},
{1,20, 6,1,0,0,0,0},
{1, 4,35,1,0,0,0,0} } };
const record_t test_data[] =
{
"11111DOE JOHN 1230067898540821201",
"03452CUSTER HERB 3218800003160821203",
"28766WORKMAN DEBBIE 0006612341520850601",
"33678MORSE EUGENE 8760098763160850715"
} ;
const int test_items = sizeof test_data / sizeof test_data[0];
int i;
/* First, purge file if it already exists */