Starting CTO
I. Starting CTO
1. The OEngineServer must be running as a service or you must launch the OEngineServer application with the following command from a DOS command prompt in your OpenInsight directory:
java –jar oesocketserver.jar –d 3
See the OpenInsight OEngineServer Configuration Guide found in the Documents folder in your OpenInsight directory.
Your system will require the 64-bit Java Runtime environment which can be downloaded at:
https://www.java.com/en/download/manual.jsp
2. To install the OEngineServer as a service right click and Run as Administrator on the InstallService.bat file found in the OESERVER folder within your OInsight10 directory.
3. The OEngineServer will be installed as a service. It will need to be started.
4. From the OpenInsight 10 IDE go to Consoles and choose CTO. The CTO screen will launch to the TCL prompt.
5. The CTO OEngineServer location and TCP port can be found in the SYSENV*CFG_CTO record. From the OpenInsight 10 IDE go to File, Open, Record. Table: SYSENV, Record: CFG_CTO
6. The CTO OEngineServer location and TCP port can also be modified via the Management Console. From the OIConsole go to System Configuration, Configuration Records. Record: CFG_CTO
7. You can set your foreground and background colors from the Colors menu on the CTO Standalone Form.
II. Creating your TRANSLATE configuration item
1. In our example we will create an application called MYAPP and store the data and dictionary tables in a folder called MYAPP_DATA located within the OInsight10 directory. From the TCL prompt copy the DEFAULT*TRANSLATE item found in the Master Dictionary to MYAPP*TRANSLATE using the COPY command from TCL.
2. Using the editor (ED), modify the MYAPP*TRANSLATE item in the MD to tell the ACCOUNT-RESTORE process where to load your data and dictionaries.
III. Selecting your virtual tape
1. To select your virtual save use the T-SELECT command. Enter the full path of your virtual tape and save type.
2. Use the ACCOUNT-RESTORE command to start your restore.
3. Enter APPLICATION_NAME (MYAPP)
4. Enter the account name on the virtual tape (MYAPP)
5. Enter the password for account owner(s) that matches the policy in force (MYAPP123!)
6. Enter your TRANSLATION item name (MYAPP)
7. The ACCOUNT-RESTORE process will perform a second pass and convert the data dictionaries into OpenInsight format. Once this process is completed type QUIT to log out of SYSPROG and close the CTO interface.
8. The ACCOUNT-RESTORE process has now created a folder called MYAPP_DATA within your OInsight10 directory. This folder is where the dictionary and data tables have been loaded from the ACCOUNT-RESTORE process.
IV. Logging on to your restored application
1. In our example the ACCOUNT-RESTORE process has created an application within OpenInsight called MYAPP. A default user has also been created within that application with the same name as the application itself. From the OpenInsight 10 IDE go to File, Open, Application, select application MYAPP.
3. Enter the User Name: MYAPP and the Password: MYAPP123!.
4. You will receive the following warning message alerting you to reset the password.
5. From the OpenInsight 10 IDE within the MYAPP application go to Settings, Users, User Setup.
6. Change your Password Expiration Type to: Password Never Expires and hit File, Save.
7. Once logged on to the MYAPP application from the OpenInsight 10 IDE go to the Settings, Database Environment Settings. You can also choose to set your foreground and background colors for the MYAPP application.
8. Make sure the Append ProcessID To @Station is checked and Save Precompiled Source is checked.
9. To configure the OpenInsight 10 graphical editor for use with traditional BASIC programs go to Settings, IDE Settings…
10. Click on Source Code Editor, code Interface, Keyword Configuration, Keywords and Colors.
11. Go to the Basic+ Coloring tab and double click on TableNames.
12. Select the tables that contain your BASIC source code and click OK.
13. To edit a BASIC program, from the OpenInsight 10 IDE, go to File, Open, Stored Procedure…
14. Choose Non-Sysprocs Stored Procedures and select the Program File from the Entity Class drop down. Choose your program and click OK..
15. Your BASIC program can now be edited using the OpenInsight 10 graphical editor.
16. To edit data records, from the OpenInsight 10 IDE go to File, Open, Record…
17. Select your Table and Record Id and click OK.
18. Note the cursor on field 9, the associated dictionary ODT is displayed and the converted OCONV value is also displayed.
19. Multivalue and subvalue fields can be exploded and edited.
V. Compiling and debugging your programs
1. During the ACCOUNT-RESTORE process, only your source code is restored. Source code must be compiled and subroutines must be compiled and cataloged.
2. Programs can be compiled using the BASIC command from TCL or by using FIB from the line editor. From TCL we entered: SSELECT BP.
3. Here we are cataloging all programs in the BP table that contain the word SUBROUTINE.
4. Source code can reside in any file/table and can be edited using ED from the TCL command prompt.
5. When source code is compiled from the CTO interface, it is actually passed through a pre-compiler. A copy of the pre-compiled source code is stored in a table called OI_PRECOMPILED_CODE with a key of TABLENAME_PROGRAMNAME. To examine the pre-compiled source code for the program H05 located in the file BP type the following: ED OI_PRECOMPILED_CODE BP_H05
6. Program errors are reported by the compiler. The OpenInsight compiler compiles and reports errors on the source code found in the table OI_PRECOMPILED_CODE.
7. In the example below an error has been found on line (18) of the source code item BP_H05 in the table OI_PRECOMPILED_CODE.
8. Please note that, although the line number reported refers to the line in the pre-processed version of the source code, program modifications MUST be made to your original source code and then re-compiled.
VI. Defining printers and managing the SPOOLER
1. All printers that are defined on the server where the OEngineServer resides are available for use with the CTO.
2. The STARTPTR & STARTPTRX commands are used to assign a printer to a form queue for use with the CTO. Using the STARTPTR command will define this printer for output using DirectPrint; all control codes, escape sequences, etc. will be passed “as is” to the printer. Using the STARTPTRX command allows you to define additional features, including a subroutine that will be invoked when a print job begins and ends, and/or the use of OIPI for output generation. To assign your printer to form queue 0 using DirectPrint type:
STARTPTR 0,0,0,Windows_Printer_Name
To assign your printer to form queue 1 using OIPI type:
STARTPTRX 1,1,0,,OIPI,1,Courier New,7,OIPI_Landscape
3. The LISTPTR command is used to list all printers defined for use with the CTO.
4. Output can be assigned to either a physical form queue or a hold file. To generate output for a hold file, specify “HS” as the output destination in the SP-ASSIGN command.
5. Output sent to a hold file can be retrieved using the SP-EDIT command. LISTPEQS will display all items in the CTO spooler. Output to an OIPI defined printer will be displayed to the print preview window.
VII. Launch your application in CTO
1. To automatically launch your application from logon, create a PROC in the MD with your APPLICATION_NAME or USER_NAME as the key. This PROC may execute another PROC or BASIC program.
2. To exit an application and the CTO interface, you must log OFF the application and QUIT the CTO.