/* @lastChanged: "1998-02-16 12:00"
 
 * @filename:   vut06
 * @purpose:    "UT_hostfile"
 * @release:    7.1.0.0
 * @see:        "-.-"
 *
 * @copyright:  (c) 1998-2004 SAP AG"
 */
 
.tt 1 $SAP$LiveCache$VUT06$
.tt 3 $$UT_hostfile$1998-12-16$
 
.nf
 
 .nf
 
 .nf

    ========== licence begin  GPL
    Copyright (c) 1998-2005 SAP AG

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    ========== licence end
.fo

 
.fo
 
 
.fo
***********************************************************
 
Module  : UT_hostfile
 
Define  :
 
        PROCEDURE
              u06hostfile_err (VAR term : tut_terminal;
                    VAR protfile : tut_vf_fileref;
                    write_prot   : boolean;
                    VAR errtext  : tsp00_ErrText);
 
        PROCEDURE
              u06outcopy_diag_extract (VAR term  : tut_terminal;
                    VAR protfile    : tut_vf_fileref;
                    is_save_outcopy : boolean;
                    snd_packet      : tsp1_packet_ptr;
                    host_packet     : tsp1_packet_ptr;
                    VAR sql_ref     : tsp00_Int4;
                    VAR rcv_packet  : tsp1_packet_ptr;
                    VAR pfkey       : tut_pfkey;
                    VAR sql_retcode : tsp00_Int2);
 
.CM *-END-* define --------------------------------------
.sp;.cp 3
Use     :
 
        FROM
              UT_utility_driver : VUT02;
 
        PROCEDURE
              u02receive (VAR term  : tut_terminal;
                    VAR protfile    : tut_vf_fileref;
                    VAR sql_ref     : tsp00_Int4;
                    msg_wanted      : integer;
                    VAR rcv_packet  : tsp1_packet_ptr;
                    VAR sql_retcode : tsp00_Int2);
 
        PROCEDURE
              u02send (VAR term     : tut_terminal;
                    VAR protfile    : tut_vf_fileref;
                    snd_packet      : tsp1_packet_ptr;
                    VAR sql_ref     : tsp00_Int4;
                    msg_wanted      : integer;
                    req_only        : boolean;
                    VAR rcv_packet  : tsp1_packet_ptr;
                    VAR sql_retcode : tsp00_Int2);
 
      ------------------------------ 
 
        FROM
              UT_errormsg : VUT03;
 
        PROCEDURE
              u03geterrormsg (errcode : tsp00_Int2; VAR ln : tsp00_Line);
 
      ------------------------------ 
 
        FROM
              UT_auxiliary_procedures : VUT05;
 
        PROCEDURE
              u05c20to_packet (n   : tsp00_C20;
                    snd_packet : tsp1_packet_ptr);
 
        FUNCTION
              u05isyes (VAR n : tsp00_Name): boolean;
 
        PROCEDURE
              u05packet_init (snd_packet : tsp1_packet_ptr);
 
      ------------------------------ 
 
        FROM
              GG_edit_routines : VGG17;
 
        PROCEDURE
              g17nameto_line (n : tsp00_Name;
                    VAR ln_len  : integer;
                    VAR ln      : tsp00_Line);
 
        PROCEDURE
              g17trimint4_to_line (int : tsp00_Int4;
                    VAR ln_len : integer;
                    VAR ln     : tsp00_Line);
 
      ------------------------------ 
 
        FROM
              TA_terminal_IO : VTA09;
 
        PROCEDURE
              t09get1name (VAR term : tut_terminal;
                    msg             : tsp00_C20;
                    msg_attr        : char;
                    in_attr         : char;
                    in_len          : integer;
                    upper_case      : boolean;
                    VAR in_name     : tsp00_Name;
                    VAR pfkey       : tut_pfkey);
 
        PROCEDURE
              t09getc256 (VAR term : tut_terminal;
                    msg           : tsp00_C20;
                    msg_attr      : char;
                    in_attr       : char;
                    in_len        : integer;
                    upper_case    : boolean;
                    VAR in_c256    : tsp00_VFilename;
                    VAR pfkey     : tut_pfkey);
 
        PROCEDURE
              t09newscreen_page (VAR term : tut_terminal);
 
        PROCEDURE
              t09put (VAR term : tut_terminal;
                    VAR text   : tsp00_Line;
                    text_attr  : char);
 
        PROCEDURE
              t09putmsg (VAR term     : tut_terminal;
                    VAR msg           : tsp00_Line;
                    is_warning        : boolean;
                    immediate_display : boolean);
 
        PROCEDURE
              t09returncode_set (VAR term : tut_terminal;
                    retcode : integer);
 
      ------------------------------ 
 
        FROM
              TA_write_protfile : VTA12;
 
        PROCEDURE
              t12write_prot (VAR fileref : tut_vf_fileref;
                    VAR ln    : tsp00_Line;
                    length    : integer;
                    VAR error : integer);
 
      ------------------------------ 
 
        FROM
              Kernel_move_and_fill : VGG101;
 
        PROCEDURE
              SAPDB_PascalForcedFill (
                    size        : tsp00_Int4;
                    m           : tsp00_MoveObjPtr;
                    pos         : tsp00_Int4;
                    len         : tsp00_Int4;
                    fillchar    : char);
 
        PROCEDURE
              s10mv (
                    source_upb  : tsp00_Int4;
                    destin_upb  : tsp00_Int4;
                    source      : tsp00_MoveObjPtr;
                    source_pos  : tsp00_Int4;
                    destin      : tsp00_MoveObjPtr;
                    destin_pos  : tsp00_Int4;
                    length      : tsp00_Int4);
 
      ------------------------------ 
 
        FROM
              Packet_handling : VSP26;
 
 
        PROCEDURE
              s26finish_part (packet_ptr : tsp1_packet_ptr;
                    VAR finish_part      : tsp1_part);
 
      ------------------------------ 
 
        FROM
              RTE_driver : VEN102;
 
        PROCEDURE
              sqlclock (VAR sec  : tsp00_Int4;
                    VAR microsec : tsp00_Int4);
 
        PROCEDURE
              sqlfclosep (
                    fhandle : tsp00_Int4;
                    option  : tsp05_RteCloseOption;
                    VAR err : tsp05_RteFileError);
 
        PROCEDURE
              sqlfopenp (
                    VAR fname   : tsp00_VFilename;
                    datakind    : tsp05_RteDataKind;
                    filemode    : tsp05_RteFileMode;
                    buffering   : tsp05_RteBufferingKind;
                    VAR fhandle : tsp00_Int4;
                    VAR err     : tsp05_RteFileError);
 
        PROCEDURE
              sqlfwritep (
                    fhandle : tsp00_Int4;
                    VAR buf : tsp00_Page;
                    inlen   : tsp00_Longint;
                    VAR err : tsp05_RteFileError);
&       ifdef TRACE
 
      ------------------------------ 
 
        FROM
              TA_test_procedures : VTA02;
 
        PROCEDURE
              t02int4 (layer : tut_debug;
                    nam : tsp00_Sname;
                    int : tsp00_Int4);
 
        PROCEDURE
              t02vffn (layer : tut_debug;
                    nam : tsp00_Sname;
                    fn  : tsp00_VFilename);
&       endif
 
.CM *-END-* use -----------------------------------------
.sp;.cp 3
Synonym :
 
        PROCEDURE
              t09getc256;
 
              tsp00_C256 tsp00_VFilename
 
        PROCEDURE
              t09put;
 
              tsp00_C80 tsp00_Line
 
        PROCEDURE
              sqlfwritep;
 
              tsp00_MoveObj tsp00_Page
 
.CM *-END-* synonym -------------------------------------
.sp;.cp 3
Author  : JuergenA
.sp
.cp 3
Created : 1984-03-26
.sp
.cp 3
.sp
.cp 3
Release :      Date : 1998-12-16
.sp
***********************************************************
.sp
.cp 11
.fo
.oc _/1
Specification:
 
Incopy und Outcopy
.sp 2;.cp 4
Procedure U06IN_DIRECT
.sp
A host file is read in by the kernel:
.br
Once the RELOAD DIRECT or RESTORE DIRECT command has been
successfully sent by U02SEND, the host file name of the file is
delivered in PART2. This is the name that is used for the
initialization of subsequent read operations. An incopy request is
sent once to enable a file to be read. Other files can be read if
either the the RETCODE_NEXT_FILE return code
is sent. An End-Incopy request is sent after an abort or a
successful end.
.sp 2;.cp 4
Procedure U06IN_FIRST_BUF
.sp
Reads the config records for ALTER DEVICE CONFIG:
.br
Once the ALTER DEVICE CONFIG command has been successfully sent by
U02SEND, the host file name of the file in which the config records
are contained as the first records is delivered in PART2. If reading
is successful, an incopy request sends the data to the kernel. In
the event of an error, the file is closed and an end-incopy
request sent with the return code -1.
.sp 2;.cp 4
Procedure U06INCOPY
.sp
Once the RELOAD or RESTORE command has been successfully sent by
U02SEND, the host file name of the file in which the records can
be read is delivered in PART2. This initialization is not needed
for ALTER DEVICE CONFIG because the first record is already read
by U06IN_FIRST_BUF. Next, two records from the host file are
moved to PART1 and to PART2 (or the last one is moved
to PART1 / PART2_LENGTH = 0) and sent with U02SEND (M_AINCOPY). In
multi-volume processing (FILE_COUNT > 0), more files are processed
in accordance with the user entries, until an info record is read
with the FILE_COUNT -1 (EOF_MARK). U02SEND (M_AENDINCOPY) is
executed in response to EOF of the last host file, an error or an
abort caused by the user.
.sp 2;.cp 4
Procedure U06INOUT_DATA_DIRECT
.sp
Once the RESTORE DATA DIRECT or SAVE DATA DIRECT command has been
successfully sent and a user action is required, then the
user issues the next command.
If the user aborts the input, an REJECT command is sent to the
kernel.
.sp 2;.cp 4
Procedure U06OUTCOPY
.sp
Once the SAVE or UNLOAD command has been successfully sent by
U02SEND, the host file name of the file into which the records
will be written is delivered in PART2. Next, 2 records for each
part (PART1 and PART2) are delivered from the kernel by U02SEND
(M_AOUTCOPY) and written into the host file one after the other.
Writing ends when PART1_LENGTH or PART2_LENGTH = 0. Thereafter,
successful closing of the host file is acknowledged by U02SEND
(M_AENDOUTCOPY).
.sp 2
Procedure UT06CONTENT_MSG
.sp
Outputs an info record and waits for confirmation by the user.
.sp 2;.cp 3
Procedure UT06END_COPY
.sp
Terminates an in-/outcopy operation by sending an end message and
a COMMIT or ROLLBACK. ABORT indicates that copying has been
aborted and therefore an end message should be sent with the
return code -1 (M_END/MM_CLEAR) followed by ROLLBACK
If COMMIT or ROLLBACK fails, Utility is finished with PF_CANCEL.
.sp 2;.cp 3
Procedure UT06END_MSG
.sp
A message with the host file creation date and the
completion time of the save is displayed on the screen and written
into the protocol file.
.sp 2;.cp 3
Procedure UT06HOSTFILE_ERR
.sp
The host file error is displayed with the environment-dependent error
description.
.sp 2;.cp 3
Procedure UT06INT_INTO_BUF
.sp
Writes an integer into the buffer in hexadecimal format.
.sp 2;.cp 3
Function UT06LEN
.sp
Yields the length of a short name.
.sp 2;.cp 4
Procedure UT06READ_BUF
.sp
This procedure reads in a buffer from the open host file. If the
buffer is an info record, it is evaluated and another record is read.
.br;FILE_COUNT -1 (eof mark) is returned in response to EOF for
normal files and EOF of the last multi-volume file
.sp 2;.cp 3
Procedure UT06TIMEOUT_OFF
.sp
Issues the command 'SET TIMEOUT OFF'.
.CM *-END-* specification -------------------------------
.sp 2
***********************************************************
.sp
.fo
.oc _/1
Description:
 
.CM *-END-* description ---------------------------------
.sp 2
***********************************************************
.sp
.nf
.oc _/1
Structure:
 
.CM *-END-* structure -----------------------------------
.sp 2
**********************************************************
.sp
.cp 10
.nf
.oc _/1
.CM -lll-
Code    :
 
 
CONST
      display_msg         =     1;
      display_pagecount   =    10;
      display_interval    =     5; (* seconds *)
      mx_yes_no           =     2;
      retcode_io_error    =  -903;
      suppress_next_msg   =     3;
      msg_hostfn          = 'HOST FILE NAME      ';
      errtext_cancelled   = 'CANCELLED                               ';
      (*
      C O M M A N D *)
      cmd_clear_save    = 'END SAVE CLEAR      ';
      (* *)
      c_immediate_displ = true;
      c_prot_wanted     = true;
      c_req_only        = true;
      c_upper_case      = true;
      c_warning         = true;
      c_write_prot      = true;
 
 
(*------------------------------*) 
 
PROCEDURE
      u06hostfile_err (VAR term : tut_terminal;
            VAR protfile : tut_vf_fileref;
            write_prot   : boolean;
            VAR errtext  : tsp00_ErrText);
 
VAR
      i      : integer;
      ln_len : integer;
      ln     : tsp00_Line;
 
BEGIN
u03geterrormsg (retcode_io_error, ln);
ln_len := LINE_MXSP00;
WHILE (ln_len > 1) AND (ln [ln_len] = ' ') DO
    ln_len := ln_len - 1;
(*ENDWHILE*) 
ln_len        := ln_len + 2;
ln [ln_len-1] := ',';
i := 1;
WHILE (i <= ERRTEXT_MXSP00) AND (ln_len < LINE_MXSP00) DO
    BEGIN
    ln_len      := ln_len + 1;
    ln [ln_len] := errtext [i];
    i           := i + 1
    END;
(*ENDWHILE*) 
t09putmsg (term, ln, c_warning, NOT c_immediate_displ);
IF  write_prot
THEN
    t12write_prot (protfile, ln, 77, i)
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      u06outcopy_diag_extract (VAR term  : tut_terminal;
            VAR protfile    : tut_vf_fileref;
            is_save_outcopy : boolean;
            snd_packet      : tsp1_packet_ptr;
            host_packet     : tsp1_packet_ptr;
            VAR sql_ref     : tsp00_Int4;
            VAR rcv_packet  : tsp1_packet_ptr;
            VAR pfkey       : tut_pfkey;
            VAR sql_retcode : tsp00_Int2);
 
VAR
      get_cmd      : boolean;
      write_file   : boolean;
      offset       : tsp00_Int4;
      page_count   : tsp00_Int4;
      curr_time    : tsp00_Int4;
      msg_time     : tsp00_Int4;
      last_displ   : tsp00_Int4;
      hostf_handle : tsp00_Int4;
      dummy_micsec : tsp00_Int4;
      db_packet    : tsp1_packet_ptr;
      aux_packet   : tsp1_packet_ptr;
      io_err       : tsp05_RteFileError;
      close_err    : tsp05_RteFileError;
      page_addr    : tsp00_PageAddr;
 
BEGIN
sql_retcode  := 0;
pfkey        := pf_none;
page_count   := 0;
hostf_handle := 0;
io_err.sp5fe_result := vf_ok;
ut06open_diag_hostfile (term, protfile, is_save_outcopy, rcv_packet,
      hostf_handle, pfkey, sql_retcode);
IF  (hostf_handle <> 0) AND (sql_retcode = 0)
THEN
    BEGIN
    get_cmd    := true;
    write_file := false;
    last_displ := 0;
    db_packet  := snd_packet;
    sqlclock (msg_time, dummy_micsec);
    REPEAT
        aux_packet  := host_packet;
        host_packet := db_packet;
        db_packet   := aux_packet;
        IF  get_cmd
        THEN
            BEGIN
            u05packet_init (db_packet);
            IF  is_save_outcopy
            THEN
                db_packet^.sp1_segm.sp1c_mess_type := sp1m_outcopy
            ELSE
                db_packet^.sp1_segm.sp1c_mess_type := sp1m_diag_outcopy;
            (*ENDIF*) 
            s26finish_part (db_packet,
                  db_packet^.sp1_segm.sp1p_part);
            u02send (term, protfile, db_packet, sql_ref,
                  display_msg, c_req_only, rcv_packet, sql_retcode);
            END;
        (*ENDIF*) 
        offset := 0;
        WITH rcv_packet^.sp1_segm DO
            WHILE write_file
                  AND (sql_retcode = 0)
                  AND (io_err.sp5fe_result = vf_ok)
                  AND (offset + sizeof (page_addr^) <= sp1p_buf_len) DO
                BEGIN
                page_addr  := @sp1p_buf [offset+1];
                page_count := page_count + 1;
                offset     := offset + sizeof (page_addr^);
                IF  term.is_reset_called
                THEN
                    BEGIN
                    io_err.sp5fe_result := vf_notok;
                    io_err.sp5fe_text   := errtext_cancelled;
                    IF  NOT term.is_inputfile
                    THEN
                        term.is_reset_called := false
                    (*ENDIF*) 
                    END
                ELSE
                    sqlfwritep (hostf_handle, page_addr^,
                          sizeof (page_addr^), io_err);
                (*ENDIF*) 
&               ifdef TRACE
                t02int4 (debug_ut, 'vfwritep_err',
                      ord (io_err.sp5fe_result));
&               endif
                IF  (io_err.sp5fe_result = vf_ok)
                    AND (page_count - last_displ >= display_pagecount)
                    AND ((page_count MOD 10) = 0)
                THEN
                    BEGIN
                    sqlclock (curr_time, dummy_micsec);
                    IF  curr_time - msg_time >= display_interval
                    THEN
                        BEGIN
                        msg_time   := curr_time;
                        last_displ := page_count;
                        ut06transferred_msg (term, protfile,
                              NOT c_prot_wanted, page_count)
                        END
                    (*ENDIF*) 
                    END;
                (*ENDIF*) 
                IF  io_err.sp5fe_result <> vf_ok
                THEN
                    BEGIN
                    t09returncode_set (term, retcode_io_error);
                    u06hostfile_err (term, protfile, c_write_prot,
                          io_err.sp5fe_text)
                    END
                (*ENDIF*) 
                END;
            (*ENDWHILE*) 
        (*ENDWITH*) 
        write_file := false;
        IF  get_cmd AND (sql_retcode = 0)
        THEN
            BEGIN
            u02receive (term, protfile, sql_ref,
                  suppress_next_msg, rcv_packet, sql_retcode);
            IF  sql_retcode = 0
            THEN
                WITH rcv_packet^.sp1_segm DO
                    IF  (sp1r_returncode = 0) AND
                        (sp1p_arg_count  > 0)
                    THEN
                        BEGIN
                        write_file := true;
                        get_cmd    :=
                              NOT (sp1pa_last_packet in sp1p_attributes)
                        END
                    ELSE
                        BEGIN
                        write_file := false;
                        get_cmd    := false
                        END
                    (*ENDIF*) 
                (*ENDWITH*) 
            (*ENDIF*) 
            END;
&       ifdef TRACE
        (*ENDIF*) 
        t02int4 (debug_ut, 'write_file  ', ord (write_file));
        t02int4 (debug_ut, 'get_cmd     ', ord (get_cmd   ));
&       endif
    UNTIL
        NOT write_file
        OR (sql_retcode <> 0)
        OR (io_err.sp5fe_result <> vf_ok);
    (*ENDREPEAT*) 
    IF  get_cmd OR (sql_retcode <> 0)
    THEN
        ut06end_clear (term, protfile, snd_packet, sql_ref,
              rcv_packet, sql_retcode)
    (*ENDIF*) 
    END;
(*ENDIF*) 
IF  hostf_handle <> 0
THEN
    BEGIN
    sqlfclosep (hostf_handle, sp5vf_close_normal, close_err);
    IF  close_err.sp5fe_result <> vf_ok
    THEN
        BEGIN
        t09returncode_set (term, retcode_io_error);
        u06hostfile_err (term, protfile, c_write_prot,
              io_err.sp5fe_text)
        END
    ELSE
        IF  (sql_retcode = 0) AND
            (io_err.sp5fe_result = vf_ok)
        THEN
            ut06transferred_msg (term, protfile, c_prot_wanted,
                  page_count)
        (*ENDIF*) 
    (*ENDIF*) 
    END
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ut06end_clear (VAR term : tut_terminal;
            VAR protfile    : tut_vf_fileref;
            snd_packet      : tsp1_packet_ptr;
            VAR sql_ref     : tsp00_Int4;
            VAR rcv_packet  : tsp1_packet_ptr;
            VAR sql_retcode : tsp00_Int2);
 
VAR
      aux_retcode : tsp00_Int2;
 
BEGIN
aux_retcode := sql_retcode;
sql_retcode := 0;
u05packet_init (snd_packet);
u05c20to_packet (cmd_clear_save, snd_packet);
s26finish_part (snd_packet, snd_packet^.sp1_segm.sp1p_part);
u02send (term, protfile, snd_packet, sql_ref, display_msg,
      NOT c_req_only, rcv_packet, sql_retcode);
IF  sql_retcode = 0
THEN
    sql_retcode := aux_retcode;
(*ENDIF*) 
t09returncode_set (term, sql_retcode)
END;
 
(*------------------------------*) 
 
PROCEDURE
      ut06open_diag_hostfile (VAR term : tut_terminal;
            VAR protfile     : tut_vf_fileref;
            is_save_outcopy  : boolean;
            rcv_packet       : tsp1_packet_ptr;
            VAR hostf_handle : tsp00_Int4;
            VAR pfkey        : tut_pfkey;
            VAR sql_retcode  : tsp00_Int2);
 
VAR
      io_err : tsp05_RteFileError;
      answer : tsp00_Name;
      hostfn : tsp00_VFilename;
 
BEGIN
sql_retcode  := 0;
hostf_handle := 0;
pfkey        := pf_none;
SAPDB_PascalForcedFill (sizeof(hostfn), @hostfn, 1, sizeof(hostfn), ' ');
io_err.sp5fe_result := vf_ok;
IF  is_save_outcopy
THEN
    t09getc256 (term, msg_hostfn, cut_bright_protected,
          cut_unprotected, sizeof (hostfn), NOT c_upper_case,
          hostfn, pfkey)
ELSE
    WITH rcv_packet^.sp1_segm DO
        IF  sp1p_buf_len >= sizeof (hostfn)
        THEN
            s10mv (sp1p_buf_size, sizeof (hostfn),
                  @sp1p_buf, 1, @hostfn, 1, sizeof (hostfn));
        (*ENDIF*) 
    (*ENDWITH*) 
(*ENDIF*) 
IF  pfkey = pf_none
THEN
    REPEAT
        sqlfopenp (hostfn, sp5vf_binary, sp5vf_write, sp5bk_unbuffered,
              hostf_handle, io_err);
&       ifdef TRACE
        t02vffn (debug_ut, 'outcopy-fn  ', hostfn);
        t02int4 (debug_ut, 'vfopen_error', ord (io_err.sp5fe_result));
&       endif
        IF  io_err.sp5fe_result <> vf_ok
        THEN
            BEGIN
            hostf_handle := 0;
            sql_retcode  := retcode_io_error;
            t09returncode_set (term, retcode_io_error);
            u06hostfile_err  (term, protfile, c_write_prot,
                  io_err.sp5fe_text)
            END;
        (*ENDIF*) 
        IF  NOT term.is_inputfile AND (hostf_handle = 0)
        THEN
            BEGIN
            t09put (term, term.blankline, cut_protected);
            t09put (term, term.blankline, cut_protected);
            answer := 'y                 ';
            t09get1name (term, 'TRY AGAIN ?  (y/n)  ',
                  cut_bright_protected, cut_unprotected,
                  mx_yes_no, c_upper_case, answer, pfkey);
            IF  u05isyes (answer) AND (pfkey = pf_none)
            THEN
                BEGIN
                sql_retcode := 0;
                t09put (term, term.blankline, cut_protected);
                t09getc256 (term, msg_hostfn, cut_bright_protected,
                      cut_unprotected, sizeof (hostfn),
                      NOT c_upper_case, hostfn, pfkey);
                t09newscreen_page (term)
                END
            (*ENDIF*) 
            END
        (*ENDIF*) 
    UNTIL
        (hostf_handle <> 0) OR (sql_retcode <> 0) OR (pfkey <> pf_none)
    (*ENDREPEAT*) 
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ut06transferred_msg (VAR term : tut_terminal;
            VAR protfile : tut_vf_fileref;
            prot_wanted  : boolean;
            page_count   : tsp00_Int4);
 
VAR
      dummy_err : integer;
      ln_len    : integer;
      ln        : tsp00_Line;
 
BEGIN
ln     := term.blankline;
ln_len := 0;
IF  page_count = 1
THEN
    g17nameto_line ('1 PAGE TRANSFERRED', ln_len, ln)
ELSE
    BEGIN
    g17trimint4_to_line (page_count, ln_len, ln);
    g17nameto_line (' PAGES TRANSFERRED', ln_len, ln)
    END;
(*ENDIF*) 
t09putmsg (term, ln, NOT c_warning, c_immediate_displ);
IF  prot_wanted
THEN
    t12write_prot (protfile, ln, ln_len, dummy_err)
(*ENDIF*) 
END;
 
.CM *-END-* code ----------------------------------------
.SP 2 
***********************************************************
.PA 
