Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
Problem: What is the difference between CBL_THREAD_SLEEP and CBL_YIELD_RUN_UNIT? Resolution: The CBL_YIELD_RUN_UNIT will tell the OS to give the current programs scheduled processing time to another program process so that it can have access to the CPU. A RUN_UNIT in COBOL is defined as the main programs executable along with any programs that have been loaded by a CALL statement. This keeps the current program from using all the CPU cycles when it is currently in a wait state. The CBL_THREAD_SLEEP does basically the same thing but it gives up the current threads processing time and not the entire run-units CPU time. The difference is that CBL_THREAD_SLEEP might yield it's time to another thread that may be running within the same process (run-unit). CBL_YIELD_RUN_UNIT yields time on a per process basis and CBL_THREAD_SLEEP yields time on a per thread basis. Old KB# 7053
Problem: How to call the sql set connect option through cobol to unlock the DataDirect OEM ODBC drivers. Here are the calls to SQLSetConnectOption as one would code in a different language: res_code = SQLSetConnectOption (hdbc, 1041, "licensefile"); res_code = SQLSetConnectOption (hdbc, 1042, "password"); Resolution: Be sure you have entered into an OEM agreement with DataDirect and have thus created a 'branded' driver that is specific to our application package. They have assured us that 'all we have to do' is make these API calls after our standard database connect, to 'unlock' the branded driver. You should just need to set a procedure pointer to ODBC32.DLL. If the app is running as EXE or DLL, you will need to link with ODBC32.LIB and ODBCCP32.LIB. The call convention should be stdcall, i.e. 66. The return value for the ODBC API call -- i.e. SQLRtn -- should be stored as a PIC S9(4) COMP-5.
Problem: Calling Microsoft SQL Server Stored Procedures from OpenESQL Resolution: The attached program illustrates various methods of invoking SQL Server stored procedures. The procedures are very simplistic but demonstrate the mechanism for creating and calling stored procedures with SQL Server. Solution: The stored procedure 'mfexecsptest' has two input parameters and one output parameter. The procedure adds the two input parameters together to produce the output value. It is invoked in the first and second examples through an embedded sql CALL statement. Example 1 demonstrates invoking the procedure with positional values, that is, the physical order of the input data in the CALL is associated, in order, with the stored procedure parameters as defined in the Create Procedure statement. This is referred to as 'passing by position'. Example 2 demonstrates invoking the stored procedure and passing the data by reference. The name of each st
Problem: Accessing an Excel 97 Spreadsheet with Embedded SQL Resolution: Create a spreadsheet that will be used with embedded SQL by creating one that contains name/titles at the top of each column. These titles will be the column names used in the embedded SQL statements. Highlight the whole table or the applicable piece of the worksheet and assign a name to this group of data. This is accomplished by selecting INSERT > NAME > DEFINE function. This name will be the table name assigned to this data. The Save As function must be used to save this spreadsheet. Now you can create a datasource using an appropriate ODBC driver for Excel, and point it to this .xls file. Below is an example of a spreadsheet. The group of data is named tsttable. Table tsttable has 4 columns - field1, field2, field3 and field4. In the attached COBOL program, generated by the OpenEsql Assistant, you will see the columns identified in the SELECT statement as f
Problem: Is it possible to select more than one item in a Listview and, if so, how can you get a list of items that have been selected? Resolution: You need to use the MultipleSelection method to tell the listview that more than one item can be selected. The "selectedItems" method returns a collection that contains the selected items. Old KB# 7036
Problem: The file-control paragraph specifies the file as follows: select dataFile assign 'datafile.dat' Resolution: The default "file-control-entry" in a COBOL program (the select statement) specifies an optional file. Such a file may or may not be present when a program attempts to open the file. When an optional file is not present at the time an open i-o statement is executed, a file status of "05" is returned and an empty file is created. When an optional file is present at the time an open i-o statement is executed, a file status of "00" is returned. In this way you can determine whether you are processing a new, empty data file (file status = "05") or an existing data file (file status = "00"). If you never want to process an existing file, you can c
Problem: The Help system states that the actual timeout period for the stated value is in seconds or tenths of a second for example: ACCEPT ws-variable AT 2326 TIMEOUT AFTER 600 ON EXCEPTION MOVE 1 TO ws-variable. Resolution: This format of ACCEPT is a Micro Focus extension (see Language Reference manual for full details). The timing unit used is not specified within the source. The ADIS configuration utility (ADISCF) allows you to specify whether the value is treated as seconds or tenths of a second. The default setting is seconds. Old KB# 7060
Problem: If one entry point in Cobol is exposed through the Interface Mapping Toolkit to an EJB using another exit point (a CHAIN operation) is this compatible with exposing it? Resolution: When you CHAIN to a subprogram, control never returns to the calling module (like an XCTL in CICS). The original parameters are preserved so that they go back to the EJB. Old KB# 7022
Problem: Microsoft have implemented security on MAPI based applications so counter virus threats on desktop applications. MS Oulook when used with MAPI based applications now prompt when an external application attempts to send email. An application may not want this level of security. Using SMTP as a medium for send email may work better for the application. Resolution: There are 2 demoes attached. One is a .Net solutoin that uses .Net classes to send an email. Also there is a Win32 based Net Express demo that shows how to use CDO for Windows2000 ( available with Windows2000/XP/2003). Attachments: cdo.zip Old KB# 7018
Problem: Clicking on an image to print using Javascript's function window.print() invokes the printer dialog and causes the form to be submitted. This causes a CGI error or "page cannot be found". The CGI Error states the following message: "The specified CGI application misbehaved by not returning a complete set of HTTP headers." Resolution: The problem is caused by the usage of "inputimage" instead of "image". The "inputimage" causes the form to be submitted. This is not necessary when the purpose is simply to print the current page using window.print(). Make sure to use "image", which is in Page Elements toolbar (while "inputimage" is the one in the Form Elements toolbar). Old KB# 7027
Problem: Getting truncation of Oracle NUMBER(27,9) column using ODBC Resolution: The host variable definition you need for the Oracle NUMBER(27,9) in COBOL needs to be PIC S9(18)v9(9) comp-3. The directive INTLEVEL(4) is required to compile program. Old KB# 7019
Problem: Crreating line sequential files with escape sequences, and they are not working as expected because Net Express inserts null values. Resolution: To eliminate nulls being placed in line sequential files: Either create a text file called extfh.cfg with the following entries [XFH-DEFAULT] INSERTNULL=OFF then set environment variable extfh=x:\\directoryname\\extfh.cfg or set environment variable cobsw=-N which turns off null insertion Old KB# 7054#netexpress#RMCOBOL#AcuCobol#COBOL#ServerExpress
Problem: Using Net Express I-O syntax to read an XML document which is in the form: <containing-doc> <childdoc1></childdoc1> <childdoc2></childdoc2> </containing-doc>, where there can be 100,000 or more instances of the <childdocn> element. When this file is opened for input, and a READ filename is executed, the entire document will be read into memory in the form of an XML DOM tree. If the document being read is very large, say 60MB , this READ operation could take up to an hour or so, and it may actually use up all the available virtual memory on your computer. This would result in a Windows error message about the system's Virtual Memory being too low and the program would then crash. Resolution: There are a few ways that you can work around this problem. 1. Increase the amount of Virtual Me
Problem: Would like to use CBL2XML to generate the copybook for an XML document that has multiple record definitions at the element level, depending on the value in a contained attribute. Resolution: The CBL2XML tool has a restriction on this type of construct. It will only generate the record description for the first record type specified in the schema. It will ignore any multiple record types or redefinitions of elements. This is a restriction in CBL2XML only, and not in the XML support provided by Net Express. The XML syntax support does provide for this type of redefinition in two different ways. Both ways are documented, with example code, in the Net Express On-Line Help. The first method is to use variables as tag names and values so that you can read any type of XML layout, and receive the names of the tags that are found, along with the corresponding data. This allows you to read an XML document with
Problem: How to to generate a copyfile for an XML document for which only a Document Type Definition (DTD) file is being used to describe the data elements in the document. Resolution: The CBL2XML tool cannot use a .DTD file in the production of a copybook. The Document Type Definition (DTD) file needs to be converted to a schema in order to be usable with CBL2XML. There are many 3rd party tools that can do this automatically, including a product called Stylus Studio. If you use Stylus Studio, and click on File>Document Wizards, you can select "DTD to XML Schema". Load your DTD and it will be converted to a corresponding XSD schema file. A DTD file does not allow for different data types and lengths to be specified for elements and attributes within a document, so the Schema that is generated will have all elements defined as a string type with an unbounded length. Add the following line to the beginning of the
Problem: Does an XML schema need to be present for a Net Express program to read an XML document? Resolution: The schema file does not need to be present in order for a Net Express program to read the XML document. The schema file must be present only in the generation of the COBOL XML-enabled copyfile when using the CBL2XML tool. CBL2XML creates the COBOL copybooks by using the data type and length information that are defined for the XML document within the schema file. In this way an element described as "type=xsd:integer" in the document will be read into a numeric COBOL field etc. CBL2XML does not have to be used to generate the copybooks. It is the most convenient and easiest method, but a programmer can code the entire XML record description by hand if they wish to. However, they still must know the names and description of the elements within the file, or there will be no mea
Problem: RTS114 error returned on call to Oracle procedure from OpenESQL application COBES0100S Incorrect SQL statement syntax near begin Resolution: When converting Pro*COBOL applications to execute using OpenESQL, note that the syntax for calling Oracle procedures may differ. Specifically : o PL/SQL cannot be used with OpenESQL applications. o Parameters should be followed by the parameter type, i.e. IN, INPUT, INOUT, OUT, OUTPUT. If no type is specified, INPUT is assumed. Whereas under Pro*COBOL, you would code : EXEC SQL EXECUTE BEGIN mySchema.myProc( :param1,
Problem: Is it possible to access multiple databases within a single OpenESQL application? Resolution: Yes. This is easily accomplished using named connections and the SET CONNECTION statement. At the beginning of your program you must connect to each database you wish to access. Each CONNECT statement specifies the AS clause which associates a user-defined name to the database connection. When access to a specific database is required the SET CONNECTION statement is issued specifying the name associated with the desired database connection. All subsequent SQL will access this database connection until another SET CONNECTION statement is issued. Below is a simple program that demonstrates accessing an SQL Server database and a DB2 database. The program opens a cursor on the DB2 database, fetches a row and, based on the value for discount-stor-id, retrieves a row from the DB2 database. Data Division. 01 dsqlcode pic s9(4) comp-5. EXEC SQL INCL
Problem: The following is an example of how to use the XML PARSE statement within Net Express. This example is different to the XMLPARSE example on the SupportLine Net Express examples page. That demonstrates the use of the Microsoft XML parser MSXML COM server, whereas this example demonstrates IBM XML PARSE. Resolution: $SET MF id division. program-id. testparse. data division. working-storage section. 01 xml-document. 05 pic x(36) value '<?xml version="1.0" encoding="UTF-8"'. 05 pic x(19) value ' standalone
Problem: Net Express 4.0: Trying to open project files .app you get back error message: 'Project file does not contain a version string' and a 'Save' does not run correctly before. Resolution: Probably, you have lost local 'user admin rights' in Windows, after setting this back to 'user admin rights' you should be able to open all .app files in a right manner. Old KB# 7010
Problem: Where is find on field option in Net Express Data File Editor Resolution: Steps for finding a value assoicated with a specific field in a datafile: 1. open the datafile - select file > open 2. open the associated structure (str) - select file > data tools > load record layout 3. from the record layout (structure) click on the field name containing the value to be searched 4. select search > data tools > data file find and replace, a find dialog box is displayed 5. in the dialog box - check hex option 6. after checking hex, Use field option will be available for checking - check Use field note: This will automatically check Within Offsets option displaying the proper value for Left and Right based on field position in record and field length. Left and Right can be changed to isolate a particular range within the specified field if nece
Problem: Use PANELS2 functions or Class library reference's methods. In the code pasted below, the Entry field's handle is set in the data EFhandle of the data-block through the use of the Dialog system function MOVE-OBJECT-HANDLE The MOVE-OBJECT-HANDLE function lets you save the handle of an object in a numeric data item in the Data Block. This ensures the same objects are being referenced by both the Panels V2 and the Dialog System parts of your application. As an example: MOVE-OBJECT-HANDLE RENAME-PB PB-HAND MOVE-OBJECT-HANDLE RENAME-WIN WIND-HAND Resolution: class-control. EntryField is class "txtentry". DATA DIVISION. WORKING-STORAGE SECTION. 78 dialog-system &
Problem: How to call ORACLE stored procedures and functions using the ODBC interface in Net Express . Resolution: The attached program illustrates various methods of invoking an Oracle stored procedures and functions. This Cobol program illustrates invoking these procedures and functions with positional values, that is the physical order of the input data in the CALL is associated, in order, with the stored procedure and functions parameters as defined in the CREATE statement. This sample program also demonstrates the use of an Oracle package. An oracle package is just a logical way of grouping objects together. It consists of a specification which identifies the interface to each object (stored procedure and function) and the body, which implements the procedural logic. The procedures and functions are very simplistic but demonstrate the mechanism for creating and calling ORACLE stored procedures and functions through the ODBC interface in Net Express. The
Problem: COBES0100S duplicate CURSOR Resolution: From Net Express 4.0 onwards, OpenESQL requires all cursor names to be unique. This restriction did not exist in earlier versions of Net Express. If the existing source code looked like this : EXEC SQL DECLARE CURSOR-1 CURSOR FOR S1 END-EXEC PERFORM CHECK-SQL-STATUS EXEC SQL PREPARE S1 FROM :SQL-STATEMENT END-EXEC PERFORM CHECK-SQL-STATUS. EXEC SQL DECLARE CURSOR-2 CURSOR FOR S1 END-EXEC PERFORM CHECK-SQL-STATUS EXEC
Problem: If you are migrating an old COBOL Workbench application to Net Express that uses SCREENS, you will not initially be able to edit the screen definition files. you will be able to run the application successfully. Resolution: You must use Net Express 4.0, and ensure that the Classic Tools Addpack (filename mct00n40.exe) is applied from the Micro Foucs SupportLine web site. Old KB# 7012
Already have an account? Login
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.