Enscribe Programmer's Guide

EXT ( 60 PAGES, 30 PAGES )
REC 112
BLOCK 4096
MAXEXTENTS 16
-create empfile
CREATED - $STORE1.SVOL1.EMPFILE
Using the FILE_CREATE_ system procedure, you could create the same file by including the TAL
code in one of your application modules. The node name is not specified, so the FILE_CREATE_
procedure obtains the node name from the current value of the VOLUME attribute of the =_DEFAULTS
DEFINE. For more information on the =_DEFAULTS DEFINE, see the TACL Programming Guide.
LITERAL name^length = 21,
pri^extent = 60,
sec^extent = 30,
file^type = 1,
rec^len = 112,
data^block^len = 4096;
INT namelen;
INT error;
STRING .filename [0:name^length-1] :=
"$STORE1.SVOL1.EMPFILE";
namelen := name^length;
error := FILE_CREATE_ (filename:name^length,
namelen,, pri^extent, sec^extent,,
file^type,, rec^len, data^block^len);
IF error <> 0 THEN ... ! error
Example 2: Creating a Relative File With Alternate Keys
This example shows how to create the file illustrated in “Example 1: Creating a Relative File
(page 138) but defines the department code field as an alternate key.
salary hire-date termination-date
90 100 106 112
name
home-address emp-# dept-code job-code
Byte Offset:
580857040
Alternate-Key
Field DP
You could create the file by using these FUP commands:
>volume.$store1.svol1
>fup
-set type r
-set ext (60,30)
-set rec 112
-set block 4096
-set altkey ("DP",keyoff 80,keylen 5)
-set altfile (0,dept)
-show
TYPE R
EXT ( 60 PAGES, 30 PAGES )
Creating Relative Files 139