Enscribe Programmer's Guide
value^list.altkey^descr[1].null^value := 0;
value^list.altkey^descr[1].attributes := 0;
value^list.num^alt^key^files := num^altkey^files;
value^list.name^length^info[0].file^name^len := 6;
value^list.file^names ':=' "INVALT";
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 key-sequenced file, you must create your alternate
key files separately. For more information, see Accessing Key- Sequenced Files“Accessing
Key-Sequenced Files” (page 85)
Example 3: Creating a Key-Sequenced Format 2 File With Alternate Keys
This example creates the same file as in “Example 2: Creating a Key-Sequenced File With Alternate
Keys” (page 77), except that it creates a format 2 file.
You could create the file by using these FUP commands:
volume $store1.svol1
fup
-set type k
-set code 1001
-set ext (32,8)
-set format 2
-set rec 54
-set block 4096
-set keylen 2
-set altkey ("LO",keyoff 42,keylen 4)
-set altkey ("VN",keyoff 46,keylen 8)
-set altfile (0,invalt)
-show
TYPE K
FORMAT 2
CODE 1001
EXT ( 32 PAGES, 8 PAGES )
FORMAT 2
REC 54
BLOCK 4096
IBLOCK 4096
KEYLEN 2
KEYOFF 0
ALTKEY ( "LO", FILE 0, KEYOFF 42, KEYLEN 4 )
ALTKEY ( "VN", FILE 0, KEYOFF 46, KEYLEN 8 )
ALTFILE ( 0, $STORE1.SVOL1.INVALT )
ALTCREATE
-create inv
CREATED - $STORE1.SVOL1.INV
CREATED - $STORE1.SVOL1.INVALT
Using the FILE_CREATELIST_ system procedure, you could create the file by including this TAL code
in one of your application modules.
The volume name, subvolume name, and node name are not specified in the procedure call.
FILE_CREATELIST_ obtains them from the current value of the VOLUME attribute of the =_DEFAULTS
DEFINE.
?NOLIST
?SOURCE $SYSTEM.ZSYSDEFS.ZSYSTAL(FILESYSTEM^ITEMCODES)
?SOURCE $SYSTEM.SYSTEM.EXTDECS0(FILE_CLOSE_,
? FILE_OPEN_,
? FILE_CREATELIST_,
? READ)
?LIST
80 Key-Sequenced Files