Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
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: 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: 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: 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
Problem: When a Tuxedo service program (exe) contains a call to a sub-program, the call to the sub-program fails. Resolution: Using Net Express, all this is hidden from you as the CBLLINK utility does this all for you. This is an issue with how the Tuxedo Service EXE is being built. The BEA supplied makefiles assume that only one COBOL module will be linked into the EXE. It is not running CBLNAMES as part of the process. CBLNAMES takes as a parameter all the COBOL objs that are to be linked, and creates "cblds.obj" which should be linked into the main exe. The BEA makefile for the client uses CBLNAMES, but the server does not. As this step has not been done the sub-program is not found when called unless built as a separate DLL. The Tuxedo build process needs to link in other Tuxedo specific C modules and objs. Change the make file to run cblnames and also link
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: 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: Retrieving ALL the Environment variables of the current process with ONE call to the Microsoft API GetEnvironmentStrings. Resolution: $SET case defaultbyte"00" special-names. call-convention 74 is winapi. working-storage section. 01 ptr pointer value null. 01 i pic 9(18) value 0. 01 j pic 9(18) value 0. 01 k pic 9(18) value 0. 01 l pic 9(18) value 0. 01 WSEnvtStrings pic x(150000) value
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: 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: 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: 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: Attempting to read in an XML document, move i's elements to a new output XML file with the same layout, and write all the records to the new file. The document file contains one root element called <letteroutput> and this is speciified at the 01 level of the record description. Within this one root element there can be any number of child elements called <dunning_letter> which itself contains other child elements and attributes. Reading through the input file using READ NEXT KEY DUNNING-LETTER, and then was moving the elements of each record to the output record, followed by a WRITE LETTER-OUTPUT, and ending up with the <letteroutput> tag for each id (key). move c-type to o-type move c-id &n
Problem: When attempting to generate COBOL calling C#, the regasm command gets error "cannot bind to server <DLL name>" Resolution: The following steps will allow Cobol to call a .net dll. 1. Create a new VS.NET class library and add a simple method that returns a string. 2. Strongly name the assembly Use the sn.exe utility to create a key for the assembly (sn.exe -k TestKey.snk) 3. Add TestKey.snk to the VS.NET project and modify the AssemblyKeyFile attribute in AssemblyInfo.cs to have the filepath to TestKey.snk i.e. (last three lines in the AssemblyInfo.cs) [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile(@"C:\\Net Express\\Base\\DEMO\\omdmap\\TestKey.snk")] &nb
Problem: sqlcode=-208 Invalid object name for Sql*server 7 when doing an insert into local temporary table Resolution: The solution will be to create a local temporary table (#temptable) using Execute Immediate statement, then you will be able to do the insert. It's is a Microsoft problem for Sql*server 7 with ODBC drivers. Old KB# 7069
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: 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: DB2 application returned SQLCODE -1403 on connect statement Resolution: sqlcode =-1403 The username and or/ password supplied is incorrect for DB2 ECM interface if you use the host variables for userid and password in the connect statement and these host variables are longer then actual name and password.To resolve use null termination (Example: Move 'userid' & x'00' to db-userid) to both user nme and password. This should no longer occur with Net Express 3.1 and later. Old KB# 7064
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: SQL Server Table not showing up in OpenESQL assistant, though it appears within the SQL Server query analyzer. Resolution: Ensure that the ODBC data source name is configured to use the correct database. Old KB# 7065
Problem: Running an application from within a .bat file, and would like a way to check the cond code. Resolution: An example script file: @echo off rem - sample batch files using selection list :begin cls myapplication if errorlevel == 3200 goto 3200 if errorlevel == 1600 goto 1600 if errorlevel == 2 goto two if errorlevel == 1 goto one goto end :3200 echo you have selected 3200 goto end :1600 echo you have selected 1600 goto end :two echo you have selected two goto end :one echo you have selected one :end rem next line will end current window rem exit Old KB# 7035
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: NOANIM used in compile statement still results in ANIM shown in listing when using CONFIRM directive. Why would ANIM show in the list produced by the CONFIRM directive when NOANIM is used at compile time? Resolution: NOANIM is the default setting when working from a Net Express command prompt and using the COBOL compiler or CBLLINK. ANIM is the default setting when working within a Net Express project. In a Net Express, Release Build you can use a Cobol.dir file in the project directory for these compiler directives: show-dir setting"col3" confirm list() to obtain a listing file. In Project (menu), Properties (button) you must negate (with a "no" prefix) these compiler directives: WB3 WB CSI ANIM and NOANIM shows in the listing file! IMPORTANT: Using the XREF directive will force ANIM because the checker has to do processing ======= that it would only do when compiling for animati
Problem: My questions is : when it says "removed from memory", what does it means ? " A .dll file is automatically removed from memory when a COBOL program within it is cancelled" Resolution: This depends on the setting in the IDE for the Project Properties>Application>Program Loading tab for the "Cache Programs" option. If this is checked then a CANCEL for a program contained within a .DLL will not release the physical memory for the .DLL. If a program in the .DLL is called again then the same .DLL will be used but the program will be in it's initial state. If the Cache Programs option is not on then doing a CANCEL progname for any program within the .DLL will physically remove it from memory. Old KB# 7031
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.