.nf
 
 
    ========== licence begin  GPL
    Copyright (C) 2000 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
*****************************************************
Copyright by SAP AG, 2000
SAP Database Technology
 
Release :      Date : 2000-11-24
*****************************************************
modname : VAK30
changed : 2000-11-24
module  : AK_Syntax_utility
 
Author  : ThomasA
Created : 1985-02-06
*****************************************************
 
Purpose : Erkennt Syntax und baut den Tree auf f?ur die Utilities auf.
 
Define  :
 
        PROCEDURE
              a30_init_utility (VAR acv : tak_all_command_glob;
                    VAR implicit_restart : boolean);
 
        PROCEDURE
              a30_dbs_utility (
                    VAR acv               : tak_all_command_glob;
                    VAR syntax_error      : boolean);
 
        PROCEDURE
              a30_standby_utility (VAR acv : tak_all_command_glob);
 
        PROCEDURE
              a30serverdb_spec (
                    VAR acv       : tak_all_command_glob;
                    VAR put_node  : tsp_int2;
                    VAR last_node : tsp_int2);
 
        PROCEDURE
              a30diag_oms (VAR acv :tak_all_command_glob);
 
        PROCEDURE
              a30diag_vtrace_syntax (
                    VAR acv      :tak_all_command_glob;
                    VAR put_node : tsp_int2 );
 
        PROCEDURE
              a30set_parameter_syntax (
                    VAR acv      :tak_all_command_glob;
                    VAR put_node : tsp_int2 );
 
        PROCEDURE
              a30CheckInstance(VAR acv : tak_all_command_glob);
 
        FUNCTION
              a30SetCountDown(VAR acv : tak_all_command_glob) : boolean;
&       ifdef TRACE
 
        PROCEDURE
              a30diag_switch_syntax (
                    VAR acv      :tak_all_command_glob;
                    VAR put_node : tsp_int2);
&       endif
 
.CM *-END-* define --------------------------------------
.sp;.cp 3
Use     :
 
&       ifdef TRACE
        FROM
              Test_Procedures : VTA01;
 
        PROCEDURE
              t01aptree (
                    layer         : tgg00_Debug;
                    VAR a_ap_tree : tak_ap_max_tree;
                    node_cnt      : integer;
                    hint_node     : tsp_int2);
 
        PROCEDURE
              t01int4 (
                    debug    : tgg00_Debug;
                    nam      : tsp00_Sname;
                    int      : tsp00_Int4);
&       endif
 
      ------------------------------ 
 
        FROM
              Scanner : VAK01;
 
        VAR
              a01char_size         : integer;
              a01kw                : tak_keywordtab;
              a01trigger           : boolean;
              a01_il_b_identifier  : tsp_knl_identifier;
 
        PROCEDURE
              a01_get_password (
                    VAR acv        : tak_all_command_glob;
                    VAR put_node   : tsp_int2;
                    VAR last_node  : tsp_int2);
 
        PROCEDURE
              a01_force_symbol (
                    VAR acv         : tak_all_command_glob;
                    expected_symbol : tak_sc_symbol;
                    VAR node1       : tsp_int2;
                    VAR node2       : tsp_int2);
 
        PROCEDURE
              a01_is_end_symbol (VAR acv : tak_all_command_glob);
 
        PROCEDURE
              a01_next_symbol (VAR acv : tak_all_command_glob);
 
        PROCEDURE
              a01_call_put (
                    VAR acv  : tak_all_command_glob;
                    proc     : tak_procs;
                    subproc  : tsp_int2;
                    VAR curr_n : tsp_int2);
 
        PROCEDURE
              a01_get_keyword (
                    VAR acv   : tak_all_command_glob;
                    VAR index : integer;
                    VAR reserved : boolean);
 
        PROCEDURE
              a01_put_node (
                    VAR acv    : tak_all_command_glob;
                    VAR curr_n : tsp_int2);
 
        FUNCTION
              a01_eqkey (
                    VAR a      : tak_keyword;
                    sqlmode    : tsp_sqlmode;
                    VAR b      : tsp_moveobj;
                    VAR scv    : tak_scanner_glob) : boolean;
 
        FUNCTION
              a01mandatory_keyword (
                    VAR acv          : tak_all_command_glob;
                    required_keyword : integer) : boolean;
 
      ------------------------------ 
 
        FROM
              AK_syntax_tools : VAK02;
 
        PROCEDURE
              a02_ahostfile_name  (
                    VAR acv      : tak_all_command_glob;
                    VAR put_node : tsp_int2;
                    VAR last_node : tsp_int2);
 
        PROCEDURE
              a02transaction (
                    VAR acv       : tak_all_command_glob;
                    VAR put_node  : tsp_int2;
                    VAR last_node : tsp_int2);
 
        PROCEDURE
              a02_aauthid (
                    VAR acv      : tak_all_command_glob;
                    VAR put_node : tsp_int2;
                    VAR last_node : tsp_int2);
 
        PROCEDURE
              a02_asystem_devspace (
                    VAR acv      : tak_all_command_glob;
                    VAR put_node : tsp_int2;
                    VAR last_node : tsp_int2);
 
        PROCEDURE
              a02_atablename (
                    VAR acv      : tak_all_command_glob;
                    VAR put_node : tsp_int2;
                    VAR last_node : tsp_int2);
 
        PROCEDURE
              a02_acolumnspec (
                    VAR acv        : tak_all_command_glob;
                    table_required : boolean;
                    VAR put_node   : tsp_int2;
                    VAR last_node  : tsp_int2);
 
        PROCEDURE
              a02_put_identifier (
                    VAR acv       : tak_all_command_glob;
                    VAR put_node  : tsp_int2;
                    VAR last_node : tsp_int2);
 
      ------------------------------ 
 
        FROM
              AK_syntax_values_tools : VAK03;
 
        PROCEDURE
              a03_aunsigned_integer (
                    VAR acv      : tak_all_command_glob;
                    VAR put_node : tsp_int2;
                    VAR last_node : tsp_int2);
 
        PROCEDURE
              a03_ainteger (
                    VAR acv            : tak_all_command_glob;
                    VAR put_node       : tsp_int2;
                    VAR last_node      : tsp_int2);
 
        PROCEDURE
              a03_astring_literal (
                    VAR acv          : tak_all_command_glob;
                    VAR put_node     : tsp_int2;
                    VAR last_node    : tsp_int2);
 
        PROCEDURE
              a03_avalue_spec (
                    VAR acv         : tak_all_command_glob;
                    null_allowed    : boolean;
                    stamp_allowed   : boolean;
                    default_allowed : boolean;
                    sysdba_allowed  : boolean;
                    VAR put_node    : tsp_int2;
                    VAR last_node   : tsp_int2);
 
      ------------------------------ 
 
        FROM
              AK_semantic_scanner_tools : VAK05;
 
        PROCEDURE
              a05_unsigned_int2_get (
                    VAR acv  : tak_all_command_glob;
                    pos      : integer;
                    l        : tsp_int2;
                    err_code : tsp_int4;
                    VAR int  : tsp_int2);
 
        PROCEDURE
              a05int4_get (
                    VAR acv            : tak_all_command_glob;
                    pos                : integer;
                    l                  : tsp_int2;
                    VAR val            : tsp_int4);
 
      ------------------------------ 
 
        FROM
              AK_error_handling : VAK07;
 
        PROCEDURE
              a07_error (
                    VAR acv : tak_all_command_glob;
                    err  : tgg_basis_error;
                    VAR nod1 : tsp_int2;
                    VAR nod2 : tsp_int2);
 
        PROCEDURE
              a07_b_put_error (
                    VAR acv : tak_all_command_glob;
                    b_err : tgg_basis_error;
                    err_code : tsp_int4);
 
        PROCEDURE
              a07_hex_uni_error (
                    VAR acv     : tak_all_command_glob;
                    uni_err     : tsp8_uni_error;
                    err_code    : tsp_int4;
                    to_unicode  : boolean;
                    bytestr     : tsp_moveobj_ptr;
                    len         : tsp_int4 );
 
      ------------------------------ 
 
        FROM
              Systeminfo_cache : VAK10;
 
        VAR
              a10chk : boolean;
 
      ------------------------------ 
 
        FROM
              AK_DDL_Syntax : VAK20;
 
        PROCEDURE
              a20alter_password (
                    VAR acv       : tak_all_command_glob;
                    VAR put_node  : tsp_int2);
 
      ------------------------------ 
 
        FROM
              Kernel_Sink_1 : VAK341;
 
        PROCEDURE
              ak341SetDumpError(errorNo : tsp00_Int4);
 
      ------------------------------ 
 
        FROM
              AK_distributor : VAK35;
 
        PROCEDURE
              a35_vtracen (VAR acv : tak_all_command_glob);
 
      ------------------------------ 
 
        FROM
              AK_cold_utility_functions : VAK36;
 
        PROCEDURE
              a36_call_semantic (
                    VAR acv         : tak_all_command_glob;
                    VAR util_cmd_id : tgg00_UtilCmdId);
 
        PROCEDURE
              a36utilprot_needed (
                    VAR acv           : tak_all_command_glob;
                    VAR prot_needed   : boolean;
                    VAR with_tapeinfo : boolean);
 
        PROCEDURE
              a36_standby_semantic (
                    VAR acv         : tak_all_command_glob);
 
      ------------------------------ 
 
        FROM
              AK_warm_utility_functions : VAK37;
 
        PROCEDURE
              a37_call_semantic (
                    VAR acv               : tak_all_command_glob;
                    VAR util_cmd_id       : tgg00_UtilCmdId);
 
        PROCEDURE
              a37utilprot_needed (
                    VAR acv           : tak_all_command_glob;
                    VAR prot_needed   : boolean;
                    VAR with_tapeinfo : boolean);
 
      ------------------------------ 
 
        FROM
              AK_Connect        : VAK51;
 
        PROCEDURE
              a51_aconnect_statement (
                    VAR acv           : tak_all_command_glob;
                    call_from_utility : boolean;
                    VAR put_node      : tsp_int2);
 
      ------------------------------ 
 
        FROM
              AK_Lock_Commit_Rollback   : VAK52;
 
        PROCEDURE
              a52_acommit_rollback_statement (
                    VAR acv      : tak_all_command_glob;
                    VAR put_node : tsp_int2;
                    commit       : boolean);
 
      ------------------------------ 
 
        FROM
              diagnose monitor : VAK545;
 
        PROCEDURE
              a545diag_monitor_syntax  (
                    VAR acv      : tak_all_command_glob;
                    VAR put_node : tsp_int2);
 
      ------------------------------ 
 
        FROM
              KB_Check : VKB03;
 
        PROCEDURE
              kb03SetBackupCheck     (SetOn : boolean);
 
        PROCEDURE
              kb03SetKbCheck         (SetOn : boolean);
 
        PROCEDURE
              kb03SetLockCheck       (SetOn : boolean);
 
        PROCEDURE
              kb03SetLockSupplyCheck (SetOn : boolean);
 
        PROCEDURE
              kb03SetLogCheck        (SetOn : boolean);
 
        PROCEDURE
              kb03SetLogQueueCheck   (SetOn : boolean);
 
        PROCEDURE
              kb03SetRegionCheck     (SetOn : boolean);
 
        PROCEDURE
              kb03SetTransCheck      (SetOn : boolean);
 
      ------------------------------ 
 
        FROM
              KB_utility : VKB35;
 
        PROCEDURE
              k35UtilIdGet (
                    TaskId        : tsp00_TaskId;
                    VAR UtilIdStr : tgg00_UtilCmdId);
 
      ------------------------------ 
 
        FROM
              KB_headmaster : vkb38;
 
        PROCEDURE
              k38UtilIdGet (VAR UtilId : tgg00_UtilCmdId);
 
        PROCEDURE
              k38UtilIdSaveLineNo (VAR UtilId : tgg00_UtilCmdId);
 
      ------------------------------ 
 
        FROM
              Configuration_Parameter : VGG01;
 
        VAR
              g01code                : tgg_code_globals;
              g01glob                : tgg_kernel_globals;
              g01unicode             : boolean;
              g01vtrace              : tgg_vtrace_state;
 
        PROCEDURE
              g01event_init (VAR new_event : tsp31_event_description);
 
      ------------------------------ 
 
        FROM
              GG_ComponentTests : VGG942;
 
        PROCEDURE
              gg942ComponentTests (VAR Trans : tgg00_TransContext;
                    TestNo : tsp00_Int4);
 
      ------------------------------ 
 
        FROM
              Kernel_move_and_fill : VGG10;
 
        PROCEDURE
              g10fil (
                    mod_id   : tsp_c6;              mod_num  : tsp_int4;
                    obj_upb  : tsp_int4;
                    VAR obj  : tsp_buf;             obj_pos  : tsp_int4;
                    length   : tsp_int4;            fillchar : char;
                    VAR e    : tgg_basis_error);
 
        PROCEDURE
              g10mv  (
                    mod_id         : tsp_c6;
                    mod_intern_num : tsp_int4;
                    source_upb     : tsp_int4;    destin_upb : tsp_int4;
                    VAR source     : tsp_moveobj; source_pos : tsp_int4;
                    VAR destin     : tsp_buf;     destin_pos : tsp_int4;
                    length         : tsp_int4;
                    VAR e          : tgg_basis_error);
 
        PROCEDURE
              g10mv1 (
                    mod_id         : tsp_c6;
                    mod_intern_num : tsp_int4;
                    source_upb     : tsp_int4;        destin_upb : tsp_int4;
                    VAR source     : tsp_moveobj;     source_pos : tsp_int4;
                    VAR destin     : tsp1_param_info; destin_pos : tsp_int4;
                    length         : tsp_int4;
                    VAR e          : tgg_basis_error);
 
      ------------------------------ 
 
        FROM
              GG_edit_routines : VGG17;
 
        PROCEDURE
              g17hexto_line (
                    c          : char;
                    VAR ln_len : integer;
                    VAR ln     : tsp00_Line);
 
        PROCEDURE
              g17nameto_line (
                    n           : tsp00_Name;
                    VAR ln_len  : integer;
                    VAR ln      : tsp00_Line);
 
        PROCEDURE
              g17sname_to_line (
                    n             : tsp00_Sname;
                    VAR ln_len    : integer;
                    VAR ln        : tsp00_Line);
 
        PROCEDURE
              g17int4to_line (
                    int       : tsp00_Int4;
                    with_zero : boolean;
                    int_len   : integer;
                    ln_pos    : integer;
                    VAR ln    : tsp00_Line);
 
      ------------------------------ 
 
        FROM
              RTE-Extension-10 : VSP10;
 
        PROCEDURE
              s10fil (
                    size     : tsp_int4;
                    VAR m    : tsp_line;
                    pos      : tsp_int4;
                    len      : tsp_int4;
                    fillchar : char);
 
        PROCEDURE
              s10mv (
                    source_upb  : tsp_int4;    destin_upb : tsp_int4;
                    VAR source  : tsp_line;    source_pos : tsp_int4;
                    VAR destin  : tsp_line;    destin_pos : tsp_int4;
                    length      : tsp_int4);
 
      ------------------------------ 
 
        FROM
              Packet_handling : VSP26;
 
        PROCEDURE
              s26find_part (
                    VAR segm         : tsp1_segment;
                    part_kind        : tsp1_part_kind;
                    VAR part_ptr     : tsp1_part_ptr);
 
      ------------------------------ 
 
        FROM
              RTE-Extension-30 : VSP30;
 
        FUNCTION
              s30lnr (
                    VAR str   : tsp_moveobj;
                    skip_val  : char;
                    start_pos : tsp_int4;
                    length    : tsp_int4) : tsp_int4;
 
      ------------------------------ 
 
        FROM
              GETSTRING-Conversions : VSP42;
 
        PROCEDURE
              s42gstr (
                    VAR buf    : tsp_moveobj;
                    pos        : tsp_int4;
                    len        : integer;
                    frac       : integer;
                    origlen    : integer;
                    VAR dest   : tsp_line;
                    dpos       : tsp_int4;
                    VAR dlen   : integer;
                    VAR res    : tsp_num_error);
 
      ------------------------------ 
 
        FROM
              RTE-Extension-80 : VSP80;
 
        PROCEDURE
              s80uni_trans (
                    src_ptr         : tsp_moveobj_ptr;
                    src_len         : tsp_int4;
                    src_codeset     : tsp_int2;
                    dest_ptr        : tsp_moveobj_ptr;
                    VAR dest_len    : tsp_int4;
                    dest_codeset    : tsp_int2;
                    trans_options   : tsp8_uni_opt_set;
                    VAR rc          : tsp8_uni_error;
                    VAR err_char_no : tsp_int4);
 
      ------------------------------ 
 
        FROM
              RTE_kernel : VEN101;
 
        PROCEDURE
              vutilprot (
                    VAR msg_line : tsp_buf;
                    msg_len      : tsp_int4);
 
        PROCEDURE
              vinsert_event ( VAR event : tsp31_event_description );
 
        PROCEDURE
              vinsert_keep_alive;
 
.CM *-END-* use -----------------------------------------
***********************************************************
 
Synonym :
 
        PROCEDURE
              g10mv;
 
              tsp_moveobj tsp_buf
 
        PROCEDURE
              g10mv1;
 
              tsp_moveobj tsp1_param_info
 
        PROCEDURE
              g10fil;
 
              tsp_moveobj tsp_buf
 
        PROCEDURE
              s42gstr;
 
              tsp_moveobj tsp_line
 
        PROCEDURE
              s10mv;
 
              tsp_moveobj tsp_line
 
        PROCEDURE
              s10fil;
 
              tsp_moveobj tsp_line
&             ifdef trace
 
        PROCEDURE
              t01aptree;
 
              tsp00_MoveObj tak_ap_max_tree
&             endif
 
.CM *-END-* synonym -------------------------------------
***********************************************************
 
Specification:
 
.nf
ChangeLog :
 
10.04.97 : removed Syntax for WRITE/INSERT LABEL
           removed Overwrite Option in SAVE .. QUICK
           media name Option in SAVE .. QUICK
 
Erkennt Syntax:
 
<util_command> ::=
  <ualter_statement>
/ <clear_log_statement>
/ <get_statement>
/ <init_config_statement>
/ <reload_statement>
/ <restart_statement>
/ <restore_statement>
/ <save_statement>
/ <set_statement>
/ <shutdown_statement>
/ <state_statement>
/ <unload_statement>
/ <uupdate_statement>
/ <verify_statement>;
 
 
<ualter_statement> ::=
    'ALTER'
      (
        'CONFIG' <system_devspace>
      / 'DEVICE' 'CONFIG'
      );
 
 
<clear_log_statement> ::=
    'CLEAR' 'LOG' <system_devspace>;
 
 
<get_statement> ::=
    'GET'
          (
            'CONFIG' <system_devspace>
          / 'DEVICE' 'CONFIG'
          );
 
 
<init_config_statement> ::=
    'INIT' 'CONFIG';
 
 
<reload_statement> ::=
    'RELOAD' <load_object> 'FROM' <host_string_name> [ 'NOLOG' ];
 
<unload_statement> ::=
    'UNLOAD' <load_object> 'TO' <host_string_name>;
 
<load_object> ::=
      'TABLE' <table_name>
    / 'STRING' <string_name>
    / 'ISAM'   <isam_name>;
 
 
<restart_statement> ::=
    'RESTART'
 
 
<restore_statement> ::=
    'RESTORE' <restore_object_spec> 'FROM' <host_string_name>
  / 'RESTORE' 'LOG' 'FROM' <system_devspace> 'TO' <system_devspace>;
  / 'RESTORE' 'DEVSPACE' 'FROM' <system_devspace> 'TO' <system_devspace>;
 
<restore_object_spec> ::=
      'DATABASE'
    / 'PAGES'
    / 'LOG' <system_devspace>
    / 'CONFIG'
    / 'TABLE' <table_name>
    / 'STRING' <string_name>
    / 'ISAM'   <isam_name>;
 
 
<save_statement> ::=
    'SAVE' <save_object_spec> 'TO' <host_string_name>;
 
<save_object_spec> ::=
      'DATABASE'
    / 'PAGES'
    / 'LOG'  [  'COLD' <system_devspace>  ]
    / 'TABLE' <table_name>
    / 'STRING' <string_name>
    / 'ISAM'   <isam_name>;
 
 
<uupdate_statement> ::=
    'UPDATE'  'STATISTICS' <table_name>;
 
 
<shutdown_statement> ::=
      'SHUTDOWN' [  'QUICK'  ]
      [  'LOCAL'
      /  'GLOBAL'
      / 'AT' <location_name>
       ];
 
 
<verify_statement> ::=
    'VERIFY' /CATALOG/
 
 
<system_devspace>  ::=
       <string_literal>;
 
<host_string_name> ::=
       <string_literal>;
 
<log_devspace>  ::=
       <string_literal>;
 
<isam_name>  ::=
       <identifier>;
 
.sp 4
.fo
Utilities werden unterschieden zwischen Funktionen, die
beim laufenden Betrieb (DBS-utility) und beim
ruhenden Betrieb (init_utility) aufgerufen werden k?onnen.
.sp 4
PROCEDURE  INIT_UTILITY :
.sp 2
n_pos im ap_tree[ 1 ] hat folgende Bedeutung:
.nf
   1  :  connect
   2  :  commit
   3  :  rollback   existiert nicht
   4  :  alter config <system_devspace>
   5  :  alter device config
   6  :  clear log <system_devspace>
   7  :  get config <system_devspace>
   8  :  get device config
   9  :  init config
   10 :  restart <system_devspace>
   11 :  restore database from <hostfilename>
   12 :  restore pages from <hostfilename>
   13 :  restore log <system_devspace> from <hostfilename>
                / until  mm/dd/yy   hh:mm:ss
   18 :  restore log <system_devspace>
                      from  <system_devspace> to <system_devspace>
   14 :  restore config from <hostfilename>
   15 :  save log to <hostfilename>
   16 :  save log cold <system_devspace> to <hostfilename>
   17 :  verify
   18 :  restore log <system_devspace>
                      from  <system_devspace> to <system_devspace>
   8..:  diagnose
 
Semantische Abarbeitung in VAK36.
.sp 4
PROCEDURE  DBS_UTILITY :
.sp 2
n_pos im ap_tree[ 1 ] hat folgende Bedeutung:
.nf
  21  :  connect
  22  :  commit
  23  :  rollback
  24  :  reload table  <tablename>  from <host_string_name>
               / with nn % usage
  25  :  reload isam   <isamname>   from <host_string_name>
               / with nn % usage
  26  :  reload string <stringname> from <host_string_name>
  27  :  unload table  <tablename>  to   <host_string_name>
  28  :  unload isam   <isamname>   to   <host_string_name>
  29  :  unload string <stringname> to   <host_string_name>
  30  :  restore table  <tablename>  from <host_string_name>
               / with nn % usage
  31  :  restore isam   <isamname>   from <host_string_name>
               / with nn % usage
  32  :  restore string <stringname> from <host_string_name>
  33  :  save    table  <tablename>  to   <host_string_name>
  34  :  save    isam   <isamname>   to   <host_string_name>
  35  :  save    string <stringname> to   <host_string_name>
  36  :  save    database            to   <host_string_name><
  37  :  save    pages               to   <host_string_name><
  38  :  update statistics <tablename>
  39  :  shutdown  quick local
  40  :  shutdown  quick global
  41  :  shutdown  quick at <locationname>
  42  :  shutdown    local
  43  :  shutdown    global
  44  :  shutdown    at <locationname>
  45  :  set write on
  46  :  set write off
  47  :  set data buffer = nn
  48  :  set lock buffer = nn
  50  :  drop table authid.tablename
 
Semnatische Abarbeitung in VAK37.
.sp 4
.fo
Procedure  a30_i.. erkennen die Syntax der Init_utility,
und a30_d.. die Syntax der DBS_utility;
.sp 4
PROCEDURE  DIAGNOSE :
.sp 2
n_pos im ap_tree[ 1 ] hat folgende Bedeutung:
.nf
  81  :  <dbname> to <hostfilename> log   all
  82  :  <dbname> to <hostfilename> log   last <nr>
  83  :  <dbname> to <hostfilename> log   from <nr> to <nr>
  84  :  <dbname> to <hostfilename> psm   all
  85  :  <dbname> to <hostfilename> psm   from <nr> to <nr>
  86  :  <dbname> to <hostfilename> table by   <rootnr>
  87  :  <dbname> to <hostfilename> table by   <tablename>
  88  :  <dbname> to <hostfilename> index by   <rootnr>
  89  :  <dbname> to <hostfilename> index by
                           <tablename> <indexnr>     (single)
  90  :  <dbname> to <hostfilename> index by
                           <tablename> <indexnr>  M  (M=multi)
  91  :  <dbname> to <hostfilename> pages from <nr> to <nr>
  92  :  <dbname> to <hostfilename> devspace <devspacename>
                                    from <nr> to <nr>
.sp 2
Semantische Abarbeitung in VAK37.
.sp
Procedure a30_g.. erkennen die Syntax der Diagnose
Auftr?age.
.CM *-END-* specification -------------------------------
.sp 2
***********************************************************
.sp
.cp 10
.fo
.oc _/1
Description:
 
 
.CM *-END-* description ---------------------------------
.sp 2
***********************************************************
.sp
.cp 10
.nf
.oc _/1
Structure:
 
.CM *-END-* structure -----------------------------------
.sp 2
**********************************************************
.sp
.cp 10
.nf
.oc _/1
.CM -lll-
Code    :
 
 
CONST
      c_with_zero       = true (*g17int4to_line*);
      c_warm_utility    = true (*ak30add_devspace*);
      c_dont_know       = false;
      (* *)
      c_null_allowed    = true (*a03_avalue_spec*);
      c_stamp_allowed   = true (*a03_avalue_spec*);
      c_default_allowed = true (*a03_avalue_spec*);
      c_sysdba_allowed  = true (*a03_avalue_spec*);
      c_trans_to_uni    = true (* a07_hex_uni_error  *);
      c_unicode_wid     = 2    (* a07_hex_uni_error  *);
      ce_restart        = 0;
      ce_shutdown       = 1;
      ce_start          = 0;
      ce_end            = 1;
 
TYPE
      t_utilheader_kind = (
            uhk_request,
            uhk_receive,
            uhk_save);
 
 
(*------------------------------*) 
 
PROCEDURE
      a30_init_utility (VAR acv : tak_all_command_glob;
            VAR implicit_restart : boolean);
 
VAR
      last_node     : tsp_int2;
      put_node      : tsp_int2;
      symbindex     : integer;
      res_kw        : boolean;
      prot_needed   : boolean;
      with_tapeinfo : boolean;
      util_cmd_id   : tgg00_UtilCmdId; (* PTS 1104845 UH 02-12-1999 *)
 
BEGIN
WITH acv, a_scv  DO
    BEGIN
    a_is_ddl := no_ddl;
    a01_get_keyword (acv, symbindex, res_kw);
    IF  a_ex_kind = only_parsing
    THEN
        a_pars_last_key.p_kind := m_nil;
    (*ENDIF*) 
    IF  ((a_curr_user_name = a01_il_b_identifier)
        AND
        (symbindex <> cak_i_connect))
    THEN
        a07_b_put_error (acv, e_user_not_connected, 1)
    ELSE
        BEGIN
        a_ap_tree^[ 0 ].n_lo_level := 1;
        a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_proc := no_proc;
        WITH a_ap_tree^[ 0 ] DO
            CASE symbindex OF
                cak_i_activate :
                    ak30activate_statement (acv,
                          NOT c_warm_utility, n_lo_level);
                cak_i_add :
                    ak30add_devspace_statement (acv, n_lo_level);
                (* PTS 1116464 E.Z. *)
                cak_i_check :
                    ak30check_statement (acv, a36, n_lo_level);
                cak_i_clear :
                    ak30clear_statement (acv, n_lo_level);
                cak_i_commit :
                    ak30cold_commit_statement (acv, n_lo_level);
                cak_i_connect :
                    ak30cold_connect_statement (acv, n_lo_level);
                (* PTS 1108247 E.Z. *)
                cak_i_delete :
                    ak30delete_statement (acv,
                          NOT c_warm_utility, n_lo_level);
                cak_i_diagnose :
                    ak30diagnose (acv, n_lo_level, true);
                cak_i_end :
                    ak30end_statement (acv, n_lo_level);
                cak_i_get   :
                    ak30get_statement (acv, n_lo_level);
                cak_i_init :
                    (* PTS 1111229 E.Z. *)
                    ak30init_statement (acv, n_lo_level);
                (* PTS 1117050 E.Z. *)
                (* PTS 1117498 E.Z. *)
                cak_i_migrate :
                    ak30migrate_statement (acv, n_lo_level, implicit_restart);
                cak_i_read :
                    ak30read_label_statement (acv, n_lo_level);
                cak_i_restart :
                    ak30restart_statement (acv, n_lo_level);
                cak_i_restore :
                    ak30restore_statement (acv, n_lo_level);
                cak_i_save :
                    ak30save_statement (acv, n_lo_level);
                cak_i_set  :
                    ak30set_statement(acv, a36, n_lo_level);
                cak_i_verify  :
                    ak30verify_statement (acv, a36, n_lo_level);
                cak_i_vtrace, cak_i_flush :
                    a35_vtracen (acv);
                OTHERWISE
                    a07_error (acv, e_invalid_keyword,
                          put_node, last_node)
                END;
            (*ENDCASE*) 
        (*ENDWITH*) 
&       ifdef TRACE
        t01aptree (ak_syn, a_ap_tree^, a_scv_index, a_first_hint_node);
&       endif
        IF  a_return_segm^.sp1r_returncode = 0
        THEN
            BEGIN
            prot_needed := c_dont_know;
            util_cmd_id.utidId_gg00     := bsp_c12;
            util_cmd_id.utidLineNo_gg00 := 0;
            ak30c_utilprot_cmd (acv, prot_needed, with_tapeinfo, util_cmd_id);
            CASE symbindex OF
                cak_i_restart :
                    ak30insert_event (ce_restart, ce_start);
                OTHERWISE
                    BEGIN
                    END
                END;
            (*ENDCASE*) 
            CASE a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_proc OF
                no_proc : ;
                    a36 :
                          a36_call_semantic (acv, util_cmd_id)
                OTHERWISE
                    a37_call_semantic (acv, util_cmd_id);
                END;
            (*ENDCASE*) 
            CASE symbindex OF
                cak_i_restart :
                    ak30insert_event (ce_restart, ce_end);
                OTHERWISE
                    BEGIN
                    END
                END;
            (*ENDCASE*) 
            ak30r_utilprot_retcode (acv, prot_needed, with_tapeinfo, util_cmd_id);
            END
        (*ENDIF*) 
        END;
    (*ENDIF*) 
    END
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      a30_dbs_utility (
            VAR acv               : tak_all_command_glob;
            VAR syntax_error      : boolean);
 
VAR
      symbindex     : integer;
      dummy_node    : tsp_int2;
      res_kw        : boolean;
      prot_needed   : boolean;
      with_tapeinfo : boolean;
      util_cmd_id   : tgg00_UtilCmdId; (* PTS 1104845 UH 02-12-1999 *)
 
BEGIN
WITH acv, a_scv  DO
    BEGIN
    syntax_error      := false;
    a_is_ddl          := no_ddl;
    a01_get_keyword (acv, symbindex, res_kw);
    IF  a_ex_kind = only_parsing
    THEN
        a_pars_last_key.p_kind := m_nil;
    (*ENDIF*) 
    IF  ((a_curr_user_name = a01_il_b_identifier)
        AND
        (symbindex <> cak_i_connect))
    THEN
        a07_b_put_error (acv, e_user_not_connected, 1)
    ELSE
        BEGIN
        a_ap_tree^[ 0 ].n_lo_level := 1;
        a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_proc := no_proc;
        WITH a_ap_tree^[ 0 ] DO
            CASE symbindex OF
                (* PTS 1115978 E.Z. *)
                cak_i_activate :
                    ak30activate_statement (acv,
                          c_warm_utility, n_lo_level);
                cak_i_add :
                    ak30add_devspace_statement (acv, n_lo_level);
                cak_i_alter :
                    ak30alter_statement (acv, n_lo_level);
                cak_i_autosave :
                    ak30autosave_statement (acv, n_lo_level);
                (* PTS 1116464 E.Z. *)
                cak_i_check :
                    ak30check_statement (acv, a37, n_lo_level);
                cak_i_commit :
                    ak30commit_rollback_statement (acv,
                          n_lo_level, cak_x_util_commit);
                cak_i_connect :
                    ak30connect_statement (acv, n_lo_level);
                cak_i_create :
                    ak30create_statement (acv, n_lo_level);
                (* PTS 1108247 E.Z. *)
                cak_i_delete :
                    ak30delete_statement (acv,
                          c_warm_utility, n_lo_level);
                cak_i_diagnose :
                    ak30diagnose (acv, n_lo_level, false);
                cak_i_drop :
                    ak30drop_statement (acv, n_lo_level);
                cak_i_end :
                    ak30end_statement (acv, n_lo_level);
                cak_i_get :
                    ak30get_set (acv, n_lo_level);
                cak_i_init :
                    ak30init_after_load (acv, n_lo_level);
                (* PTS 1111229 E.Z. *)
                cak_i_prepare :
                    ak30prepare_standby (acv, n_lo_level);
                cak_i_rollback :
                    ak30commit_rollback_statement(acv,
                          n_lo_level, cak_x_util_rollback);
                (* PTS 1115982 E.Z. *)
                cak_i_save :
                    ak30save_statement (acv, n_lo_level);
                cak_i_read :
                    ak30read_label_statement (acv, n_lo_level);
                (* PTS 1111229 E.Z. *)
                cak_i_register :
                    ak30register_standby (acv, n_lo_level);
                cak_i_set  :
                    ak30set_statement (acv, a37, n_lo_level);
                cak_i_shutdown :
                    ak30shutdown_statement (acv, n_lo_level);
                cak_i_resume :
                    ak30aresume_statement (acv, n_lo_level);
                cak_i_suspend :
                    ak30asuspend_statement (acv, n_lo_level);
                (* PTS 1115978 E.Z. *)
                cak_i_verify  :
                    ak30verify_statement (acv, a37, n_lo_level);
                OTHERWISE
                    a07_error (acv, e_invalid_command,
                          dummy_node, dummy_node);
                END;
            (*ENDCASE*) 
        (*ENDWITH*) 
&       ifdef TRACE
        t01aptree (ak_syn, a_ap_tree^, a_scv_index, a_first_hint_node);
&       endif
        IF  a_return_segm^.sp1r_returncode = 0
        THEN
            BEGIN
            IF  a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_proc <> no_proc
            THEN
                BEGIN
                IF  a_init_ddl = no_ddl
                THEN
                    a_init_ddl := a_is_ddl;
                (*ENDIF*) 
                prot_needed := c_dont_know;
                util_cmd_id.utidId_gg00     := bsp_c12;
                util_cmd_id.utidLineNo_gg00 := 0;
                ak30c_utilprot_cmd (acv, prot_needed, with_tapeinfo, util_cmd_id);
                (* PTS 1102365 E.Z. *)
                CASE symbindex OF
                    cak_i_shutdown :
                        ak30insert_event (ce_shutdown, ce_start);
                    OTHERWISE
                        BEGIN
                        END
                    END;
                (*ENDCASE*) 
                IF  a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_proc = a36
                THEN
                    a36_call_semantic (acv, util_cmd_id)
                ELSE
                    a37_call_semantic (acv, util_cmd_id);
                (*ENDIF*) 
                (* PTS 1102365 E.Z. *)
                CASE symbindex OF
                    cak_i_shutdown :
                        ak30insert_event (ce_shutdown, ce_end);
                    OTHERWISE
                        BEGIN
                        END
                    END;
                (*ENDCASE*) 
                ak30r_utilprot_retcode (acv, prot_needed, with_tapeinfo, util_cmd_id);
                END
            (*ENDIF*) 
            END
        ELSE
            syntax_error := true;
        (*ENDIF*) 
        END;
    (*ENDIF*) 
    END
(*ENDWITH*) 
END;
 
(* PTS 1111229 E.Z. *)
(*------------------------------*) 
 
PROCEDURE
      a30_standby_utility (VAR acv : tak_all_command_glob);
 
VAR
      last_node     : tsp_int2;
      put_node      : tsp_int2;
      symbindex     : integer;
      res_kw        : boolean;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    a_is_ddl := no_ddl;
    a01_get_keyword (acv, symbindex, res_kw);
    a_ap_tree^[ 0 ].n_lo_level := 1;
    a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_proc := no_proc;
    WITH a_ap_tree^[ 0 ] DO
        CASE symbindex OF
            (* for testing cases connect/commit is allowed *)
            cak_i_commit :
                ak30cold_commit_statement (acv, n_lo_level);
            cak_i_connect :
                ak30cold_connect_statement (acv, n_lo_level);
            cak_i_remove :
                ak30remove_standby_statement (acv, n_lo_level);
            cak_i_insert :
                ak30insert_standby_statement (acv, n_lo_level);
            cak_i_synchronize :
                ak30synchronize_log_statement (acv, n_lo_level);
            cak_i_takeover :
                ak30takeover_statement (acv, n_lo_level);
            OTHERWISE
                a07_error (acv, e_invalid_keyword, put_node, last_node)
            END;
        (*ENDCASE*) 
    (*ENDWITH*) 
    IF  a_return_segm^.sp1r_returncode = 0
    THEN
        BEGIN
        (*
              prot_needed := c_dont_know;
              util_cmd_id.utidId_gg00     := bsp_c12;
              util_cmd_id.utidLineNo_gg00 := 0;
              ak30c_utilprot_cmd (acv, prot_needed, with_tapeinfo, util_cmd_id);
              *)
        a36_standby_semantic (acv);
        (*
              ak30r_utilprot_retcode (acv, prot_needed, with_tapeinfo, util_cmd_id);
              *)
        END
    (*ENDIF*) 
    END
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30end_statement (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      res_kw   : boolean;
      kw_index : integer;
 
BEGIN
a01_next_symbol (acv);
a01_get_keyword (acv, kw_index, res_kw);
CASE kw_index OF
    cak_i_restore, cak_i_save :
        BEGIN
        a01_next_symbol (acv);
        a01_call_put (acv, a36, cak_x_end, put_node);
        acv.a_ap_tree^[put_node].n_length := kw_index;
        IF  acv.a_scv.sc_symb <> s_eof
        THEN
            BEGIN
            a01_get_keyword (acv, kw_index, res_kw);
            IF  kw_index = cak_i_clear
            THEN
                BEGIN
                acv.a_ap_tree^[put_node].n_subproc :=
                      cak_x_end_clear;
                a01_next_symbol (acv);
                END;
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        END;
    OTHERWISE
        a07_error (acv, e_missing_keyword, put_node, put_node);
    END;
(*ENDCASE*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30file_type (
            VAR acv       : tak_all_command_glob;
            VAR put_node  : tsp_int2;
            VAR last_node : tsp_int2);
 
VAR
      res_kw : boolean;
      ikw    : integer;
 
BEGIN
a01_get_keyword (acv, ikw, res_kw);
IF  (ikw = cak_i_file    ) OR
    (ikw = cak_i_norewind) OR
    (ikw = cak_i_pipe    ) OR
    (ikw = cak_i_raw     ) OR
    (ikw = cak_i_tape     ) OR
    (ikw = cak_i_unknown )
THEN
    BEGIN (* filetype *)
    a01_call_put (acv, a37, ikw, put_node);
    last_node := put_node;
    a01_next_symbol (acv)
    END
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30add_devspace_statement (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      (* PTS 1111040 E.Z. *)
      logdev   : boolean;
      last_n   : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    a01_call_put (acv, a37, cak_x_add_devspace, put_node);
    a_ap_tree^[put_node].n_length := 0;
    a01_next_symbol (acv);
    (* PTS 1111040 E.Z. *)
    logdev := false;
    IF  a01_eqkey (a01kw[ cak_i_log], a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        BEGIN
        a_ap_tree^[put_node].n_length := cak_i_log;
        (* PTS 1111040 E.Z. *)
        logdev := true;
        (* PTS 1105850 UH 07-03-2000 *)
        a01_next_symbol (acv)
        END
    ELSE
        IF  a01_eqkey (a01kw[ cak_i_data], a_sqlmode,
            a_cmd_part^.sp1p_buf, a_scv)
        THEN
            a01_next_symbol (acv);
        (*ENDIF*) 
    (*ENDIF*) 
    IF  a01_eqkey (a01kw[ cak_i_devspace], a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        BEGIN
        a01_next_symbol (acv);
        a02_asystem_devspace (acv,
              a_ap_tree^[ put_node ].n_lo_level, last_n);
        IF  (
            NOT (a01_eqkey (a01kw[ cak_i_pages], a_sqlmode,
            a_cmd_part^.sp1p_buf, a_scv))
            )
            (* PTS 1111040 E.Z. *)
            AND logdev
        THEN
            a02_asystem_devspace (acv,
                  a_ap_tree^[ last_n ].n_lo_level, last_n);
        (*ENDIF*) 
        IF  a01_eqkey (a01kw[ cak_i_pages], a_sqlmode,
            a_cmd_part^.sp1p_buf, a_scv)
        THEN
            BEGIN
            a01_next_symbol (acv);
            a03_aunsigned_integer (acv,
                  a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_sa_level, last_n);
            (* PTS 1111040 E.Z. *)
            IF  a01_eqkey (a01kw[ cak_i_device], a_sqlmode,
                a_cmd_part^.sp1p_buf, a_scv)
            THEN
                BEGIN
                a01_next_symbol (acv);
                a03_aunsigned_integer (acv,
                      a_ap_tree^[ last_n ].n_sa_level, last_n);
                (* PTS 1111040 E.Z. *)
                END
            ELSE
                a07_error (acv, e_missing_keyword, last_n, last_n);
            (*ENDIF*) 
            END
        ELSE
            a07_error (acv, e_missing_keyword, last_n, last_n);
        (*ENDIF*) 
        END
    ELSE
        a07_error (acv, e_missing_keyword, last_n, last_n);
    (*ENDIF*) 
    a01_is_end_symbol (acv)
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30diagnose  (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2;
            cold_utility : boolean);
 
VAR
      last_node    : tsp_int2;
      curr_n       : tsp_int2;
      kw           : integer;
      kw_index     : integer;
      error        : boolean;
      is_on        : boolean;
      res_kw       : boolean;
 
BEGIN
WITH acv, a_scv  DO
    BEGIN
    IF  cold_utility
    THEN
        a01_call_put (acv, a36, cak_x_diagnose, curr_n)
    ELSE
        a01_call_put (acv, a37, cak_x_diagnose, curr_n);
    (*ENDIF*) 
    put_node := curr_n;
    a01_next_symbol (acv);
    a01_get_keyword (acv, kw_index, res_kw);
    CASE kw_index OF
&       ifdef trace
        cak_i_switch:
            a30diag_switch_syntax(acv, put_node);
&       endif
        (* PTS 1113051 E.Z. *)
        cak_i_parseid :
            BEGIN
            a01_next_symbol (acv);
            IF  cold_utility
            THEN
                a07_b_put_error (acv, e_invalid_command, 1)
            ELSE
                IF  a01_eqkey (a01kw[ cak_i_on], a_sqlmode,
                    a_cmd_part^.sp1p_buf, a_scv)
                THEN
                    BEGIN
                    a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_subproc := cak_x_on_diag_parse;
                    a01_next_symbol (acv)
                    END
                ELSE
                    IF  a01_eqkey (a01kw[ cak_i_off], a_sqlmode,
                        a_cmd_part^.sp1p_buf, a_scv)
                    THEN
                        BEGIN
                        a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_subproc := cak_x_off_diag_parse;
                        a01_next_symbol (acv)
                        END
                    ELSE
                        a07_error (acv,
                              e_missing_keyword,put_node,last_node);
                    (*ENDIF*) 
                (*ENDIF*) 
            (*ENDIF*) 
            END;
        cak_i_caches, cak_i_trigger :
            BEGIN
            a01_next_symbol (acv);
            IF  a01_eqkey (a01kw[ cak_i_on], a_sqlmode,
                a_cmd_part^.sp1p_buf, a_scv)
            THEN
                BEGIN
                is_on := true;
                a01_next_symbol (acv);
                END
            ELSE
                IF  a01_eqkey (a01kw[ cak_i_off], a_sqlmode,
                    a_cmd_part^.sp1p_buf, a_scv)
                THEN
                    BEGIN
                    is_on := false;
                    a01_next_symbol (acv);
                    END
                ELSE
                    a07_error (acv,
                          e_missing_keyword,put_node,last_node);
                (*ENDIF*) 
            (*ENDIF*) 
            IF  a_return_segm^.sp1r_returncode = 0
            THEN
                IF  ((a_current_user_kind <> unoprivate) AND
                    (a_current_user_kind  <> uprivate))
                THEN
                    BEGIN
                    a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_proc := no_proc;
                    CASE kw_index OF
                        cak_i_caches :
                            a10chk := is_on;
                        cak_i_trigger :
                            a01trigger := is_on;
                        END;
                    (*ENDCASE*) 
                    END
                ELSE
                    a07_b_put_error (acv, e_invalid_command, 1);
                (*ENDIF*) 
            (*ENDIF*) 
            END;
        cak_i_monitor :
            a545diag_monitor_syntax (acv, a_ap_tree^[ 0 ].n_lo_level );
        cak_i_set :
            BEGIN (* h.b. PTS 1105143 *)
            a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_subproc
                  := cak_x_set_parameter;
            a30set_parameter_syntax (acv, curr_n);
            END;
        cak_i_vtrace :
            a30diag_vtrace_syntax (acv, curr_n);
        cak_i_index :
            IF  NOT (cold_utility)
            THEN
                BEGIN
                a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_subproc := cak_x_diag_index;
                a01_next_symbol (acv);
                a02_acolumnspec (acv, false,
                      a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_lo_level,
                      last_node);
                IF  (a_ap_tree^[ last_node ].n_symb = s_columnname)
                    AND ( sc_symb <> s_eof)
                THEN
                    BEGIN
                    a_ap_tree^[ last_node ].n_symb := s_identifier;
                    IF  a01_eqkey (a01kw[ cak_i_on], a_sqlmode,
                        a_cmd_part^.sp1p_buf, a_scv)
                    THEN
                        BEGIN
                        a01_next_symbol (acv);
                        a02_atablename (acv,
                              a_ap_tree^[ last_node ].n_lo_level,
                              last_node);
                        END;
                    (*ENDIF*) 
                    END;
                (*ENDIF*) 
                END
            ELSE
                a07_b_put_error (acv, e_invalid_command, 1);
            (*ENDIF*) 
        cak_i_tabid :
            BEGIN
            a01_next_symbol (acv);
            a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_length := ord(diagTabIdGet_egg00);
            a02_atablename (acv,
                  a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_lo_level, last_node);
            END;
        cak_i_table, cak_i_user :
            BEGIN
            a01_next_symbol (acv);
            IF  kw_index = cak_i_table
            THEN
                a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_length :=
                      ord(diagTabNameGet_egg00)
            ELSE
                a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_length :=
                      ord(diagUserNameGet_egg00);
            (*ENDIF*) 
            a03_astring_literal (acv,
                  a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_lo_level, last_node)
            END;
        cak_i_userid :
            BEGIN
            a01_next_symbol (acv);
            a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_length :=
                  ord (diagUserIdGet_egg00);
            a02_aauthid (acv,
                  a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_lo_level,
                  last_node);
            END;
        cak_i_data :
            BEGIN
            a01_next_symbol (acv);
            a01_get_keyword (acv, kw, res_kw);
            CASE  kw OF
                cak_i_buffer :
                    BEGIN
                    a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_proc := no_proc;
                    a01_next_symbol (acv);
                    a01_get_keyword (acv, kw, res_kw);
                    IF  (kw = cak_i_on) OR (kw = cak_i_off)
                    THEN
                        BEGIN
                        a01_next_symbol (acv);
                        g01glob.datacachecheck := kw = cak_i_on
                        END
                    (*ENDIF*) 
                    END;
                cak_i_to :
                    BEGIN
                    a_ap_tree^[a_ap_tree^[ 0 ].n_lo_level].n_subproc := cak_x_diag_dump;
                    a_ap_tree^[a_ap_tree^[ 0 ].n_lo_level].n_length := 0;
                    a02_ahostfile_name (acv,
                          a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_lo_level, last_node);
                    curr_n := 1;
                    WHILE (sc_symb <> s_eof) AND
                          (a_return_segm^.sp1r_returncode = 0) DO
                        BEGIN
                        a01_put_node (acv, last_node);
                        a_ap_tree^[curr_n].n_sa_level := last_node;
                        curr_n := last_node;
                        ak30adump_kind (acv, curr_n);
                        a01_next_symbol (acv)
                        END;
                    (*ENDWHILE*) 
                    END;
                OTHERWISE
                    a07_error (acv, e_missing_keyword,
                          put_node,last_node);
                END;
            (*ENDCASE*) 
            END;
        cak_i_pages :
            BEGIN
            error    := true;
            a01_next_symbol (acv);
            IF  a01_eqkey (a01kw[ cak_i_lock], a_sqlmode,
                a_cmd_part^.sp1p_buf, a_scv)
            THEN
                BEGIN
                a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_proc := no_proc;
                a01_next_symbol (acv);
                a01_get_keyword (acv, kw, res_kw);
                IF  (kw = cak_i_on) OR (kw = cak_i_off)
                THEN
                    BEGIN
                    error := false;
                    a01_next_symbol (acv);
                    g01glob.bd_lock_check := (kw = cak_i_on)
                    END
                (*ENDIF*) 
                END;
            (*ENDIF*) 
            IF  error
            THEN
                a07_error (acv, e_missing_keyword,
                      put_node, last_node)
            (*ENDIF*) 
            END;
        cak_i_check :
            BEGIN
            a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_proc := no_proc;
            last_node := put_node;
            a01_next_symbol (acv);
            (* h.b. CR 1000066 *)
            IF  a01_eqkey (a01kw[ cak_i_index], a_sqlmode,
                a_cmd_part^.sp1p_buf, a_scv)
            THEN
                BEGIN
                a01_next_symbol (acv);
                IF  a01_eqkey (a01kw[ cak_i_usage], a_sqlmode,
                    a_cmd_part^.sp1p_buf, a_scv)
                THEN
                    BEGIN
                    a01_next_symbol (acv);
                    a01_get_keyword (acv, kw_index, res_kw);
                    CASE kw_index OF
                        cak_i_on, cak_i_off :
                            BEGIN
                            a07_error (acv, e_not_implemented,
                                  put_node, last_node);
                            (* a01_next_symbol (acv); *)
                            (* a01check_index_usage := kw_index = cak_i_on *)
                            END;
                        OTHERWISE
                            a07_error (acv, e_missing_keyword,
                                  put_node, last_node)
                        END;
                    (*ENDCASE*) 
                    END
                ELSE
                    a07_error (acv, e_missing_keyword,
                          put_node, last_node);
                (*ENDIF*) 
                END
            ELSE
                a30diag_check (acv, put_node) (* PTS 1103957 JA 199-09-15 *)
            (*ENDIF*) 
            END;
        cak_i_write :
            BEGIN
            a01_next_symbol (acv);
            a_ap_tree^ [ a_ap_tree^[ 0 ].n_lo_level ].n_length := ord(diagWrite_egg00);
            IF  a01_eqkey (a01kw[ cak_i_pages], a_sqlmode,
                a_cmd_part^.sp1p_buf, a_scv)
            THEN
                BEGIN
                a01_next_symbol (acv);
                a03_aunsigned_integer (acv,
                      a_ap_tree^[a_ap_tree^[ 0 ].n_lo_level].n_sa_level, last_node)
                END
            ELSE
                a07_error (acv, e_missing_keyword,
                      put_node, last_node)
            (*ENDIF*) 
            END;
        OTHERWISE
            BEGIN
            a01_get_keyword (acv, kw_index, res_kw);
            IF  cold_utility
            THEN
                BEGIN
                IF  kw_index = cak_i_devspace
                THEN
                    BEGIN
                    a01_next_symbol (acv);
                    IF  a01_eqkey (a01kw[ cak_i_enable], a_sqlmode,
                        a_cmd_part^.sp1p_buf, a_scv)
                    THEN
                        BEGIN
                        a01_next_symbol (acv);
                        a_ap_tree^[a_ap_tree^[ 0 ].n_lo_level].n_subproc := cak_x_diagnose;
                        a_ap_tree^[a_ap_tree^[ 0 ].n_lo_level].n_length  := ord (diagEnableDevspace_egg00);
                        a03_astring_literal (acv,
                              a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_lo_level, last_node)
                        END
                    ELSE
                        a07_error (acv, e_missing_keyword, put_node,last_node);
                    (*ENDIF*) 
                    (* CR 1000152 *)
                    END
                ELSE
                    IF  kw_index = cak_i_restore
                    THEN
                        BEGIN
                        last_node := curr_n;
                        a_ap_tree^[a_ap_tree^[ 0 ].n_lo_level].n_length := ord(diagRestore_egg00);
                        a01_call_put (acv, a36, cak_x_diagnose, curr_n);
                        a_ap_tree^[last_node].n_sa_level := curr_n;
                        last_node := curr_n;
                        a01_next_symbol (acv);
                        IF  a01_eqkey (a01kw [cak_i_data], a_sqlmode,
                            a_cmd_part^.sp1p_buf, a_scv)
                        THEN
                            BEGIN
                            a_ap_tree^[curr_n].n_length := ord(diagPages_egg00);
                            a01_next_symbol (acv)
                            END
                        ELSE
                            IF  a01_eqkey (a01kw [cak_i_psm], a_sqlmode,
                                a_cmd_part^.sp1p_buf, a_scv)
                            THEN
                                BEGIN
                                a_ap_tree^[curr_n].n_length := ord(diagConvPage_egg00);
                                a01_next_symbol (acv)
                                END
                            ELSE
                                IF  a01_eqkey (a01kw [cak_i_restart], a_sqlmode,
                                    a_cmd_part^.sp1p_buf, a_scv)
                                THEN
                                    BEGIN
                                    a_ap_tree^[curr_n].n_length := ord(diagRestart_egg00);
                                    a01_next_symbol (acv)
                                    END
                                ELSE
                                    IF  a01_eqkey (a01kw [cak_i_devspace],
                                        a_sqlmode, a_cmd_part^.sp1p_buf,
                                        a_scv)
                                    THEN
                                        ak30devspace (acv, 2,
                                              a_ap_tree^[curr_n].n_sa_level)
                                    (*ENDIF*) 
                                (*ENDIF*) 
                            (*ENDIF*) 
                        (*ENDIF*) 
                        END
                    ELSE
                        IF  kw_index = cak_i_to
                        THEN
                            BEGIN
                            a02_ahostfile_name (acv,
                                  a_ap_tree^[ curr_n ].n_sa_level,
                                  last_node);
                            IF  a_return_segm^.sp1r_returncode = 0
                            THEN
                                BEGIN
                                curr_n := last_node;
                                a01_get_keyword (acv, kw_index, res_kw);
                                WITH a_ap_tree^[ curr_n ] DO
                                    CASE kw_index OF
                                        cak_i_column :
                                            ak30column (acv, n_sa_level);
                                        cak_i_data :
                                            ak30data_page (acv, n_sa_level);
                                        cak_i_devspace  :
                                            ak30devspace (acv, 1, n_sa_level);
                                        cak_i_index :
                                            ak30index (acv, n_sa_level);
                                        cak_i_log  :
                                            ak30log (acv, n_sa_level);
                                        cak_i_logfull  :
                                            BEGIN
                                            (* get log info page *)
                                            a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_length :=
                                                  ord(diagLoginfoPage_egg00);
                                            a01_next_symbol (acv);
                                            END;
                                        cak_i_psm :
                                            ak30conv_page (acv, n_sa_level);
                                        cak_i_restart  :
                                            BEGIN
                                            (* get restart record *)
                                            a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_length :=
                                                  ord(diagRestart_egg00);
                                            a01_next_symbol (acv);
                                            END;
                                        cak_i_table :
                                            ak30table (acv, n_sa_level);
                                        OTHERWISE
                                            a07_error (acv, e_invalid_keyword,
                                                  put_node, last_node)
                                        END
                                    (*ENDCASE*) 
                                (*ENDWITH*) 
                                END
                            (*ENDIF*) 
                            END
                        ELSE
                            a07_error (acv,
                                  e_missing_keyword,put_node,last_node);
                        (*ENDIF*) 
                    (*ENDIF*) 
                (*ENDIF*) 
                END
            ELSE
                (* warm *)
                IF  kw_index = cak_i_to
                THEN
                    BEGIN
                    a02_ahostfile_name (acv,
                          a_ap_tree^[ curr_n ].n_sa_level,
                          last_node);
                    IF  a_return_segm^.sp1r_returncode = 0
                    THEN
                        BEGIN
                        curr_n := last_node;
                        a01_get_keyword (acv, kw_index, res_kw);
                        WITH a_ap_tree^[ curr_n ] DO
                            CASE kw_index OF
                                cak_i_data :
                                    ak30data_page (acv, n_sa_level);
                                cak_i_logfull  :
                                    BEGIN
                                    a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_length :=
                                          ord(diagLoginfoPage_egg00);
                                    a01_next_symbol (acv);
                                    END;
                                cak_i_restart  :
                                    BEGIN
                                    a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_length :=
                                          ord(diagRestart_egg00);
                                    a01_next_symbol (acv);
                                    END;
                                OTHERWISE
                                    a07_error (acv, e_invalid_keyword,
                                          put_node, last_node)
                                END
                            (*ENDCASE*) 
                        (*ENDWITH*) 
                        END
                    (*ENDIF*) 
                    END
                ELSE
                    a07_error (acv,
                          e_missing_keyword,put_node,last_node)
                (*ENDIF*) 
            (*ENDIF*) 
            END
        END;
    (*ENDCASE*) 
    a01_is_end_symbol (acv)
    END;
(*ENDWITH*) 
END;
 
(* PTS 1108234 E.Z. *)
(*------------------------------*) 
 
PROCEDURE
      a30diag_check (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
CONST
      c_check_items = 20;
 
VAR
      i          : integer;
      item_cnt   : integer;
      instanceno : tsp_int2;
      last_node  : tsp_int2;
      set_on     : boolean;
      kw_index   : integer;
      res_kw     : boolean;
      check_item : ARRAY [1..c_check_items] OF integer;
 
BEGIN
(* PTS 1103957 JA 199-09-15 *)
set_on   := false;
item_cnt := 0;
REPEAT
    a01_get_keyword (acv, kw_index, res_kw);
    CASE kw_index OF
        cak_i_all,
        cak_i_bufferpool,  (* LockSupply     *)
        cak_i_cache,       (* datacachecheck *)
        cak_i_current,     (* KB-Region      *)
        cak_i_default,     (* vtrCheck0      *)
        cak_i_freepage,    (* bd_lock_check  *)
        cak_i_lock,        (* Lock           *)
        cak_i_log,         (* Log            *)
        cak_i_pages,       (* treecheck      *)
        cak_i_save,        (* Backup         *)
        cak_i_transaction, (* Trans          *)
        cak_i_write:       (* LogQueue       *)
            BEGIN
            item_cnt := item_cnt + 1;
            check_item [item_cnt] := kw_index;
            IF  item_cnt >= c_check_items
            THEN
                a07_error (acv, e_missing_keyword, put_node, put_node)
            ELSE
                a01_next_symbol (acv)
            (*ENDIF*) 
            END;
        cak_i_instance :
            BEGIN
            item_cnt := item_cnt + 1;
            check_item [item_cnt] := kw_index;
            a01_next_symbol (acv);
            a03_aunsigned_integer (acv, acv.a_ap_tree^[put_node].n_sa_level,
                  last_node);
            END;
        OTHERWISE
            IF  ((kw_index = cak_i_on ) OR
                ( kw_index = cak_i_off))
                AND
                (item_cnt > 0)
            THEN
                BEGIN
                set_on := kw_index = cak_i_on;
                a01_next_symbol (acv);
                END
            ELSE
                a07_error (acv, e_missing_keyword, put_node, put_node)
            (*ENDIF*) 
        END;
    (*ENDCASE*) 
UNTIL
    (kw_index = cak_i_on      ) OR
    (kw_index = cak_i_off     ) OR
    (kw_index = cak_i_instance) OR  (* PTS 1108234 JA 2000-11-23 *)
    (acv.a_return_segm^.sp1r_returncode <> 0);
(*ENDREPEAT*) 
IF  acv.a_return_segm^.sp1r_returncode = 0
THEN
    FOR i := 1 TO item_cnt DO
        CASE check_item [i] OF
            cak_i_all:
                BEGIN
                kb03SetKbCheck (set_on);
                g01vtrace.vtrCheck_gg00 := set_on;
                g01glob.datacachecheck  := set_on;
                g01glob.bd_lock_check   := set_on;
                g01glob.treecheck       := set_on
                END;
            cak_i_bufferpool:
                kb03SetLockSupplyCheck (set_on);
            cak_i_cache:
                g01glob.datacachecheck := set_on;
            cak_i_current:
                kb03SetRegionCheck (set_on);
            cak_i_default:
                g01vtrace.vtrCheck_gg00 := set_on;
            cak_i_freepage:
                g01glob.bd_lock_check := set_on;
            cak_i_instance:
                BEGIN
                WITH acv.a_ap_tree^[ last_node ] DO
                    a05_unsigned_int2_get (acv, n_pos,
                          n_length, e_invalid_unsign_integer, instanceno);
                (*ENDWITH*) 
                (* PTS 1108234 JA 2000-11-23 *)
                gg942ComponentTests (acv.a_transinf.tri_trans, instanceno);
                IF  acv.a_transinf.tri_trans.trError_gg00 <> e_ok
                THEN
                    a07_b_put_error (acv, acv.a_transinf.tri_trans.trError_gg00, 1);
                (*ENDIF*) 
                END;
            cak_i_lock:
                kb03SetLockCheck (set_on);
            cak_i_log:
                kb03SetLogCheck (set_on);
            cak_i_pages:
                g01glob.treecheck := set_on;
            cak_i_save:
                kb03SetBackupCheck (set_on);
            cak_i_transaction:
                kb03SetTransCheck (set_on);
            cak_i_write:
                kb03SetLogQueueCheck (set_on);
            OTHERWISE
                ;
            END;
        (*ENDCASE*) 
    (*ENDFOR*) 
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      a30diag_oms (VAR acv :tak_all_command_glob);
 
VAR
      put_node  : tsp00_Int2;
      last_node : tsp00_Int2;
      errorCode : tsp00_Int4;
 
BEGIN
a01_call_put (acv, no_proc, 0, last_node);
a01_next_symbol (acv);
IF  a01mandatory_keyword (acv, cak_i_catch)
THEN
    BEGIN
    a03_ainteger (acv, put_node, last_node);
    a05int4_get (acv, acv.a_ap_tree^[last_node].n_pos,
          acv.a_ap_tree^[last_node].n_length, errorCode);
    IF  acv.a_return_segm^.sp1r_returncode = 0
    THEN
        ak341SetDumpError(errorCode);
    (*ENDIF*) 
    acv.a_ex_kind := only_syntax;
    END;
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      a30CheckInstance(VAR acv : tak_all_command_glob);
 
VAR
      put_node   : tsp00_Int2;
      last_node  : tsp00_Int2;
      instanceno : tsp_int2;
 
BEGIN (* 1113008 *)
a01_call_put (acv, no_proc, 0, last_node);
a01_next_symbol (acv);
a03_ainteger (acv, put_node, last_node);
WITH acv.a_ap_tree^[ last_node ] DO
    a05_unsigned_int2_get (acv, n_pos,
          n_length, e_invalid_unsign_integer, instanceno);
(*ENDWITH*) 
gg942ComponentTests (acv.a_transinf.tri_trans, instanceno);
IF  acv.a_transinf.tri_trans.trError_gg00 <> e_ok
THEN
    a07_b_put_error (acv, acv.a_transinf.tri_trans.trError_gg00, 1);
(*ENDIF*) 
acv.a_ex_kind := only_syntax;
END;
 
(*------------------------------*) 
 
FUNCTION
      a30SetCountDown(VAR acv : tak_all_command_glob) : boolean;
 
VAR
      put_node  : tsp00_Int2;
      last_node : tsp00_Int2;
 
BEGIN
a01_call_put (acv, no_proc, 0, last_node);
a01_next_symbol (acv);
a03_ainteger (acv, put_node, last_node);
a05int4_get (acv, acv.a_ap_tree^[last_node].n_pos,
      acv.a_ap_tree^[last_node].n_length, acv.a_allocatorInfo.ai_badAllocCountDown);
IF  acv.a_allocatorInfo.ai_badAllocCountDown <= 0
THEN
    acv.a_allocatorInfo.ai_badAllocCountDown := -1;
(*ENDIF*) 
acv.a_ex_kind   := only_syntax;
a30SetCountDown := true;
END;
 
(*------------------------------*) 
 
PROCEDURE
      a30diag_vtrace_syntax (
            VAR acv      :tak_all_command_glob;
            VAR put_node : tsp_int2 );
 
VAR
      _exit_loop  : boolean;
      _kw_index   : integer;
      _obj_kw_idx : integer;
      _h_pos      : integer;
      _last_node  : tsp_int2;
      _selected   : boolean;
      _oms_node   : tsp_int2;
      _oms_last   : tsp_int2;
      _res_kw     : boolean;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    _selected  := false;
    _oms_node  := 0;
    REPEAT
        _last_node := put_node;
        a01_next_symbol (acv);
        a01_get_keyword (acv, _kw_index, _res_kw);
        CASE _kw_index OF
            (* PTS 1111576 E.Z. *)
            cak_i_analyze,
            cak_i_default,  cak_i_delete,
            cak_i_index,    cak_i_insert,
            cak_i_lock,     cak_i_long,
            cak_i_optimize, cak_i_order,
            cak_i_pages,
            cak_i_select,   cak_i_session,
            cak_i_table,    cak_i_time,
            cak_i_update,
            cak_i_object :
                BEGIN
                IF  _kw_index = cak_i_order
                THEN
                    BEGIN
                    _h_pos := sc_newpos;
                    a01_next_symbol (acv);
                    IF  a01_eqkey (a01kw[ cak_i_standard], a_sqlmode,
                        a_cmd_part^.sp1p_buf, a_scv)
                    THEN
                        _kw_index := cak_i_standard
                    ELSE
                        sc_newpos := _h_pos;
                    (*ENDIF*) 
                    END;
                (*ENDIF*) 
                IF  _kw_index = cak_i_object
                THEN
                    BEGIN
                    _h_pos := sc_newpos;
                    a01_next_symbol (acv);
                    IF  a01_eqkey (a01kw [cak_i_get], a_sqlmode,
                        a_cmd_part^.sp1p_buf, a_scv)
                    THEN
                        _kw_index := cak_i_get (* OsmGet *)
                    ELSE
                        IF  a01_eqkey (a01kw [cak_i_add], a_sqlmode,
                            a_cmd_part^.sp1p_buf, a_scv)
                        THEN
                            _kw_index := cak_i_add (* OsmNew *)
                        ELSE
                            IF  a01_eqkey (a01kw [cak_i_alter], a_sqlmode,
                                a_cmd_part^.sp1p_buf, a_scv)
                            THEN
                                _kw_index := cak_i_alter (* OsmUpd *)
                            ELSE
                                IF  a01_eqkey (a01kw [cak_i_freepage], a_sqlmode,
                                    a_cmd_part^.sp1p_buf, a_scv)
                                THEN
                                    _kw_index := cak_i_freepage (* OsmFree *)
                                ELSE
                                    BEGIN
                                    _exit_loop := false;
                                    REPEAT
                                        a01_get_keyword (acv, _obj_kw_idx, _res_kw);
                                        IF  _obj_kw_idx = 0
                                        THEN
                                            BEGIN
                                            IF  _oms_node = 0
                                            THEN
                                                BEGIN
                                                a01_put_node (acv, _oms_node);
                                                _oms_last := _oms_node
                                                END
                                            ELSE
                                                BEGIN
                                                a01_put_node (acv, a_ap_tree^[_oms_last].n_sa_level);
                                                _oms_last := a_ap_tree^[_oms_last].n_sa_level
                                                END;
                                            (*ENDIF*) 
                                            _h_pos := sc_newpos;
                                            a01_next_symbol(acv);
                                            END
                                        ELSE
                                            _exit_loop := true;
                                        (*ENDIF*) 
                                    UNTIL
                                        _exit_loop;
                                    (*ENDREPEAT*) 
                                    sc_newpos := _h_pos;
                                    END;
                                (*ENDIF*) 
                            (*ENDIF*) 
                        (*ENDIF*) 
                    (*ENDIF*) 
                    END;
                (*ENDIF*) 
                a01_call_put (acv, a37, _kw_index, put_node);
                a_ap_tree^[put_node].n_lo_level    := _oms_node;
                a_ap_tree^[ _last_node ].n_sa_level:= put_node;
                (* PTS 1111576 E.Z. *)
                IF  _kw_index = cak_i_session
                THEN
                    BEGIN
                    a01_next_symbol (acv);
                    IF  (sc_symb = s_byte_string) OR
                        (sc_symb = s_asterisk)    OR
                        (sc_symb = s_equal)
                    THEN
                        BEGIN
                        a01_put_node (acv, _last_node);
                        a_ap_tree^[put_node].n_sa_level :=
                              _last_node;
                        END
                    ELSE
                        a07_error (acv, e_missing_keyword,
                              put_node, _last_node);
                    (*ENDIF*) 
                    a_ap_tree^[a_ap_tree^[ 0 ].n_lo_level].n_subproc := cak_x_vtrace_on;
                    _kw_index           := cak_i_on
                    END;
                (*ENDIF*) 
                _selected := true;
                END;
            cak_i_clear, cak_i_flush :
                BEGIN
                a01_call_put (acv, a37, _kw_index, put_node);
                a_ap_tree^[ _last_node ].n_sa_level:= put_node;
                a01_next_symbol (acv);
                a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_subproc :=
                      cak_x_vtrace_on;
                _kw_index := cak_i_on;
                END;
            cak_i_stop :
                BEGIN
                a01_call_put (acv, a37, _kw_index, put_node);
                a_ap_tree^[ _last_node ].n_sa_level:= put_node;
                a01_next_symbol (acv);
                IF  a01mandatory_keyword (acv, cak_i_on)
                THEN
                    IF  a01mandatory_keyword (acv, cak_i_error)
                    THEN
                        BEGIN
                        a03_ainteger (acv,  a_ap_tree^[ put_node ].n_lo_level,
                              put_node);
                        a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_subproc :=
                              cak_x_vtrace_on;
                        _kw_index := cak_i_on;
                        END
                    (*ENDIF*) 
                (*ENDIF*) 
                END;
            (* PTS 1110976 E.Z. *)
            cak_i_check :
                BEGIN
                _h_pos := sc_newpos;
                a01_next_symbol (acv);
                IF  sc_symb = s_string_literal
                THEN
                    BEGIN
                    _h_pos := sc_newpos;
                    a01_call_put (acv, a37, _kw_index, put_node);
                    a03_astring_literal (acv,
                          a_ap_tree^[ put_node ].n_lo_level, _oms_node);
                    a_ap_tree^[ _last_node ].n_sa_level:= put_node;
                    sc_newpos := _h_pos;
                    END
                ELSE
                    BEGIN
                    _kw_index := cak_i_constraint;
                    a01_call_put (acv, a37, _kw_index, put_node);
                    a_ap_tree^[ _last_node ].n_sa_level:= put_node;
                    sc_newpos := _h_pos;
                    END;
                (*ENDIF*) 
                _selected := true;
                END;
            cak_i_topic :
                BEGIN
                a01_call_put (acv, a37, _kw_index, put_node);
                a01_next_symbol (acv);
                _h_pos := sc_newpos;
                a03_astring_literal (acv,
                      a_ap_tree^[ put_node ].n_lo_level, _oms_node);
                a_ap_tree^[ _last_node ].n_sa_level:= put_node;
                sc_newpos := _h_pos;
                _selected := true;
                END;
            OTHERWISE
                IF  NOT (_kw_index in [ cak_i_on, cak_i_off ]) OR
                    NOT (_selected)
                THEN
                    a07_error (acv, e_missing_keyword,
                          put_node, _last_node)
                ELSE
                    IF  _kw_index = cak_i_on
                    THEN
                        a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_subproc :=
                              cak_x_vtrace_on
                    ELSE
                        a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_subproc :=
                              cak_x_vtrace_off;
                    (*ENDIF*) 
                (*ENDIF*) 
            END;
        (*ENDCASE*) 
    UNTIL
        (_kw_index in [ cak_i_on, cak_i_off ]) OR
        (a_return_segm^.sp1r_returncode <> 0);
    (*ENDREPEAT*) 
    IF  (a_return_segm^.sp1r_returncode = 0)
    THEN
        a01_next_symbol (acv);
    (*ENDIF*) 
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      a30set_parameter_syntax (
            VAR acv      :tak_all_command_glob;
            VAR put_node : tsp_int2 );
 
VAR
      _last_n : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    IF  a_return_segm^.sp1r_returncode = 0
    THEN
        BEGIN (* h.b. PTS 1105143 *)
        a01_next_symbol (acv);
        ak30set_parameter_clause (acv,
              a_ap_tree^[ put_node ].n_lo_level, _last_n);
        (* h.b. 03.09.1999  for future release, semantik exists already
              WHILE sc_symb = s_comma DO
              BEGIN
              a01_next_symbol (acv);
              ak30set_parameter_clause (acv, a_ap_tree^[ _last_n ].n_sa_level,
              _last_n)
              END;
              *)
        a01_is_end_symbol (acv);
        END;
    (*ENDIF*) 
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30set_parameter_clause (
            VAR acv       : tak_all_command_glob;
            VAR put_node  : tsp_int2;
            VAR last_node : tsp_int2);
 
VAR
      _last_n : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    IF  a_return_segm^.sp1r_returncode = 0
    THEN
        BEGIN
        a02_put_identifier (acv, put_node, last_node);
        a01_force_symbol (acv, s_equal, put_node, last_node);
        IF  a_return_segm^.sp1r_returncode = 0
        THEN
            a03_avalue_spec (acv, NOT c_null_allowed, NOT c_stamp_allowed,
                  NOT c_default_allowed, NOT c_sysdba_allowed,
                  a_ap_tree^[ put_node ].n_lo_level, _last_n);
        (*ENDIF*) 
        IF  a_return_segm^.sp1r_returncode = 0
        THEN
            IF  NOT (a_ap_tree^[ _last_n ].n_symb in [
                s_string_literal, s_unsigned_integer,
                s_fixed_point_literal, s_floating_point_literal])
            THEN
                a07_error (acv, e_missing_value_spec, put_node, _last_n);
            (*ENDIF*) 
        (*ENDIF*) 
        END
    (*ENDIF*) 
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30cold_commit_statement (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      curr_n : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    a01_call_put (acv, a36, cak_x_util_commit, curr_n);
    put_node := curr_n;
    a01_next_symbol (acv);
    IF  a01_eqkey (a01kw[ cak_i_work], a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        a01_next_symbol (acv);
    (*ENDIF*) 
    IF  a01_eqkey (a01kw[ cak_i_release], a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        BEGIN
        a01_next_symbol (acv);
        a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_subproc :=
              cak_x_commit_release;
        END;
    (*ENDIF*) 
    a01_is_end_symbol (acv)
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30cold_connect_statement (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      curr_n : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    a01_call_put (acv, a36, cak_x_connect, curr_n);
    put_node := curr_n;
    a51_aconnect_statement (acv, true, a_ap_tree^[ curr_n ].n_lo_level);
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30adump_kind (
            VAR acv : tak_all_command_glob;
            curr_n : tsp_int2);
 
VAR
      dump_kind : tak_keyword;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    dump_kind := 'A51DUMP           ';
    IF  a01_eqkey (dump_kind, a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        a_ap_tree^[curr_n].n_subproc := cak_i_connect;
    (* *)
    (*ENDIF*) 
    dump_kind := 'BDLOCKLIST        ';
    IF  a01_eqkey (dump_kind, a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        a_ap_tree^[curr_n].n_subproc := cak_i_pages;
    (* *)
    (*ENDIF*) 
    dump_kind := 'CONFIGURATION     ';
    IF  a01_eqkey (dump_kind, a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        a_ap_tree^[curr_n].n_subproc := cak_i_config;
    (* *)
    (*ENDIF*) 
    dump_kind := 'CONVERTER         ';
    IF  a01_eqkey (dump_kind, a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        a_ap_tree^[curr_n].n_subproc := cak_i_psm;
    (* *)
    (*ENDIF*) 
    dump_kind := 'CONVERTERCACHE    ';
    IF  a01_eqkey (dump_kind, a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        a_ap_tree^[curr_n].n_subproc := cak_i_buffer;
    (* *)
    (*ENDIF*) 
    dump_kind := 'DATACACHE         ';
    IF  a01_eqkey (dump_kind, a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        a_ap_tree^[curr_n].n_subproc := cak_i_data;
    (* *)
    (*ENDIF*) 
    dump_kind := 'PAGERWRITER       ';
    IF  a01_eqkey (dump_kind, a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        a_ap_tree^[curr_n].n_subproc := cak_i_write;
    (* *)
    (*ENDIF*) 
    dump_kind := 'FBM               ';
    IF  a01_eqkey (dump_kind, a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        a_ap_tree^[curr_n].n_subproc := cak_i_freepage;
    (* *)
    (*ENDIF*) 
    dump_kind := 'HEADMASTER        ';
    IF  a01_eqkey (dump_kind, a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        a_ap_tree^[curr_n].n_subproc := cak_i_autosave;
    (* *)
    (*ENDIF*) 
    dump_kind := 'KBLOCKLIST        ';
    IF  a01_eqkey (dump_kind, a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        a_ap_tree^[curr_n].n_subproc := cak_i_lock;
    (* *)
    (*ENDIF*) 
    dump_kind := 'LOGWRITER         ';
    IF  a01_eqkey (dump_kind, a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        a_ap_tree^[curr_n].n_subproc := cak_i_log;
    (* *)
    (*ENDIF*) 
    dump_kind := 'LOGCACHE          ';
    IF  a01_eqkey (dump_kind, a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        a_ap_tree^[curr_n].n_subproc := cak_i_caches;
    (* *)
    (*ENDIF*) 
    dump_kind := 'NETSERVER         ';
    IF  a01_eqkey (dump_kind, a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        a_ap_tree^[curr_n].n_subproc := cak_i_serverdb;
    (* *)
    (*ENDIF*) 
    dump_kind := 'RESTARTRECORD     ';
    IF  a01_eqkey (dump_kind, a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        a_ap_tree^[curr_n].n_subproc := cak_i_restart;
    (* *)
    (*ENDIF*) 
    dump_kind := 'RTE               ';
    IF  a01_eqkey (dump_kind, a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        a_ap_tree^[curr_n].n_subproc := cak_i_version;
    (* *)
    (*ENDIF*) 
    dump_kind := 'TRANSFORMATION    ';
    IF  a01_eqkey (dump_kind, a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        a_ap_tree^[curr_n].n_subproc := cak_i_translate;
    (* *)
    (*ENDIF*) 
    dump_kind := 'UTILITY           ';
    IF  a01_eqkey (dump_kind, a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        a_ap_tree^[curr_n].n_subproc := cak_i_adabas;
    (* *)
    (*ENDIF*) 
    dump_kind := 'GARBCOLL          ';
    IF  a01_eqkey (dump_kind, a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        a_ap_tree^[curr_n].n_subproc := cak_i_release;
    (* *)
    (*ENDIF*) 
    dump_kind := 'OBJFDIR           ';
    IF  a01_eqkey (dump_kind, a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        a_ap_tree^[curr_n].n_subproc := cak_i_object;
    (* *)
    (*ENDIF*) 
    IF   a_ap_tree^[curr_n].n_subproc = 0
    THEN
        a07_error (acv, e_missing_keyword, curr_n, curr_n);
    (*ENDIF*) 
    END
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30alter_statement (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      res_kw    : boolean;
      symbindex : integer;
 
BEGIN
a01_next_symbol (acv);
a01_get_keyword (acv, symbindex, res_kw);
CASE symbindex OF
    cak_i_mapchar :
        ak30alter_create_set (acv, put_node, cak_x_alter_mapset);
    (* PTS 1116602 E.Z. *)
    (*
          cak_i_termchar :
          ak30alter_create_set (acv, put_node, cak_x_alter_termset);
          *)
    cak_i_serverdb :
        ak30alter_serverdb (acv, put_node);
    cak_i_password :
        BEGIN
        acv.a_init_ddl := ddl_alter_password;
        a20alter_password (acv, put_node);
        END;
    OTHERWISE
        a07_error (acv, e_missing_keyword, put_node, put_node);
    END;
(*ENDCASE*) 
IF  acv.a_return_segm^.sp1r_returncode = 0
THEN
    a01_is_end_symbol (acv)
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30create_statement (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      res_kw    : boolean;
      symbindex : integer;
 
BEGIN
a01_next_symbol (acv);
a01_get_keyword (acv, symbindex, res_kw);
CASE symbindex OF
    cak_i_mapchar :
        ak30alter_create_set (acv, put_node, cak_x_create_mapset);
    (* PTS 1116602 E.Z. *)
    (*
          cak_i_termchar :
          ak30alter_create_set (acv, put_node, cak_x_create_termset);
          *)
    cak_i_serverdb :
        ak30create_serverdb (acv, put_node);
    OTHERWISE
        a07_error (acv, e_missing_keyword, put_node, put_node);
    END;
(*ENDCASE*) 
IF  acv.a_return_segm^.sp1r_returncode = 0
THEN
    a01_is_end_symbol (acv)
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30drop_statement (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      symbindex    : integer;
      res_kw       : boolean;
 
BEGIN
a01_next_symbol (acv);
a01_get_keyword (acv, symbindex, res_kw);
CASE symbindex OF
    cak_i_mapchar :
        ak30drop_set (acv, put_node, cak_x_drop_mapset);
    (* PTS 1116602 E.Z. *)
    (*
          cak_i_termchar :
          ak30drop_set (acv, put_node, cak_x_drop_termset);
          *)
    OTHERWISE
        a07_error (acv, e_missing_keyword, put_node, put_node);
    END;
(*ENDCASE*) 
IF  acv.a_return_segm^.sp1r_returncode = 0
THEN
    a01_is_end_symbol (acv)
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30alter_create_set (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2;
            indicator    : integer);
 
VAR
      res_kw       : boolean;
      ikw          : integer;
      mapcharbytes : integer;
      curr_node    : tsp_int2;
      enable       : tak_keyword;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    a01_call_put (acv, a37, indicator, curr_node);
    put_node    := curr_node;
    a01_next_symbol (acv);
    IF  NOT a01_eqkey (a01kw[ cak_i_set], a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        a07_error (acv, e_invalid_end_of_command,
              curr_node, curr_node)
    ELSE
        BEGIN
        a01_next_symbol (acv);
        IF  sc_symb <> s_identifier
        THEN
            a07_b_put_error (acv, e_invalid_command, sc_sypos)
        ELSE
            BEGIN
            a01_get_keyword (acv, ikw, res_kw);
            IF  res_kw
            THEN
                a07_error (acv, e_reserved_identifier,
                      curr_node, curr_node)
            ELSE(* create mapchar|termchar set <set name> ...  *)
                a02_put_identifier (acv,
                      a_ap_tree^[ put_node ].n_lo_level, curr_node);
            (*ENDIF*) 
            IF  a_return_segm^.sp1r_returncode =  0
            THEN
                BEGIN
                (* PTS 1120721 E.Z. *)
                IF  NOT a01_eqkey (a01kw[ cak_i_as], a_sqlmode,
                    a_cmd_part^.sp1p_buf, a_scv)
                THEN
                    a07_error (acv, e_missing_keyword,
                          curr_node, curr_node)
                ELSE
                    BEGIN
                    (* create mapchar|termchar set <set name> as ... *)
                    a01_next_symbol (acv);
                    mapcharbytes := 1;
                    IF  NOT (a01_eqkey (a01kw[ cak_i_ascii], a_sqlmode,
                        a_cmd_part^.sp1p_buf, a_scv) OR
                        a01_eqkey (a01kw[ cak_i_ebcdic], a_sqlmode,
                        a_cmd_part^.sp1p_buf, a_scv) OR
                        (a01_eqkey (a01kw[ cak_i_unicode], a_sqlmode,
                        a_cmd_part^.sp1p_buf, a_scv) AND g01unicode))
                    THEN
                        a07_error (acv, e_missing_keyword,
                              curr_node, curr_node)
                    ELSE (* create mapchar|termchar set <set name>
                          as ascii/ebcdic/unicode ...  *)
                        BEGIN
                        IF  a01_eqkey (a01kw[ cak_i_unicode], a_sqlmode,
                            a_cmd_part^.sp1p_buf, a_scv)
                        THEN
                            BEGIN
                            a_scv.sc_symb := s_unicode;
                            mapcharbytes := 2;
                            END
                        ELSE
                            IF  a01_eqkey (a01kw[ cak_i_ascii], a_sqlmode,
                                a_cmd_part^.sp1p_buf, a_scv)
                            THEN
                                a_scv.sc_symb := s_ascii
                            ELSE
                                a_scv.sc_symb := s_ebcdic;
                            (*ENDIF*) 
                        (*ENDIF*) 
                        a01_put_node (acv, a_ap_tree^[ curr_node ].n_lo_level);
                        curr_node := a_ap_tree^[ curr_node ].n_lo_level;
                        a01_next_symbol (acv);
                        enable := 'ENABLE            ';
                        IF  (indicator = cak_x_alter_termset ) OR
                            (indicator = cak_x_create_termset)
                        THEN
                            IF  a01_eqkey (enable, a_sqlmode,
                                a_cmd_part^.sp1p_buf, a_scv)
                            THEN (* create char/acter/ set <set name>
                                  as ascii/ebcdic activate ...  *)
                                a02_put_identifier (acv,
                                      a_ap_tree^[ curr_node ].n_lo_level,
                                      curr_node);
                            (*ENDIF*) 
                        (*ENDIF*) 
                        IF  NOT a01_eqkey (a01kw[ cak_i_with], a_sqlmode,
                            a_cmd_part^.sp1p_buf, a_scv)
                        THEN
                            a07_error (acv, e_missing_keyword,
                                  curr_node, curr_node)
                        ELSE (* create mapchar|termchar set <set name>
                              as ascii/ebcdic with ...  *)
                            IF  (indicator = cak_x_alter_termset ) OR
                                (indicator = cak_x_create_termset)
                            THEN
                                ak30get_hex_values (acv, curr_node)
                            ELSE
                                ak30get_map_codes (acv, curr_node, mapcharbytes);
                            (*ENDIF*) 
                        (*ENDIF*) 
                        END;
                    (*ENDIF*) 
                    END;
                (*ENDIF*) 
                END;
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        END;
    (*ENDIF*) 
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30alter_serverdb (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      last_n : tsp_int2;
 
BEGIN
WITH acv DO
    BEGIN
    a01_next_symbol (acv);
    a01_call_put (acv, a37, cak_x_alter_serverdb, put_node);
    a_ap_tree^[put_node].n_length := cak_i_serverdb;
    a03_astring_literal (acv,
          a_ap_tree^[put_node].n_lo_level, last_n);
    IF  a01mandatory_keyword (acv, cak_i_to)
    THEN
        a30serverdb_spec (acv, a_ap_tree^[last_n].n_lo_level, last_n)
    (*ENDIF*) 
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30get_hex_values (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      last      : boolean;
      cnt       : integer;
      curr_node : tsp_int2;
      first_hex : tsp_int2;
      last_node : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    a01_next_symbol (acv);
    cnt       := 0;
    last      := false;
    first_hex := put_node;
    WHILE (a_return_segm^.sp1r_returncode = 0                  ) AND
          (cnt         < cgg_termset_entries) AND
          NOT last DO
        BEGIN
        (* first hex value *)
        IF  (sc_symb = s_byte_string) AND
            (sc_sylength = 2)
        THEN
            BEGIN
            a01_put_node (acv, curr_node);
            a_ap_tree^[ first_hex ].n_sa_level :=
                  curr_node;
            first_hex := curr_node;
            END
        ELSE
            BEGIN
            a07_b_put_error (acv,
                  e_invalid_command, sc_sypos);
            END;
        (*ENDIF*) 
        a01_next_symbol (acv);
        (* ... to ... *)
        IF  NOT a01_eqkey (a01kw[ cak_i_to], a_sqlmode,
            a_cmd_part^.sp1p_buf, a_scv)
        THEN
            BEGIN
            IF  sc_symb = s_eof
            THEN
                a07_error (acv,
                      e_invalid_end_of_command,
                      curr_node, curr_node)
            ELSE
                a07_error (acv,
                      e_missing_keyword,
                      curr_node, curr_node)
            (*ENDIF*) 
            END
        ELSE
            BEGIN
            a01_next_symbol (acv);
            (* second hex value *)
            IF  (sc_symb = s_byte_string) AND
                (sc_sylength = 2)
            THEN
                BEGIN
                a01_put_node (acv, curr_node);
                a_ap_tree^[ first_hex ].
                      n_lo_level := curr_node;
                last_node  := curr_node;
                cnt := succ(cnt);
                END
            ELSE
                a07_b_put_error (acv,
                      e_invalid_command, sc_sypos);
            (*ENDIF*) 
            a01_next_symbol (acv);
            IF  NOT a01_eqkey (a01kw[ cak_i_for], a_sqlmode,
                a_cmd_part^.sp1p_buf, a_scv)
            THEN
                BEGIN
                (* comma or eof *)
                IF  sc_symb = s_comma
                THEN
                    a01_next_symbol (acv)
                ELSE
                    last := true;
                (*ENDIF*) 
                END
            ELSE (* comment, up to 8 characters *)
                BEGIN
                a01_next_symbol (acv);
                IF  (sc_symb     = s_string_literal) AND
                    (sc_sylength < 9)
                THEN
                    BEGIN
                    a01_put_node (acv, curr_node);
                    a_ap_tree^[ last_node ].
                          n_lo_level := curr_node;
                    a01_next_symbol (acv);
                    (* comma or eof *)
                    IF  sc_symb = s_comma
                    THEN
                        a01_next_symbol (acv)
                    ELSE
                        last := true;
                    (*ENDIF*) 
                    END
                ELSE
                    IF  sc_symb = s_eof
                    THEN
                        a07_error (acv,
                              e_invalid_end_of_command,
                              curr_node, curr_node)
                    ELSE
                        a07_error (acv,
                              e_missing_keyword,
                              curr_node, curr_node)
                    (*ENDIF*) 
                (*ENDIF*) 
                END;
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        END;
    (*ENDWHILE*) 
    IF  NOT last
    THEN
        a07_b_put_error (acv,
              e_too_many_values, sc_sypos);
    (*ENDIF*) 
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30get_map_codes (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2;
            mapcharbytes : integer);
 
VAR
      last      : boolean;
      cnt       : integer;
      curr_node : tsp_int2;
      first_val : tsp_int2;
      last_node : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    a01_next_symbol (acv);
    cnt       := 0;
    last      := false;
    first_val := put_node;
    WHILE (a_return_segm^.sp1r_returncode = 0) AND
          (cnt < cgg_mapset_entries)           AND
          NOT last DO
        BEGIN
        (* first value *)
        (* PTS 1120721 E.Z. *)
        IF  (sc_symb = s_byte_string) AND
            (sc_sylength = 2 * mapcharbytes * a01char_size)
        THEN
            BEGIN
            a01_put_node (acv, curr_node);
            a_ap_tree^[ first_val ].n_sa_level :=
                  curr_node;
            first_val := curr_node;
            END
        ELSE
            a07_b_put_error (acv, e_incompatible_datatypes, sc_sypos);
        (*ENDIF*) 
        a01_next_symbol (acv);
        (* ... to ... *)
        IF  NOT a01_eqkey (a01kw[ cak_i_to], a_sqlmode,
            a_cmd_part^.sp1p_buf, a_scv)
        THEN
            BEGIN
            IF  sc_symb = s_eof
            THEN
                a07_error (acv, e_invalid_end_of_command,
                      curr_node, curr_node)
            ELSE
                a07_error (acv, e_missing_keyword,
                      curr_node, curr_node)
            (*ENDIF*) 
            END
        ELSE
            BEGIN
            a01_next_symbol (acv);
            (* second value *)
            IF  (sc_symb = s_string_literal) AND
                ((sc_sylength = 1 * a01char_size) OR (sc_sylength = 2 * a01char_size))
            THEN
                BEGIN
                a01_put_node (acv, curr_node);
                a_ap_tree^[ first_val ].
                      n_lo_level := curr_node;
                last_node  := curr_node;
                cnt        := succ(cnt);
                END
            ELSE
                IF  (sc_symb = s_byte_string) AND
                    ((sc_sylength = 2 * mapcharbytes * a01char_size) OR
                    ( sc_sylength = 4 * mapcharbytes * a01char_size))
                THEN
                    BEGIN
                    a01_put_node (acv, curr_node);
                    a_ap_tree^[ first_val ].n_lo_level :=
                          curr_node;
                    last_node := curr_node;
                    cnt       := succ(cnt);
                    END
                ELSE
                    a07_b_put_error (acv, e_incompatible_datatypes, sc_sypos);
                (*ENDIF*) 
            (*ENDIF*) 
            a01_next_symbol (acv);
            (* comma or eof *)
            IF  sc_symb = s_comma
            THEN
                a01_next_symbol (acv)
            ELSE
                last := true;
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        END;
    (*ENDWHILE*) 
    IF  NOT last
    THEN
        a07_b_put_error (acv,
              e_too_many_values, sc_sypos);
    (*ENDIF*) 
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30drop_set (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2;
            indicator    : integer);
 
VAR
      res_kw    : boolean;
      ikw       : integer;
      curr_node : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    a01_call_put (acv, a37, indicator, curr_node);
    put_node := curr_node;
    a01_next_symbol (acv);
    IF  NOT a01_eqkey (a01kw[ cak_i_set], a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        a07_error (acv, e_invalid_end_of_command,
              curr_node, curr_node)
    ELSE (* drop mapchar|termchar set ... *)
        BEGIN
        a01_next_symbol (acv);
        IF  sc_symb <> s_identifier
        THEN
            a07_error (acv, e_invalid_tablename, curr_node, curr_node)
        ELSE
            BEGIN
            a01_get_keyword (acv, ikw, res_kw);
            IF  res_kw
            THEN
                a07_error (acv, e_reserved_identifier,
                      curr_node, curr_node)
            ELSE (* drop mapchar|termchar set <set name> *)
                a02_put_identifier (acv,
                      a_ap_tree^[ put_node ].n_lo_level, curr_node);
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        END;
    (*ENDIF*) 
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30get_set (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      res_kw    : boolean;
      ikw       : integer;
      curr_node : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    a01_next_symbol (acv);
    a01_get_keyword (acv, ikw, res_kw);
    IF  ikw = cak_i_config
    THEN
        BEGIN
        a01_call_put (acv, a37, cak_x_get_config, put_node);
        a01_next_symbol (acv)
        END
    ELSE
        IF  (ikw = cak_i_mapchar)   OR
            (ikw = cak_i_termchar)
        THEN
            BEGIN
            IF  ikw = cak_i_mapchar
            THEN
                a01_call_put (acv, a37, cak_x_get_mapset, curr_node)
            ELSE
                a01_call_put (acv, a37, cak_x_get_termset, curr_node);
            (*ENDIF*) 
            put_node := curr_node;
            a01_next_symbol (acv);
            IF  NOT a01_eqkey (a01kw[ cak_i_set], a_sqlmode,
                a_cmd_part^.sp1p_buf, a_scv)
            THEN
                a07_error (acv, e_invalid_end_of_command,
                      curr_node, curr_node)
            ELSE
                BEGIN
                a01_next_symbol (acv);
                IF  sc_symb <> s_identifier
                THEN
                    a07_b_put_error (acv, e_invalid_command, sc_sypos)
                ELSE
                    BEGIN
                    a01_get_keyword (acv, ikw, res_kw);
                    IF  res_kw
                    THEN
                        a07_error (acv, e_reserved_identifier,
                              curr_node, curr_node)
                    ELSE
                        a02_put_identifier (acv,
                              a_ap_tree^[ put_node ].n_lo_level,
                              curr_node);
                    (*ENDIF*) 
                    END;
                (*ENDIF*) 
                END;
            (*ENDIF*) 
            END
        ELSE
            a07_error (acv, e_missing_keyword, put_node, put_node);
        (*ENDIF*) 
    (*ENDIF*) 
    END;
(*ENDWITH*) 
IF  acv.a_return_segm^.sp1r_returncode = 0
THEN
    a01_is_end_symbol (acv)
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30init_after_load (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
BEGIN
a01_next_symbol (acv);
IF  a01mandatory_keyword (acv, cak_i_after)
THEN
    IF  a01mandatory_keyword (acv, cak_i_load)
    THEN
        a01_call_put (acv, a37, cak_x_init_after_load, put_node);
    (*ENDIF*) 
(*ENDIF*) 
END;
 
(* PTS 1111229 E.Z. *)
(*------------------------------*) 
 
PROCEDURE
      ak30prepare_standby (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      last_node : tsp_int2;
 
BEGIN
WITH acv DO
    BEGIN
    a01_next_symbol (acv);
    IF  a01mandatory_keyword (acv, cak_i_standby)
    THEN
        BEGIN
        a01_call_put (acv, a37, cak_x_prepare_standby, last_node);
        put_node := last_node;
        a03_astring_literal (acv,
              a_ap_tree^[ last_node ].n_sa_level, last_node);
        IF  a_return_segm^.sp1r_returncode = 0
        THEN
            WITH a_ap_tree^[ last_node ] DO
                IF  n_length > mxsp_nodeid
                THEN
                    n_length := mxsp_nodeid;
                (*ENDIF*) 
            (*ENDWITH*) 
        (*ENDIF*) 
        END
    (*ENDIF*) 
    END;
(*ENDWITH*) 
IF  acv.a_return_segm^.sp1r_returncode = 0
THEN
    a01_is_end_symbol (acv)
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30register_standby (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      last_node : tsp_int2;
 
BEGIN
WITH acv DO
    BEGIN
    a01_next_symbol (acv);
    IF  a01mandatory_keyword (acv, cak_i_standby)
    THEN
        BEGIN
        a01_call_put (acv, a37, cak_x_register_standby, last_node);
        put_node := last_node;
        a03_astring_literal (acv,
              a_ap_tree^[ last_node ].n_sa_level, last_node);
        IF  a_return_segm^.sp1r_returncode = 0
        THEN
            BEGIN
            WITH a_ap_tree^[ last_node ] DO
                IF  n_length > mxsp_nodeid
                THEN
                    n_length := mxsp_nodeid;
                (*ENDIF*) 
            (*ENDWITH*) 
            IF  a_scv.sc_symb = s_byte_string
            THEN
                a03_astring_literal (acv, a_ap_tree^[ last_node ].n_sa_level, last_node)
            ELSE
                a07_error (acv, e_missing_string_literal, put_node, last_node)
            (*ENDIF*) 
            END
        (*ENDIF*) 
        END
    (*ENDIF*) 
    END;
(*ENDWITH*) 
IF  acv.a_return_segm^.sp1r_returncode = 0
THEN
    a01_is_end_symbol (acv)
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30create_serverdb (
            VAR acv         : tak_all_command_glob;
            VAR put_node    : tsp_int2);
 
VAR
      res_kw       : boolean;
      res_kw_index : integer;
      last_node    : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    a_is_ddl := ddl_create_serverdb;
    a01_call_put (acv, a37, cak_x_create_serverdb, last_node);
    a_ap_tree^[ last_node ].n_length := cak_i_serverdb;
    put_node := last_node;
    a01_next_symbol (acv);
    a30serverdb_spec (acv,
          a_ap_tree^[ last_node ].n_sa_level, last_node);
    IF  a01mandatory_keyword (acv, cak_i_sysdba)
    THEN
        BEGIN
        a01_get_keyword (acv, res_kw_index, res_kw);
        IF  res_kw OR (res_kw_index = cak_i_temp)
        THEN
            a07_error (acv, e_reserved_identifier,
                  put_node, last_node)
        ELSE
            BEGIN
            a02_aauthid (acv,
                  a_ap_tree^[ last_node ].n_sa_level, last_node);
            IF  a01_eqkey (a01kw[ cak_i_password], a_sqlmode,
                a_cmd_part^.sp1p_buf, a_scv)
            THEN
                BEGIN
                a01_get_password (acv,
                      a_ap_tree^[last_node].n_sa_level, last_node);
                a01_next_symbol (acv);
                END;
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        END
    (*ENDIF*) 
    END;
(*ENDWITH*) 
END;
 
(* PTS 1116464 E.Z. *)
(*------------------------------*) 
 
PROCEDURE
      ak30check_statement (
            VAR acv      : tak_all_command_glob;
            modul_id     : tak_procs;
            VAR put_node : tsp_int2);
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    a01_call_put (acv, modul_id, cak_x_verify, put_node);
    a01_next_symbol (acv);
    IF  a01_eqkey (a01kw[ cak_i_catalog], a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
        AND
        (modul_id = a37)
    THEN
        BEGIN
        a01_next_symbol (acv);
        IF  a01_eqkey (a01kw[ cak_i_with], a_sqlmode,
            a_cmd_part^.sp1p_buf, a_scv)
        THEN
            BEGIN
            a01_next_symbol (acv);
            IF  a01mandatory_keyword (acv, cak_i_update)
            THEN
                a_ap_tree^[put_node].n_length := cak_i_modify
            (*ENDIF*) 
            END
        ELSE
            a_ap_tree^[put_node].n_length := cak_i_catalog
        (*ENDIF*) 
        END
    ELSE
        IF  a01_eqkey (a01kw[ cak_i_data], a_sqlmode,
            a_cmd_part^.sp1p_buf, a_scv)
        THEN
            BEGIN
            a_ap_tree^[put_node].n_length := 0;
            a01_next_symbol (acv);
            IF  modul_id = a36
            THEN
                BEGIN
                IF  a01mandatory_keyword (acv, cak_i_with)
                THEN
                    IF  a01mandatory_keyword (acv, cak_i_update)
                    THEN
                        BEGIN
                        END
                    (*ENDIF*) 
                (*ENDIF*) 
                END
            (* PTS 1120781 E.Z. *)
            ELSE
                IF  sc_symb <> s_eof
                THEN
                    BEGIN
                    IF  a01mandatory_keyword (acv, cak_i_except)
                    THEN
                        IF  a01mandatory_keyword (acv, cak_i_index)
                        THEN
                            a_ap_tree^[put_node].n_length := cak_i_index;
                        (*ENDIF*) 
                    (*ENDIF*) 
                    END;
                (*ENDIF*) 
            (*ENDIF*) 
            END
        ELSE
            a07_error (acv, e_missing_keyword, put_node, put_node);
        (*ENDIF*) 
    (*ENDIF*) 
    ;
    a01_is_end_symbol (acv)
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30clear_statement (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      curr_n : tsp_int2;
      last_n : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    a01_next_symbol (acv);
    IF  a01_eqkey (a01kw[ cak_i_log], a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        BEGIN
        a01_call_put (acv, a36, cak_x_clear_log, curr_n);
        put_node := curr_n;
        a01_next_symbol (acv)
        END
    ELSE
        a07_error (acv, e_missing_keyword, put_node, last_n);
    (*ENDIF*) 
    a01_is_end_symbol (acv)
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30get_statement (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      curr_n   : tsp_int2;
      last_n   : tsp_int2;
      kw_index : integer;
      res_kw   : boolean;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    a01_next_symbol (acv);
    a01_get_keyword (acv, kw_index, res_kw);
    CASE kw_index OF
        (* PTS 1117472 E.Z. *)
        cak_i_bad :
            BEGIN
            a01_next_symbol (acv);
            IF  a01mandatory_keyword (acv, cak_i_log)
            THEN
                IF  a01mandatory_keyword (acv, cak_i_volume)
                THEN
                    a01_call_put (acv, a36, cak_x_get_bad_log_volume, curr_n);
                (*ENDIF*) 
            (*ENDIF*) 
            END;
        cak_i_config :
            BEGIN
            a01_call_put (acv, a36, cak_x_get_config, curr_n);
            put_node := curr_n;
            a01_next_symbol (acv)
            END;
        cak_i_device :
            BEGIN
            a01_call_put (acv, a36, cak_x_get_dev_config, curr_n);
            put_node := curr_n;
            a01_next_symbol (acv);
            IF  a01_eqkey (a01kw[ cak_i_config], a_sqlmode,
                a_cmd_part^.sp1p_buf, a_scv)
            THEN
                a01_next_symbol (acv)
            ELSE
                a07_error (acv, e_missing_keyword,put_node,last_n)
            (*ENDIF*) 
            END;
        cak_i_restart :
            BEGIN
            a01_next_symbol (acv);
            IF  a01mandatory_keyword (acv, cak_i_version)
            THEN
                a01_call_put (acv, a36,
                      cak_x_get_restart_version, put_node);
            (*ENDIF*) 
            END;
        OTHERWISE
            a07_error (acv, e_missing_keyword, put_node, last_n);
        END;
    (*ENDCASE*) 
    a01_is_end_symbol (acv)
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30init_statement (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      curr_n : tsp_int2;
      last_n : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    a01_next_symbol (acv);
    IF  a01_eqkey (a01kw[ cak_i_config], a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        BEGIN
        a01_call_put (acv, a36, cak_x_init_config, curr_n);
        put_node := curr_n;
        a01_next_symbol (acv);
        END
    ELSE
        IF  a01_eqkey (a01kw[ cak_i_standby], a_sqlmode,
            a_cmd_part^.sp1p_buf, a_scv)
        THEN
            BEGIN
            a01_call_put (acv, a36, cak_x_init_standby, put_node);
            a01_next_symbol (acv);
            END
        ELSE
            a07_error (acv, e_missing_keyword, put_node, last_n);
        (*ENDIF*) 
    (*ENDIF*) 
    a01_is_end_symbol (acv)
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30asuspend_statement (VAR acv : tak_all_command_glob;
            VAR put_node : tsp00_Int2);
 
BEGIN
a01_next_symbol (acv);
IF  a01mandatory_keyword (acv, cak_i_logwriter)
THEN
    a01_call_put (acv, a37, cak_i_suspend, put_node);
(*ENDIF*) 
a01_is_end_symbol (acv)
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30aresume_statement (VAR acv : tak_all_command_glob;
            VAR put_node : tsp00_Int2);
 
BEGIN
a01_next_symbol (acv);
IF  a01mandatory_keyword (acv, cak_i_logwriter)
THEN
    a01_call_put (acv, a37, cak_i_resume, put_node);
(*ENDIF*) 
a01_is_end_symbol (acv)
END;
 
(* END PTS 1111229 E.Z. *)
(* PTS 1117050 E.Z. *)
(*------------------------------*) 
 
PROCEDURE
      ak30migrate_statement (
            VAR acv              : tak_all_command_glob;
            VAR put_node         : tsp_int2;
            VAR implicit_restart : boolean);
 
VAR
      curr_n : tsp_int2;
      last_n : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    a01_next_symbol (acv);
    IF  a01_eqkey (a01kw[ cak_i_database], a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        BEGIN
        a01_call_put (acv, a36, cak_x_migrate_database, put_node);
        a01_next_symbol (acv);
        END
    ELSE
        IF  a01_eqkey (a01kw[ cak_i_to], a_sqlmode,
            a_cmd_part^.sp1p_buf, a_scv)
        THEN
            BEGIN
            a01_next_symbol (acv);
            IF  a01mandatory_keyword (acv, cak_i_unicode)
            THEN
                BEGIN
                implicit_restart := true;
                a01_call_put (acv, a36, cak_x_migrate_to_unicode, put_node);
                END
            (*ENDIF*) 
            END
        ELSE
            a07_error (acv, e_missing_keyword, put_node, last_n);
        (*ENDIF*) 
    (*ENDIF*) 
    a01_is_end_symbol (acv)
    END;
(*ENDWITH*) 
END;
 
(* END PTS 1117050 E.Z. *)
(*------------------------------*) 
 
PROCEDURE
      ak30activate_statement (
            VAR acv      : tak_all_command_glob;
            warm_utility : boolean;
            VAR put_node : tsp_int2);
 
VAR
      kw_index : integer;
      res_kw   : boolean;
      last_n   : tsp_int2;
      dummy_n  : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    a01_next_symbol (acv);
    IF  (NOT warm_utility) AND
        a01_eqkey (a01kw[ cak_i_serverdb], a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        BEGIN
        a01_call_put (acv, a36, cak_x_activate, last_n);
        put_node := last_n;
        a01_next_symbol (acv);
        IF  a01_eqkey (a01kw[ cak_i_using], a_sqlmode,
            a_cmd_part^.sp1p_buf, a_scv)
        THEN
            BEGIN
            a01_next_symbol (acv);
            a30serverdb_spec (acv,
                  a_ap_tree^[ last_n ].n_lo_level, dummy_n)
            END
        ELSE
            IF  a01_eqkey (a01kw[ cak_i_sysdba], a_sqlmode,
                a_cmd_part^.sp1p_buf, a_scv)
            THEN
                BEGIN
                a01_next_symbol (acv);
                a01_get_keyword (acv, kw_index, res_kw);
                IF  res_kw OR (kw_index = cak_i_temp)
                THEN
                    a07_error (acv, e_reserved_identifier,
                          put_node, last_n);
                (*ENDIF*) 
                IF  a_return_segm^.sp1r_returncode = 0
                THEN
                    BEGIN
                    a02_aauthid (acv,
                          a_ap_tree^[ last_n ].n_sa_level, last_n);
                    IF  a01_eqkey (a01kw[ cak_i_password], a_sqlmode,
                        a_cmd_part^.sp1p_buf, a_scv)
                    THEN
                        BEGIN
                        a01_get_password (acv,
                              a_ap_tree^[ last_n ].n_sa_level, last_n);
                        a01_next_symbol (acv);
                        END;
                    (*ENDIF*) 
                    END;
                (*ENDIF*) 
                END
            ELSE
                a07_error (acv, e_missing_keyword, put_node, last_n);
            (*ENDIF*) 
        (*ENDIF*) 
        END
    ELSE
        BEGIN
        (*PTS 1103475 E.Z.*)
        IF  a01_eqkey (a01kw[ cak_i_event], a_sqlmode,
            a_cmd_part^.sp1p_buf, a_scv)
        THEN
            vinsert_keep_alive
        ELSE
            a07_error (acv, e_missing_keyword, put_node, last_n);
        (*ENDIF*) 
        END;
    (*ENDIF*) 
    a01_is_end_symbol (acv)
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30restart_statement (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      res_kw   : boolean;
      curr_n   : tsp_int2;
      last_n   : tsp_int2;
      kw_index : integer;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    (* PTS 1111229 E.Z. *)
    a01_next_symbol (acv);
    a01_get_keyword (acv, kw_index, res_kw);
    IF  kw_index = cak_i_standby
    THEN
        BEGIN
        a01_call_put (acv, a36, cak_x_restart_standby, put_node);
        a01_next_symbol (acv);
        END
    ELSE
        BEGIN
        a01_call_put (acv, a36, cak_x_restart, last_n);
        a_ap_tree^[last_n].n_length := 0;
        put_node := last_n;
        CASE kw_index OF
            cak_i_copy :
                BEGIN
                a01_next_symbol (acv);
                a01_call_put (acv, a36, cak_i_copy, curr_n);
                a_ap_tree^[ last_n ].n_lo_level := curr_n;
                last_n := curr_n;
                a03_astring_literal (acv, a_ap_tree^[last_n].n_lo_level, last_n)
                END;
            cak_i_local :
                BEGIN
                a01_next_symbol (acv);
                a01_call_put (acv, a36, cak_i_local, curr_n);
                a_ap_tree^[ last_n ].n_lo_level := curr_n
                END;
            cak_i_until :
                BEGIN
                a01_next_symbol (acv);
                a01_call_put (acv, a36, cak_i_until, curr_n);
                a_ap_tree^[last_n].n_lo_level := curr_n;
                last_n := curr_n;
                a03_astring_literal (acv,
                      a_ap_tree^[ last_n ].n_sa_level, last_n);
                a03_astring_literal (acv,
                      a_ap_tree^[ last_n ].n_sa_level, last_n)
                END;
            OTHERWISE ;
            END
        (*ENDCASE*) 
        END;
    (*ENDIF*) 
    a01_is_end_symbol (acv)
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30read_label_statement (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      last_n : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    a01_call_put (acv, a37, cak_x_read_label, put_node);
    a01_next_symbol (acv);
    IF  a01_eqkey (a01kw[cak_i_label], a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        BEGIN
        a02_ahostfile_name (acv,
              a_ap_tree^[put_node].n_lo_level, last_n);
        IF  acv.a_return_segm^.sp1r_returncode = 0
        THEN
            ak30file_type (acv,
                  a_ap_tree^[ last_n ].n_sa_level, last_n)
        (*ENDIF*) 
        END;
    (*ENDIF*) 
    a01_is_end_symbol (acv)
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30restore_statement (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      restore_from_dev  : boolean;
      res_kw            : boolean;
      curr_n            : tsp_int2;
      last_n            : tsp_int2;
      indicator         : tsp_int2;
      kw_index          : integer;
      restore_data_kind : integer;
      aux_scv           : tak_scanner_glob;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    restore_from_dev  := false;
    restore_data_kind := cak_i_no_keyword;
    a01_next_symbol (acv);
    a01_get_keyword (acv, kw_index, res_kw);
    CASE kw_index OF
        cak_i_data,
        cak_i_log,
        cak_i_pages :
            BEGIN
            IF  kw_index = cak_i_data
            THEN
                indicator := cak_x_restore_db
            ELSE
                IF  kw_index = cak_i_log
                THEN
                    indicator := cak_x_restore_log
                ELSE
                    indicator := cak_x_restore_pages;
                (*ENDIF*) 
            (*ENDIF*) 
            aux_scv   := a_scv;
            a01_next_symbol (acv);
            a01_get_keyword (acv, restore_data_kind, res_kw);
            IF  (restore_data_kind <> cak_i_begin) AND
                (restore_data_kind <> cak_i_ignore) AND
                (restore_data_kind <> cak_i_cancel) AND
                (restore_data_kind <> cak_i_replace)
            THEN
                BEGIN
                restore_data_kind := cak_i_no_keyword;
                a_scv             := aux_scv
                END
            ELSE
                a01_next_symbol (acv)
            (*ENDIF*) 
            END;
        cak_i_config :
            indicator := cak_x_restore_config;
        OTHERWISE
            a07_error (acv, e_missing_keyword, put_node, last_n);
        END;
    (*ENDCASE*) 
    IF  a_return_segm^.sp1r_returncode = 0
    THEN
        BEGIN
        a01_call_put (acv, a36, indicator, last_n);
        a_ap_tree^[last_n].n_length := restore_data_kind;
        put_node := last_n;
        curr_n   := last_n;
        IF  indicator = cak_x_restore_log
        THEN
            BEGIN (* restore log .. *)
            aux_scv   := a_scv;
            a01_next_symbol (acv);
            IF  a01_eqkey (a01kw[ cak_i_from], a_sqlmode,
                a_cmd_part^.sp1p_buf, a_scv)
            THEN
                BEGIN
                a01_next_symbol (acv);
                IF  a01_eqkey (a01kw[ cak_i_devspace], a_sqlmode,
                    a_cmd_part^.sp1p_buf, a_scv)
                THEN
                    BEGIN (* restore log from dev to dev *)
                    restore_from_dev := true;
                    a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_subproc :=
                          cak_x_rest_log_from;
                    a01_next_symbol (acv)
                    END
                ELSE
                    BEGIN
                    (* no restore from dev to dev, backtracking *)
                    a_scv  := aux_scv;
                    last_n := curr_n
                    END;
                (*ENDIF*) 
                END
            ELSE
                (* PTS 1117472 E.Z. *)
                IF  a01_eqkey (a01kw[ cak_i_volume], a_sqlmode,
                    a_cmd_part^.sp1p_buf, a_scv)
                THEN
                    BEGIN
                    a_ap_tree^[put_node].n_subproc := cak_x_restore_bad_log;
                    restore_data_kind := cak_i_bad;
                    a01_next_symbol (acv);
                    a02_asystem_devspace (acv,
                          a_ap_tree^[ put_node ].n_lo_level, last_n);
                    END
                ELSE
                    BEGIN
                    (* no restore log from, backtracking *)
                    a_scv  := aux_scv;
                    last_n := curr_n
                    END;
                (*ENDIF*) 
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        IF  (restore_data_kind = cak_i_replace)
        THEN
            BEGIN
            a03_astring_literal (acv,
                  a_ap_tree^[ last_n ].n_sa_level,
                  last_n);
            IF  a_return_segm^.sp1r_returncode = 0
            THEN
                WITH a_ap_tree^[ last_n ] DO
                    BEGIN
                    n_symb := s_hostfilename;
                    IF  n_length > mxsp_vfilename
                    THEN
                        n_length := mxsp_vfilename;
                    (*ENDIF*) 
                    ak30file_type (acv,
                          a_ap_tree^[last_n].n_sa_level, last_n)
                    END;
                (*ENDWITH*) 
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        END;
    (*ENDIF*) 
    IF  (a_return_segm^.sp1r_returncode = 0) AND NOT
        ((restore_data_kind <> cak_i_no_keyword) OR restore_from_dev)
    THEN
        BEGIN
        a01_next_symbol (acv);
        IF  a01_eqkey (a01kw[ cak_i_quick], a_sqlmode,
            a_cmd_part^.sp1p_buf, a_scv)
        THEN
            a01_next_symbol (acv);
        (*ENDIF*) 
        IF  a01_eqkey (a01kw[ cak_i_from], a_sqlmode,
            a_cmd_part^.sp1p_buf, a_scv)
        THEN
            REPEAT
                a02_ahostfile_name (acv,
                      a_ap_tree^[ last_n ].n_sa_level, last_n);
                IF  acv.a_return_segm^.sp1r_returncode = 0
                THEN
                    ak30file_type (acv,
                          a_ap_tree^[ last_n ].n_sa_level, last_n);
                (*ENDIF*) 
            UNTIL
                (sc_symb <> s_comma)
                OR  (acv.a_return_segm^.sp1r_returncode <> 0)
                OR (indicator = cak_x_restore_config)
            (*ENDREPEAT*) 
        ELSE
            a07_error (acv, e_missing_keyword,
                  put_node, last_n);
        (*ENDIF*) 
        IF  a_return_segm^.sp1r_returncode = 0
        THEN
            BEGIN
            IF  indicator = cak_x_restore_config
            THEN
                BEGIN
                IF  a01_eqkey (a01kw[ cak_i_to], a_sqlmode,
                    a_cmd_part^.sp1p_buf, a_scv)
                THEN
                    BEGIN
                    a01_next_symbol (acv);
                    a03_astring_literal (acv,
                          a_ap_tree^[ last_n ].n_sa_level, last_n);
                    IF  a_return_segm^.sp1r_returncode = 0
                    THEN
                        WITH a_ap_tree^[ last_n] DO
                            IF  n_length > mxsp_dbname
                            THEN
                                n_length := mxsp_dbname;
                            (*ENDIF*) 
                        (*ENDWITH*) 
                    (*ENDIF*) 
                    END
                (*ENDIF*) 
                END
            ELSE
                IF  indicator = cak_x_restore_log
                THEN
                    IF  a01_eqkey (a01kw[ cak_i_until], a_sqlmode,
                        a_cmd_part^.sp1p_buf, a_scv)
                    THEN
                        BEGIN
                        a01_next_symbol (acv);
                        a03_astring_literal (acv,
                              a_ap_tree^[ last_n ].n_sa_level, last_n);
                        a03_astring_literal (acv,
                              a_ap_tree^[ last_n ].n_sa_level, last_n)
                        END;
                    (*ENDIF*) 
                (*ENDIF*) 
            (*ENDIF*) 
            ak30block_size  (acv,
                  a_ap_tree^[ last_n ].n_sa_level, last_n);
            IF  (sc_symb <> s_eof) AND (indicator = cak_x_restore_db)
            THEN
                BEGIN
                IF  sc_symb <> s_eof
                THEN
                    IF  a01_eqkey (a01kw[ cak_i_config], a_sqlmode,
                        a_cmd_part^.sp1p_buf, a_scv)
                    THEN
                        BEGIN
                        curr_n := last_n;
                        a01_call_put (acv, a36, cak_i_config, last_n);
                        a_ap_tree^[ curr_n ].n_sa_level := last_n;
                        a01_next_symbol (acv);
                        END
                    (*ENDIF*) 
                (*ENDIF*) 
                END;
            (*ENDIF*) 
            IF  indicator <> cak_x_restore_config
            THEN
                BEGIN
                IF  sc_symb <> s_eof
                THEN
                    IF  a01_eqkey (a01kw[cak_i_cascade], a_sqlmode,
                        a_cmd_part^.sp1p_buf, a_scv)
                    THEN
                        BEGIN
                        curr_n := last_n;
                        a01_call_put (acv, a37, cak_i_cascade, last_n);
                        a_ap_tree^[ curr_n ].n_sa_level := last_n;
                        a01_next_symbol (acv)
                        END;
                    (*ENDIF*) 
                (*ENDIF*) 
                ak30media_name (acv, a_ap_tree^[last_n].n_sa_level, last_n)
                END
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        END;
    (*ENDIF*) 
    a01_is_end_symbol (acv)
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30verify_statement (
            VAR acv      : tak_all_command_glob;
            modul_id     : tak_procs;
            VAR put_node : tsp_int2);
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    a01_call_put (acv, modul_id, cak_x_verify, put_node);
    a01_next_symbol (acv);
    IF  a01_eqkey (a01kw[ cak_i_catalog], a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
        AND
        (modul_id = a37)
    THEN
        BEGIN
        a01_next_symbol (acv);
        IF  a01_eqkey (a01kw[ cak_i_modify], a_sqlmode,
            a_cmd_part^.sp1p_buf, a_scv)
        THEN
            BEGIN
            a01_next_symbol (acv);
            a_ap_tree^[put_node].n_length := cak_i_modify
            END
        ELSE
            a_ap_tree^[put_node].n_length := cak_i_catalog
        (*ENDIF*) 
        END
    ELSE
        a_ap_tree^[put_node].n_length := 0;
    (*ENDIF*) 
    a01_is_end_symbol (acv)
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30commit_rollback_statement (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2;
            indicator    : integer);
 
VAR
      curr_n   : tsp_int2;
      init_pos : integer;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    init_pos := sc_newpos;
    a01_next_symbol (acv);
    IF  a01_eqkey (a01kw[ cak_i_transaction], a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        BEGIN
        IF  indicator = cak_x_util_commit
        THEN
            indicator := cak_x_commit_trans
        ELSE
            indicator := cak_x_rollback_trans;
        (*ENDIF*) 
        a01_call_put (acv, a37, indicator, put_node);
        a02transaction (acv, a_ap_tree^[put_node].n_lo_level, curr_n)
        END
    ELSE
        BEGIN
        a01_call_put (acv, a37, indicator, put_node);
        sc_newpos := init_pos;
        a52_acommit_rollback_statement (acv,
              a_ap_tree^[put_node].n_lo_level,
              indicator = cak_x_util_commit)
        END;
    (*ENDIF*) 
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30connect_statement (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      curr_n : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    a01_call_put (acv, a37, cak_x_connect, curr_n);
    put_node := curr_n;
    a51_aconnect_statement (acv, true, a_ap_tree^[ curr_n ].n_lo_level);
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30save_statement (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      curr_n        : tsp_int2;
      last_n        : tsp_int2;
      x_save_mode   : tsp_int2;
      save_data_kind: integer;
      kw_index      : integer;
      res_kw        : boolean;
      aux_scv       : tak_scanner_glob;
 
BEGIN
(* PTS 1103119 E.Z. *)
WITH acv, a_scv DO
    BEGIN
    a01_next_symbol (acv);
    a01_get_keyword (acv, kw_index, res_kw);
    save_data_kind:= cak_i_no_keyword;
    CASE kw_index OF
        cak_i_data,
        cak_i_pages :
            BEGIN
            IF  kw_index = cak_i_data
            THEN
                x_save_mode := cak_x_save_database
            ELSE
                x_save_mode   := cak_x_save_pages;
            (*ENDIF*) 
            aux_scv     := a_scv;
            a01_next_symbol (acv);
            a01_get_keyword (acv, save_data_kind, res_kw);
            IF  (save_data_kind <> cak_i_ignore) AND
                (save_data_kind <> cak_i_cancel) AND
                (save_data_kind <> cak_i_replace)
            THEN
                BEGIN
                save_data_kind := cak_i_no_keyword;
                a_scv          := aux_scv;
                END
            ELSE
                a01_next_symbol (acv);
            (*ENDIF*) 
            END;
        cak_i_log :
            BEGIN
            aux_scv := a_scv;
            a01_next_symbol (acv);
            a01_get_keyword (acv, save_data_kind, res_kw);
            IF  (save_data_kind <> cak_i_ignore) AND
                (save_data_kind <> cak_i_cancel) AND
                (save_data_kind <> cak_i_replace)
            THEN
                BEGIN
                save_data_kind := cak_i_no_keyword;
                a_scv          := aux_scv;
                x_save_mode    := cak_x_save_log
                END
            ELSE
                BEGIN
                x_save_mode := cak_x_save_log;
                a01_next_symbol (acv)
                END;
            (*ENDIF*) 
            END;
        OTHERWISE
            a07_error (acv, e_missing_keyword, put_node, put_node);
        END;
    (*ENDCASE*) 
    IF  a_return_segm^.sp1r_returncode = 0
    THEN
        BEGIN
        a01_call_put (acv, a37, x_save_mode, put_node);
        last_n := put_node;
        a_ap_tree^[last_n].n_length := save_data_kind;
        IF  save_data_kind = cak_i_no_keyword
        THEN
            BEGIN
            a01_next_symbol (acv);
            IF  a01_eqkey (a01kw[cak_i_quick], a_sqlmode,
                a_cmd_part^.sp1p_buf, a_scv)
            THEN
                BEGIN
                a01_call_put (acv, a37, cak_i_quick, last_n);
                a_ap_tree^[put_node].n_sa_level := last_n;
                a01_next_symbol (acv);
                IF  a01_eqkey (a01kw[cak_i_to], a_sqlmode,
                    a_cmd_part^.sp1p_buf, a_scv)
                THEN
                    REPEAT
                        a02_ahostfile_name (acv,
                              a_ap_tree^[ last_n ].n_sa_level, last_n);
                        IF  a_return_segm^.sp1r_returncode = 0
                        THEN
                            ak30file_type (acv,
                                  a_ap_tree^[ last_n ].n_sa_level, last_n);
                        (*ENDIF*) 
                        IF  acv.a_return_segm^.sp1r_returncode = 0
                        THEN
                            ak30count_check (acv,
                                  a_ap_tree^[ last_n ].n_sa_level, last_n);
                        (*ENDIF*) 
                    UNTIL
                        (sc_symb <> s_comma)
                    (*ENDREPEAT*) 
                ELSE
                    a07_error (acv, e_wanted_keyword, put_node, last_n);
                (*ENDIF*) 
                IF  a_return_segm^.sp1r_returncode = 0
                THEN
                    IF  a01_eqkey (a01kw[cak_i_fversion], a_sqlmode,
                        a_cmd_part^.sp1p_buf, a_scv)
                    THEN
                        BEGIN
                        curr_n := last_n;
                        a01_call_put (acv, a37, cak_i_fversion, last_n);
                        a_ap_tree^[curr_n].n_sa_level := last_n;
                        a01_next_symbol (acv)
                        END;
                    (*ENDIF*) 
                (*ENDIF*) 
                IF  a_return_segm^.sp1r_returncode = 0
                THEN
                    BEGIN
                    ak30block_size  (acv,
                          a_ap_tree^[ last_n ].n_sa_level, last_n);
                    IF  sc_symb <> s_eof
                    THEN
                        IF  a01_eqkey (a01kw[cak_i_cascade], a_sqlmode,
                            a_cmd_part^.sp1p_buf,
                            a_scv)
                        THEN
                            BEGIN
                            curr_n := last_n;
                            a01_call_put (acv, a37, cak_i_cascade, last_n);
                            a_ap_tree^[ curr_n ].n_sa_level := last_n;
                            a01_next_symbol (acv)
                            END;
                        (*ENDIF*) 
                    (*ENDIF*) 
                    IF  sc_symb <> s_eof
                    THEN (* PTS 2040 *)
                        IF  a01_eqkey (a01kw[cak_i_no], a_sqlmode,
                            a_cmd_part^.sp1p_buf, a_scv)
                        THEN
                            BEGIN
                            a01_next_symbol (acv);
                            IF  a01mandatory_keyword (acv,
                                cak_i_checkpoint)
                            THEN
                                BEGIN
                                curr_n := last_n;
                                a01_call_put (acv,
                                      a37, cak_i_no, last_n);
                                a_ap_tree^[curr_n].n_sa_level := last_n
                                END;
                            (*ENDIF*) 
                            END;
                        (*ENDIF*) 
                    (*ENDIF*) 
                    ak30media_name (acv,
                          a_ap_tree^[last_n].n_sa_level, last_n);
                    END
                ELSE
                    ak30block_size  (acv,
                          a_ap_tree^[put_node].n_sa_level, last_n);
                (*ENDIF*) 
                (* PTS 1107603 E.Z. *)
                END;
            (*ENDIF*) 
            END
        ELSE
            IF  save_data_kind = cak_i_replace
            THEN
                BEGIN
                IF  (sc_symb <> s_eof) AND
                    NOT a01_eqkey(a01kw[cak_i_count], a_sqlmode,
                    a_cmd_part^.sp1p_buf, a_scv)
                THEN
                    BEGIN
                    a03_astring_literal (acv,
                          a_ap_tree^[ last_n ].n_sa_level,
                          last_n);
                    IF  a_return_segm^.sp1r_returncode = 0
                    THEN
                        WITH a_ap_tree^[ last_n ] DO
                            BEGIN
                            n_symb := s_hostfilename;
                            IF  n_length > mxsp_vfilename
                            THEN
                                n_length := mxsp_vfilename;
                            (*ENDIF*) 
                            END;
                        (*ENDWITH*) 
                    (*ENDIF*) 
                    ak30file_type (acv,
                          a_ap_tree^[last_n].n_sa_level, last_n)
                    END;
                (*ENDIF*) 
                ak30count_check (acv,
                      a_ap_tree^[ last_n ].n_sa_level, last_n)
                END
            (*ENDIF*) 
        (*ENDIF*) 
        END;
    (* PTS 1107603 E.Z. *)
    (*ENDIF*) 
    a01_is_end_symbol (acv)
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30shutdown_statement (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      curr_n : tsp_int2;
      call_id: tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    a01_next_symbol (acv);
    (* PTS 1111289 E.Z. *)
    call_id := cak_x_shutdown;
    a01_call_put (acv, a37, call_id, curr_n);
    put_node := curr_n;
    a01_is_end_symbol (acv)
    END;
(*ENDWITH*) 
END;
 
(* PTS 1115978 E.Z. *)
(* PTS 1115982 E.Z. *)
(*------------------------------*) 
 
PROCEDURE
      ak30event_statement (
            VAR acv      : tak_all_command_glob;
            modul_id     : tak_procs;
            subproc      : tsp_int2;
            VAR put_node : tsp_int2);
 
VAR
      curr_n     : tsp_int2;
      last_n     : tsp_int2;
      kw_index   : integer;
      exp_values : integer;
      value_no   : integer;
      res_kw     : boolean;
 
BEGIN
(* PTS 1104572 E.Z. *)
WITH acv, a_scv DO
    BEGIN
    exp_values := 0;
    a01_get_keyword (acv, kw_index, res_kw);
    CASE kw_index OF
        cak_i_backup_pages,
        cak_i_db_above_limit,
        cak_i_db_below_limit,
        cak_i_log_above_limit :
            BEGIN
            a01_call_put (acv, modul_id, kw_index, put_node);
            exp_values := 1;
            END;
        OTHERWISE
            a07_error (acv, e_missing_keyword, put_node, put_node)
        END;
    (*ENDCASE*) 
    curr_n := put_node;
    a01_next_symbol (acv);
    IF  (a_return_segm^.sp1r_returncode = 0) AND
        (subproc = cak_x_set_event)
    THEN
        BEGIN
        a01_get_keyword (acv, kw_index, res_kw);
        CASE kw_index OF
            cak_i_high, cak_i_low, cak_i_medium :
                BEGIN
                a01_call_put (acv, modul_id, kw_index,
                      a_ap_tree^[ put_node ].n_sa_level);
                a01_next_symbol (acv);
                curr_n := a_ap_tree^[ put_node ].n_sa_level;
                END;
            OTHERWISE
                a07_error (acv, e_missing_keyword, put_node, put_node)
            END;
        (*ENDCASE*) 
        END;
    (*ENDIF*) 
    IF  a_return_segm^.sp1r_returncode = 0
    THEN
        BEGIN
        IF  sc_symb <> s_eof
        THEN
            BEGIN
            value_no := 0;
            WHILE ((sc_symb <> s_eof)      AND
                  ( value_no < exp_values) AND
                  ( a_return_segm^.sp1r_returncode = 0)) DO
                BEGIN
                a03_ainteger (acv,
                      a_ap_tree^[ curr_n ].n_sa_level, last_n);
                value_no := succ(value_no);
                curr_n := last_n;
                END
            (*ENDWHILE*) 
            END
        (*ENDIF*) 
        END;
    (*ENDIF*) 
    a01_is_end_symbol (acv)
    END
(*ENDWITH*) 
END;
 
(* PTS 1108247 E.Z. *)
(*------------------------------*) 
 
PROCEDURE
      ak30delete_statement (VAR acv : tak_all_command_glob;
            warm_utility  : boolean;
            VAR put_node : tsp_int2);
 
VAR
      last_n     : tsp_int2;
 
BEGIN
WITH acv DO
    BEGIN
    a01_next_symbol (acv);
    IF  a01_eqkey (a01kw[ cak_i_event], a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        BEGIN
        a01_call_put (acv, a37,
              cak_x_delete_event, put_node);
        a01_next_symbol (acv);
        ak30event_statement (acv, a37, cak_x_delete_event,
              a_ap_tree^[ put_node ].n_lo_level);
        END
    ELSE
        IF  (a01_eqkey (a01kw[ cak_i_log], a_sqlmode,
            a_cmd_part^.sp1p_buf, a_scv) AND
            warm_utility)
        THEN
            BEGIN
            a01_next_symbol (acv);
            IF  a01mandatory_keyword (acv, cak_i_from)
            THEN
                BEGIN
                a01_call_put (acv, a37, cak_x_delete_log_from_to, put_node);
                a03_aunsigned_integer (acv, a_ap_tree^[put_node].n_lo_level, last_n);
                IF  a01mandatory_keyword (acv, cak_i_to)
                THEN
                    a03_aunsigned_integer (acv, a_ap_tree^[last_n].n_sa_level, last_n);
                (*ENDIF*) 
                END
            (*ENDIF*) 
            END
        ELSE
            a07_error (acv, e_missing_keyword, put_node, put_node)
        (*ENDIF*) 
    (*ENDIF*) 
    END
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30set_statement (
            VAR acv      : tak_all_command_glob;
            modul_id     : tak_procs;
            VAR put_node : tsp_int2);
 
VAR
      curr_n   : tsp_int2;
      last_n   : tsp_int2;
      kw_index : integer;
      res_kw   : boolean;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    a01_next_symbol (acv);
    a01_get_keyword (acv, kw_index, res_kw);
    CASE kw_index OF
        cak_i_event :
            BEGIN
            a01_call_put (acv, a37,
                  cak_x_set_event, put_node);
            a01_next_symbol (acv);
            ak30event_statement (acv, a37, cak_x_set_event,
                  a_ap_tree^[ put_node ].n_lo_level);
            END;
        cak_i_log :
            (* PTS 1113190 E.Z. *)
            BEGIN
            a01_next_symbol (acv);
            (* PTS 1120105 E.Z. *)
            IF  a01_eqkey (a01kw[ cak_i_writer], a_sqlmode,
                a_cmd_part^.sp1p_buf, a_scv)
            THEN
                IF  modul_id = a37
                THEN
                    a07_error (acv, e_missing_keyword, put_node, last_n)
                ELSE
                    BEGIN
                    a01_next_symbol (acv);
                    IF  a01_eqkey (a01kw[ cak_i_on], a_sqlmode,
                        a_cmd_part^.sp1p_buf, a_scv)
                    THEN
                        a01_call_put (acv, modul_id,
                              cak_x_log_devspace_on, curr_n)
                    ELSE
                        IF  a01_eqkey (a01kw[ cak_i_off], a_sqlmode,
                            a_cmd_part^.sp1p_buf, a_scv)
                        THEN
                            a01_call_put (acv, modul_id,
                                  cak_x_log_devspace_off, curr_n)
                        ELSE
                            a07_error (acv, e_missing_keyword,
                                  put_node, last_n);
                        (*ENDIF*) 
                    (*ENDIF*) 
                    a01_next_symbol (acv);
                    END
                (*ENDIF*) 
            ELSE
                (* PTS 1120105 E.Z. *)
                IF  a01_eqkey (a01kw[ cak_i_auto], a_sqlmode,
                    a_cmd_part^.sp1p_buf, a_scv)
                THEN
                    BEGIN
                    a01_next_symbol (acv);
                    IF  a01mandatory_keyword (acv, cak_i_overwrite)
                    THEN
                        BEGIN
                        IF  a01_eqkey (a01kw[ cak_i_on], a_sqlmode,
                            a_cmd_part^.sp1p_buf, a_scv)
                        THEN
                            a01_call_put (acv, a37,
                                  cak_x_auto_overwrite_on, curr_n)
                        ELSE
                            IF  a01_eqkey (a01kw[ cak_i_off], a_sqlmode,
                                a_cmd_part^.sp1p_buf, a_scv)
                            THEN
                                a01_call_put (acv, a37,
                                      cak_x_auto_overwrite_off, curr_n)
                            ELSE
                                a07_error (acv, e_missing_keyword,
                                      put_node, last_n);
                            (*ENDIF*) 
                        (*ENDIF*) 
                        a01_next_symbol (acv);
                        END
                    (*ENDIF*) 
                    END
                ELSE
                    a07_error (acv, e_missing_keyword, put_node, last_n);
                (*ENDIF*) 
            (*ENDIF*) 
            END;
        cak_i_write :
            IF  modul_id = a36
            THEN
                a07_error (acv, e_missing_keyword, put_node, last_n)
            ELSE
                BEGIN
                a01_next_symbol (acv);
                IF  a01_eqkey (a01kw[ cak_i_on], a_sqlmode,
                    a_cmd_part^.sp1p_buf, a_scv)
                THEN
                    a01_call_put (acv, modul_id,
                          cak_x_write_on, curr_n)
                ELSE
                    IF  a01_eqkey (a01kw[ cak_i_off], a_sqlmode,
                        a_cmd_part^.sp1p_buf, a_scv)
                    THEN
                        a01_call_put (acv, modul_id,
                              cak_x_write_off, curr_n)
                    ELSE
                        a07_error (acv, e_missing_keyword,
                              put_node, last_n);
                    (*ENDIF*) 
                (*ENDIF*) 
                put_node := curr_n;
                a01_next_symbol (acv);
                IF  a_return_segm^.sp1r_returncode = 0
                THEN
                    BEGIN
                    IF  a01_eqkey(a01kw[ cak_i_for], a_sqlmode,
                        a_cmd_part^.sp1p_buf, a_scv)
                    THEN
                        BEGIN
                        a01_next_symbol (acv);
                        IF  a01_eqkey(a01kw[ cak_i_table], a_sqlmode,
                            a_cmd_part^.sp1p_buf, a_scv)
                        THEN
                            BEGIN
                            IF  a_ap_tree^[ curr_n ].n_subproc
                                = cak_x_write_off
                            THEN
                                a_ap_tree^[ curr_n ].n_subproc :=
                                      cak_x_tab_off_write
                            ELSE
                                a_ap_tree^[ curr_n ].n_subproc :=
                                      cak_x_tab_on_write;
                            (*ENDIF*) 
                            a01_next_symbol (acv);
                            a02_atablename (acv,
                                  a_ap_tree^[ curr_n ].n_lo_level,
                                  curr_n);
                            END
                        ELSE
                            a07_error (acv, e_missing_keyword,
                                  put_node, last_n);
                        (*ENDIF*) 
                        END
                    ELSE
                        a07_error (acv, e_missing_keyword, put_node,
                              last_n);
                    (*ENDIF*) 
                    END
                (*ENDIF*) 
                END;
            (*ENDIF*) 
        cak_i_nolog :
            BEGIN
            a01_next_symbol (acv);
            IF  (a01_eqkey (a01kw[ cak_i_off], a_sqlmode,
                a_cmd_part^.sp1p_buf, a_scv))
            THEN
                BEGIN
                a01_next_symbol (acv);
                a01_call_put (acv, a37,
                      cak_x_set_nolog_off, curr_n);
                put_node := curr_n;
                END
            ELSE
                a07_error (acv, e_missing_keyword,
                      put_node, last_n);
            (*ENDIF*) 
            END;
        cak_i_timeout :
            IF  modul_id = a36
            THEN
                a07_error (acv, e_missing_keyword, put_node, last_n)
            ELSE
                BEGIN
                a01_next_symbol (acv);
                IF  a01_eqkey (a01kw[ cak_i_on], a_sqlmode,
                    a_cmd_part^.sp1p_buf, a_scv)
                THEN
                    BEGIN
                    a01_call_put (acv, a37, cak_x_timeout_on, put_node);
                    a01_next_symbol (acv)
                    END
                ELSE
                    IF  a01_eqkey (a01kw[ cak_i_off], a_sqlmode,
                        a_cmd_part^.sp1p_buf, a_scv)
                    THEN
                        BEGIN
                        a01_call_put (acv,
                              a37, cak_x_timeout_off, put_node);
                        a01_next_symbol (acv)
                        END
                    ELSE
                        a07_error (acv, e_missing_keyword,
                              put_node, last_n);
                    (*ENDIF*) 
                (*ENDIF*) 
                END;
            (*ENDIF*) 
        cak_i_update :
            IF  modul_id = a36
            THEN
                a07_error (acv, e_missing_keyword, put_node, last_n)
            ELSE
                BEGIN
                a01_next_symbol (acv);
                IF  a01_eqkey (a01kw[ cak_i_stat], a_sqlmode,
                    a_cmd_part^.sp1p_buf, a_scv)
                    OR
                    a01_eqkey (a01kw[ cak_i_statistics], a_sqlmode,
                    a_cmd_part^.sp1p_buf, a_scv)
                THEN
                    BEGIN
                    a01_next_symbol (acv);
                    IF  a01_eqkey (a01kw[ cak_i_on], a_sqlmode,
                        a_cmd_part^.sp1p_buf, a_scv)
                    THEN
                        BEGIN
                        a01_call_put (acv, a37, cak_x_updstat_on, put_node);
                        a01_next_symbol (acv)
                        END
                    ELSE
                        IF  a01_eqkey (a01kw[ cak_i_off], a_sqlmode,
                            a_cmd_part^.sp1p_buf, a_scv)
                        THEN
                            BEGIN
                            a01_call_put (acv,
                                  a37, cak_x_updstat_off, put_node);
                            a01_next_symbol (acv)
                            END
                        ELSE
                            a07_error (acv, e_missing_keyword,
                                  put_node, last_n);
                        (*ENDIF*) 
                    (*ENDIF*) 
                    END
                (*ENDIF*) 
                END
            (*ENDIF*) 
        OTHERWISE
            a07_error (acv, e_missing_keyword, put_node, last_n);
        END;
    (*ENDCASE*) 
    a01_is_end_symbol (acv)
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30log  (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      last_n : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    IF  a_return_segm^.sp1r_returncode = 0
    THEN
        BEGIN
        a01_next_symbol (acv);
        IF  a01_eqkey (a01kw[ cak_i_last], a_sqlmode,
            a_cmd_part^.sp1p_buf, a_scv)
        THEN
            BEGIN
            a01_next_symbol (acv);
            a_ap_tree^ [ a_ap_tree^[ 0 ].n_lo_level ].n_length := ord(diagLogLast_egg00);
            a03_aunsigned_integer (acv, put_node, last_n);
            END
        ELSE
            IF  a01_eqkey (a01kw[ cak_i_from], a_sqlmode,
                a_cmd_part^.sp1p_buf, a_scv)
            THEN
                BEGIN
                a01_next_symbol (acv);
                a_ap_tree^ [ a_ap_tree^[ 0 ].n_lo_level ].n_length := ord(diagLogFrom_egg00);
                a03_aunsigned_integer (acv, put_node, last_n);
                IF  a01_eqkey (a01kw[ cak_i_to], a_sqlmode,
                    a_cmd_part^.sp1p_buf, a_scv)
                THEN
                    BEGIN
                    a01_next_symbol (acv);
                    a03_aunsigned_integer (acv,
                          a_ap_tree^[ last_n ].n_sa_level, last_n);
                    END
                ELSE
                    a07_error (acv,
                          e_missing_keyword, put_node, last_n);
                (*ENDIF*) 
                END
            ELSE
                a07_error (acv, e_missing_keyword, put_node, last_n);
            (*ENDIF*) 
        (*ENDIF*) 
        a01_is_end_symbol (acv)
        END;
    (*ENDIF*) 
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30table  (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      last_n : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    IF  a_return_segm^.sp1r_returncode = 0
    THEN
        BEGIN
        a01_next_symbol (acv);
        IF  sc_symb = s_identifier
        THEN
            BEGIN
            a_ap_tree^ [ a_ap_tree^[ 0 ].n_lo_level ].n_length := ord(diagTabName_egg00);
            a02_atablename (acv, put_node, last_n)
            END
        ELSE
            IF  sc_symb = s_byte_string
            THEN
                BEGIN
                a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_length := ord(diagTabId_egg00);
                a03_astring_literal (acv, put_node, last_n)
                END
            ELSE
                BEGIN
                a_ap_tree^ [ a_ap_tree^[ 0 ].n_lo_level ].n_length := ord(diagFile_egg00);
                a03_aunsigned_integer (acv, put_node, last_n);
                END;
            (*ENDIF*) 
        (*ENDIF*) 
        a01_is_end_symbol (acv)
        END;
    (*ENDIF*) 
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30column (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      last_n : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    IF  a_return_segm^.sp1r_returncode = 0
    THEN
        BEGIN
        a01_next_symbol (acv);
        IF  sc_symb = s_byte_string
        THEN
            BEGIN
            a_ap_tree^ [ a_ap_tree^[ 0 ].n_lo_level ].n_length := ord(diagColId_egg00);
            a03_astring_literal (acv, put_node, last_n)
            END
        ELSE
            BEGIN
            a_ap_tree^ [ a_ap_tree^[ 0 ].n_lo_level ].n_length := ord(diagColRoot_egg00);
            a03_aunsigned_integer (acv, put_node, last_n);
            END;
        (*ENDIF*) 
        a01_is_end_symbol (acv)
        END;
    (*ENDIF*) 
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30conv_page (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      last_n : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    IF  a_return_segm^.sp1r_returncode = 0
    THEN
        BEGIN
        a01_next_symbol (acv);
        a_ap_tree^ [ a_ap_tree^[ 0 ].n_lo_level ].n_length := ord(diagConvPage_egg00);
        a03_aunsigned_integer (acv, put_node, last_n);
        a01_is_end_symbol (acv)
        END
    (*ENDIF*) 
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30index  (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      last_n : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    IF  a_return_segm^.sp1r_returncode = 0
    THEN
        BEGIN
        a01_next_symbol (acv);
        IF  sc_symb in [ s_identifier, s_byte_string ]
        THEN
            BEGIN
            IF  sc_symb = s_identifier
            THEN
                BEGIN
                a_ap_tree^ [ a_ap_tree^[ 0 ].n_lo_level ].n_length := ord(diagInvName_egg00);
                a02_atablename (acv, put_node, last_n)
                END
            ELSE
                BEGIN
                a_ap_tree^ [ a_ap_tree^[ 0 ].n_lo_level ].n_length := ord(diagInvId_egg00);
                a03_astring_literal (acv, put_node, last_n)
                END;
            (*ENDIF*) 
            a03_aunsigned_integer (acv, a_ap_tree^[ last_n ].n_sa_level,
                  last_n);
            IF  g01unicode
            THEN
                BEGIN
                IF  (a_cmd_part^.sp1p_buf[ sc_sypos   ] = csp_unicode_mark) AND
                    (a_cmd_part^.sp1p_buf[ sc_sypos+1 ] = 'M')
                THEN
                    BEGIN
                    IF  a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_length = ord(diagInvName_egg00)
                    THEN
                        a_ap_tree^ [ a_ap_tree^[ 0 ].n_lo_level ].n_length :=
                              ord(diagMultInvName_egg00)
                    ELSE
                        a_ap_tree^ [ a_ap_tree^[ 0 ].n_lo_level ].n_length :=
                              ord(diagMultInvId_egg00);
                    (*ENDIF*) 
                    a01_next_symbol (acv);
                    END
                (*ENDIF*) 
                END
            ELSE
                IF  a_cmd_part^.sp1p_buf[ sc_sypos ] = 'M'
                THEN
                    BEGIN
                    IF  a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_length = ord(diagInvName_egg00)
                    THEN
                        a_ap_tree^ [ a_ap_tree^[ 0 ].n_lo_level ].n_length :=
                              ord(diagMultInvName_egg00)
                    ELSE
                        a_ap_tree^ [ a_ap_tree^[ 0 ].n_lo_level ].n_length :=
                              ord(diagMultInvId_egg00);
                    (*ENDIF*) 
                    a01_next_symbol (acv);
                    END
                (*ENDIF*) 
            (*ENDIF*) 
            END
        ELSE
            BEGIN
            a_ap_tree^ [ a_ap_tree^[ 0 ].n_lo_level ].n_length := ord(diagInvTree_egg00);
            a03_aunsigned_integer (acv, put_node, last_n)
            END;
        (*ENDIF*) 
        a01_is_end_symbol (acv)
        END;
    (*ENDIF*) 
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30data_page (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      last_n : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    IF  a_return_segm^.sp1r_returncode = 0
    THEN
        BEGIN
        a01_next_symbol (acv);
        a_ap_tree^ [ a_ap_tree^[ 0 ].n_lo_level ].n_length := ord(diagPages_egg00);
        a03_aunsigned_integer (acv, put_node, last_n);
        a01_is_end_symbol (acv)
        END
    (*ENDIF*) 
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30devspace (
            VAR acv         : tak_all_command_glob;
            diag_node       : tsp_int2;
            VAR put_node    : tsp_int2);
 
VAR
      last_n  : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    IF  a_return_segm^.sp1r_returncode = 0
    THEN
        BEGIN
        a01_next_symbol (acv);
        a_ap_tree^[diag_node].n_length := ord(diagDev_egg00);
        IF  a01_eqkey (a01kw [cak_i_second], a_sqlmode,
            a_cmd_part^.sp1p_buf, a_scv)
        THEN
            BEGIN
            a01_next_symbol (acv);
            IF  a01_eqkey (a01kw [cak_i_log], a_sqlmode,
                a_cmd_part^.sp1p_buf, a_scv)
            THEN
                a_ap_tree^[diag_node].n_length := ord (diagMirrLogDev_egg00)
            ELSE
                IF  a01_eqkey (a01kw [cak_i_config], a_sqlmode,
                    a_cmd_part^.sp1p_buf, a_scv)
                THEN
                    a_ap_tree^[diag_node].n_length :=
                          ord (diagMirrSysDev_egg00)
                ELSE
                    a07_error (acv, e_missing_keyword, put_node, last_n)
                (*ENDIF*) 
            (*ENDIF*) 
            END
        ELSE
            IF  a01_eqkey (a01kw [cak_i_log], a_sqlmode,
                a_cmd_part^.sp1p_buf, a_scv)
            THEN
                a_ap_tree^[diag_node].n_length := ord (diagLogDev_egg00)
            ELSE
                IF  a01_eqkey (a01kw [cak_i_config], a_sqlmode,
                    a_cmd_part^.sp1p_buf, a_scv)
                THEN
                    a_ap_tree^[diag_node].n_length := ord (diagSysDev_egg00);
                (*ENDIF*) 
            (*ENDIF*) 
        (*ENDIF*) 
        IF  (a_return_segm^.sp1r_returncode = 0)
            AND
            (a_ap_tree^[diag_node].n_length <> ord (diagDev_egg00))
        THEN
            (* devspace number *)
            BEGIN
            a01_next_symbol (acv);
            a03_aunsigned_integer (acv, put_node, last_n);
            END;
        (*ENDIF*) 
        IF  (a_return_segm^.sp1r_returncode = 0)
            AND
            (a_ap_tree^[diag_node].n_length = ord (diagDev_egg00))
        THEN
            (* devspace name *)
            BEGIN
            a_ap_tree^ [diag_node].n_length := ord(diagDev_egg00);
            a02_asystem_devspace (acv, put_node, last_n)
            END;
        (*ENDIF*) 
        IF  a_return_segm^.sp1r_returncode = 0
        THEN
            BEGIN
            IF  a01_eqkey (a01kw [cak_i_from], a_sqlmode,
                a_cmd_part^.sp1p_buf, a_scv)
            THEN
                BEGIN
                a01_next_symbol (acv);
                a03_aunsigned_integer (acv,
                      a_ap_tree^[last_n].n_sa_level, last_n);
                IF  a01_eqkey (a01kw[cak_i_to], a_sqlmode,
                    a_cmd_part^.sp1p_buf, a_scv)
                THEN
                    BEGIN
                    a01_next_symbol (acv);
                    a03_aunsigned_integer (acv,
                          a_ap_tree^[last_n].n_sa_level, last_n);
                    END
                ELSE
                    a07_error (acv, e_missing_keyword, put_node, last_n)
                (*ENDIF*) 
                END
            ELSE
                a07_error (acv, e_missing_keyword, put_node, last_n)
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        a01_is_end_symbol (acv)
        END
    (*ENDIF*) 
(*ENDWITH*) 
END;
 
(* PTS 1115978 E.Z. *)
(*------------------------------*) 
 
PROCEDURE
      ak30autosave_statement (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      res_kw     : boolean;
      ikw        : integer;
      file_count : integer;
      last_n     : tsp_int2;
      curr_n     : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    a01_call_put (acv, a37, cak_x_autosave, put_node);
    a01_next_symbol (acv);
    a01_get_keyword (acv, ikw, res_kw);
    a_ap_tree^[put_node].n_length := ikw;
    curr_n := put_node;
    CASE ikw OF
        cak_i_on :
            BEGIN
            file_count := 0;
            REPEAT
                file_count := file_count + 1;
                a02_ahostfile_name (acv,
                      a_ap_tree^[curr_n].n_lo_level, last_n);
                IF  a_return_segm^.sp1r_returncode = 0
                THEN
                    ak30file_type (acv,
                          a_ap_tree^[last_n].n_lo_level, curr_n);
                (*ENDIF*) 
            UNTIL
                (sc_symb <> s_comma) OR (file_count = 2)
                OR  (a_return_segm^.sp1r_returncode <> 0);
            (*ENDREPEAT*) 
            curr_n := put_node;
            ak30media_name (acv, a_ap_tree^[curr_n].n_sa_level, curr_n);
            IF  a01_eqkey (a01kw[cak_i_before], a_sqlmode,
                a_cmd_part^.sp1p_buf, a_scv)
            THEN
                BEGIN
                a01_call_put (acv, a37, cak_i_date, last_n);
                a_ap_tree^[curr_n].n_sa_level := last_n;
                curr_n := last_n;
                a01_next_symbol (acv);
                a03_astring_literal (acv,
                      a_ap_tree^[last_n].n_lo_level, last_n);
                END;
            (*ENDIF*) 
            ak30count_check (acv,
                  a_ap_tree^[curr_n].n_sa_level, curr_n);
            IF  a01_eqkey (a01kw[cak_i_fversion], a_sqlmode,
                a_cmd_part^.sp1p_buf, a_scv)
            THEN
                BEGIN
                a01_call_put (acv, a37, cak_i_fversion, last_n);
                a_ap_tree^[curr_n].n_sa_level := last_n;
                curr_n := last_n;
                a01_next_symbol (acv)
                END;
            (*ENDIF*) 
            IF  sc_symb <> s_eof
            THEN
                IF  a01_eqkey (a01kw[cak_i_cascade], a_sqlmode,
                    a_cmd_part^.sp1p_buf,
                    a_scv)
                THEN
                    BEGIN
                    a01_call_put (acv, a37, cak_i_cascade, last_n);
                    a_ap_tree^[ curr_n ].n_sa_level := last_n;
                    a01_next_symbol (acv)
                    END;
                (*ENDIF*) 
            (*ENDIF*) 
            END;
        cak_i_cancel, cak_i_show, cak_i_end :
            a01_next_symbol (acv);
        OTHERWISE
            a07_error (acv, e_wanted_keyword, put_node, last_n)
        END;
    (*ENDCASE*) 
    a01_is_end_symbol (acv)
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30media_name (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2;
            VAR last_n   : tsp_int2);
 
VAR
      dummy_n : tsp_int2;
 
BEGIN
IF  acv.a_scv.sc_symb <> s_eof
THEN
    IF  a01_eqkey (a01kw[cak_i_medianame], acv.a_sqlmode,
        acv.a_cmd_part^.sp1p_buf, acv.a_scv)
    THEN
        BEGIN
        a01_call_put (acv, a37, cak_i_medianame, put_node);
        last_n := put_node;
        a01_next_symbol (acv);
        a03_astring_literal (acv,
              acv.a_ap_tree^[put_node].n_lo_level, dummy_n)
        END;
    (*ENDIF*) 
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30block_size  (
            VAR acv       : tak_all_command_glob;
            VAR put_node  : tsp_int2;
            VAR last_node : tsp_int2);
 
VAR
      curr_n : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    IF  sc_symb = s_identifier
    THEN
        IF  a01_eqkey (a01kw[ cak_i_blocksize], a_sqlmode,
            a_cmd_part^.sp1p_buf, a_scv)
        THEN
            BEGIN
            a01_call_put (acv, a37, cak_i_blocksize, put_node);
            last_node := put_node;
            a01_next_symbol (acv);
            a03_aunsigned_integer (acv,
                  a_ap_tree^[last_node].n_lo_level, curr_n)
            END;
        (*ENDIF*) 
    (*ENDIF*) 
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30count_check (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2;
            VAR last_n   : tsp_int2);
 
VAR
      curr_n : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    IF  a01_eqkey (a01kw[ cak_i_count], a_sqlmode,
        a_cmd_part^.sp1p_buf, a_scv)
    THEN
        BEGIN
        a01_call_put (acv, a37, cak_i_count, last_n);
        put_node := last_n;
        a01_next_symbol (acv);
        a03_aunsigned_integer (acv,
              a_ap_tree^[last_n].n_lo_level, curr_n)
        END;
    (*ENDIF*) 
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30c_utilprot_cmd (
            VAR acv           : tak_all_command_glob;
            VAR prot_needed   : boolean;
            VAR with_tapeinfo : boolean;
            VAR util_cmd_id   : tgg00_UtilCmdId);
 
VAR
      prot_buf    : tsp_buf;
      buf_len     : tsp_int4;
      err_char_no : tsp_int4;
      uni_err     : tsp8_uni_error;
      move_err    : tgg_basis_error;
      cmd_len     : integer;
      rest_len    : integer;
      line_ptr    : ^tsp_line;
      curr_n      : integer;
 
BEGIN
IF  prot_needed = c_dont_know
THEN
    IF  acv.a_ap_tree^[ acv.a_ap_tree^[ 0 ].n_lo_level ].n_proc = a36
    THEN
        a36utilprot_needed (acv, prot_needed, with_tapeinfo)
    ELSE
        a37utilprot_needed (acv, prot_needed, with_tapeinfo);
    (*ENDIF*) 
(*ENDIF*) 
IF  prot_needed
THEN
    WITH acv, a_cmd_part^ DO
        BEGIN
        line_ptr  := @prot_buf;
        ak30h_utilprot_header (acv,
              uhk_request, line_ptr^, buf_len, util_cmd_id);
        IF  (a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_proc     =  a36)AND
            (a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_subproc  =
            cak_x_activate) AND
            (a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_sa_level <> 0)
        THEN (* ACTIVATE SERVERDB SYSDBA ... PASSWORD ... *)
            (*  Here we better cut the PASSWORD off.      *)
            WITH a_ap_tree^[ a_ap_tree^[a_ap_tree^[ 0 ].n_lo_level].n_sa_level ] DO
                cmd_len := n_pos + n_length -1
            (*ENDWITH*) 
        ELSE
            cmd_len := sp1p_buf_len;
        (*ENDIF*) 
        IF  (a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_proc     = a37) AND
            (a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ].n_subproc  =
            cak_x_create_serverdb)
        THEN
            BEGIN
            curr_n := 1;
            curr_n := a_ap_tree^[ curr_n ].n_sa_level;
            curr_n := a_ap_tree^[ curr_n ].n_sa_level;
            curr_n := a_ap_tree^[ curr_n ].n_sa_level;
            IF  a_ap_tree^[ curr_n ].n_sa_level <> 0
            THEN (* CREATE SERVERDB SYSDBA ... PASSWORD ... *)
                (*  Here we better cut the PASSWORD off.    *)
                WITH a_ap_tree^[ curr_n ] DO
                    cmd_len := n_pos + n_length -1
                (*ENDWITH*) 
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        IF  g01unicode
        THEN      (* Since utility commands have to be in ascii, *)
            BEGIN (* we simply transform it back. CK, 21.3.97    *)
            rest_len := sizeof (tsp_buf) - buf_len;
            s80uni_trans (@sp1p_buf[ 1 ],           cmd_len,  csp_unicode,
                  @prot_buf[ 1 + buf_len ], rest_len, csp_ascii,
                  [ ], uni_err, err_char_no)
            END
        ELSE
            BEGIN
            IF  cmd_len < sizeof (tsp_buf) - buf_len
            THEN
                rest_len := cmd_len
            ELSE
                rest_len := sizeof (tsp_buf) - buf_len;
            (*ENDIF*) 
            move_err := e_ok;
            g10mv ('VAK30 ',   1,    
                  sp1p_buf_size, sizeof (prot_buf),
                  sp1p_buf, 1, prot_buf, 1 + buf_len, rest_len, move_err)
            END;
        (*ENDIF*) 
        buf_len := buf_len + rest_len;
        vutilprot (prot_buf, buf_len)
        END
    (*ENDWITH*) 
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30r_utilprot_retcode (
            VAR acv         : tak_all_command_glob;
            prot_needed     : boolean;
            with_tapeinfo   : boolean;
            VAR util_cmd_id : tgg00_UtilCmdId);
 
CONST
      mx_page_cnt = 10;
 
VAR
      line       : tsp_line;
      ln_len     : integer;
      buf_ptr    : ^tsp_buf;
      move_err   : tgg_basis_error;
      data_part  : tsp1_part_ptr;
      sinfo_part : tsp1_part_ptr;
      coln_part  : tsp1_part_ptr;
 
BEGIN
WITH acv, a_ap_tree^[ a_ap_tree^[ 0 ].n_lo_level ] DO
    BEGIN
    IF  (n_proc    = a37)                     AND
        (n_subproc = cak_x_autosave)          AND
        (n_length  = cak_i_show)              AND
        (a_return_segm^.sp1r_returncode <> 0) AND
        (a_return_segm^.sp1r_returncode <> 100)
    THEN
        BEGIN
        prot_needed := true;
        ak30c_utilprot_cmd (acv,
              prot_needed, with_tapeinfo,
              util_cmd_id);
        END;
    (*ENDIF*) 
    IF  prot_needed
    THEN
        BEGIN
        move_err := e_ok;
        buf_ptr  := @line;
        ak30h_utilprot_header (acv,
              uhk_receive, line, ln_len, util_cmd_id);
        line [ln_len+1] := 'R';
        line [ln_len+2] := 'E';
        line [ln_len+3] := 'T';
        line [ln_len+4] := 'U';
        line [ln_len+5] := 'R';
        line [ln_len+6] := 'N';
        line [ln_len+7] := 'C';
        line [ln_len+8] := 'O';
        line [ln_len+9] := 'D';
        line [ln_len+10]:= 'E';
        ln_len := ln_len + 10;
        IF  a_return_segm^.sp1r_returncode < 0
        THEN
            g17int4to_line (a_return_segm^.sp1r_returncode,
                  NOT c_with_zero, 6, ln_len+1, line)
        ELSE
            g17int4to_line (a_return_segm^.sp1r_returncode MOD cak_e_released,
                  NOT c_with_zero, 6, ln_len+1, line);
        (*ENDIF*) 
        ln_len   := ln_len + 6;
        IF  (n_proc in  [ a36, a37 ]) AND (n_subproc = cak_x_verify)
        THEN
            BEGIN
            IF  a_return_segm^.sp1r_returncode = 0
            THEN
                BEGIN
                s26find_part (a_return_segm^, sp1pk_data, data_part);
                IF  data_part <> NIL
                THEN
                    WITH data_part^ DO
                        BEGIN
                        ln_len         := ln_len + 1;
                        line[ ln_len ] := ' ';
                        g10mv ('VAK30 ',   2,    
                              sp1p_buf_size, sizeof (line),
                              sp1p_buf, 1, buf_ptr^, ln_len+1, mx_page_cnt,
                              move_err);
                        ln_len         := ln_len + mx_page_cnt;
                        g17nameto_line (' PERM PAGES,      ', ln_len, line);
                        ln_len         := ln_len + 1;
                        line[ ln_len ] := ' ';
                        g10mv ('VAK30 ',   3,    
                              sp1p_buf_size, sizeof (line),
                              sp1p_buf, 11, buf_ptr^, ln_len+1, mx_page_cnt,
                              move_err);
                        ln_len := ln_len + mx_page_cnt;
                        g17nameto_line (' RELEASED BLOCKS  ', ln_len, line);
                        END
                    (*ENDWITH*) 
                (*ENDIF*) 
                END
            ELSE
                BEGIN
                s26find_part (a_return_segm^, sp1pk_data, data_part);
                IF  data_part <> NIL
                THEN
                    WITH data_part^ DO
                        BEGIN
                        move_err       := e_ok;
                        ln_len         := ln_len + 1;
                        line[ ln_len ] := ' ';
                        g10mv ('VAK30 ',   4,    
                              sp1p_buf_size, sizeof (line),
                              sp1p_buf, 1, buf_ptr^, ln_len+1, mx_page_cnt,
                              move_err);
                        ln_len         := ln_len + mx_page_cnt;
                        g17nameto_line (' BAD INDEXES      ', ln_len, line);
                        ln_len         := ln_len + 1;
                        line[ ln_len ] := ' ';
                        g10mv ('VAK30 ',   5,    
                              sp1p_buf_size, sizeof (line),
                              sp1p_buf, 11, buf_ptr^, ln_len+1, mx_page_cnt,
                              move_err);
                        ln_len := ln_len + mx_page_cnt;
                        g17nameto_line (' TOTAL BAD FILES  ', ln_len, line);
                        END
                    (*ENDWITH*) 
                (*ENDIF*) 
                END
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        vutilprot (buf_ptr^, ln_len);
        IF  with_tapeinfo
        THEN
            BEGIN
            s26find_part (a_return_segm^,
                  sp1pk_data, data_part);
            s26find_part (a_return_segm^,
                  sp1pk_shortinfo, sinfo_part);
            s26find_part (a_return_segm^,
                  sp1pk_columnnames, coln_part);
            IF  (data_part  <> NIL) AND
                (sinfo_part <> NIL) AND
                (coln_part  <> NIL)
            THEN
                ak30save_info (acv,
                      data_part^, sinfo_part^, coln_part^,
                      util_cmd_id);
            (*ENDIF*) 
            END
        (*ENDIF*) 
        END
    (*ENDIF*) 
    END
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30save_info (
            VAR acv         : tak_all_command_glob;
            VAR data_part   : tsp1_part;
            VAR sinfo_part  : tsp1_part;
            VAR coln_part   : tsp1_part;
            VAR util_cmd_id : tgg00_UtilCmdId);
 
CONST
      c_undef = 'UNDEF       ';
      c_true  = 'TRUE        ';
      c_false = 'FALSE       ';
 
VAR
      curr_index : integer;
      buf_len    : integer;
      buf        : tsp_buf;
      line_ptr   : ^tsp_line;
      sinfo_pos  : tsp_int4;
      coln_pos   : tsp_int4;
      head_len   : integer;
      this_len   : integer;
      num_len    : integer;
      namelen    : integer;
      num_err    : tsp_num_error;
      move_err   : tgg_basis_error;
      err_char_no: tsp_int4;
      error      : tsp8_uni_error;
      sinfo      : tsp1_param_info;
 
BEGIN
coln_pos  := 1;
sinfo_pos := 1;
move_err  := e_ok;
line_ptr  := @buf;
(* PTS 1000584 UH *)
FOR curr_index := 1 TO sinfo_part.sp1p_arg_count DO
    BEGIN
    ak30h_utilprot_header (acv, uhk_save, line_ptr^,
          head_len, util_cmd_id); (* PTS 1000584 UH *)
    buf_len   := head_len;
    this_len := ord (coln_part.sp1p_buf[ coln_pos ]);
    (* PTS 1115493 E.Z. *)
    IF  acv.a_out_packet^.sp1_header.sp1h_mess_code <> csp_ascii
    THEN
        BEGIN
        namelen := this_len DIV 2;
        s80uni_trans (@(coln_part.sp1p_buf[coln_pos+1]), this_len,
              acv.a_out_packet^.sp1_header.sp1h_mess_code,
              @(buf[buf_len+1]), namelen, csp_ascii,
              [ ], error, err_char_no);
        IF  error <> uni_ok
        THEN
            a07_hex_uni_error (acv, error, 1, NOT c_trans_to_uni,
                  @(coln_part.sp1p_buf[coln_pos+err_char_no]), c_unicode_wid);
        (*ENDIF*) 
        END
    ELSE
        BEGIN
        g10mv ('VAK30 ',   6,    
              coln_part.sp1p_buf_size, sizeof (buf),
              coln_part.sp1p_buf, coln_pos+1, buf, buf_len+1,
              this_len, move_err);
        namelen := this_len;
        END;
    (*ENDIF*) 
    buf_len  := buf_len      + namelen;
    coln_pos := coln_pos + 1 + this_len;
    IF  buf_len < head_len+18
    THEN
        g10fil ('VAK30 ',   7,    
              sizeof (buf), buf, buf_len+1, head_len+18-buf_len,
              '.', move_err);
    (*ENDIF*) 
    buf_len         := head_len+18+1;
    buf[ buf_len ] := ' ';
    g10mv1 ('VAK30 ',   8,    
          sinfo_part.sp1p_buf_size, sizeof (sinfo),
          sinfo_part.sp1p_buf, sinfo_pos, sinfo, 1,
          sizeof (sinfo), move_err);
    sinfo_pos := sinfo_pos + sizeof (sinfo);
&   ifdef trace
    t01int4 (ak_sem, 'bufpos      ', sinfo.sp1i_bufpos);
    t01int4 (ak_sem, 'data_type   ', ord (sinfo.sp1i_data_type));
&   endif
    WITH data_part, sinfo DO
        IF  sp1p_buf[ sp1i_bufpos ] = csp_undef_byte
        THEN
            g17sname_to_line (c_undef, buf_len, line_ptr^)
        ELSE
            CASE sp1i_data_type OF
                dcha:
                    BEGIN
                    this_len := s30lnr (sp1p_buf, csp_ascii_blank,
                          sp1i_bufpos + 1, sp1i_length);
                    g10mv ('VAK30 ',   9,    
                          sp1p_buf_size, sizeof (buf),
                          sp1p_buf, sp1i_bufpos + 1,
                          buf, buf_len + 1,
                          this_len, move_err);
                    buf_len := buf_len + this_len
                    END;
                ddate:
                    BEGIN
                    buf[ buf_len + 1 ] := sp1p_buf[ sp1i_bufpos+1 ];
                    buf[ buf_len + 2 ] := sp1p_buf[ sp1i_bufpos+2 ];
                    buf[ buf_len + 3 ] := sp1p_buf[ sp1i_bufpos+3 ];
                    buf[ buf_len + 4 ] := sp1p_buf[ sp1i_bufpos+4 ];
                    buf[ buf_len + 5 ] := '-';
                    buf[ buf_len + 6 ] := sp1p_buf[ sp1i_bufpos+5 ];
                    buf[ buf_len + 7 ] := sp1p_buf[ sp1i_bufpos+6 ];
                    buf[ buf_len + 8 ] := '-';
                    buf[ buf_len + 9 ] := sp1p_buf[ sp1i_bufpos+7 ];
                    buf[ buf_len +10 ] := sp1p_buf[ sp1i_bufpos+8 ];
                    buf_len             := buf_len + 10;
                    END;
                dtime:
                    BEGIN
                    buf[ buf_len+1 ] := sp1p_buf[ sp1i_bufpos+3 ];
                    buf[ buf_len+2 ] := sp1p_buf[ sp1i_bufpos+4 ];
                    buf[ buf_len+3 ] := ':';
                    buf[ buf_len+4 ] := sp1p_buf[ sp1i_bufpos+5 ];
                    buf[ buf_len+5 ] := sp1p_buf[ sp1i_bufpos+6 ];
                    buf[ buf_len+6 ] := ':';
                    buf[ buf_len+7 ] := sp1p_buf[ sp1i_bufpos+7 ];
                    buf[ buf_len+8 ] := sp1p_buf[ sp1i_bufpos+8 ];
                    buf_len           := buf_len + 8;
                    END;
                dfixed:
                    BEGIN
                    s42gstr (sp1p_buf, sp1i_bufpos + 1,
                          csp_resnum_deflen, 0, csp_resnum_deflen,
                          line_ptr^, buf_len + 1, num_len, num_err);
                    buf_len := buf_len + num_len
                    END;
                dboolean:
                    IF  ord (sp1p_buf[ sp1i_bufpos+1 ]) <> 0
                    THEN
                        g17sname_to_line (c_true, buf_len, line_ptr^ )
                    ELSE
                        g17sname_to_line (c_false, buf_len, line_ptr^);
                    (*ENDIF*) 
                OTHERWISE;
                END;
            (*ENDCASE*) 
        (*ENDIF*) 
    (*ENDWITH*) 
    vutilprot (buf, buf_len);
    END;
(*ENDFOR*) 
k38UtilIdSaveLineNo (util_cmd_id); (* PTS 1108625 UH 2000-12-11 *)
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30h_utilprot_header (
            VAR acv         : tak_all_command_glob;
            header_kind     : t_utilheader_kind;
            VAR ln          : tsp_line;
            VAR ln_len      : integer;
            VAR util_id_str : tgg00_UtilCmdId);
 
CONST
      c_request     = 'REQ';
      c_receive     = 'RET';
      c_save        = 'TAP';
 
VAR
      use_old_id  : boolean;                     (* PTS 1000584 UH *)
      dummy_err   : tgg_basis_error;             (* PTS 1000431 UH *)
      header      : tsp_c3;
      c3_ptr      : ^tsp_c3;
      line_ptr    : ^tsp_line;                   (* PTS 1000584 UH *)
      aux_line_no : tsp_int_map_c2;   (* PTS 1104845 UH 02-12-1999 *)
 
BEGIN
s10fil (sizeof (ln), ln, 1, 24, ' ');          (* PTS 1000584 UH *)
use_old_id := false;                           (* PTS 1000584 UH *)
IF  header_kind = uhk_request                  (* PTS 1000584 UH *)
THEN
    CASE acv.a_ap_tree^[ acv.a_ap_tree^[ 0 ].n_lo_level ].n_proc OF
        a36:
            IF  (acv.a_ap_tree^[ acv.a_ap_tree^[ 0 ].n_lo_level ].n_subproc IN
                [cak_x_restore_db, cak_x_restore_pages, cak_x_restore_log])
                AND
                (acv.a_ap_tree^[ acv.a_ap_tree^[ 0 ].n_lo_level ].n_length IN
                [cak_i_replace, cak_i_ignore, cak_i_cancel])
            THEN
                use_old_id := true;
            (*ENDIF*) 
        a37:
            IF  (acv.a_ap_tree^[ acv.a_ap_tree^[ 0 ].n_lo_level ].n_subproc IN
                [cak_x_save_log, cak_x_save_database, cak_x_save_pages])
                AND
                (acv.a_ap_tree^[ acv.a_ap_tree^[ 0 ].n_lo_level ].n_length IN
                [cak_i_replace, cak_i_ignore, cak_i_cancel])
            THEN
                use_old_id := true;
            (*ENDIF*) 
        END;
    (*ENDCASE*) 
(* PTS 1104845 UH 02-12-1999 begin *)
(*ENDIF*) 
IF  use_old_id
THEN
    k38UtilIdGet (util_id_str)
ELSE
    IF  header_kind = uhk_request
    THEN
        k35UtilIdGet (acv.a_transinf.tri_trans.trTaskId_gg00, util_id_str);
    (* PTS 1104845 UH 02-12-1999 end *)
    (*ENDIF*) 
(*ENDIF*) 
dummy_err := e_ok;                             (* PTS 1000431 UH *)
line_ptr  := @util_id_str.utidId_gg00;                     (* PTS 1000584 UH *)
s10mv (sizeof (util_id_str.utidId_gg00), sizeof (ln),
      line_ptr^, 1, ln, 1, sizeof (util_id_str.utidId_gg00)); (* PTS 1000584 UH *)
ln_len   := sizeof (util_id_str.utidId_gg00) + 1;             (* PTS 1000584 UH *)
(* PTS 1104845 UH 02-12-1999 begin *)
aux_line_no.map_int := util_id_str.utidLineNo_gg00;
util_id_str.utidLineNo_gg00 := (util_id_str.utidLineNo_gg00 + 1) MOD 999;
IF  g01code.kernel_swap = sw_normal
THEN
    BEGIN
    g17hexto_line (aux_line_no.map_c2[1], ln_len, ln);
    g17hexto_line (aux_line_no.map_c2[2], ln_len, ln)
    END
ELSE
    BEGIN
    g17hexto_line (aux_line_no.map_c2[2], ln_len, ln);
    g17hexto_line (aux_line_no.map_c2[1], ln_len, ln)
    END;
(*ENDIF*) 
(* PTS 1104845 UH 02-12-1999 end *)
ln_len := sizeof (util_id_str.utidLineNo_gg00) + 1;                (* PTS 1000584 UH *)
CASE header_kind OF
    uhk_request:
        CASE acv.a_ap_tree^[ acv.a_ap_tree^[ 0 ].n_lo_level ].n_proc OF
            a36:
                CASE acv.a_ap_tree^[ acv.a_ap_tree^[ 0 ].n_lo_level ].n_subproc OF
                    cak_x_activate:
                        IF  acv.a_ap_tree^[ acv.a_ap_tree^[ 0 ].n_lo_level ].n_sa_level <> 0
                        THEN
                            header := 'AC1'
                        ELSE
                            header := 'AC2';
                        (*ENDIF*) 
                    cak_x_clear_log:
                        header := 'CLR';
                    cak_x_init_config:
                        header := 'ICF';
                    cak_x_restart:
                        header := 'RST';
                    cak_x_restore_db:
                        header := 'RDB';
                    cak_x_restore_config:
                        header := 'RCF';
                    cak_x_restore_pages:
                        BEGIN
                        header := 'RPG';
                        END;
                    cak_x_restore_log:
                        header := 'RLG';
                    cak_x_rest_log_from:
                        header := 'RLF';
                    cak_x_verify:
                        header := 'VER';
                    OTHERWISE
                        header := c_request;
                    END;
                (*ENDCASE*) 
            a37:
                CASE acv.a_ap_tree^[ acv.a_ap_tree^[ 0 ].n_lo_level ].n_subproc OF
                    cak_x_add_devspace:
                        header := 'ADD';
                    cak_x_alter_serverdb:
                        header := 'ALT';
                    cak_x_autosave:
                        CASE acv.a_ap_tree^[ acv.a_ap_tree^[ 0 ].n_lo_level ].n_length OF
                            cak_i_on:
                                header := 'ASO';
                            cak_i_end:
                                header := 'ASE';
                            cak_i_cancel:
                                header := 'ASC';
                            OTHERWISE
                                header := c_request;
                            END;
                        (*ENDCASE*) 
                    cak_x_create_serverdb:
                        header := 'CRE';
                    (* PTS 1115982 E.Z. *)
                    cak_x_save_log:
                        header := 'SLG';
                    cak_x_save_log_cold:
                        header := 'SLC';
                    cak_x_save_database:
                        header := 'SDB';
                    cak_x_save_pages:
                        header := 'SPG';
                    (* PTS 1111289 E.Z. *)
                    cak_x_shutdown:
                        header := 'SHT';
                    OTHERWISE
                        header := c_request;
                    END;
                (*ENDCASE*) 
            OTHERWISE
                header := c_request;
            END;
        (*ENDCASE*) 
    uhk_receive:
        header := c_receive;
    uhk_save:
        header := c_save;
    END;
(*ENDCASE*) 
c3_ptr  := @ln[ 21 ]; (* PTS 1000584 UH *)
c3_ptr^ := header;
ln_len  := 24;        (* PTS 1000584 UH *)
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30insert_event (
            restart_shutdown : integer;
            start_end : integer);
 
VAR
      event_description : tsp31_event_description;
 
BEGIN
g01event_init (event_description);
WITH event_description DO
    BEGIN
    sp31ed_ident      := sp31ei_restart_shutdown;
    sp31ed_priority   := sp31ep_low;
    sp31ed_value_1    := restart_shutdown;
    sp31ed_value_2    := start_end;
    END;
(*ENDWITH*) 
vinsert_event (event_description)
END;
 
(*------------------------------*) 
 
PROCEDURE
      a30serverdb_spec (
            VAR acv       : tak_all_command_glob;
            VAR put_node  : tsp_int2;
            VAR last_node : tsp_int2);
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    a03_astring_literal (acv, put_node, last_node);
    IF  a_return_segm^.sp1r_returncode = 0
    THEN
        BEGIN
        WITH a_ap_tree^[ last_node ] DO
            IF  n_length > mxsp_dbname
            THEN
                n_length := mxsp_dbname;
            (*ENDIF*) 
        (*ENDWITH*) 
        IF  a01_eqkey (a01kw[ cak_i_on], a_sqlmode,
            a_cmd_part^.sp1p_buf, a_scv)
        THEN
            BEGIN
            a01_next_symbol (acv);
            a03_astring_literal (acv,
                  a_ap_tree^[ last_node ].n_sa_level, last_node);
            IF  a_return_segm^.sp1r_returncode = 0
            THEN
                WITH a_ap_tree^[ last_node ] DO
                    IF  n_length > mxsp_nodeid
                    THEN
                        n_length := mxsp_nodeid;
                    (*ENDIF*) 
                (*ENDWITH*) 
            (*ENDIF*) 
            END
        ELSE
            a07_error (acv, e_missing_keyword, put_node, last_node);
        (*ENDIF*) 
        END;
    (*ENDIF*) 
    END;
(*ENDWITH*) 
END;
 
&ifdef TRACE
(*------------------------------*) 
 
PROCEDURE
      a30diag_switch_syntax (
            VAR acv      :tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      _kw_index               : integer;
      _last_n                 : tsp_int2;
      _kw_keyword             : tak_keyword;
      _kw_keyword_layer       : tak_keyword;
      _kw_keyword_debug       : tak_keyword;
      _res_kw                 : boolean;
      _is_first               : boolean;
 
BEGIN
(* DIAGNOSE SWITCH *)
a01_call_put (acv, a37, cak_x_switch, _last_n);
put_node := _last_n;
a01_next_symbol (acv);
a01_get_keyword (acv, _kw_index, _res_kw);
CASE _kw_index OF
    cak_i_off :
        BEGIN
        (* DIAGNOSE SWITCH OFF *)
        acv.a_ap_tree^[ _last_n ].n_length := cak30_x_switch_off;
        a01_next_symbol (acv);
        END;
    OTHERWISE
        BEGIN
        _kw_keyword := 'MAXBUF            ';
        IF  a01_eqkey (_kw_keyword, acv.a_sqlmode, acv.a_cmd_part^.sp1p_buf,
            acv.a_scv)
        THEN
            BEGIN
            (* DIAGNOSE SWITCH MAXBUF *)
            acv.a_ap_tree^[ _last_n ].n_length := cak30_x_switch_maxbuf;
            a01_next_symbol (acv);
            END
        ELSE
            BEGIN
            _kw_keyword := 'MINBUF            ';
            IF  a01_eqkey (_kw_keyword, acv.a_sqlmode, acv.a_cmd_part^.sp1p_buf,
                acv.a_scv)
            THEN
                BEGIN
                (* DIAGNOSE SWITCH MINBUF *)
                acv.a_ap_tree^[ _last_n ].n_length := cak30_x_switch_minbuf;
                a01_next_symbol (acv);
                END
            ELSE
                BEGIN
                _kw_keyword := 'BUFLIMIT          ';
                IF  a01_eqkey (_kw_keyword, acv.a_sqlmode,
                    acv.a_cmd_part^.sp1p_buf, acv.a_scv)
                THEN
                    BEGIN
                    (* DIAGNOSE SWITCH BUFLIMIT <unsigned> *)
                    acv.a_ap_tree^[ _last_n ].n_length := cak30_x_switch_buflimit;
                    a01_next_symbol (acv);
                    a03_aunsigned_integer (acv,
                          acv.a_ap_tree^[ _last_n ].n_sa_level, _last_n );
                    END
                ELSE
                    BEGIN
                    _kw_keyword_layer       := 'LAYER             ';
                    _kw_keyword_debug       := 'DEBUG             ';
                    _is_first               := true;
                    IF  a01_eqkey (_kw_keyword_layer, acv.a_sqlmode,
                        acv.a_cmd_part^.sp1p_buf, acv.a_scv)
                        OR
                        a01_eqkey (_kw_keyword_debug, acv.a_sqlmode,
                        acv.a_cmd_part^.sp1p_buf, acv.a_scv)
                    THEN
                        BEGIN
                        (* LAYER optional *)
                        IF  a01_eqkey (_kw_keyword_layer, acv.a_sqlmode,
                            acv.a_cmd_part^.sp1p_buf, acv.a_scv)
                        THEN
                            BEGIN
                            (* DIAGNOSE SWITCH LAYER <string> [...] *)
                            acv.a_ap_tree^[ _last_n ].n_length := cak30_x_switch_trace;
                            a01_next_symbol (acv);
                            a03_astring_literal (acv,
                                  acv.a_ap_tree^[ _last_n ].n_sa_level ,
                                  acv.a_ap_tree^[ _last_n ].n_sa_level );
                            _is_first := false
                            END;
                        (*ENDIF*) 
                        ;
                        (* DEBUG optional *)
                        IF  a01_eqkey (_kw_keyword_debug, acv.a_sqlmode,
                            acv.a_cmd_part^.sp1p_buf, acv.a_scv)
                        THEN
                            BEGIN
                            (* DIAGNOSE SWITCH [LAYER <string>] DEBUG <string> [...] *)
                            IF  NOT _is_first
                            THEN
                                BEGIN
                                a01_call_put (acv, a37, cak_x_switch,
                                      acv.a_ap_tree^[ _last_n ].n_lo_level );
                                _last_n := acv.a_ap_tree^[ _last_n ].n_lo_level
                                END;
                            (*ENDIF*) 
                            acv.a_ap_tree^[ _last_n ].n_length := cak30_x_switch_debug;
                            a01_next_symbol (acv);
                            a03_astring_literal (acv,
                                  acv.a_ap_tree^[ _last_n ].n_sa_level ,
                                  acv.a_ap_tree^[ _last_n ].n_sa_level );
                            _is_first := false
                            END;
                        (*ENDIF*) 
                        ;
                        _kw_keyword := 'LIMIT             ';
                        IF  a01_eqkey (_kw_keyword, acv.a_sqlmode,
                            acv.a_cmd_part^.sp1p_buf, acv.a_scv)
                        THEN
                            (* DIAGNOSE SWITCH ... [LIMIT ... ] *)
                            BEGIN
                            a01_next_symbol (acv);
                            IF  a01mandatory_keyword (acv, cak_i_start)
                            THEN
                                BEGIN
                                (* DIAGNOSE SWITCH ...             *)
                                (*    [LIMIT START <string> [...]] *)
                                a01_call_put (acv, a37, cak_x_switch,
                                      acv.a_ap_tree^[ _last_n ].n_lo_level );
                                _last_n := acv.a_ap_tree^[ _last_n ].n_lo_level;
                                acv.a_ap_tree^[ _last_n ].n_length :=
                                      cak30_x_switchlimit_start;
                                a03_astring_literal (acv,
                                      acv.a_ap_tree^[ _last_n ].n_sa_level ,
                                      acv.a_ap_tree^[ _last_n ].n_sa_level);
                                (* COUNT optional *)
                                _kw_keyword := 'COUNT             ';
                                IF  a01_eqkey (_kw_keyword, acv.a_sqlmode,
                                    acv.a_cmd_part^.sp1p_buf, acv.a_scv)
                                THEN
                                    (* DIAGNOSE SWITCH ...                                *)
                                    (*    [LIMIT START <string> [COUNT <unsigned>] [...]] *)
                                    BEGIN
                                    a01_call_put (acv, a37, cak_x_switch,
                                          acv.a_ap_tree^[ _last_n ].n_lo_level );
                                    _last_n := acv.a_ap_tree^[ _last_n ].n_lo_level;
                                    acv.a_ap_tree^[ _last_n ].n_length :=
                                          cak30_x_switchlimit_count;
                                    a01_next_symbol (acv);
                                    a03_aunsigned_integer (acv,
                                          acv.a_ap_tree^[ _last_n ].n_sa_level ,
                                          acv.a_ap_tree^[ _last_n ].n_sa_level);
                                    END;
                                (*ENDIF*) 
                                a01_get_keyword (acv, _kw_index, _res_kw);
                                (* STOP optional *)
                                IF  _kw_index = cak_i_stop
                                THEN
                                    (* DIAGNOSE SWITCH ...                                          *)
                                    (*    [LIMIT START <string> [COUNT <unsigned>] [STOP <string>]] *)
                                    BEGIN
                                    a01_call_put (acv, a37, cak_x_switch,
                                          acv.a_ap_tree^[ _last_n ].n_lo_level );
                                    _last_n := acv.a_ap_tree^[ _last_n ].n_lo_level;
                                    acv.a_ap_tree^[ _last_n ].n_length :=
                                          cak30_x_switchlimit_stop;
                                    a01_next_symbol (acv);
                                    a03_astring_literal (acv,
                                          acv.a_ap_tree^[ _last_n ].n_sa_level ,
                                          acv.a_ap_tree^[ _last_n ].n_sa_level);
                                    END
                                ELSE
                                    IF  acv.a_scv.sc_symb <> s_eof
                                    THEN
                                        a07_error (acv, e_missing_keyword, put_node, _last_n);
                                    (*ENDIF*) 
                                (*ENDIF*) 
                                END;
                            (*ENDIF*) 
                            END
                        ELSE
                            IF  acv.a_scv.sc_symb <> s_eof
                            THEN
                                a07_error (acv, e_missing_keyword, put_node, _last_n);
                            (*ENDIF*) 
                        (*ENDIF*) 
                        END
                    ELSE
                        a07_error (acv, e_missing_keyword, put_node, _last_n);
                    (*ENDIF*) 
                    END;
                (*ENDIF*) 
                END;
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        END;
    END;
(*ENDCASE*) 
a01_is_end_symbol (acv)
END;
 
&endif
(* PTS 1111229 E.Z. *)
(*------------------------------*) 
 
PROCEDURE
      ak30remove_standby_statement (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      last_node    : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    a01_next_symbol (acv);
    IF  a01mandatory_keyword (acv, cak_i_standby)
    THEN
        BEGIN
        a01_call_put (acv, a36, cak_x_remove_standby, put_node);
        a03_astring_literal (acv,
              a_ap_tree^[ put_node ].n_sa_level, last_node);
        IF  a_return_segm^.sp1r_returncode = 0
        THEN
            WITH a_ap_tree^[ last_node ] DO
                IF  n_length > mxsp_nodeid
                THEN
                    n_length := mxsp_nodeid;
                (*ENDIF*) 
            (*ENDWITH*) 
        (*ENDIF*) 
        END
    (*ENDIF*) 
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30insert_standby_statement (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      last_node    : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    a01_next_symbol (acv);
    IF  a01mandatory_keyword (acv, cak_i_standby)
    THEN
        BEGIN
        a01_call_put (acv, a36, cak_x_insert_standby, put_node);
        a03_astring_literal (acv,
              a_ap_tree^[ put_node ].n_sa_level, last_node);
        IF  a_return_segm^.sp1r_returncode = 0
        THEN
            WITH a_ap_tree^[ last_node ] DO
                IF  n_length > mxsp_nodeid
                THEN
                    n_length := mxsp_nodeid;
                (*ENDIF*) 
            (*ENDWITH*) 
        (*ENDIF*) 
        END
    (*ENDIF*) 
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30synchronize_log_statement (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
VAR
      last_node    : tsp_int2;
 
BEGIN
WITH acv, a_scv DO
    BEGIN
    a01_next_symbol (acv);
    a01_call_put (acv, a36, cak_x_synchronize_log, put_node);
    IF  sc_symb = s_byte_string
    THEN
        BEGIN
        a03_astring_literal (acv, a_ap_tree^[ put_node ].n_sa_level, last_node);
        a01_is_end_symbol (acv)
        END
    ELSE
        a07_error (acv, e_missing_string_literal, put_node, last_node)
    (*ENDIF*) 
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak30takeover_statement (
            VAR acv      : tak_all_command_glob;
            VAR put_node : tsp_int2);
 
BEGIN
a01_call_put (acv, a36, cak_x_takeover, put_node);
a01_next_symbol (acv);
a01_is_end_symbol (acv)
END;
 
.CM *-END-* code ----------------------------------------
.SP 2 
***********************************************************
.PA 
