package cobolprogramclasses;

/************************************************************************

 **This file automatically generated from Cobol program BGE018Q in source file BGE018Q.CBL

 **Generated at time 20:42:00.73 on Saturday, 01/23/10

 ************************************************************************/

import coboldataclasses.WsFlags;

import coboldataclasses.WsCounters;

import coboldataclasses.WsGeneralVariables;

import coboldataclasses.WsSqlVariables;

import coboldataclasses.Sqlca;

import coboldataclasses.GvCommonArea;

import coboldataclasses.HubMessageLinkage;

import com.res.java.lib.*;

import java.math.BigDecimal;

 

public class Bge018q extends Program {

 

      //* Created automatically by MsgGen                                 

      //*   on : 25-Nov-1998 15:01:39                                    

      //*                                                                

      //* DO NOT EDIT LINES WITH  IN COLUMN 73!!!                        

      //*                                                                 

      //*                                                                

      //* Program Description:                                           

      //* Get Property Values                                            

      //*                                                                 

      //* Common routine used to retrieve property values used in        

      //* many different areas of the system.                            

      //* .............................................................. 

      //* .............................................................. 

      //*                                                                

      //* Maintenance Log                                                

      //* ===============                                                 

      //* CR Nbr   Who   Details                                         

      //* ------   ---   -------                                         

      //* 1554  kahase   When investigating 1554 found that the order of 

      //* 10/03/99       status property values returned for document    

      //*                is sometimes in the wrong order when the start  

      //*                dates are the same. Added the end date to the   

      //*                order to solve.                                  

      //*          EM    When Inventory DateActive and DateDeactive are  

      //*                modified to be virtual properties, the property 

      //*                grid started falling over. Investigation showed 

      //*                that this code had to be modified to expect null

      //*                values for virtual properties.                  

      //* 28/03/00 sel   Fixed Host variable definition for floating point

      //*                data type properties.

      //*

      //* BTB193   PJL   Populate the new field NULLFLG for numeric      

      //*                properties to 'Y', if the table contains a NULL 

      //*                value.                                          

      //*

      //*                                                                 

      //*                                                                

      //*                                                                

      //*                                                                

      //************* DO NOT REMOVE OR CHANGE THESE FIELDS!! *************

      //*   The Revision Number and Checkin Date fields are updated      

      //*   automatically each time the source is checked in to PVCS     

      //************* DO NOT REMOVE OR CHANGE THESE FIELDS!! *************

      //*                                                                

      //*   03  CN-MULTI-MSG                      PIC X(01) VALUE 'Y'.   

      //*   03  CN-ARR-MAX                        PIC 9(04) VALUE 50.    

      //*                                                                 

      //@CobolSourceFile("BGE018Q.CBL",60,8)

      //01  WS-FLAGS.

      private WsFlags wsFlags = new WsFlags();

      public byte[] getWsFlags() {

            return wsFlags.getBytes();

      }

      public void setWsFlags(byte[] val) {

            wsFlags.valueOf(val);

      }

      //*    03  FL-DEFAULTS                      PIC X(01) VALUE ' '.   

      //*        88 DEFAULTS-MAY-BE-NECESSARY               VALUE 'Y'.   

      //*        88 DEFAULTS-NOT-NECESSARY                  VALUE 'N'.   

      //*    03  FL-END-OF-FETCH                  PIC X(01).             

      //*        88 END-OF-FETCH                  VALUE 'Y'.             

      //*                                                                

      //@CobolSourceFile("BGE018Q.CBL",69,8)

      //01  WS-COUNTERS.

      private WsCounters wsCounters = new WsCounters();

      public byte[] getWsCounters() {

            return wsCounters.getBytes();

      }

      public void setWsCounters(byte[] val) {

            wsCounters.valueOf(val);

      }

      //*                                                                 

      //@CobolSourceFile("BGE018Q.CBL",75,8)

      //01  WS-GENERAL-VARIABLES.

      private WsGeneralVariables wsGeneralVariables = new WsGeneralVariables();

      public byte[] getWsGeneralVariables() {

            return wsGeneralVariables.getBytes();

      }

      public void setWsGeneralVariables(byte[] val) {

            wsGeneralVariables.valueOf(val);

      }

      //*                                                                

      //*                                                                

      //@CobolSourceFile("BGE018Q.CBL",99,8)

      //01  WS-SQL-VARIABLES.

      private WsSqlVariables wsSqlVariables = new WsSqlVariables();

      public byte[] getWsSqlVariables() {

            return wsSqlVariables.getBytes();

      }

      public void setWsSqlVariables(byte[] val) {

            wsSqlVariables.valueOf(val);

      }

      //@CobolSourceFile("SQLCA.COB",11,8)

      //01  SQLCA.

      private Sqlca sqlca = new Sqlca();

      public byte[] getSqlca() {

            return sqlca.getBytes();

      }

      public void setSqlca(byte[] val) {

            sqlca.valueOf(val);

      }

      //@CobolSourceFile("DB2INC.COB",1,8)

      //01 GV-COMMON-AREA.

      private GvCommonArea gvCommonArea = new GvCommonArea();

      public byte[] getGvCommonArea() {

            return gvCommonArea.getBytes();

      }

      public void setGvCommonArea(byte[] val) {

            gvCommonArea.valueOf(val);

      }

      //*                                                          

      //*                                                                

      //*    EXEC SQL

      //*        INCLUDE "SQLCA.COB"

      //*    END-EXEC.

      //*   

      //*   

      //*****************************************************************

      //*                                                               *

      //*               S  Q  L  C  A                                   *

      //*  (This file in ANSI format.  Do NOT bse it).                  *

      //*                                                               *

      //* MODIFIED                                                      *

      //*   Clare      12/06/84 - Ch SQLCA to not be an EXTERNAL.       *

      //*****************************************************************

      //*                                                                

      //*    EXEC SQL

      //*        INCLUDE "DB2INC.COB"

      //*    END-EXEC.

      //*                                                                

      //*                                                                 

      //*  COPY "H1SYSPFX".                                              

      //*

      //* Created automatically by MsgGen

      //*   on : 26-Jun-1997 15:53:57

      //* Modified for MCI Phase 2 by Thomas Lobo

      //*   on : 26-Apr-1999 08:30:00

      //*

      //* Implements Message SYSPFX

      //* VB Class is QR_SysPrefix

      //*

      //* DO NOT EDIT !!!

      //*

      //@CobolSourceFile("BGE018Q.CBL",189,8)

      //01  HUB-MESSAGE-LINKAGE.

      private HubMessageLinkage hubMessageLinkage = new HubMessageLinkage();

      public byte[] getHubMessageLinkage() {

            return hubMessageLinkage.getBytes();

      }

      public void setHubMessageLinkage(byte[] val) {

            hubMessageLinkage.valueOf(val);

      }

      //@CobolSourceFile("BGE018Q.CPY",10,8)

      //78 BGE018Q-VER                       VALUE 2.

      public final int getBge018qVer() {

            return 2;

      }

      //@CobolSourceFile("BGE018Q.CPY",11,8)

      //78 BGE018Q-LEN                       VALUE 75.

      //@CobolSourceFile("BGE018Q.CPY",12,8)

      //78 BGE018Q-OCC                       VALUE 200.

      public final int getBge018qOcc() {

            return 200;

      }

      //@CobolSourceFile("BGE018R1.CPY",10,8)

      //78 BGE018R1-VER                      VALUE 3.

      public final int getBge018r1Ver() {

            return 3;

      }

      //@CobolSourceFile("BGE018R1.CPY",11,8)

      //78 BGE018R1-LEN                      VALUE 399.

      public final int getBge018r1Len() {

            return 399;

      }

      //@CobolSourceFile("BGE018R1.CPY",12,8)

      //78 BGE018R1-OCC                      VALUE 200.

      public static void main(String[] args) {

            Bge018q instance_ = new Bge018q();

            instance_.execute(); System.exit(0);

      }

      public void execute() {

            initialize();

            doCobolGotoStart();

      }

      Section __0000Main=new Section(this) {

            public CobolMethod run() {

            //*COPY "BGE018Q".

            //*

            //* Created automatically by MsgGen

            //*   on : 28/03/2002 4:12:28 PM

            //*

            //* Implements Message BGE018Q

            //* VB Class is BGE018Q

            //*

            //* DO NOT EDIT !!!

            //*

            //*COPY "BGE018R1".

            //*

            //* Created automatically by MsgGen

            //*   on : 28/03/2002 4:12:35 PM

            //*

            //* Implements Message BGE018R1

            //* VB Class is BGE018R1

            //*

            //* DO NOT EDIT !!!

            //*

            //*                                                                

            //*                                                                

            //*                                                                

            //*

            //*    MOVE 'BGE018Q-START'   TO GV-MSG.

            //*    CALL 'tslog' USING BY REFERENCE GV-TRACE.

            //*

            //@CobolSourceFile("BGE018Q.CBL",221,12)

            //PERFORM 1000-INITIALISE          

            doCobolPerform(__1000Initialise,null);

            //*

            //@CobolSourceFile("BGE018Q.CBL",223,12)

            //MOVE ZEROES TO SQL-RETURN-CODE         

            gvCommonArea.setSqlReturnCode(0);

            //*

            //@CobolSourceFile("BGE018Q.CBL",225,12)

            //EXEC SQL       

            //    WHENEVER SQLERROR DO         

            if (false) {

                  //@CobolSourceFile("BGE018Q.CBL",226,37)

                  //PERFORM 9000-SQL-ERROR-ROUTINE               

                  doCobolPerform(__9000SqlErrorRoutine,null);

            }

            //*

            //@CobolSourceFile("BGE018Q.CBL",229,12)

            //IF SYSPFX-VERSIONID NOT = BGE018Q-VER        

            //          ...END-IF        

            if(hubMessageLinkage.getSyspfxVersionid() != getBge018qVer()) {

                  //@CobolSourceFile("BGE018Q.CBL",230,16)

                  //MOVE 001000 TO SQLCODE                 

                  sqlca.setSqlcode(1000);

                  //@CobolSourceFile("BGE018Q.CBL",231,16)

                  //STRING "Incorrect Version of Message "             

                  //       "BGE018Q"                 

                  //       DELIMITED BY SIZE               

                  //       INTO SQLERRMC             

                  //@CobolSourceFile("BGE018Q.CBL",235,15)

                  //GO TO PROG-EXIT            

                  return progExit;

            }

            //*

            //*    PERFORM 7100-PREPARE-SQL.

            //*    PERFORM 7200-DECLARE-CURSOR.

            //*

            //@CobolSourceFile("BGE018Q.CBL",241,12)

            //PERFORM VARYING CT-QRY-PTR FROM 1 BY 1       

            //    UNTIL CT-QRY-PTR > GV-NBR-OF-QUESTIONS         

            //          ...END-PERFORM         

            for(wsCounters.setCtQryPtr(1);wsCounters.getCtQryPtr() <= wsGeneralVariables.getGvNbrOfQuestions();wsCounters.setCtQryPtr(wsCounters.getCtQryPtr()+1)) {

                  //*

                  //@CobolSourceFile("BGE018Q.CBL",244,16)

                  //PERFORM 6050-GET-QUESTION-DETAILS            

                  doCobolPerform(__6050GetQuestionDetails,null);

            }

            //*

            //@CobolSourceFile("BGE018Q.CBL",246,16)

            //IF SV-KEYVALUE < ZERO      

            //          ... ELSE         

            //          ...END-IF        

            if(wsSqlVariables.getSvKeyvalue() < 0) {

                  //@CobolSourceFile("BGE018Q.CBL",247,20)

                  //PERFORM 5000-DECLARE-CURSOR            

                  doCobolPerform(__5000DeclareCursor,null);

                  //@CobolSourceFile("BGE018Q.CBL",248,20)

                  //PERFORM 5100-OPEN-CURSOR               

                  doCobolPerform(__5100OpenCursor,null);

                  //@CobolSourceFile("BGE018Q.CBL",249,20)

                  //PERFORM 5200-FETCH-ROWS                

                  doCobolPerform(__5200FetchRows,null);

                  //@CobolSourceFile("BGE018Q.CBL",250,20)

                  //PERFORM 5300-CLOSE-CURSOR              

                  doCobolPerform(__5300CloseCursor,null);

            } else {

                  //@CobolSourceFile("BGE018Q.CBL",252,18)

                  //IF SV-WK-VIRTUALCOLNAME  <> SPACES                 

                  //                ...ELSE                

                  //                ...END-IF              

                  if(wsSqlVariables.getSvWkVirtualcolname().compareTo(" ") < 0) {

                        //@CobolSourceFile("BGE018Q.CBL",253,20)

                        //PERFORM 6100-PREPARE-SQL                     

                        doCobolPerform(__6100PrepareSql,null);

                        //@CobolSourceFile("BGE018Q.CBL",254,20)

                        //PERFORM 6200-DECLARE-CURSOR                  

                        doCobolPerform(__6200DeclareCursor,null);

                        //@CobolSourceFile("BGE018Q.CBL",255,20)

                        //PERFORM 6400-OPEN-CURSOR                     

                        doCobolPerform(__6400OpenCursor,null);

                        //@CobolSourceFile("BGE018Q.CBL",256,20)

                        //PERFORM 6500-FETCH-ROWS                      

                        doCobolPerform(__6500FetchRows,null);

                        //@CobolSourceFile("BGE018Q.CBL",257,20)

                        //PERFORM 6600-CLOSE-CURSOR                    

                        doCobolPerform(__6600CloseCursor,null);

                  } else {

                        //@CobolSourceFile("BGE018Q.CBL",259,20)

                        //PERFORM 7100-PREPARE-SQL                     

                        doCobolPerform(__7100PrepareSql,null);

                        //@CobolSourceFile("BGE018Q.CBL",260,20)

                        //PERFORM 7200-DECLARE-CURSOR                  

                        doCobolPerform(__7200DeclareCursor,null);

                        //@CobolSourceFile("BGE018Q.CBL",261,20)

                        //PERFORM 7400-OPEN-CURSOR                     

                        doCobolPerform(__7400OpenCursor,null);

                        //@CobolSourceFile("BGE018Q.CBL",262,20)

                        //PERFORM UNTIL NOT SQL-OK                     

                        //END-PERFORM                      

                        while(gvCommonArea.getSqlOk()) {

                              //@CobolSourceFile("BGE018Q.CBL",263,24)

                              //PERFORM 7500-FETCH-ROWS                            

                              doCobolPerform(__7500FetchRows,null);

                        };

                        //@CobolSourceFile("BGE018Q.CBL",265,20)

                        //PERFORM 7600-CLOSE-CURSOR                    

                        doCobolPerform(__7600CloseCursor,null);

                        //@CobolSourceFile("BGE018Q.CBL",266,20)

                        //SET SQL-OK TO TRUE                     

                  }

            }

            //*                                                                

            //*    SUBTRACT 1 FROM CT-MSG-PTR.                                  

            //@CobolSourceFile("BGE018Q.CBL",272,12)

            //MOVE CT-MSG-PTR TO SV-TOTAL-ROWS       

            wsSqlVariables.setSvTotalRows(wsCounters.getCtMsgPtr());

            doCobolPerform(progExit, null);

            return doCobolExit();

            }

      };

      Paragraph progExit=new Paragraph(this) {

            public CobolMethod run() {

            //*                                                                

            //*                                                                

            //@CobolSourceFile("BGE018Q.CBL",276,12)

            //MOVE SQLCODE       TO SYSPFX-ERRORCODE       

            hubMessageLinkage.setSyspfxErrorcode(sqlca.getSqlcode());

            //@CobolSourceFile("BGE018Q.CBL",277,12)

            //MOVE SQLERRMC      TO SYSPFX-ERRORMSG        

      hubMessageLinkage.setSyspfxErrormsg(HubMessageLinkage.syspfxErrormsgFmt_.format(sqlca.getSqlerrmc()));

            //@CobolSourceFile("BGE018Q.CBL",278,12)

            //MOVE ZEROES        TO SYSPFX-ERRORLOGID      

            hubMessageLinkage.setSyspfxErrorlogid(0);

            //@CobolSourceFile("BGE018Q.CBL",279,12)

            //MOVE BGE018R1-LEN  TO SYSPFX-ROWLEN          

            hubMessageLinkage.setSyspfxRowlen(getBge018r1Len());

            //@CobolSourceFile("BGE018Q.CBL",280,12)

            //MOVE CT-MSG-PTR    TO SYSPFX-ROWCOUNT        

            hubMessageLinkage.setSyspfxRowcount(wsCounters.getCtMsgPtr());

            //@CobolSourceFile("BGE018Q.CBL",281,12)

            //MOVE SV-TOTAL-ROWS TO SYSPFX-ROWTOTAL        

            hubMessageLinkage.setSyspfxRowtotal(wsSqlVariables.getSvTotalRows());

            //@CobolSourceFile("BGE018Q.CBL",282,12)

            //MOVE BGE018R1-VER  TO SYSPFX-VERSIONID       

            hubMessageLinkage.setSyspfxVersionid(getBge018r1Ver());

            //*

            //*    MOVE 'BGE018Q-END'   TO GV-MSG.

            //*    CALL 'tslog' USING BY REFERENCE GV-TRACE.

            //*                                                                

            //@CobolSourceFile("BGE018Q.CBL",287,12)

            //GOBACK         

            return doCobolExit();

            }

      };

      Section __1000Initialise=new Section(this) {

            public CobolMethod run() {

            //*                                                                

            //*                                                                

            //*                                                                 

            //@CobolSourceFile("BGE018Q.CBL",292,12)

            //INITIALIZE           

            //           WS-COUNTERS           

            //           WS-GENERAL-VARIABLES        

            //           WS-SQL-VARIABLES      

            //*               WS-FLAGS                                          

            //*                                                                

            //*----------------------------------------------------------------

            //*  Both Q and R1 messages redefine HUB-MESSAGE-BUFFER so,

            //*  let's store all questions in Working Storage before

            //*  they get overwritten by our answers:

            //*----------------------------------------------------------------

            //*

            //@CobolSourceFile("BGE018Q.CBL",304,12)

            //PERFORM VARYING CT-QRY-PTR FROM 1 BY 1       

            //    UNTIL CT-QRY-PTR > BGE018Q-OCC           

            //       OR F-PFCODE OF BGE018Q-REC (CT-QRY-PTR) = SPACES        

            //          ...END-PERFORM         

            for(wsCounters.setCtQryPtr(1);wsCounters.getCtQryPtr() <= getBge018qOcc() && hubMessageLinkage.getFPfcode(wsCounters.getCtQryPtr()).compareTo(" ") !=0;wsCounters.setCtQryPtr(wsCounters.getCtQryPtr()+1)) {

                  //@CobolSourceFile("BGE018Q.CBL",307,15)

                  //MOVE F-PFCODE         OF BGE018Q-REC (CT-QRY-PTR)              

                  //  TO GV-PFCODE           (CT-QRY-PTR)              

            wsGeneralVariables.setGvPfcode(WsGeneralVariables.gvPfcodeFmt_.format(hubMessageLinkage.getFPfcode(wsCounters.getCtQryPtr())),wsCounters.getCtQryPtr());

                  //@CobolSourceFile("BGE018Q.CBL",309,15)

                  //MOVE F-KEYVALUE       OF BGE018Q-REC (CT-QRY-PTR)              

                  //  TO GV-KEYVALUE         (CT-QRY-PTR)              

                  wsGeneralVariables.setGvKeyvalue((int) hubMessageLinkage.getFKeyvalue(wsCounters.getCtQryPtr()),wsCounters.getCtQryPtr());

                  //@CobolSourceFile("BGE018Q.CBL",311,15)

                  //MOVE F-KEYVALUE       OF BGE018Q-REC (1)                 

                  //  TO SV-KEYVALUE                 

                  wsSqlVariables.setSvKeyvalue((int) hubMessageLinkage.getFKeyvalue(1));

                  //@CobolSourceFile("BGE018Q.CBL",313,15)

                  //MOVE GV-KEYVALUE         (CT-QRY-PTR)              

                  //  TO GV-KEYVALUE-X       (CT-QRY-PTR)              

                  wsGeneralVariables.setGvKeyvalueX(new String(WsGeneralVariables.gvKeyvalueXFmt_.format(WsGeneralVariables.gvKeyvalueFmt_.format(wsGeneralVariables.getGvKeyvalue(wsCounters.getCtQryPtr())))),wsCounters.getCtQryPtr());

                  //@CobolSourceFile("BGE018Q.CBL",315,15)

                  //INSPECT GV-KEYVALUE-X    (CT-QRY-PTR)              

                  //     REPLACING LEADING ZEROES BY SPACES            

                  //@CobolSourceFile("BGE018Q.CBL",317,15)

                  //MOVE F-PROPERTYKEY    OF BGE018Q-REC (CT-QRY-PTR)              

                  //  TO GV-PROPERTYKEY      (CT-QRY-PTR)              

            wsGeneralVariables.setGvPropertykey(WsGeneralVariables.gvPropertykeyFmt_.format(hubMessageLinkage.getFPropertykey(wsCounters.getCtQryPtr())),wsCounters.getCtQryPtr());

                  //@CobolSourceFile("BGE018Q.CBL",319,15)

                  //MOVE F-VIRTUALCOLNAME OF BGE018Q-REC (CT-QRY-PTR)              

                  //  TO GV-VIRTUALCOLNAME   (CT-QRY-PTR)              

            wsGeneralVariables.setGvVirtualcolname(WsGeneralVariables.gvVirtualcolnameFmt_.format(hubMessageLinkage.getFVirtualcolname(wsCounters.getCtQryPtr())),wsCounters.getCtQryPtr());

                  //@CobolSourceFile("BGE018Q.CBL",321,15)

                  //MOVE F-DATATYPE       OF BGE018Q-REC (CT-QRY-PTR)              

                  //  TO GV-DATATYPE         (CT-QRY-PTR)              

            wsGeneralVariables.setGvDatatype(WsGeneralVariables.gvDatatypeFmt_.format(hubMessageLinkage.getFDatatype(wsCounters.getCtQryPtr())),wsCounters.getCtQryPtr());

            }

            //*

            //@CobolSourceFile("BGE018Q.CBL",325,12)

            //COMPUTE GV-NBR-OF-QUESTIONS = CT-QRY-PTR - 1       

            wsGeneralVariables.setGvNbrOfQuestions(wsCounters.getCtQryPtr()-1);

            //*                                                                 

            //@CobolSourceFile("BGE018Q.CBL",327,12)

            //IF GV-PFCODE (1) <> SPACES       

            //END-IF         

            if(wsGeneralVariables.getGvPfcode(1).compareTo(" ") !=0) {

                  //@CobolSourceFile("BGE018Q.CBL",328,16)

                  //PERFORM 1100-GET-FKCOLNAME             

                  doCobolPerform(__1100GetFkcolname,null);

            }

            return doCobolExit();

            }

      };

      Section __1100GetFkcolname=new Section(this) {

            public CobolMethod run() {

            //*

            //*

            //*

            //@CobolSourceFile("BGE018Q.CBL",334,12)

            //MOVE GV-PFCODE (1)  TO SV-WK-PFCODE          

      wsSqlVariables.setSvWkPfcode(WsSqlVariables.svWkPfcodeFmt_.format(wsGeneralVariables.getGvPfcode(1)));

            //*

            //@CobolSourceFile("BGE018Q.CBL",336,12)

            //EXEC SQL       

            //    SELECT  TABLENAME      

            //           ,IDCOLNAME      

            //           ,FKCOLNAME      

            //           ,OBJECTTABLENAME      

            //    INTO    :SV-PF-TABLENAME:SV-PF-IND-TABLENAME         

            //           ,:SV-PF-IDCOLNAME:SV-PF-IND-IDCOLNAME         

            //           ,:SV-PF-FKCOLNAME:SV-PF-IND-FKCOLNAME         

            //           ,:SV-PF-OBJECTTABLENAME:SV-PF-IND-OBJECTTABLENAME         

            //    FROM    PROPERTYFUNCTION           

            //    WHERE   PFCODE  =   :SV-WK-PFCODE        

            dao.execSqlStatement1(wsSqlVariables.getSvWkPfcode());

            //*

            //@CobolSourceFile("BGE018Q.CBL",349,12)

            //MOVE SQLCODE TO SQL-RETURN-CODE        

            gvCommonArea.setSqlReturnCode(sqlca.getSqlcode());

            return doCobolExit();

            }

      };

      Section __2000LoadMessage=new Section(this) {

            public CobolMethod run() {

            //*                                                                 

            //*                                                                

            //@CobolSourceFile("BGE018Q.CBL",353,12)

            //MOVE SV-IDCOLVALUE           TO F-IDCOLVALUE       

            //                             OF BGE018R1-REC (CT-MSG-PTR)      

        hubMessageLinkage.setFIdcolvalue(wsSqlVariables.getSvIdcolvalue(),wsCounters.getCtMsgPtr());

            //*    MOVE SV-PROPERTYKEY          TO F-PROPERTYKEY               

            //*                                 OF BGE018R1-REC (CT-MSG-PTR).  

            //@CobolSourceFile("BGE018Q.CBL",357,12)

            //MOVE SV-WK-PROPERTYKEY       TO F-PROPERTYKEY      

            //                             OF BGE018R1-REC (CT-MSG-PTR)      

      hubMessageLinkage.setFPropertykey2(HubMessageLinkage.fPropertykey1Fmt_.format(wsSqlVariables.getSvWkPropertykey()),wsCounters.getCtMsgPtr());

            //@CobolSourceFile("BGE018Q.CBL",359,12)

            //IF SV-IND-PROPVALCHAR < ZERO           

            //          ...ELSE          

            //          ...END-IF        

            if(wsSqlVariables.getSvIndPropvalchar() < 0) {

                  //@CobolSourceFile("BGE018Q.CBL",360,15)

                  //MOVE SPACES               TO F-PROPVALCHAR               

                  //                          OF BGE018R1-REC (CT-MSG-PTR)               

                  hubMessageLinkage.setFPropvalchar(HubMessageLinkage.fPropvalcharFmt_.format(" "),wsCounters.getCtMsgPtr());

            } else {

                  //@CobolSourceFile("BGE018Q.CBL",363,15)

                  //MOVE SV-PROPVALCHAR              

                  //                          TO F-PROPVALCHAR               

                  //                          OF BGE018R1-REC (CT-MSG-PTR)               

            hubMessageLinkage.setFPropvalchar(HubMessageLinkage.fPropvalcharFmt_.format(wsSqlVariables.getSvPropvalchar()),wsCounters.getCtMsgPtr());

            }

            //@CobolSourceFile("BGE018Q.CBL",367,12)

            //IF SV-IND-PROPVALDATE < ZERO           

            //          ...ELSE          

            //          ...END-IF        

            if(wsSqlVariables.getSvIndPropvaldate() < 0) {

                  //@CobolSourceFile("BGE018Q.CBL",368,15)

                  //MOVE SPACES               TO F-PROPVALDATE               

                  //                          OF BGE018R1-REC (CT-MSG-PTR)               

                  hubMessageLinkage.setFPropvaldate(HubMessageLinkage.fPropvaldateFmt_.format(" "),wsCounters.getCtMsgPtr());

            } else {

                  //@CobolSourceFile("BGE018Q.CBL",371,15)

                  //MOVE SV-PROPVALDATE              

                  //                          TO F-PROPVALDATE               

                  //                          OF BGE018R1-REC (CT-MSG-PTR)               

            hubMessageLinkage.setFPropvaldate(HubMessageLinkage.fPropvaldateFmt_.format(wsSqlVariables.getSvPropvaldate()),wsCounters.getCtMsgPtr());

            }

            //@CobolSourceFile("BGE018Q.CBL",375,12)

            //IF SV-WK-DATATYPE            = 'N'           

            //          ...END-IF        

            if(wsSqlVariables.getSvWkDatatype().compareTo("N") == 0) {

                  //@CobolSourceFile("BGE018Q.CBL",376,15)

                  //IF SV-TN-IND-PROPVALNUMBER < 0               

                  //                ...ELSE                

                  //                ...END-IF              

                  if(wsSqlVariables.getSvTnIndPropvalnumber() < 0) {

                        //@CobolSourceFile("BGE018Q.CBL",377,18)

                        //MOVE 'Y'               TO F-NULLFLG                      

                        //                       OF BGE018R1-REC (CT-MSG-PTR)                  

                  hubMessageLinkage.setFNullflg(HubMessageLinkage.fNullflgFmt_.format("Y"),wsCounters.getCtMsgPtr());

                  } else {

                        //@CobolSourceFile("BGE018Q.CBL",380,18)

                        //MOVE 'N'               TO F-NULLFLG                      

                        //                       OF BGE018R1-REC (CT-MSG-PTR)                  

                  hubMessageLinkage.setFNullflg(HubMessageLinkage.fNullflgFmt_.format("N"),wsCounters.getCtMsgPtr());

                  }

            }

            //@CobolSourceFile("BGE018Q.CBL",384,12)

            //IF SV-IND-PROPVALNUMBER < ZERO         

            //          ...ELSE          

            //          ...END-IF        

            if(wsSqlVariables.getSvIndPropvalnumber() < 0) {

                  //@CobolSourceFile("BGE018Q.CBL",385,15)

                  //MOVE ZERO                 TO F-PROPVALNUMBER             

                  //                          OF BGE018R1-REC (CT-MSG-PTR)               

                  hubMessageLinkage.setFPropvalnumber(new BigDecimal(0),wsCounters.getCtMsgPtr());

            } else {

                  //@CobolSourceFile("BGE018Q.CBL",388,15)

                  //MOVE SV-PROPVALNUMBER            

                  //                          TO F-PROPVALNUMBER             

                  //                          OF BGE018R1-REC (CT-MSG-PTR)               

            hubMessageLinkage.setFPropvalnumber(wsSqlVariables.getSvPropvalnumber(),wsCounters.getCtMsgPtr());

            }

            //@CobolSourceFile("BGE018Q.CBL",392,12)

            //IF SV-IND-DATESTART < ZERO       

            //          ...ELSE          

            //          ...END-IF        

            if(wsSqlVariables.getSvIndDatestart() < 0) {

                  //@CobolSourceFile("BGE018Q.CBL",393,15)

                  //MOVE SPACES               TO F-DATESTART                 

                  //                          OF BGE018R1-REC (CT-MSG-PTR)               

                  hubMessageLinkage.setFDatestart(HubMessageLinkage.fDatestartFmt_.format(" "),wsCounters.getCtMsgPtr());

            } else {

                  //@CobolSourceFile("BGE018Q.CBL",396,15)

                  //MOVE SV-DATESTART                

                  //                          TO F-DATESTART                 

                  //                          OF BGE018R1-REC (CT-MSG-PTR)               

            hubMessageLinkage.setFDatestart(HubMessageLinkage.fDatestartFmt_.format(wsSqlVariables.getSvDatestart()),wsCounters.getCtMsgPtr());

            }

            //@CobolSourceFile("BGE018Q.CBL",400,12)

            //IF SV-IND-DATEEND < ZERO         

            //          ...ELSE          

            //          ...END-IF        

            if(wsSqlVariables.getSvIndDateend() < 0) {

                  //@CobolSourceFile("BGE018Q.CBL",401,15)

                  //MOVE SPACES               TO F-DATEEND             

                  //                          OF BGE018R1-REC (CT-MSG-PTR)               

                  hubMessageLinkage.setFDateend(HubMessageLinkage.fDateendFmt_.format(" "),wsCounters.getCtMsgPtr());

            } else {

                  //@CobolSourceFile("BGE018Q.CBL",404,15)

                  //MOVE SV-DATEEND            

                  //                          TO F-DATEEND             

                  //                          OF BGE018R1-REC (CT-MSG-PTR)               

            hubMessageLinkage.setFDateend(HubMessageLinkage.fDateendFmt_.format(wsSqlVariables.getSvDateend()),wsCounters.getCtMsgPtr());

            }

            //@CobolSourceFile("BGE018Q.CBL",408,12)

            //MOVE SV-RowID                TO F-RowID      

            //                             OF BGE018R1-REC (CT-MSG-PTR)      

      hubMessageLinkage.setFRowid(HubMessageLinkage.fRowidFmt_.format(wsSqlVariables.getSvRowid()),wsCounters.getCtMsgPtr());

            //@CobolSourceFile("BGE018Q.CBL",410,12)

            //MOVE SV-ROWVERSION           TO F-ROWVERSION       

            //                             OF BGE018R1-REC (CT-MSG-PTR)      

      hubMessageLinkage.setFRowversion(HubMessageLinkage.fRowversionFmt_.format(wsSqlVariables.getSvRowversion()),wsCounters.getCtMsgPtr());

            //@CobolSourceFile("BGE018Q.CBL",412,12)

            //MOVE SV-WK-VIRTUALCOLNAME    TO F-VIRTUALCOLNAME         

            //                             OF BGE018R1-REC (CT-MSG-PTR)      

      hubMessageLinkage.setFVirtualcolname4(HubMessageLinkage.fVirtualcolname3Fmt_.format(wsSqlVariables.getSvWkVirtualcolname()),wsCounters.getCtMsgPtr());

            return doCobolExit();

            }

      };

      Section __5000DeclareCursor=new Section(this) {

            public CobolMethod run() {

            //*

            //*

            //@CobolSourceFile("BGE018Q.CBL",417,13)

            //EXEC SQL       

            //   DECLARE SQL1 CURSOR FOR       

            //           SELECT    DFLTVALUE         

            //             FROM PROPERTYSETMBR PSM         

            //             WHERE PSM.PSID =  -( :SV-KEYVALUE )         

            //              AND PSM.PROPERTYKEY = :SV-WK-PROPERTYKEY         

            //              AND USERREADFLG = 'Y'          

          dao.execSqlStatement2(wsSqlVariables.getSvKeyvalue(),wsSqlVariables.getSvWkPropertykey());

            return doCobolExit();

            }

      };

      Section __5100OpenCursor=new Section(this) {

            public CobolMethod run() {

            //*

            //*

            //@CobolSourceFile("BGE018Q.CBL",428,12)

            //EXEC SQL       

            //    OPEN SQL1        

            dao.execSqlStatement3();

            return doCobolExit();

            }

      };

      Section __5200FetchRows=new Section(this) {

            public CobolMethod run() {

            //*

            //*

            //@CobolSourceFile("BGE018Q.CBL",434,16)

            //MOVE SPACES TO  SV-DFLTVALUE           

            wsSqlVariables.setSvDfltvalue(WsSqlVariables.svDfltvalueFmt_.format(" "));

            //@CobolSourceFile("BGE018Q.CBL",435,16)

            //MOVE ZERO TO  SV-IND-DFLTVALUE         

            wsSqlVariables.setSvIndDfltvalue(0);

            //@CobolSourceFile("BGE018Q.CBL",436,16)

            //EXEC SQL       

            //    FETCH SQL1       

            //    INTO :SV-DFLTVALUE:SV-IND-DFLTVALUE      

            try {

                  dao.execSqlStatement4();

                  if(dao.resultExists()) {

                        wsSqlVariables.setSvDfltvalue(dao.getResult().getString(1));

                        if(wsSqlVariables.getSvDfltvalue()==null) wsSqlVariables.setSvIndDfltvalue(-1);

                        else wsSqlVariables.setSvIndDfltvalue(0);

                  }

            } catch(Exception e) {

                  e.printStackTrace();

            }

            //*

            //@CobolSourceFile("BGE018Q.CBL",441,12)

            //MOVE SQLCODE TO SQL-RETURN-CODE        

            gvCommonArea.setSqlReturnCode(sqlca.getSqlcode());

            //@CobolSourceFile("BGE018Q.CBL",442,12)

            //IF SQL-NOT-FOUND           

            //          ...END-IF        

            if(gvCommonArea.getSqlNotFound()) {

                  //@CobolSourceFile("BGE018Q.CBL",443,17)

                  //MOVE ZEROS TO SQL-RETURN-CODE                

                  gvCommonArea.setSqlReturnCode(0);

                  //@CobolSourceFile("BGE018Q.CBL",444,17)

                  //MOVE ZEROS TO SQLCODE            

                  sqlca.setSqlcode(0);

                  //@CobolSourceFile("BGE018Q.CBL",445,17)

                  //MOVE SQLCODE TO SQL-RETURN-CODE              

                  gvCommonArea.setSqlReturnCode(sqlca.getSqlcode());

                  //@CobolSourceFile("BGE018Q.CBL",446,17)

                  //MOVE -1 TO SV-IND-DFLTVALUE            

                  wsSqlVariables.setSvIndDfltvalue(-1);

            }

            //*

            //@CobolSourceFile("BGE018Q.CBL",449,12)

            //IF SQL-OK      

            //          ...END-IF        

            if(gvCommonArea.getSqlOk()) {

                  //@CobolSourceFile("BGE018Q.CBL",450,16)

                  //EVALUATE SV-WK-DATATYPE                

                  //WHEN "C"             

                  //                ...WHEN "D"            

                  //                ...WHEN "N"            

                  //                ...END-EVALUATE              

                  //@CobolSourceFile("BGE018Q.CBL",452,20)

                  //IF SV-IND-DFLTVALUE < 0                

                  //                ...ELSE                

                  //                ...END-IF              

                  if(wsSqlVariables.getSvIndDfltvalue() < 0) {

                        //@CobolSourceFile("BGE018Q.CBL",453,23)

                        //MOVE -1 TO SV-IND-PROPVALCHAR                      

                        wsSqlVariables.setSvIndPropvalchar(-1);

                        //@CobolSourceFile("BGE018Q.CBL",454,23)

                        //MOVE SPACES              TO SV-PROPVALCHAR                     

                        wsSqlVariables.setSvPropvalchar(WsSqlVariables.svPropvalcharFmt_.format(" "));

                  } else {

                        //@CobolSourceFile("BGE018Q.CBL",456,23)

                        //IF SV-DFLTVALUE(1:1) = '='                   

                        //                      ...ELSE                      

                        //END-IF                     

                        if(wsSqlVariables.getSvDfltvalue().substring(1-1,1-1+1).compareTo("=") == 0) {

                              //@CobolSourceFile("BGE018Q.CBL",457,27)

                              //INSPECT SV-DFLTVALUE                         

                              //   REPLACING FIRST '=' BY SPACE                          

                              //@CobolSourceFile("BGE018Q.CBL",459,27)

                              //EXEC SQL                         

                              //  SELECT :SV-DFLTVALUE                             

                              //  INTO :SV-PROPVALDATE                             

                              //  FROM DUAL                            

                              dao.execSqlStatement5(wsSqlVariables.getSvDfltvalue());

                        } else {

                              //@CobolSourceFile("BGE018Q.CBL",465,27)

                              //MOVE SV-DFLTVALUE        TO SV-PROPVALCHAR                           

                        wsSqlVariables.setSvPropvalchar(WsSqlVariables.svPropvalcharFmt_.format(wsSqlVariables.getSvDfltvalue()));

                        }

                        //@CobolSourceFile("BGE018Q.CBL",467,23)

                        //MOVE ZEROES              TO SV-IND-PROPVALCHAR                       

                        wsSqlVariables.setSvIndPropvalchar(0);

                  }

                  //@CobolSourceFile("BGE018Q.CBL",470,20)

                  //IF SV-IND-DFLTVALUE < 0                

                  //                ...ELSE                

                  //                ...END-IF              

                  if(wsSqlVariables.getSvIndDfltvalue() < 0) {

                        //@CobolSourceFile("BGE018Q.CBL",471,23)

                        //MOVE -1 TO SV-IND-PROPVALDATE                      

                        wsSqlVariables.setSvIndPropvaldate(-1);

                        //@CobolSourceFile("BGE018Q.CBL",472,23)

                        //MOVE SPACES              TO SV-PROPVALDATE                     

                        wsSqlVariables.setSvPropvaldate(WsSqlVariables.svPropvaldateFmt_.format(" "));

                  } else {

                        //@CobolSourceFile("BGE018Q.CBL",474,23)

                        //IF SV-DFLTVALUE(1:1) = '='                   

                        //                      ...ELSE                      

                        //END-IF                     

                        if(wsSqlVariables.getSvDfltvalue().substring(1-1,1-1+1).compareTo("=") == 0) {

                              //@CobolSourceFile("BGE018Q.CBL",475,27)

                              //INSPECT SV-DFLTVALUE                         

                              //   REPLACING FIRST '=' BY SPACE                          

                              //@CobolSourceFile("BGE018Q.CBL",477,27)

                              //EXEC SQL                         

                              //  SELECT :SV-DFLTVALUE                             

                              //  INTO :SV-PROPVALDATE                             

                              //  FROM DUAL                            

                              dao.execSqlStatement6(wsSqlVariables.getSvDfltvalue());

                        } else {

                              //@CobolSourceFile("BGE018Q.CBL",483,27)

                              //MOVE SV-DFLTVALUE TO SV-PROPVALDATE                            

                        wsSqlVariables.setSvPropvaldate(WsSqlVariables.svPropvaldateFmt_.format(wsSqlVariables.getSvDfltvalue()));

                        }

                        //@CobolSourceFile("BGE018Q.CBL",485,23)

                        //MOVE ZEROES              TO SV-IND-PROPVALDATE                       

                        wsSqlVariables.setSvIndPropvaldate(0);

                  }

                  //@CobolSourceFile("BGE018Q.CBL",488,20)

                  //IF SV-IND-DFLTVALUE < 0                

                  //                ...ELSE                

                  //                ...END-IF              

                  if(wsSqlVariables.getSvIndDfltvalue() < 0) {

                        //@CobolSourceFile("BGE018Q.CBL",489,23)

                        //MOVE -1 TO SV-IND-PROPVALNUMBER                    

                        wsSqlVariables.setSvIndPropvalnumber(-1);

                        //@CobolSourceFile("BGE018Q.CBL",490,23)

                        //MOVE ZEROES              TO SV-PROPVALNUMBER                   

                        wsSqlVariables.setSvPropvalnumber(new BigDecimal(0));

                  } else {

                        //@CobolSourceFile("BGE018Q.CBL",492,23)

                        //IF SV-DFLTVALUE(1:1) = '='                   

                        //                      ... ELSE                     

                        //                      ...END-IF                    

                        if(wsSqlVariables.getSvDfltvalue().substring(1-1,1-1+1).compareTo("=") == 0) {

                              //@CobolSourceFile("BGE018Q.CBL",493,27)

                              //MOVE 0      TO L5                            

                              wsGeneralVariables.setL5(0);

                              //@CobolSourceFile("BGE018Q.CBL",494,27)

                              //INSPECT SV-DFLTVALUE  TALLYING L5                        

                              //  FOR CHARACTERS BEFORE INITIAL "  "                           

                              wsGeneralVariables.setL5(new CobolString(wsSqlVariables.getSvDfltvalue()).before("  ").tally().count()+wsGeneralVariables.getL5());

                              //@CobolSourceFile("BGE018Q.CBL",496,27)

                              //INSPECT SV-DFLTVALUE                         

                              //  REPLACING FIRST '=' BY SPACE                           

                              //*

                              //@CobolSourceFile("BGE018Q.CBL",499,27)

                              //STRING                           

                              //  "SELECT TO_NUMBER("  DELIMITED BY SIZE                             

                              //  SV-DFLTVALUE(1:L5)                         

                              //  ") FROM DUAL"                        

                              //  DELIMITED BY SIZE                          

                              //  INTO SV-TMP-DFLTVALUE                            

                              //END-STRING                             

                              //*

                              //@CobolSourceFile("BGE018Q.CBL",507,27)

                              //EXEC SQL                         

                              //    PREPARE S3 FROM :SV-TMP-DFLTVALUE                          

                              prepareDynStatement("S3",wsSqlVariables.getSvTmpDfltvalue());

                              //*    

                              //@CobolSourceFile("BGE018Q.CBL",511,27)

                              //EXEC SQL                         

                              //    DECLARE DFT3 CURSOR FOR S3                           

                              declareDynamicCursor("DFT3","S3");

                              //*    

                              //@CobolSourceFile("BGE018Q.CBL",515,27)

                              //EXEC SQL                         

                              //    OPEN DFT3                          

                              dao.execSqlStatement7();

                              //*                                                                

                              //@CobolSourceFile("BGE018Q.CBL",519,27)

                              //EXEC SQL                         

                              //    FETCH DFT3 INTO                          

                              //       :SV-PROPVALNUMBER                           

                              try {

                                    dao.execSqlStatement8();

                                    if(dao.resultExists()) {

                                          wsSqlVariables.setSvPropvalnumber(dao.getResult().getBigDecimal(1));

                                    }

                              } catch(Exception e) {

                                    e.printStackTrace();

                              }

                              //*

                              //@CobolSourceFile("BGE018Q.CBL",524,27)

                              //EXEC SQL                         

                              //    CLOSE DFT3                         

                        } else {

                              //*

                              //@CobolSourceFile("BGE018Q.CBL",529,25)

                              //EXEC SQL                         

                              //  SELECT TO_NUMBER(:SV-DFLTVALUE)                        

                              //  INTO :SV-PROPVALNUMBER                           

                              //  FROM DUAL                            

                              dao.execSqlStatement9(wsSqlVariables.getSvDfltvalue());

                        }

                        //@CobolSourceFile("BGE018Q.CBL",535,23)

                        //MOVE ZEROES              TO SV-IND-PROPVALNUMBER                     

                        wsSqlVariables.setSvIndPropvalnumber(0);

                  }

                  //@CobolSourceFile("BGE018Q.CBL",538,16)

                  //MOVE SPACES             TO SV-ROWID                

                  wsSqlVariables.setSvRowid(WsSqlVariables.svRowidFmt_.format(" "));

                  //@CobolSourceFile("BGE018Q.CBL",539,16)

                  //MOVE SPACES        TO SV-ROWVERSION                

                  wsSqlVariables.setSvRowversion(WsSqlVariables.svRowversionFmt_.format(" "));

            }

            //*

            //@CobolSourceFile("BGE018Q.CBL",542,12)

            //IF SQL-OK AND NOT SQL-NOT-FOUND        

            //          ...END-IF        

            if(gvCommonArea.getSqlOk() && !gvCommonArea.getSqlNotFound()) {

                  //@CobolSourceFile("BGE018Q.CBL",543,16)

                  //ADD 1 TO CT-MSG-PTR              

                  wsCounters.setCtMsgPtr(1 + wsCounters.getCtMsgPtr());

                  //@CobolSourceFile("BGE018Q.CBL",544,16)

                  //PERFORM 2000-LOAD-MESSAGE              

                  doCobolPerform(__2000LoadMessage,null);

            }

            return doCobolExit();

            }

      };

      Section __5300CloseCursor=new Section(this) {

            public CobolMethod run() {

            //*

            //*

            //*

            //@CobolSourceFile("BGE018Q.CBL",550,12)

            //EXEC SQL       

            //    CLOSE SQL1       

            return doCobolExit();

            }

      };

      Section __6050GetQuestionDetails=new Section(this) {

            public CobolMethod run() {

            //*

            //*

            //*

            //@CobolSourceFile("BGE018Q.CBL",557,12)

            //MOVE "Y" TO FL-FIRSTTIME         

            wsFlags.setFlFirsttime(WsFlags.flFirsttimeFmt_.format("Y"));

            //@CobolSourceFile("BGE018Q.CBL",558,12)

            //MOVE GV-PFCODE         (CT-QRY-PTR) TO SV-WK-PFCODE      

      wsSqlVariables.setSvWkPfcode(WsSqlVariables.svWkPfcodeFmt_.format(wsGeneralVariables.getGvPfcode(wsCounters.getCtQryPtr())));

            //@CobolSourceFile("BGE018Q.CBL",559,12)

            //MOVE GV-KEYVALUE       (CT-QRY-PTR) TO SV-WK-KEYVALUE          

            //                                       GV-KEYVALUE-TEMP        

         wsSqlVariables.setSvWkKeyvalue(wsGeneralVariables.getGvKeyvalue(wsCounters.getCtQryPtr()));

      wsGeneralVariables.setGvKeyvalueTemp(wsGeneralVariables.getGvKeyvalue(wsCounters.getCtQryPtr()));

            //@CobolSourceFile("BGE018Q.CBL",561,12)

            //MOVE GV-KEYVALUE-X     (CT-QRY-PTR) TO SV-WK-KEYVALUE-X        

      wsSqlVariables.setSvWkKeyvalueX(WsSqlVariables.svWkKeyvalueXFmt_.format(wsGeneralVariables.getGvKeyvalueX(wsCounters.getCtQryPtr())));

            //@CobolSourceFile("BGE018Q.CBL",562,12)

            //MOVE GV-PROPERTYKEY    (CT-QRY-PTR) TO SV-WK-PROPERTYKEY       

      wsSqlVariables.setSvWkPropertykey(WsSqlVariables.svWkPropertykeyFmt_.format(wsGeneralVariables.getGvPropertykey(wsCounters.getCtQryPtr())));

            //@CobolSourceFile("BGE018Q.CBL",563,12)

            //MOVE GV-VIRTUALCOLNAME (CT-QRY-PTR) TO SV-WK-VIRTUALCOLNAME          

      wsSqlVariables.setSvWkVirtualcolname(WsSqlVariables.svWkVirtualcolnameFmt_.format(wsGeneralVariables.getGvVirtualcolname(wsCounters.getCtQryPtr())));

            //@CobolSourceFile("BGE018Q.CBL",564,12)

            //MOVE GV-DATATYPE       (CT-QRY-PTR) TO SV-WK-DATATYPE          

      wsSqlVariables.setSvWkDatatype(WsSqlVariables.svWkDatatypeFmt_.format(wsGeneralVariables.getGvDatatype(wsCounters.getCtQryPtr())));

            return doCobolExit();

            }

      };

      Section __6100PrepareSql=new Section(this) {

            public CobolMethod run() {

            //*

            //*    MOVE '6100-START'   TO GV-MSG.

            //*    CALL 'tslog' USING BY REFERENCE GV-TRACE.

            //*

            //@CobolSourceFile("BGE018Q.CBL",570,12)

            //MOVE 01     TO SV-SQL-LEN        

            wsSqlVariables.setSvSqlLen(1);

            //@CobolSourceFile("BGE018Q.CBL",571,12)

            //MOVE 0      TO L1          

            wsGeneralVariables.setL1(0);

            //@CobolSourceFile("BGE018Q.CBL",572,12)

            //MOVE 0      TO L2          

            wsGeneralVariables.setL2(0);

            //@CobolSourceFile("BGE018Q.CBL",573,12)

            //MOVE 0      TO L3          

            wsGeneralVariables.setL3(0);

            //@CobolSourceFile("BGE018Q.CBL",574,12)

            //MOVE SPACES TO SV-SQL-STMT-6000        

            wsSqlVariables.setSvSqlStmt6000(WsSqlVariables.svSqlStmt6000Fmt_.format(" "));

            //*

            //@CobolSourceFile("BGE018Q.CBL",576,12)

            //INSPECT SV-WK-VIRTUALCOLNAME     TALLYING L1       

            //    FOR CHARACTERS BEFORE INITIAL SPACE      

            wsGeneralVariables.setL1(new CobolString(wsSqlVariables.getSvWkVirtualcolname()).before(" ").tally().count()+wsGeneralVariables.getL1());

            //@CobolSourceFile("BGE018Q.CBL",578,12)

            //INSPECT SV-PF-OBJECTTABLENAME TALLYING L2          

            //    FOR CHARACTERS BEFORE INITIAL SPACE      

            wsGeneralVariables.setL2(new CobolString(wsSqlVariables.getSvPfObjecttablename()).before(" ").tally().count()+wsGeneralVariables.getL2());

            //@CobolSourceFile("BGE018Q.CBL",580,12)

            //INSPECT SV-PF-FKCOLNAME       TALLYING L3          

            //    FOR CHARACTERS BEFORE INITIAL SPACE      

            wsGeneralVariables.setL3(new CobolString(wsSqlVariables.getSvPfFkcolname()).before(" ").tally().count()+wsGeneralVariables.getL3());

            //*

            //*----------------------------------------------------------------

            //* VirtualColName <> SPACES

            //*----------------------------------------------------------------

            //@CobolSourceFile("BGE018Q.CBL",586,12)

            //STRING         

            //    "SELECT " SV-WK-VIRTUALCOLNAME     (1:L1)  " "       

            //            ", ROWID "           

            //            ", ROWVERSION "      

            //    "FROM "   SV-PF-OBJECTTABLENAME (1:L2)  " "          

            //    "WHERE "  SV-PF-FKCOLNAME       (1:L3)  " = "        

            //                        GV-KEYVALUE-TEMP    " "          

            //    DELIMITED BY SIZE      

            //    INTO SV-SQL-STMT-6000        

            //    WITH POINTER SV-SQL-LEN      

            //END-STRING           

            //*

            //*

            //*

            //@CobolSourceFile("BGE018Q.CBL",600,12)

            //EXEC SQL       

            //    PREPARE S6000 FROM :SV-SQL-STMT-6000           

            prepareDynStatement("S6000",wsSqlVariables.getSvSqlStmt6000());

            return doCobolExit();

            }

      };

      Section __6200DeclareCursor=new Section(this) {

            public CobolMethod run() {

            //*

            //*    MOVE '6100-END'   TO GV-MSG.

            //*    CALL 'tslog' USING BY REFERENCE GV-TRACE.

            //*

            //*

            //*

            //*    MOVE '6200-START'   TO GV-MSG.

            //*    CALL 'tslog' USING BY REFERENCE GV-TRACE.

            //*

            //@CobolSourceFile("BGE018Q.CBL",613,12)

            //EXEC SQL       

            //    DECLARE SQL6000 CURSOR FOR S6000         

            declareDynamicCursor("SQL6000","S6000");

            return doCobolExit();

            }

      };

      Section __6400OpenCursor=new Section(this) {

            public CobolMethod run() {

            //*

            //*    MOVE '6200-END'   TO GV-MSG.

            //*    CALL 'tslog' USING BY REFERENCE GV-TRACE.

            //*

            //*

            //*

            //*    MOVE '6400-START'   TO GV-MSG.

            //*    CALL 'tslog' USING BY REFERENCE GV-TRACE.

            //*

            //@CobolSourceFile("BGE018Q.CBL",626,12)

            //EXEC SQL       

            //    OPEN SQL6000           

            dao.execSqlStatement10();

            return doCobolExit();

            }

      };

      Section __6500FetchRows=new Section(this) {

            public CobolMethod run() {

            //*

            //*    MOVE '6400-END'   TO GV-MSG.

            //*    CALL 'tslog' USING BY REFERENCE GV-TRACE.

            //*

            //*

            //*

            //*    MOVE '6500-START'   TO GV-MSG.

            //*    CALL 'tslog' USING BY REFERENCE GV-TRACE.

            //*

            //@CobolSourceFile("BGE018Q.CBL",639,12)

            //MOVE SPACES                 TO SV-PROPVALCHAR      

            wsSqlVariables.setSvPropvalchar(WsSqlVariables.svPropvalcharFmt_.format(" "));

            //@CobolSourceFile("BGE018Q.CBL",640,12)

            //MOVE SPACES                 TO SV-PROPVALDATE      

            wsSqlVariables.setSvPropvaldate(WsSqlVariables.svPropvaldateFmt_.format(" "));

            //@CobolSourceFile("BGE018Q.CBL",641,12)

            //MOVE ZEROES                 TO SV-PROPVALNUMBER          

            wsSqlVariables.setSvPropvalnumber(new BigDecimal(0));

            //@CobolSourceFile("BGE018Q.CBL",642,12)

            //MOVE SPACES                 TO SV-DATEEND          

            wsSqlVariables.setSvDateend(WsSqlVariables.svDateendFmt_.format(" "));

            //*

            //@CobolSourceFile("BGE018Q.CBL",644,12)

            //EVALUATE SV-WK-DATATYPE          

            //WHEN "C"       

            //          ...WHEN "D"      

            //          ...WHEN "N"      

            //          ...END-EVALUATE        

            //@CobolSourceFile("BGE018Q.CBL",646,16)

            //EXEC SQL       

            //    FETCH SQL6000          

            //    INTO :SV-TN-PROPVALCHAR:SV-TN-IND-PROPVALCHAR        

            //        ,:SV-TN-ROWID      

            //        ,:SV-TN-ROWVERSION       

            try {

                  dao.execSqlStatement11();

                  if(dao.resultExists()) {

                        wsSqlVariables.setSvTnPropvalchar(dao.getResult().getString(1));

                        if(wsSqlVariables.getSvTnPropvalchar()==null) wsSqlVariables.setSvTnIndPropvalchar(-1);

                        else wsSqlVariables.setSvTnIndPropvalchar(0);

                        wsSqlVariables.setSvTnRowid(dao.getResult().getString(2));

                        wsSqlVariables.setSvTnRowversion(dao.getResult().getString(3));

                  }

            } catch(Exception e) {

                  e.printStackTrace();

            }

            //@CobolSourceFile("BGE018Q.CBL",653,16)

            //EXEC SQL       

            //    FETCH SQL6000          

            //    INTO :SV-TN-PROPVALDATE:SV-TN-IND-PROPVALDATE        

            //        ,:SV-TN-ROWID      

            //        ,:SV-TN-ROWVERSION       

            try {

                  dao.execSqlStatement12();

                  if(dao.resultExists()) {

                        wsSqlVariables.setSvTnPropvaldate(dao.getResult().getString(1));

                        if(wsSqlVariables.getSvTnPropvaldate()==null) wsSqlVariables.setSvTnIndPropvaldate(-1);

                        else wsSqlVariables.setSvTnIndPropvaldate(0);

                        wsSqlVariables.setSvTnRowid(dao.getResult().getString(2));

                        wsSqlVariables.setSvTnRowversion(dao.getResult().getString(3));

                  }

            } catch(Exception e) {

                  e.printStackTrace();

            }

            //@CobolSourceFile("BGE018Q.CBL",660,16)

            //EXEC SQL       

            //    FETCH SQL6000          

            //    INTO :SV-TN-PROPVALNUMBER:SV-TN-IND-PROPVALNUMBER          

            //        ,:SV-TN-ROWID      

            //        ,:SV-TN-ROWVERSION       

            try {

                  dao.execSqlStatement13();

                  if(dao.resultExists()) {

                        wsSqlVariables.setSvTnPropvalnumber(dao.getResult().getBigDecimal(1));

                        if(wsSqlVariables.getSvTnPropvalnumber()==null) wsSqlVariables.setSvTnIndPropvalnumber(-1);

                        else wsSqlVariables.setSvTnIndPropvalnumber(0);

                        wsSqlVariables.setSvTnRowid(dao.getResult().getString(2));

                        wsSqlVariables.setSvTnRowversion(dao.getResult().getString(3));

                  }

            } catch(Exception e) {

                  e.printStackTrace();

            }

            //*

            //@CobolSourceFile("BGE018Q.CBL",668,12)

            //MOVE SQLCODE TO SQL-RETURN-CODE        

            gvCommonArea.setSqlReturnCode(sqlca.getSqlcode());

            //*

            //@CobolSourceFile("BGE018Q.CBL",670,12)

            //IF SQL-OK      

            //          ...END-IF        

            if(gvCommonArea.getSqlOk()) {

                  //@CobolSourceFile("BGE018Q.CBL",671,16)

                  //EVALUATE SV-WK-DATATYPE                

                  //WHEN "C"             

                  //                ...WHEN "D"            

                  //                ...WHEN "N"            

                  //                ...END-EVALUATE              

                  //@CobolSourceFile("BGE018Q.CBL",673,20)

                  //IF SV-TN-IND-PROPVALCHAR < 0                 

                  //ELSE                 

                  //                ...END-IF              

                  if(wsSqlVariables.getSvTnIndPropvalchar() < 0) {

                        //@CobolSourceFile("BGE018Q.CBL",674,23)

                        //MOVE SPACES              TO SV-PROPVALCHAR                     

                        wsSqlVariables.setSvPropvalchar(WsSqlVariables.svPropvalcharFmt_.format(" "));

                  } else {

                        //@CobolSourceFile("BGE018Q.CBL",676,23)

                        //MOVE SV-TN-PROPVALCHAR   TO SV-PROPVALCHAR                     

                  wsSqlVariables.setSvPropvalchar(WsSqlVariables.svPropvalcharFmt_.format(wsSqlVariables.getSvTnPropvalchar()));

                        //@CobolSourceFile("BGE018Q.CBL",677,23)

                        //MOVE ZEROES              TO SV-IND-PROPVALCHAR                       

                        wsSqlVariables.setSvIndPropvalchar(0);

                  }

                  //@CobolSourceFile("BGE018Q.CBL",680,20)

                  //IF SV-TN-IND-PROPVALDATE < 0                 

                  //ELSE                 

                  //                ...END-IF              

                  if(wsSqlVariables.getSvTnIndPropvaldate() < 0) {

                        //@CobolSourceFile("BGE018Q.CBL",681,23)

                        //MOVE SPACES              TO SV-PROPVALDATE                     

                        wsSqlVariables.setSvPropvaldate(WsSqlVariables.svPropvaldateFmt_.format(" "));

                  } else {

                        //@CobolSourceFile("BGE018Q.CBL",683,23)

                        //MOVE SV-TN-PROPVALDATE   TO SV-PROPVALDATE                     

                  wsSqlVariables.setSvPropvaldate(WsSqlVariables.svPropvaldateFmt_.format(wsSqlVariables.getSvTnPropvaldate()));

                        //@CobolSourceFile("BGE018Q.CBL",684,23)

                        //MOVE ZEROES              TO SV-IND-PROPVALDATE                       

                        wsSqlVariables.setSvIndPropvaldate(0);

                  }

                  //@CobolSourceFile("BGE018Q.CBL",687,20)

                  //IF SV-TN-IND-PROPVALNUMBER < 0               

                  //ELSE                 

                  //                ...END-IF              

                  if(wsSqlVariables.getSvTnIndPropvalnumber() < 0) {

                        //@CobolSourceFile("BGE018Q.CBL",688,23)

                        //MOVE ZEROES              TO SV-PROPVALNUMBER                   

                        wsSqlVariables.setSvPropvalnumber(new BigDecimal(0));

                  } else {

                        //@CobolSourceFile("BGE018Q.CBL",690,23)

                        //MOVE SV-TN-PROPVALNUMBER TO SV-PROPVALNUMBER                   

                        wsSqlVariables.setSvPropvalnumber(wsSqlVariables.getSvTnPropvalnumber());

                        //@CobolSourceFile("BGE018Q.CBL",691,23)

                        //MOVE ZEROES              TO SV-IND-PROPVALNUMBER                     

                        wsSqlVariables.setSvIndPropvalnumber(0);

                  }

                  //@CobolSourceFile("BGE018Q.CBL",694,16)

                  //MOVE SV-TN-ROWID             TO SV-ROWID                 

              wsSqlVariables.setSvRowid(WsSqlVariables.svRowidFmt_.format(wsSqlVariables.getSvTnRowid()));

                  //@CobolSourceFile("BGE018Q.CBL",695,16)

                  //MOVE SV-TN-ROWVERSION        TO SV-ROWVERSION            

            wsSqlVariables.setSvRowversion(WsSqlVariables.svRowversionFmt_.format(wsSqlVariables.getSvTnRowversion()));

            }

            //*

            //@CobolSourceFile("BGE018Q.CBL",698,12)

            //IF SQL-OK      

            //AND NOT SQL-NOT-FOUND      

            //          ...END-IF        

            if(gvCommonArea.getSqlOk() && !gvCommonArea.getSqlNotFound()) {

                  //@CobolSourceFile("BGE018Q.CBL",700,16)

                  //ADD 1 TO CT-MSG-PTR              

                  wsCounters.setCtMsgPtr(1 + wsCounters.getCtMsgPtr());

                  //@CobolSourceFile("BGE018Q.CBL",701,16)

                  //PERFORM 2000-LOAD-MESSAGE              

                  doCobolPerform(__2000LoadMessage,null);

            }

            return doCobolExit();

            }

      };

      Section __6600CloseCursor=new Section(this) {

            public CobolMethod run() {

            //*

            //*    MOVE '6500-END'   TO GV-MSG.

            //*    CALL 'tslog' USING BY REFERENCE GV-TRACE.

            //*

            //*

            //*

            //*    MOVE '6600-START'   TO GV-MSG.

            //*    CALL 'tslog' USING BY REFERENCE GV-TRACE.

            //*

            //@CobolSourceFile("BGE018Q.CBL",713,12)

            //EXEC SQL       

            //    CLOSE SQL6000          

            return doCobolExit();

            }

      };

      Section __7100PrepareSql=new Section(this) {

            public CobolMethod run() {

            //*

            //*    MOVE '6600-END'   TO GV-MSG.

            //*    CALL 'tslog' USING BY REFERENCE GV-TRACE.

            //*

            //*

            //*

            //*    MOVE '7100-START'   TO GV-MSG.

            //*    CALL 'tslog' USING BY REFERENCE GV-TRACE.

            //*

            //@CobolSourceFile("BGE018Q.CBL",726,12)

            //MOVE 01     TO SV-SQL-LEN        

            wsSqlVariables.setSvSqlLen(1);

            //@CobolSourceFile("BGE018Q.CBL",727,12)

            //MOVE 0      TO L1          

            wsGeneralVariables.setL1(0);

            //@CobolSourceFile("BGE018Q.CBL",728,12)

            //MOVE 0      TO L2          

            wsGeneralVariables.setL2(0);

            //@CobolSourceFile("BGE018Q.CBL",729,12)

            //MOVE 0      TO L3          

            wsGeneralVariables.setL3(0);

            //@CobolSourceFile("BGE018Q.CBL",730,12)

            //MOVE 0      TO L4          

            wsGeneralVariables.setL4(0);

            //*    MOVE SPACES TO SV-SQL-STMT-7000.

            //*

            //*    MOVE 'INSPECT-START'   TO GV-MSG.

            //*    CALL 'tslog' USING BY REFERENCE GV-TRACE.

            //*

            //@CobolSourceFile("BGE018Q.CBL",736,12)

            //INSPECT SV-PF-IDCOLNAME       TALLYING L1          

            //    FOR CHARACTERS BEFORE INITIAL SPACE      

            wsGeneralVariables.setL1(new CobolString(wsSqlVariables.getSvPfIdcolname()).before(" ").tally().count()+wsGeneralVariables.getL1());

            //@CobolSourceFile("BGE018Q.CBL",738,12)

            //INSPECT SV-PF-TABLENAME       TALLYING L2          

            //    FOR CHARACTERS BEFORE INITIAL SPACE      

            wsGeneralVariables.setL2(new CobolString(wsSqlVariables.getSvPfTablename()).before(" ").tally().count()+wsGeneralVariables.getL2());

            //@CobolSourceFile("BGE018Q.CBL",740,12)

            //INSPECT SV-PF-FKCOLNAME       TALLYING L3          

            //    FOR CHARACTERS BEFORE INITIAL SPACE      

            wsGeneralVariables.setL3(new CobolString(wsSqlVariables.getSvPfFkcolname()).before(" ").tally().count()+wsGeneralVariables.getL3());

            //@CobolSourceFile("BGE018Q.CBL",742,12)

            //INSPECT SV-PF-OBJECTTABLENAME TALLYING L4          

            //    FOR CHARACTERS BEFORE INITIAL SPACE      

            wsGeneralVariables.setL4(new CobolString(wsSqlVariables.getSvPfObjecttablename()).before(" ").tally().count()+wsGeneralVariables.getL4());

            //*

            //@CobolSourceFile("BGE018Q.CBL",745,12)

            //MOVE FUNCTION UPPER-CASE (SV-PF-TABLENAME)         

            //  TO SV-PF-TABLENAME       

      wsSqlVariables.setSvPfTablename(WsSqlVariables.svPfTablenameFmt_.format(wsSqlVariables.getSvPfTablename()));

            //*

            //*    MOVE 'INSPECT-END'   TO GV-MSG.

            //*    CALL 'tslog' USING BY REFERENCE GV-TRACE.

            //*----------------------------------------------------------------

            //* VirtualColName = SPACES

            //*----------------------------------------------------------------

            //*    MOVE 'STRING-START'   TO GV-MSG.

            //*    CALL 'tslog' USING BY REFERENCE GV-TRACE.

            //@CobolSourceFile("BGE018Q.CBL",755,12)

            //STRING         

            //    "SELECT " SV-PF-IDCOLNAME (1:L1) " "           

            //            ",PROPVALCHAR "      

            //            ",PROPVALDATE "      

            //            ",PROPVALNUMBER "          

            //    DELIMITED BY SIZE      

            //    INTO SV-SQL-STMT-7000-ARR          

            //    WITH POINTER SV-SQL-LEN      

            //END-STRING           

            //*

            //@CobolSourceFile("BGE018Q.CBL",765,12)

            //IF SV-PF-TABLENAME <> "RRPROPERTY"           

            //          ...END-IF        

            if(wsSqlVariables.getSvPfTablename().compareTo("RRPROPERTY") < 0) {

                  //@CobolSourceFile("BGE018Q.CBL",766,16)

                  //STRING               

                  //        ",DATESTART "            

                  //        ",DATEEND "              

                  //    DELIMITED BY SIZE            

                  //    INTO SV-SQL-STMT-7000-ARR                

                  //    WITH POINTER SV-SQL-LEN            

                  //END-STRING                 

            }

            //*

            //@CobolSourceFile("BGE018Q.CBL",775,12)

            //STRING         

            //            ",ROWID "      

            //            ",ROWVERSION "       

            //    "FROM "   SV-PF-TABLENAME (1:L2)       " "           

            //    "WHERE "  SV-PF-TABLENAME (1:L2)       ".PROPERTYKEY = "         

            //                "RTRIM(:PROPERTYKEY) "       

            //    DELIMITED BY SIZE      

            //    INTO SV-SQL-STMT-7000-ARR          

            //    WITH POINTER SV-SQL-LEN      

            //END-STRING           

            //*

            //*

            //*    IF SV-WK-KeyValue-X <> SPACES

            //@CobolSourceFile("BGE018Q.CBL",788,12)

            //IF GV-KEYVALUE-X (1) <> SPACES         

            //          ...END-IF        

            if(wsGeneralVariables.getGvKeyvalueX(1).compareTo(" ") < 0) {

                  //@CobolSourceFile("BGE018Q.CBL",789,16)

                  //STRING               

                  //    "AND "    SV-PF-FKCOLNAME (1:L3)       " = "               

                  //           ":KEYVALUE "                

                  //    DELIMITED BY SIZE            

                  //    INTO SV-SQL-STMT-7000-ARR                

                  //    WITH POINTER SV-SQL-LEN            

                  //END-STRING                 

            }

            //*                   "LTRIM(" SV-WK-KEYVALUE-X ") "

            //*

            //@CobolSourceFile("BGE018Q.CBL",799,12)

            //IF SV-PF-TABLENAME <> "RRPROPERTY"           

            //          ...END-IF        

            if(wsSqlVariables.getSvPfTablename().compareTo("RRPROPERTY") < 0) {

                  //@CobolSourceFile("BGE018Q.CBL",800,16)

                  //STRING               

                  //    "ORDER BY DATESTART, DATEEND"            

                  //    DELIMITED BY SIZE            

                  //    INTO SV-SQL-STMT-7000-ARR                

                  //    WITH POINTER SV-SQL-LEN            

                  //END-STRING                 

            }

            //*            "ORDER BY DATESTART "                               

            //*

            //*    DISPLAY SV-SQL-STMT-7000.

            //@CobolSourceFile("BGE018Q.CBL",810,12)

            //COMPUTE SV-SQL-STMT-7000-LEN = SV-SQL-LEN - 1      

            setNull(wsSqlVariables.getSvSqlLen()-1);

            //*

            //*    MOVE 'STRING-END'   TO GV-MSG.

            //*    CALL 'tslog' USING BY REFERENCE GV-TRACE.

            //*

            //@CobolSourceFile("BGE018Q.CBL",815,12)

            //EXEC SQL       

            //    PREPARE S7000 FROM :SV-SQL-STMT-7000           

            prepareDynStatement("S7000",wsSqlVariables.getSvSqlStmt7000());

            return doCobolExit();

            }

      };

      Section __7200DeclareCursor=new Section(this) {

            public CobolMethod run() {

            //*

            //*    MOVE '7100-END'   TO GV-MSG.

            //*    CALL 'tslog' USING BY REFERENCE GV-TRACE.

            //*

            //*

            //*

            //*    MOVE '7200-START'   TO GV-MSG.

            //*    CALL 'tslog' USING BY REFERENCE GV-TRACE.

            //*

            //@CobolSourceFile("BGE018Q.CBL",828,12)

            //EXEC SQL       

            //    DECLARE SQL7000 CURSOR FOR S7000         

            declareDynamicCursor("SQL7000","S7000");

            return doCobolExit();

            }

      };

      Section __7400OpenCursor=new Section(this) {

            public CobolMethod run() {

            //*

            //*    MOVE '7200-END'   TO GV-MSG.

            //*    CALL 'tslog' USING BY REFERENCE GV-TRACE.

            //*

            //*

            //*

            //*    MOVE '7400-START'   TO GV-MSG.

            //*    CALL 'tslog' USING BY REFERENCE GV-TRACE.

            //*

            //@CobolSourceFile("BGE018Q.CBL",841,12)

            //IF  GV-KEYVALUE-X (1) <> SPACES        

            //          ...ELSE          

            //          ...END-IF        

            if(wsGeneralVariables.getGvKeyvalueX(1).compareTo(" ") < 0) {

                  //@CobolSourceFile("BGE018Q.CBL",842,16)

                  //EXEC SQL             

                  //     OPEN SQL7000 USING :SV-WK-PROPERTYKEY               

                  //                       ,:SV-WK-KEYVALUE            

                  dao.execSqlStatement14();

            } else {

                  //@CobolSourceFile("BGE018Q.CBL",847,16)

                  //EXEC SQL             

                  //     OPEN SQL7000 USING :SV-WK-PROPERTYKEY               

                  dao.execSqlStatement15();

            }

            return doCobolExit();

            }

      };

      Section __7500FetchRows=new Section(this) {

            public CobolMethod run() {

            //*

            //*    MOVE '7400-END'   TO GV-MSG.

            //*    CALL 'tslog' USING BY REFERENCE GV-TRACE.

            //*

            //*

            //*

            //*    MOVE '7500-START'   TO GV-MSG.

            //*    CALL 'tslog' USING BY REFERENCE GV-TRACE.

            //*

            //@CobolSourceFile("BGE018Q.CBL",861,12)

            //IF SV-PF-TABLENAME <> "RRPROPERTY"           

            //          ...ELSE          

            //          ...END-IF        

            if(wsSqlVariables.getSvPfTablename().compareTo("RRPROPERTY") < 0) {

                  //@CobolSourceFile("BGE018Q.CBL",862,16)

                  //EXEC SQL             

                  //    FETCH SQL7000                

                  //    INTO    :SV-TN-IDCOLVALUE:SV-TN-IND-IDCOLVALUE             

                  //           ,:SV-TN-PROPVALCHAR:SV-TN-IND-PROPVALCHAR                 

                  //           ,:SV-TN-PROPVALDATE:SV-TN-IND-PROPVALDATE                 

                  //           ,:SV-TN-PROPVALNUMBER:SV-TN-IND-PROPVALNUMBER             

                  //           ,:SV-TN-DATESTART:SV-TN-IND-DATESTART               

                  //           ,:SV-TN-DATEEND:SV-TN-IND-DATEEND             

                  //           ,:SV-TN-ROWID               

                  //           ,:SV-TN-ROWVERSION                

                  try {

                        dao.execSqlStatement16();

                        if(dao.resultExists()) {

                              wsSqlVariables.setSvTnIdcolvalue(dao.getResult().getInt(1));

                              wsSqlVariables.setSvTnPropvalchar(dao.getResult().getString(2));

                              if(wsSqlVariables.getSvTnPropvalchar()==null) wsSqlVariables.setSvTnIndPropvalchar(-1);

                              else wsSqlVariables.setSvTnIndPropvalchar(0);

                              wsSqlVariables.setSvTnPropvaldate(dao.getResult().getString(3));

                              if(wsSqlVariables.getSvTnPropvaldate()==null) wsSqlVariables.setSvTnIndPropvaldate(-1);

                              else wsSqlVariables.setSvTnIndPropvaldate(0);

                              wsSqlVariables.setSvTnPropvalnumber(dao.getResult().getBigDecimal(4));

                              if(wsSqlVariables.getSvTnPropvalnumber()==null) wsSqlVariables.setSvTnIndPropvalnumber(-1);

                              else wsSqlVariables.setSvTnIndPropvalnumber(0);

                              wsSqlVariables.setSvTnDatestart(dao.getResult().getString(5));

                              if(wsSqlVariables.getSvTnDatestart()==null) wsSqlVariables.setSvTnIndDatestart(-1);

                              else wsSqlVariables.setSvTnIndDatestart(0);

                              wsSqlVariables.setSvTnDateend(dao.getResult().getString(6));

                              if(wsSqlVariables.getSvTnDateend()==null) wsSqlVariables.setSvTnIndDateend(-1);

                              else wsSqlVariables.setSvTnIndDateend(0);

                              wsSqlVariables.setSvTnRowid(dao.getResult().getString(7));

                              wsSqlVariables.setSvTnRowversion(dao.getResult().getString(8));

                        }

                  } catch(Exception e) {

                        e.printStackTrace();

                  }

            } else {

                  //@CobolSourceFile("BGE018Q.CBL",874,16)

                  //EXEC SQL             

                  //    FETCH SQL7000                

                  //    INTO    :SV-TN-IDCOLVALUE:SV-TN-IND-IDCOLVALUE             

                  //           ,:SV-TN-PROPVALCHAR:SV-TN-IND-PROPVALCHAR                 

                  //           ,:SV-TN-PROPVALDATE:SV-TN-IND-PROPVALDATE                 

                  //           ,:SV-TN-PROPVALNUMBER:SV-TN-IND-PROPVALNUMBER             

                  //           ,:SV-TN-DATESTART:SV-TN-IND-DATESTART               

                  //           ,:SV-TN-DATEEND:SV-TN-IND-DATEEND             

                  //           ,:SV-TN-ROWID               

                  //           ,:SV-TN-ROWVERSION                

                  try {

                        dao.execSqlStatement17();

                        if(dao.resultExists()) {

                              wsSqlVariables.setSvTnIdcolvalue(dao.getResult().getInt(1));

                              wsSqlVariables.setSvTnPropvalchar(dao.getResult().getString(2));

                              if(wsSqlVariables.getSvTnPropvalchar()==null) wsSqlVariables.setSvTnIndPropvalchar(-1);

                              else wsSqlVariables.setSvTnIndPropvalchar(0);

                              wsSqlVariables.setSvTnPropvaldate(dao.getResult().getString(3));

                              if(wsSqlVariables.getSvTnPropvaldate()==null) wsSqlVariables.setSvTnIndPropvaldate(-1);

                              else wsSqlVariables.setSvTnIndPropvaldate(0);

                              wsSqlVariables.setSvTnPropvalnumber(dao.getResult().getBigDecimal(4));

                              if(wsSqlVariables.getSvTnPropvalnumber()==null) wsSqlVariables.setSvTnIndPropvalnumber(-1);

                              else wsSqlVariables.setSvTnIndPropvalnumber(0);

                              wsSqlVariables.setSvTnDatestart(dao.getResult().getString(5));

                              if(wsSqlVariables.getSvTnDatestart()==null) wsSqlVariables.setSvTnIndDatestart(-1);

                              else wsSqlVariables.setSvTnIndDatestart(0);

                              wsSqlVariables.setSvTnDateend(dao.getResult().getString(6));

                              if(wsSqlVariables.getSvTnDateend()==null) wsSqlVariables.setSvTnIndDateend(-1);

                              else wsSqlVariables.setSvTnIndDateend(0);

                              wsSqlVariables.setSvTnRowid(dao.getResult().getString(7));

                              wsSqlVariables.setSvTnRowversion(dao.getResult().getString(8));

                        }

                  } catch(Exception e) {

                        e.printStackTrace();

                  }

            }

            //*

            //@CobolSourceFile("BGE018Q.CBL",887,12)

            //MOVE SQLCODE TO SQL-RETURN-CODE        

            gvCommonArea.setSqlReturnCode(sqlca.getSqlcode());

            //*

            //*

            //@CobolSourceFile("BGE018Q.CBL",890,12)

            //IF SQL-NOT-FOUND           

            //AND FIRSTTIME        

            //          ...ELSE          

            //          ...END-IF        

            if(gvCommonArea.getSqlNotFound() && wsFlags.getFirsttime()) {

                  //@CobolSourceFile("BGE018Q.CBL",892,16)

                  //MOVE ZEROES              TO SV-IDCOLVALUE                

                  wsSqlVariables.setSvIdcolvalue(0);

                  //@CobolSourceFile("BGE018Q.CBL",893,16)

                  //MOVE SPACES              TO SV-PROPVALCHAR               

                  wsSqlVariables.setSvPropvalchar(WsSqlVariables.svPropvalcharFmt_.format(" "));

                  //@CobolSourceFile("BGE018Q.CBL",894,16)

                  //MOVE -1                  TO SV-IND-PROPVALCHAR                 

                  wsSqlVariables.setSvIndPropvalchar(-1);

                  //@CobolSourceFile("BGE018Q.CBL",895,16)

                  //MOVE SPACES              TO SV-PROPVALDATE               

                  wsSqlVariables.setSvPropvaldate(WsSqlVariables.svPropvaldateFmt_.format(" "));

                  //@CobolSourceFile("BGE018Q.CBL",896,16)

                  //MOVE -1                  TO SV-IND-PROPVALDATE                 

                  wsSqlVariables.setSvIndPropvaldate(-1);

                  //@CobolSourceFile("BGE018Q.CBL",897,16)

                  //MOVE ZEROES              TO SV-PROPVALNUMBER             

                  wsSqlVariables.setSvPropvalnumber(new BigDecimal(0));

                  //@CobolSourceFile("BGE018Q.CBL",898,16)

                  //MOVE -1                  TO SV-IND-PROPVALNUMBER               

                  wsSqlVariables.setSvIndPropvalnumber(-1);

                  //@CobolSourceFile("BGE018Q.CBL",899,16)

                  //MOVE SPACES              TO SV-DATESTART                 

                  wsSqlVariables.setSvDatestart(WsSqlVariables.svDatestartFmt_.format(" "));

                  //@CobolSourceFile("BGE018Q.CBL",900,16)

                  //MOVE SPACES              TO SV-DATEEND             

                  wsSqlVariables.setSvDateend(WsSqlVariables.svDateendFmt_.format(" "));

                  //@CobolSourceFile("BGE018Q.CBL",901,16)

                  //MOVE -1                  TO SV-IND-DATESTART             

                  wsSqlVariables.setSvIndDatestart(-1);

                  //@CobolSourceFile("BGE018Q.CBL",902,16)

                  //MOVE -1                  TO SV-IND-DATEEND               

                  wsSqlVariables.setSvIndDateend(-1);

                  //@CobolSourceFile("BGE018Q.CBL",903,16)

                  //MOVE SPACES              TO SV-ROWID               

                  wsSqlVariables.setSvRowid(WsSqlVariables.svRowidFmt_.format(" "));

                  //@CobolSourceFile("BGE018Q.CBL",904,16)

                  //MOVE '0'                 TO SV-ROWVERSION                

                  wsSqlVariables.setSvRowversion(WsSqlVariables.svRowversionFmt_.format("0"));

                  //@CobolSourceFile("BGE018Q.CBL",905,16)

                  //MOVE 0 TO SQL-RETURN-CODE              

                  gvCommonArea.setSqlReturnCode(0);

                  //@CobolSourceFile("BGE018Q.CBL",906,16)

                  //display 'loaded over sql not found ' SV-WK-PROPERTYKEY               

                  Console.println("loaded over sql not found "+WsSqlVariables.svWkPropertykeyFmt_.format(wsSqlVariables.getSvWkPropertykey()));

            } else {

                  //@CobolSourceFile("BGE018Q.CBL",907,17)

                  //IF SQL-OK            

                  //                ...END-IF              

                  if(gvCommonArea.getSqlOk()) {

                        //@CobolSourceFile("BGE018Q.CBL",908,16)

                        //IF SV-TN-IND-IDCOLVALUE    < 0                     

                        //ELSE                       

                        //                      ...END-IF                    

                        if(wsSqlVariables.getSvTnIndIdcolvalue() < 0) {

                              //@CobolSourceFile("BGE018Q.CBL",909,20)

                              //MOVE ZEROES              TO SV-IDCOLVALUE                            

                              wsSqlVariables.setSvIdcolvalue(0);

                        } else {

                              //@CobolSourceFile("BGE018Q.CBL",911,20)

                              //MOVE SV-TN-IDCOLVALUE    TO SV-IDCOLVALUE                            

                              wsSqlVariables.setSvIdcolvalue(wsSqlVariables.getSvTnIdcolvalue());

                        }

                        //*            MOVE ZEROES              TO SV-IND-IDCOLVALUE

                        //@CobolSourceFile("BGE018Q.CBL",914,16)

                        //IF SV-TN-IND-PROPVALCHAR   < 0                     

                        //ELSE                       

                        //                      ...END-IF                    

                        if(wsSqlVariables.getSvTnIndPropvalchar() < 0) {

                              //@CobolSourceFile("BGE018Q.CBL",915,20)

                              //MOVE SPACES              TO SV-PROPVALCHAR                           

                              wsSqlVariables.setSvPropvalchar(WsSqlVariables.svPropvalcharFmt_.format(" "));

                        } else {

                              //@CobolSourceFile("BGE018Q.CBL",917,20)

                              //MOVE SV-TN-PROPVALCHAR   TO SV-PROPVALCHAR                           

                        wsSqlVariables.setSvPropvalchar(WsSqlVariables.svPropvalcharFmt_.format(wsSqlVariables.getSvTnPropvalchar()));

                              //@CobolSourceFile("BGE018Q.CBL",918,20)

                              //MOVE ZEROES              TO SV-IND-PROPVALCHAR                             

                              wsSqlVariables.setSvIndPropvalchar(0);

                        }

                        //@CobolSourceFile("BGE018Q.CBL",920,16)

                        //IF SV-TN-IND-PROPVALDATE   < 0                     

                        //ELSE                       

                        //                      ...END-IF                    

                        if(wsSqlVariables.getSvTnIndPropvaldate() < 0) {

                              //@CobolSourceFile("BGE018Q.CBL",921,20)

                              //MOVE SPACES              TO SV-PROPVALDATE                           

                              wsSqlVariables.setSvPropvaldate(WsSqlVariables.svPropvaldateFmt_.format(" "));

                        } else {

                              //@CobolSourceFile("BGE018Q.CBL",923,20)

                              //MOVE SV-TN-PROPVALDATE   TO SV-PROPVALDATE                           

                        wsSqlVariables.setSvPropvaldate(WsSqlVariables.svPropvaldateFmt_.format(wsSqlVariables.getSvTnPropvaldate()));

                              //@CobolSourceFile("BGE018Q.CBL",924,20)

                              //MOVE ZEROES              TO SV-IND-PROPVALDATE                             

                              wsSqlVariables.setSvIndPropvaldate(0);

                        }

                        //@CobolSourceFile("BGE018Q.CBL",926,16)

                        //IF SV-TN-IND-PROPVALNUMBER < 0                     

                        //ELSE                       

                        //                      ...END-IF                    

                        if(wsSqlVariables.getSvTnIndPropvalnumber() < 0) {

                              //@CobolSourceFile("BGE018Q.CBL",927,20)

                              //MOVE ZEROES              TO SV-PROPVALNUMBER                         

                              wsSqlVariables.setSvPropvalnumber(new BigDecimal(0));

                        } else {

                              //@CobolSourceFile("BGE018Q.CBL",929,20)

                              //MOVE SV-TN-PROPVALNUMBER TO SV-PROPVALNUMBER                         

                              wsSqlVariables.setSvPropvalnumber(wsSqlVariables.getSvTnPropvalnumber());

                              //@CobolSourceFile("BGE018Q.CBL",930,20)

                              //MOVE ZEROES              TO SV-IND-PROPVALNUMBER                           

                              wsSqlVariables.setSvIndPropvalnumber(0);

                        }

                        //*

                        //@CobolSourceFile("BGE018Q.CBL",933,16)

                        //IF SV-PF-TABLENAME <> "RRPROPERTY"                       

                        //                      ...END-IF                    

                        if(wsSqlVariables.getSvPfTablename().compareTo("RRPROPERTY") < 0) {

                              //@CobolSourceFile("BGE018Q.CBL",934,20)

                              //IF SV-TN-IND-DATESTART     < 0                           

                              //ELSE                             

                              //END-IF                           

                              if(wsSqlVariables.getSvTnIndDatestart() < 0) {

                                    //@CobolSourceFile("BGE018Q.CBL",935,24)

                                    //MOVE SPACES              TO SV-DATESTART                                   

                                    wsSqlVariables.setSvDatestart(WsSqlVariables.svDatestartFmt_.format(" "));

                              } else {

                                    //@CobolSourceFile("BGE018Q.CBL",937,24)

                                    //MOVE SV-TN-DATESTART     TO SV-DATESTART                                   

                              wsSqlVariables.setSvDatestart(WsSqlVariables.svDatestartFmt_.format(wsSqlVariables.getSvTnDatestart()));

                              }

                              //@CobolSourceFile("BGE018Q.CBL",939,20)

                              //IF SV-TN-IND-DATEEND       < 0                           

                              //ELSE                             

                              //END-IF                           

                              if(wsSqlVariables.getSvTnIndDateend() < 0) {

                                    //@CobolSourceFile("BGE018Q.CBL",940,24)

                                    //MOVE SPACES              TO SV-DATEEND                               

                                    wsSqlVariables.setSvDateend(WsSqlVariables.svDateendFmt_.format(" "));

                              } else {

                                    //@CobolSourceFile("BGE018Q.CBL",942,24)

                                    //MOVE SV-TN-DATEEND       TO SV-DATEEND                               

                              wsSqlVariables.setSvDateend(WsSqlVariables.svDateendFmt_.format(wsSqlVariables.getSvTnDateend()));

                              }

                        }

                        //*

                        //@CobolSourceFile("BGE018Q.CBL",946,16)

                        //MOVE SV-TN-ROWID             TO SV-ROWID                       

                    wsSqlVariables.setSvRowid(WsSqlVariables.svRowidFmt_.format(wsSqlVariables.getSvTnRowid()));

                        //@CobolSourceFile("BGE018Q.CBL",947,16)

                        //MOVE SV-TN-ROWVERSION        TO SV-ROWVERSION                  

                  wsSqlVariables.setSvRowversion(WsSqlVariables.svRowversionFmt_.format(wsSqlVariables.getSvTnRowversion()));

                  }

            }

            //*

            //@CobolSourceFile("BGE018Q.CBL",951,12)

            //IF SQL-OK      

            //OR ( FIRSTTIME AND SQL-NOT-FOUND)      

            //          ...END-IF        

            if(gvCommonArea.getSqlOk() || (wsFlags.getFirsttime() && gvCommonArea.getSqlNotFound())) {

                  //*     AND NOT SQL-NOT-FOUND

                  //@CobolSourceFile("BGE018Q.CBL",954,16)

                  //ADD 1 TO CT-MSG-PTR              

                  wsCounters.setCtMsgPtr(1 + wsCounters.getCtMsgPtr());

                  //@CobolSourceFile("BGE018Q.CBL",955,16)

                  //PERFORM 2000-LOAD-MESSAGE              

                  doCobolPerform(__2000LoadMessage,null);

            }

            //*

            //@CobolSourceFile("BGE018Q.CBL",958,12)

            //MOVE "N" TO FL-FIRSTTIME         

            wsFlags.setFlFirsttime(WsFlags.flFirsttimeFmt_.format("N"));

            return doCobolExit();

            }

      };

      Section __7600CloseCursor=new Section(this) {

            public CobolMethod run() {

            //*   

            //*    MOVE '7500-END'   TO GV-MSG.

            //*    CALL 'tslog' USING BY REFERENCE GV-TRACE.

            //*

            //*

            //*

            //*    MOVE '7600-START'   TO GV-MSG.

            //*    CALL 'tslog' USING BY REFERENCE GV-TRACE.

            //*

            //@CobolSourceFile("BGE018Q.CBL",969,12)

            //EXEC SQL       

            //    CLOSE SQL7000          

            return doCobolExit();

            }

      };

      Section __9000SqlErrorRoutine=new Section(this) {

            public CobolMethod run() {

            //*

            //*    MOVE '7600-END'   TO GV-MSG.

            //*    CALL 'tslog' USING BY REFERENCE GV-TRACE.

            //*

            //*                                                                

            //*                                                                

            //@CobolSourceFile("BGE018Q.CBL",979,12)

            //MOVE SQLCODE       TO SYSPFX-ERRORCODE       

            hubMessageLinkage.setSyspfxErrorcode(sqlca.getSqlcode());

            //@CobolSourceFile("BGE018Q.CBL",980,12)

            //MOVE SQLERRMC      TO SYSPFX-ERRORMSG        

      hubMessageLinkage.setSyspfxErrormsg(HubMessageLinkage.syspfxErrormsgFmt_.format(sqlca.getSqlerrmc()));

            //@CobolSourceFile("BGE018Q.CBL",981,12)

            //MOVE ZEROES        TO SYSPFX-ERRORLOGID      

            //                      SYSPFX-ROWLEN          

            hubMessageLinkage.setSyspfxErrorlogid(0);

            hubMessageLinkage.setSyspfxRowlen(0);

            //@CobolSourceFile("BGE018Q.CBL",983,12)

            //MOVE CT-MSG-PTR    TO SYSPFX-ROWCOUNT        

            hubMessageLinkage.setSyspfxRowcount(wsCounters.getCtMsgPtr());

            //@CobolSourceFile("BGE018Q.CBL",984,12)

            //MOVE SV-TOTAL-ROWS TO SYSPFX-ROWTOTAL        

            hubMessageLinkage.setSyspfxRowtotal(wsSqlVariables.getSvTotalRows());

            //@CobolSourceFile("BGE018Q.CBL",985,12)

            //MOVE SPACES        TO SYSPFX-CONTINUE        

            hubMessageLinkage.setSyspfxContinue(HubMessageLinkage.syspfxContinueFmt_.format(" "));

            //@CobolSourceFile("BGE018Q.CBL",986,12)

            //MOVE BGE018R1-VER  TO SYSPFX-VERSIONID       

            hubMessageLinkage.setSyspfxVersionid(getBge018r1Ver());

            //*                                                                

            //@CobolSourceFile("BGE018Q.CBL",988,12)

            //MOVE 4000 TO SV-SQL-LEN          

            wsSqlVariables.setSvSqlLen(4000);

            //@CobolSourceFile("BGE018Q.CBL",989,12)

            //CALL "SQLGLS" USING BY REFERENCE SV-SQL-STMT       

            //                    BY REFERENCE SV-SQL-LEN        

            //                    BY REFERENCE SV-SQL-FC         

            //END-CALL       

            //*

            //@CobolSourceFile("BGE018Q.CBL",994,12)

            //CALL "BERRLOG" USING SYSPFX-REC        

            //                      SV-SQL-STMT      

            //                      SV-SQL-LEN       

            //END-CALL       

            //*                                                                

            //@CobolSourceFile("BGE018Q.CBL",999,13)

            //STOP RUN       

            System.exit(0);

            return doCobolExit();

            }

      };

      //*     GOBACK.                                                    

      //*          

      private Bge018q() {

            super(new CobolBytes(99));

      }

      private void initialize() {

            wsFlags.initialize();

            wsCounters.initialize();

            wsGeneralVariables.initialize();

            wsSqlVariables.initialize();

            sqlca.initialize();

            gvCommonArea.initialize();

            hubMessageLinkage.initialize();

      }

      private cobolprogramclasses.dao.Bge018qDao dao = new cobolprogramclasses.dao.Bge018qDao();

}