Guardian Programmer's Guide

Table Of Contents
Communicating With Disk Files
Guardian Programmer’s Guide 421922-014
5 - 78
Creating Partitioned Files
The simplest way to create a partitioned file is by using the FUP CREATE command as
shown below. This example creates a partitioned file that could be used by the
inventory application described in the subsection Using Key-Sequenced Files, earlier in
this section.
1>
FUP
-SET TYPE K
-SET REC 134
-SET EXT (64,8)
-SET BLOCK 4096
-SET IBLOCK 4096
-SET KEYLEN 8
-SET PART (1,$PART1,64,8,"25")
-SET PART (2,$PART2,64,8,"50")
-SET PART (3,$PART3,64,8,"75")
-CREATE KEYFILE
.
.
-EXIT
2>
Refer to the File Utility Program (FUP) Reference Manual for more details on how to
create files using the FUP CREATE command.
The next example creates the same file programmatically using the
FILE_CREATELIST_ procedure. You supply this procedure with an item-list and a
list of corresponding values. The item-list parameter is an array of numbers that
identify the values given in the values parameter. In the following example, item
number 41 identifies the first word of the values array as the file type, item number 43
identifies the second word as the record length, and so on.
?NOLIST
?INSPECT,SYMBOLS
?SOURCE $SYSTEM.ZSYSDEFS.ZSYSTAL
! Global variables:
STRING .S^PTR;
.
.
?SOURCE $SYSTEM.SYSTEM.EXTDECS0
?LIST
.
.