Enscribe Programmer's Guide

ERROR := FILE_CREATELIST_ (filename:name^length,namelen,
item^list, item^list^len, value^list,
$LEN(value^list), error2);
END;
When you use a system procedure to create your entry-sequenced file, you must create your
alternate key files separately, as shown in the next example.
Example 3: Creating an Alternate-Key File Programmatically
When you use FUP to create the primary file, FUP automatically creates any required alternate-key
files. If you create the primary file programmatically, however, you must create the alternate-key
file yourself as a separate operation.
You could create the alternate-key file for the previous example (Example 2) by including this TAL
code in one of your application modules:
LITERAL name^length = 21,
pri^extent = 30,
sec^extent = 15,
file^type = 3,
rec^len = 11,
data^block^len = 4096,
key^length = 11, ! maximum alt.-key length
! + big files primary-key length
! + 2
key^offset = 0;
INT error;
INT namelen;
STRING .filename [0:name^length-1]
:= "$STORE1.SVOL1.ALTTRAN";
namelen := name^length;
error := FILE_CREATE_(filename:name^length, namelen,,
pri^extent, sec^extent,, file^type,, rec^len,
data^block^len, key^length, key^offset);
IF Error <> 0 THEN ... ! error
Example 4: Creating a Partitioned Entry-Sequenced File
This example shows how to create the file illustrated in Example 1: Creating an Entry- Sequenced
File, but enables it to ultimately span four partitions.
You could create the file by using these FUP commands:
>volume $store1.svol1
>fup
-set type e
-set ext (1000,500)
-set rec 60
-set block 4096
-set part (1,$store2,1000,500)
-set part (2,$store3,1000,500)
-set part (3,$store4,1000,500)
-show
TYPE E
EXT ( 1000 PAGES, 500 PAGES )
REC 60
BLOCK 4096
PART ( 1, $STORE2, 1000, 500 )
PART ( 2, $STORE3, 1000, 500 )
PART ( 3, $STORE4, 1000, 500 )
-create tranfile
CREATED - $STORE1.SVOL1.TRANFILE
Creating Entry-Sequenced Files 129