Enscribe Programmer's Guide

Queue File Examples
These examples illustrate the three different ways to create queue files.
Example 1: Creating a Queue File with FUP
This example shows how you might use FUP to create a queue file:
10> FUP
- SET TYPE K
- SET CODE 1001
- SET QUEUEFILE
- SET EXT (20,10)
- SET MAXEXTENTS 64
- SET KEYLEN 10
- SET REC 100
- SET AUDIT
- CREATE QFILE
- EXIT
>
Example 2: Creating a Queue File With the FILE_CREATE_Procedure
This TAL example creates a queue file using the FILE_CREATE_Procedure. The nod name is snot
specified in the procedure call, so FILE_CREATE_ 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.
STRING .QF^Name[0:33] := "$spool.lst.qfile"; ! File name
LITERAL QF^NameLength = 16; ! Length in
! bytes of file name
INT QF^NameLen;
LITERAL Key^Length = 8; ! Key length
! (must be >= 8)
INT Key^Len;
STRING .Key[0:Key^Length - 8]; ! Application key
LITERAL Rec^Len = 100; ! Record length
INT Error; ! Returned error code
?SOURCE $SYSTEM.SYSTEM.EXTDECS0
(FILE_CREATE_,FILE_CREATELIST_)
QF^NameLen := QF^NameLength;
Key^Len := Key^Length;
Error := FILE_CREATE_(
QF^Name:34, ! filename:maxlen
QF^NameLen, ! filenamelen
1001, ! filecode
20, ! primary-extent-size
10, ! secondary-extent-size
64, ! maximum-extents
3, ! file-type (key-sequenced)
%000102, ! options (queue file, audited)
Rec^Len, ! recordlen
4096, ! blocklen
Key^Len, ! keylen
0); ! key-offset (must be zero)
IF Error <> 0 THEN ... ! error
Example 3: Creating a Queue File With the FILE_CREATELIST_ Procedure
This example creates a queue file using the FILE_CREATELIST_procedure:
! Create a Queue File with FILE_CREATELIST_
STRING .QF^Name[0:33] := "$spool.lst.qfile"; ! File name
LITERAL QF^NameLength = 16; ! Length in
! bytes of file name
Creating Queue Files 109