Google
 

Trailing-Edge - PDP-10 Archives - BB-M251A-BM_1981 - subsys/fts.r36
There are no other files named fts.r36 in the archive.
%TITLE 'FTS.R36 ... FTS-20 definitions'

!LIBRARY 'BLI:XPORT';
LIBRARY 'RMS';
LIBRARY 'CONDIT';
!
! Request Block Definitions:
!
MACRO
    $FTS_BLOCK = BLOCK[FTS$K_LEN] FIELD(FTS$$REQUEST_FIELDS) %;

LITERAL
    FTS$K_FILESPEC_MAXIMUM_LENGTH = 300,        ! Characters in a filespec
    FTS$K_NODE_NAME_LENGTH = 6,         ! Characters in a node name
    FTS$K_MAX_MJOB = 8;                 ! Max simultaneous transfers

%IF (%VARIANT AND %O'400') NEQ 0 %THEN $SHOW(ALL) %FI

!
! FTSBLK - Request block definition
!
LITERAL
    FTS$K_VERSION = 4;                  ! Version no. of request block format
                                        ! IMPORTANT!!  Update each time you
                                        ! change FTS$$REQUEST_FIELDS
$FIELD
    FTS$$REQUEST_FIELDS =
       SET
       FTS$H_FUNCTION = [$SHORT_INTEGER],
       FTS$H_LENGTH = [$SHORT_INTEGER],
       FTS$H_VERSION = [$SHORT_INTEGER],        ! Version no. of req blk format
       FTS$H_REQUEST_ID = [$SHORT_INTEGER],     ! Binary request ID number
       FTS$H_PREREQUISITE_ID = [$SHORT_INTEGER],
       FTS$H_DEPENDENT_ID = [$SHORT_INTEGER],

       FTS$H_NEXT_RECORD = [$SHORT_INTEGER],    ! Record # of next record
       FTS$H_PREV_RECORD = [$SHORT_INTEGER],    ! Record # of previous record

       FTS$G_CTX = [$INTEGER],          ! Supplied by user, untouched by FTS

       FTS$H_OPTIONS = [$BITS(16)],     ! Global options
        $OVERLAY(FTS$H_OPTIONS)
        FTS$V_CHECKPOINT = [$BIT],      ! Reserved for checkpointing
        FTS$Z_NOTIFY = [$BITS(4)],      ! /NOTIFY bits
        FTS$V_ACTIVE = [$BIT],          ! Request is currently being processed
        FTS$V_HOLDING = [$BIT],         ! Request is being held
        FTS$V_DELETED = [$BIT],         ! Request has been deleted
        FTS$V_MATCH_EITHER = [$BIT],    ! Match either node name
        FTS$V_SEQ_CONTINUE = [$BIT],    ! Continue sequence in spite of errors
        FTS$Z_LIST_LEVEL = [$BITS(2)],  ! Level of directory listing desired
        $CONTINUE

        $OVERLAY(FTS$Z_NOTIFY)
        FTS$V_NOTIFY_TERMINAL = [$BIT], ! /NOTIFY:TERMINAL
        FTS$V_NOTIFY_MAIL = [$BIT],     ! /NOTIFY:MAIL
        FTS$V_NOTIFY_IPCF = [$BIT],     ! /NOTIFY:IPCF
        FTS$V_NOTIFY_FAILURE = [$BIT],  ! Notify only on failure of request
        $CONTINUE

       FTS$B_PRIORITY = [$BYTE],        ! Priority
       FTS$H_JOBNAME = [$SHORT_INTEGER],
       FTS$T_JOBNAME = [$STRING(6)],    ! Six-character job name
       FTS$H_TERMINAL = [$SHORT_INTEGER],       ! Terminal (for accounting & /NOTIFY)
       FTS$H_JOB_NUMBER = [$SHORT_INTEGER],
       FTS$G_NOTIFY_PID = [$INTEGER],   ! PID to notify for /NOTIFY:IPCF

       FTS$G_AFTER = [$INTEGER],        ! /AFTER date-time
       FTS$G_DEADLINE = [$INTEGER],     ! /DEADLINE date-time
       FTS$G_CREATION = [$INTEGER],     ! Date-time of creation of this request

       FTS$G_SOURCE_CHECKPOINT = [$INTEGER],
       FTS$G_DESTINATION_CHECKPOINT = [$INTEGER],

       FTS$H_ACCOUNT = [$SHORT_INTEGER],
       FTS$T_ACCOUNT = [$STRING(40)],   ! Account to charge
       FTS$G_USER_NUMBER = [$INTEGER],
       FTS$H_USERNAME = [$SHORT_INTEGER],
       FTS$T_USERNAME = [$STRING(40)],  ! Name of user who requested this
       FTS$H_CONNECTED_DIRECTORY = [$SHORT_INTEGER],
       FTS$T_CONNECTED_DIRECTORY = [$STRING(60)],
       FTS$G_CAPABILITIES = [$INTEGER], ! Enabled capabilities of requestor

       FTS$H_SOURCE_NODE = [$SHORT_INTEGER],
       FTS$T_SOURCE_NODE = [$STRING(FTS$K_NODE_NAME_LENGTH)],
       FTS$Z_SOURCE_FAB = [$SUB_BLOCK(FAB$K_SIZE)], ! RMS FAB
        FTS$Z_SOURCE_RFM = [$SUB_FIELD(FTS$Z_SOURCE_FAB,FAB$Z_RFM)],
        FTS$H_SOURCE_MRS = [$SUB_FIELD(FTS$Z_SOURCE_FAB,FAB$H_MRS)],
        FTS$H_SOURCE_FAC = [$SUB_FIELD(FTS$Z_SOURCE_FAB,FAB$H_FAC)],
        FTS$V_SOURCE_BIO = [$SUB_FIELD(FTS$Z_SOURCE_FAB,FAB$V_FAC_BIO)],
        FTS$V_SOURCE_BLK = [%FIELDEXPAND(FTS$V_SOURCE_BIO)],
       FTS$G_SOURCE_DATATYPE = [$BYTES(4)],
       FTS$H_SOURCE_FILESPEC = [$SHORT_INTEGER],        ! Byte count
       FTS$T_SOURCE_FILESPEC = [$STRING(FTS$K_FILESPEC_MAXIMUM_LENGTH)],
       FTS$H_SOURCE_STRUCTURE = [$SHORT_INTEGER],
       FTS$T_SOURCE_STRUCTURE = [$STRING (7)],

       FTS$H_DESTINATION_NODE = [$SHORT_INTEGER],
       FTS$T_DESTINATION_NODE = [$STRING(FTS$K_NODE_NAME_LENGTH)],
       FTS$Z_DESTINATION_FAB = [$SUB_BLOCK(FAB$K_SIZE)],
        FTS$Z_DESTINATION_RFM = [$SUB_FIELD(FTS$Z_DESTINATION_FAB,FAB$Z_RFM)],
        FTS$H_DESTINATION_MRS = [$SUB_FIELD(FTS$Z_DESTINATION_FAB,FAB$H_MRS)],
        FTS$H_DESTINATION_FAC = [$SUB_FIELD(FTS$Z_DESTINATION_FAB,FAB$H_FAC)],
        FTS$V_DESTINATION_BIO = [$SUB_FIELD(FTS$Z_DESTINATION_FAB,
                                            FAB$V_FAC_BIO)],
        FTS$V_DESTINATION_BLK = [%FIELDEXPAND(FTS$V_DESTINATION_BIO)],
       FTS$H_DESTINATION_FOP = [$SUB_FIELD(FTS$Z_DESTINATION_FAB,FAB$H_FOP)],
        FTS$V_DESTINATION_CIF = [$SUB_FIELD(FTS$Z_DESTINATION_FAB,
                                            FAB$V_FOP_CTG)],
        FTS$V_DESTINATION_SUP = [$SUB_FIELD(FTS$Z_DESTINATION_FAB,
                                            FAB$V_FOP_SUP)],
        FTS$V_DESTINATION_CTG = [$SUB_FIELD(FTS$Z_DESTINATION_FAB,
                                            FAB$V_FOP_CTG)],
       FTS$G_DESTINATION_DATATYPE = [$BYTES(4)],
       FTS$H_DESTINATION_FILESPEC = [$SHORT_INTEGER],
       FTS$T_DESTINATION_FILESPEC = [$STRING(FTS$K_FILESPEC_MAXIMUM_LENGTH)],
       FTS$H_DESTINATION_STRUCTURE = [$SHORT_INTEGER],
       FTS$T_DESTINATION_STRUCTURE = [$STRING (7)],

       FTS$H_LOG_FILESPEC = [$SHORT_INTEGER],
       FTS$T_LOG_FILESPEC = [$STRING(FTS$K_FILESPEC_MAXIMUM_LENGTH)],
       FTS$H_LOG_STRUCTURE = [$SHORT_INTEGER],
       FTS$T_LOG_STRUCTURE = [$STRING (7)],

       FTS$G_REQUEUE_COUNT = [$INTEGER]
       TES;
!
! End of FTSBLK
!
LITERAL
   FTS$K_LEN = $FIELD_SET_SIZE,
   FTS$K_CHAR_COUNT = %BLISS36 ( 5* ) FTS$K_LEN;

LITERAL
    FTS$K_COPY = 1,
    FTS$K_APPEND = 2,
    FTS$K_DELETE = 3,
    FTS$K_RENAME = 4,
    FTS$K_PRINT = 5,
    FTS$K_SUBMIT = 6,
    FTS$K_DIRECTORY = 7,

    FTS$K_MIN_FUNCTION = 1,
    FTS$K_MAX_FUNCTION = 7;

LITERAL                                 ! DATATYPE values
    FTS$K_DATATYPE_ASCII = TYP$K_CLASS_ASCII,
    FTS$K_DATATYPE_IMAGE = TYP$K_CLASS_IMAGE,
    FTS$K_DATATYPE_MACY11 = TYP$K_CLASS_MACY11;

LITERAL                                 ! RFM values
    FTS$K_RFM_FIX = FAB$K_RFM_FIX,
    FTS$K_RFM_VAR = FAB$K_RFM_VAR,
    FTS$K_RFM_STM = FAB$K_RFM_STM,
    FTS$K_RFM_VFC = FAB$K_RFM_VFC,
    FTS$K_RFM_UDF = FAB$K_RFM_UDF;

!
! Directory listing level (/BRIEF, /FULL, /LIST):
!

LITERAL
    FTS$K_LIST_NONE = 0,
    FTS$K_LIST_BRIEF = 1,
    FTS$K_LIST_NORMAL = 2,
    FTS$K_LIST_FULL=3,
    FTS$K_LIST_NAME_ONLY=5;             ! Used internally

!
! /QUEUE switch values
!

LITERAL
       FTS$K_NO_QUEUE=0,
       FTS$K_QUEUE=1,
       FTS$K_MAYBE_QUEUE=2;

!
! Interprocess message codes
!
$LITERAL
    FTSQ$K_ENTER = $DISTINCT,           ! Enter a request in the queue
    FTSQ$K_DELETE = $DISTINCT,          ! Delete a request
    FTSQ$K_FIND = $DISTINCT,            ! Find a request or requests
    FTSQ$K_MODIFY = $DISTINCT,          ! Modify a request
    FTSQ$K_LOG = $DISTINCT,             ! Place text in log file
    FTSQ$K_STATUS = $DISTINCT,          ! Report status of a request
    FTSQ$K_ACK = $DISTINCT,             ! Acknowledgement message
    FTSQ$K_NACK = $DISTINCT,            ! Negative acknowledgement
    FTSQ$K_CONNECT_ME = $DISTINCT;      ! Connect me (slave) to a directory
!
! FTSQBK - Interprocess queue manipulation messages
!
$FIELD
    FTSQ$$MESSAGE_FIELDS =
        SET
        FTSQ$B_FUNCTION = [$BYTE],
        FTSQ$B_ITEM_CODE = [$BYTE],     ! For MODIFY requests only
        FTSQ$H_LENGTH = [$SHORT_INTEGER],
        FTSQ$G_COMP_CODE = [$INTEGER],
            $OVERLAY (FTSQ$G_COMP_CODE)
            FTSQ$G_REQ_ID = [$INTEGER], ! For MODIFY and DELETE
            $CONTINUE
        FTSQ$G_NEW_VALUE = [$INTEGER],  ! For MODIFY only
            $OVERLAY (FTSQ$G_NEW_VALUE)
            FTSQ$G_2ND_CODE = [$INTEGER],       ! For STATUS and ACK/NACK only
            $CONTINUE
        FTSQ$H_SEQUENCE_NUMBER = [$SHORT_INTEGER],
        FTSQ$H_SENDER_JOB = [$SHORT_INTEGER],
        FTSQ$Z_REQ_BLOCK = [$SUB_BLOCK (FTS$K_LEN)],
            $OVERLAY (FTSQ$Z_REQ_BLOCK)        ! For STATUS and CONNECT msgs
            FTSQ$G_JOB_HANDLE = [$INTEGER],
            FTSQ$H_STATUS_TEXT = [$SHORT_INTEGER],
            FTSQ$T_STATUS_TEXT = [$STRING (255)],
            $CONTINUE
        FTSQ$G_CTX = [$INTEGER]
        TES;
!
! End of FTSQBK
!
! The message cannot be larger than one page
!
%IF $FIELD_SET_SIZE GTR 512
%THEN
    %ERROR ('FTSQ IPCF message exceeds one page')
%FI

!
! Item number codes for MODIFY messages.
!
$LITERAL
    FTSQ$K_AFTER = $DISTINCT,
    FTSQ$K_DEADLINE = $DISTINCT,
    FTSQ$K_PRIORITY = $DISTINCT,
    FTSQ$K_HOLDING = $DISTINCT,
    FTSQ$K_DEPENDENT_ID = $DISTINCT,
    FTSQ$K_PREREQUISITE_ID = $DISTINCT,
    FTSQ$K_SEQUENCE = $DISTINCT,
    FTSQ$K_LOG_FILESPEC = $DISTINCT,
    FTSQ$K_NOTIFY= $DISTINCT;

!
! FTSJBK - Scheduler job status block
!
$FIELD
    FTSJ$$JOBSTAT_FIELDS =
        SET
        FTSJ$V_BITS = [$BITS (16)],
            $OVERLAY (FTSJ$V_BITS)
            FTSJ$V_INUSE = [$BIT],
            FTSJ$V_SIGNED_ON = [$BIT],
            FTSJ$V_STATUS_REPORTED = [$BIT],
            FTSJ$V_ERROR_LOGOUT_PENDING = [$BIT],
            FTSJ$V_FORCED_LOGOUT_PENDING = [$BIT],
            FTSJ$V_FLUSH_REQUEST = [$BIT],
            FTSJ$V_REQ_COMPLETED = [$BIT],
            FTSJ$V_NOTIFY_MAIL = [$BIT],
            FTSJ$V_NOTIFY_TERMINAL = [$BIT],
            FTSJ$V_NOTIFY_IPCF = [$BIT],
            FTSJ$V_ALREADY_DELETED = [$BIT],
            FTSJ$V_ALREADY_NOTIFIED = [$BIT],
            $CONTINUE
        FTSJ$H_JOB_NUMBER = [$SHORT_INTEGER],
        FTSJ$H_REQUEST_ID = [$SHORT_INTEGER],
        FTSJ$A_REQ_BLOCK = [$ADDRESS],
        FTSJ$G_JOB_CREATE_TIME = [$INTEGER],
        FTSJ$G_BLOCKS_READ = [$INTEGER],
        FTSJ$G_BLOCKS_WRITTEN = [$INTEGER],
        FTSJ$G_LAST_ERROR = [$INTEGER],
        FTSJ$G_USER_NUMBER = [$INTEGER],
        FTSJ$G_PACKETS_XFERRED = [$INTEGER],
        FTSJ$G_RUNTIME = [$INTEGER],
        FTSJ$G_2ND_CODE = [$INTEGER],
        FTSJ$T_EXTRA_TEXT = [$DESCRIPTOR (DYNAMIC)],
        FTSJ$G_SERIAL_NUMBER = [$INTEGER]
        TES;
!
! End of FTSJBK
!

LITERAL
    FTSJ$K_LEN = $FIELD_SET_SIZE;

!
! Some bits for NOTIFY
!
LITERAL
    FTS$$V_NOTIFY_MAIL = 1,
    FTS$$V_NOTIFY_TERMINAL = 2,
    FTS$$V_NOTIFY_IPCF = 4;

!
! Define FTS error codes and related strings
!
MACRO
    $fts$errors = 
	$fts$error
(
FTS$_NORMAL,		NORM, 1, SUCCESS,     'successful completion',
FTS$_MORE,		MORE, 2, SUCCESS,     'successful partial completion',
FTS$_REQ_NOT_FOUND,	RQNF, 3, WARNING,     'request not found',
FTS$_HOLD,		HOLD, 4, WARNING,     'request is on HOLD',
FTS$_INVALID_REQUEST,	INVR, 5, ERROR,       'invalid request block format',
FTS$_RMS_ERROR,		RMSE, 6, ERROR,       'unexpected RMS error',
FTS$_ACTIVE,		ACTI, 7, ERROR,       'request already active',
FTS$_INV_BLK_LEN,	INVL, 8, ERROR,       'invalid request block length',
FTS$_INV_FUN_CODE,	INVC, 9, ERROR,       'invalid request function code',
FTS$_INV_FLAGS,		INVF, 10, ERROR,      'invalid request flags',
FTS$_NO_SPOOLER,        NSPL, 11, ERROR,      'spooler not started',
FTS$_MJOB_EXCEEDED,     MJOB, 12, ERROR,      'mjob exceeded',
FTS$_NO_MEMORY,         NMEM, 13, ERROR,      'insufficient dynamic memory',
FTS$_NO_MASTER,         NMAS, 14, ERROR,      'master FTS job not running',
FTS$_NO_SEND,           NSEN, 15, ERROR,      'cannot send IPCF to master FTS job',
FTS$_NO_RECEIVE,        NREC, 16, ERROR,      'cannot receive IPCF from master FTS job',
FTS$_INSUFF_PRIVS,      NPRV, 17, ERROR,      'insufficient privileges',
FTS$_BUG,               BUG,  18, FATAL,      'internal FTS error',
FTS$_TWO_MASTERS,       TMAS, 19, ERROR,      'another spooler already active',
FTS$_ALREADY_STARTED,   ASTA, 20, ERROR,      'spooler already active',
FTS$_NO_JOB_SLOTS,      NJOB, 21, ERROR,      'no free job slots',
FTS$_SHUTDOWN,          SHUT, 22, ERROR,      'spooler has been shut down',
FTS$_NO_MESSAGE_PENDING,NPEN, 23, WARNING,    'no message pending',
FTS$_UNSOLICITED_STATUS,USTA, 24, ERROR,      'status message received from non-slave job',
FTS$_REQUEST_COMPLETED, OK,   25, SUCCESS,    'request completed OK',
FTS$_CHECKPOINT,        CHEC, 26, SUCCESS,    'checkpoint occurred',
FTS$_REQUEST_STARTED,   STAR, 27, SUCCESS,    'request started OK',
FTS$_NOT_MY_JOB_SENOR,  NMYJ, 28, ERROR,      'job not mine logged out',
FTS$_NOT_STARTED,       NSTA, 29, ERROR,      'spooler not yet started',
FTS$_NO_MAILER,         NMAI, 30, ERROR,      'cannot get PID for MAILER or MAILEX',
FTS$_NO_MAIL_CPY,       NWMC, 31, ERROR,      'cannot write MAIL.CPY',
FTS$_CANT_MAIL,         CMAI, 32, ERROR,      'cannot notify user via mail',
FTS$_INV_IPCF_MSG,      IIPC, 33, ERROR,      'invalid IPCF message received',
FTS$_USER_LOG_FAULT,    ULGF, 34, INFO,       'error writing to user log file',
FTS$_NOT_IMPLEMENTED,   NIMP, 35, ERROR,      'function not implemented',
FTS$_KILLED_BY_USER,    KBUS, 36, ERROR,      'request killed by user',
FTS$_SYSTEM_FULL,       SFUL, 37, INFO,       'can''t start subjob, system full',
FTS$_SPOOLER_STARTED,   SSTA, 38, INFO,       'spooler started',
FTS$_SPOOLER_STOPPED,   SSTO, 39, INFO,       'spooler shutdown initiated',
FTS$_SPOOLER_DOWN,      SDWN, 40, INFO,       'spooler shutdown completed',
FTS$_MISSED_MESSAGE,    MMES, 41, INFO,       'missed IPCF message from master FTS job',
FTS$_DEADLINE_EXPIRED,  DEXP, 42, ERROR,      'deadline expired',
FTS$_DEPENDENT_ABORTED, DEPA, 43, ERROR,      'prerequisite in a sequence aborted or failed',
FTS$_INVALID_DEPENDENCY,IDEP, 44, WARNING,    'prerequisite request is either nonexistent or not yours',
FTS$_TOO_MANY_OKINT,    TMOK, 45, FATAL,      'S$OKINT invoked while OKINT',
FTS$_SYS_LOG_FAULT,     SLGF, 46, FATAL,      'Can''t open system log file',
FTS$_INVALID_PRIORITY,  IPRI, 47, ERROR,      'Invalid priority specified',
FTS$_INV_REQ_BLK_VER,   IRQV, 48, ERROR,      'Invalid request block version',
FTS$_INV_STR_LENGTH,    ISTL, 49, ERROR,      'Invalid length string in request block',
FTS$_DEADLINE_CONFLICT, DEDC, 50, ERROR,      'Deadline and After parameters conflict',
FTS$_TEXT,              TEXT, 51, INFO,       '',
FTS$_STRUCTURE_NOT_UP,  NSTR, 52, ERROR,      'File structure not mounted',
FTS$_QUEUE_EMPTY,       QEMP, 53, WARNING,    'The queue is empty',
FTS$_DEADLINE_PAST,     DEDP, 54, ERROR,      'Deadline cannot be in the past',
FTS$_NO_CONNECT,        NCON, 55, ERROR,      'Cannot connect to directory',
FTS$_ARG_RANGE,         ARGR, 56, ERROR,      'Argument out of range',
FTS$_ARG_MISSING,       ARGM, 57, ERROR,      'Argument missing',
FTS$_NO_HELP_FILE,      NHLP, 58, ERROR,      'Cannot open help file (HLP:FTS.HLP)',
FTS$_HAS_DEPENDENT,     HDEP, 59, ERROR,      'Request specified as prerequisite already has a dependent',
FTS$_NO_DEPENDENT,      NDEP, 60, ERROR,      'Dependency being removed does not exist',
FTS$_QUEUE_FULL,        QFUL, 61, ERROR,      'FTS queue is full',
FTS$_CANT_GET_TOP_INT,  CGTP, 62, INFO,       'Cannot enable network topology change interrupts',
FTS$_WILDCARD_NOT_ALLOWED, WLDN, 63, ERROR,   'Wildcards not allowed for this operation',
FTS$_NOT_DISK,          NDSK, 64, ERROR,      'Device is not a disk',
FTS$_INVALID_ATTRIBUTES, IATT, 65, ERROR,     'Invalid file attributes specified',
FTS$_CANT_CREATE_JOB,   CJOB, 66, FATAL,      'Can''t create job',
FTS$_CANT_GET_FTS,      CGFT, 67, FATAL,      'User job can''t get SYS:FTS.EXE',
FTS$_SPACE_NOT_ALLOWED, SPCN, 68, ERROR,      'Spaces not allowed in USER, PASSWORD, or ACCOUNT fields',
FTS$_SOURCE_FILESPEC_MISSING, SFSM, 69, ERROR,      'Source Filespec Missing',
FTS$_DEST_FILESPEC_MISSING, DFSM, 70, ERROR, 'Destination Filespec Missing',
FTS$_SOURCE_FILESPEC_TOO_LONG, SFSL, 71, ERROR, 'Source Filespec too Long',
FTS$_DEST_FILESPEC_TOO_LONG, DFSL, 72, ERROR, 'Destination Filespec too Long',
FTS$_LOG_FILESPEC_TOO_LONG, LFSL, 73, ERROR, 'Log Filespec too Long',
FTS$_SOURCE_NODE_TOO_LONG, SNDL, 74, ERROR, 'Source Node name too Long',
FTS$_SOURCE_STRUCTURE_TOO_LONG, SSTL, 75, ERROR, 'Source Structure too Long',
FTS$_DEST_NODE_TOO_LONG, DNDL, 76, ERROR, 'Destination Node name too Long',
FTS$_DEST_STRUCTURE_TOO_LONG, DSTL, 77, ERROR,'Destination Structure too Long',
FTS$_LOG_STRUCTURE_TOO_LONG, LSTL, 78, ERROR, 'Log Structure too Long',
FTS$_JOBNAME_TOO_LONG, JNML, 79, ERROR, 'Jobname too Long'
) %;
!
! Now define the symbolic names
!
COMPILETIME
    FTS$K_ERRTAB_LENGTH = 0,
    FTS$K_FACILITY_CODE = %O'1000000';

MACRO
    $FTS$ERROR[CODE,SCODE,VALUE,SEVERITY,TEXT] =
        %ASSIGN (FTS$K_ERRTAB_LENGTH, %COUNT + 1)
        CODE = (VALUE ^ 3) + FTS$K_FACILITY_CODE + %NAME (STS$K_, SEVERITY)
        %;

LITERAL
   $FTS$ERRORS;

!
! Log file hacking macros
!
MACRO
    !
    ! Place a line of text into the log file
    !
    $FTS_LOG (text) =
        BEGIN
        %IF NOT %DECLARED (l$text)
        %THEN
        EXTERNAL ROUTINE
            l$text : NOVALUE;
        %FI
        EXTERNAL
            mst_flag;
        LOCAL
            log_descr : $STR_DESCRIPTOR ();
        IF .mst_flag
        THEN
            BEGIN
            $STR_DESC_INIT (DESCRIPTOR = log_descr,
                            CLASS = DYNAMIC);
            $STR_COPY (STRING = %REMOVE (text), TARGET = log_descr);
            l$text (log_descr);
            $XPO_FREE_MEM (STRING = log_descr);
            END;
        END %,
    !
    ! Place a line of text pertaining to a particular slave job in the log
    !
    $FTS_JOB_LOG (jobhandle, text) =
        BEGIN
        EXTERNAL ROUTINE
            lj$text : NOVALUE;
        EXTERNAL
            mst_flag;
        LOCAL
            log_descr : $STR_DESCRIPTOR ();
        IF .mst_flag
        THEN
            BEGIN
            $STR_DESC_INIT (DESCRIPTOR = log_descr,
                            CLASS = DYNAMIC);
            $STR_COPY (STRING = %REMOVE (text), TARGET = log_descr);
            lj$text (log_descr, jobhandle);
            $XPO_FREE_MEM (STRING = log_descr);
            END;
        END % ;