Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
Problem: Applications that perform very large SORT operations can often take quite some time to complete the process. However it is possible to inrease the performance of a SORT application by increasing the amount of memory used by SORT by conguring the SORTSPACE environment variable. Resolution: By default, SORT uses 1MB of memory when performing SORT operations. This amount can be increased however by setting the SORTSPACE environment variable to specify a greater amount of memory, for example SET SORTSPACE=256MB The more memory you define, the quicker the sort. We found that using the settings below produced the following results when performing a SORT operation against 1 million records: SORTSPACE TIME TAKEN 2MB 39s 1
Problem: In .NET WinForms how to show a form as a Modal Dialog Box? Resolution: Showing a form as a Modal Dialog Box by using the "ShowDialog" method. This will display the form as a Dialog Box and return a value that allows to determine if OK orCANCEL was pressed. For example: set ls-result to ls-Form4::"ShowDialog"(self) The ShowDialog method takes the parent window as a parameter. Old KB# 4408
Problem: When the "Remember this" logon option is set, compiling DB2 programs will no longer present the logon dialog. How to get the logon dialog to show up again? This would be necessary to use a different user id and password Resolution: The following can be found from the DB2 documentations: ________________________________________ Compiling Programs that use a Remote DB2 Server To compile a program that uses a remote DB2 server, you must first connect to that remote server. The DB2 ECM first attempts to connect to the database using the default values for the client workstation you logged on with. If the logon fails, the DB2 ECM will invoke the Micro Focus SQL Logon dialog in which you can then enter a logon ID and password for the database you are trying to compile your program against Automated Compiles Having the graphical logon dialog appear might not be acceptable for automating compiles from a background process such as a command f
Problem: Using a Treeview control how can you put a Node into Edit Mode ? A tree view allows you to edit the label of a TreeViewItem. Can you programmatically force a item into this mode. Resolution: You can do this using the "EditLabel" method. The following code snippit shows how you can create a treeviewitem and put it into edit mode:- INVOKE aTreeview "addItemZ" USING aTreeView Term-Field RETURNING ws-treenode &n
Problem: Cannot find ygrep32.dll when compiling a COBOL program. This error occured when rebuilding a COBOL project in Net Express. Resolution: The ygrep32.dll is used by the PCOMMAIN precompiler that is supplied with the Migration Toolkit. Moving the ygrep32.dll to a directory pointed to by the PATH statement resolved the problem. Old KB# 4405
Problem: Windows Vista differs from earlier Windows operating systems (eg. Windows XP) in that you must take into account security restrictions which are defaulted into the operating system. As it stands only NetExpress 5.0 and NetExpress 5.1 are currently supported on Windows Vista. Before installing any wrappack, fixpack or hotfix it is stronly advised to carefully read the installation instructions on the SupportLine "Products Update" website page as there are specific installation instructions for each wrappack. The aim of this article is to emphasise further security issues pertaining to Windows Vista which are not mentioned in the installtion instructions on the website. If you do not amend the security settings indicated below, you will get the an error message when attempting to install the patch which will be along the lines of: "Server 5.0 WrapPack #005 has not been installed. Please contact Micro Focus Sup
Problem: Release 4.0: While debugging within IDE and trying to change a value the Net Express IDE crashes completely with an unexpected error, s. attached snapshot. What to do to prevent this? Resolution: Probably, there are some Net Express common files not registered in the Windows registry correctly. Take a look here first: ..programs\\common files\\Micro Focus for Hex3.ocx, Hex5.ocx, Valueedit.ocx To register those files again via the Windows command line use regsvr32, i.e.: >regsvr32 Hex3.ocx and the problem gets rid off. Attachments: 2145552.JPG Old KB# 4406
Problem: When creating a new mapping for a Web Service from legacy COBOL code, you may find in doing so that the case of the legacy COBOL code is lost - for example all converted to lowercase. This may cause you a problem if you have a requirement for the case to be as in the original code, for example (lower-) CamelCase. Resolution: Specify the PRESERVECASE directive in your program program: $SET PRESERVECASE This will then ensure that the original case is preserved as required. Old KB# 4429
Problem: When a Visual Basic program creates another VB object and attempts to pass this object to a Cobol Object the the Build Error "Reference required to assembly 'xxx' containing the type 'xxx.yyy'. Add one to the project. The calling project does have all the required references. The error occured in Visual Studio 2003. Resolution: This is caused by a bug in VB and is documented by Microsoft at: http://support.microsoft.com/kb/818411 To work around the problem by adding a reference to the Assembly DLL rather than the project. This error was also resolved in Visual Studio 2005. Old KB# 4358
Problem: This is the easiest and quickest way to animate a DB2 stored procedure with UDB 8.1 with latest fixes or a later version of UDB. This assumes that the Net Express development environment is installed on the UDB server machine. Resolution: The procedure for animating a COBOL Stored proedure is as follows:- 1. put a call to CBL_DEBUGBREAK within in your stored procedure program 2. compile the stored procedure and create it as a dll 3. link the stored procedure with db2api.lib 4. make sure the stored procedure dll is linked as shared , dynamic and includes the system files 5. copy dll to IBM's sqllib\\function subdirectory 6. run the stored procedure from IBM's development center and enter necessary parameters 7. when the dialog box appears that indicates the RTS has encountered a call to CBL_DEBUGBREAK , do you want to debug - answer yes 8. the stored procedure should pop up in animator, ready for animating Note: R
Problem: Often there is a need to be able to calculate the length of data within a COBOL string (PIC X). Resolution: There are many ways to calculate the length of data within a COBOL string variable. The following method is simple and hopefully easy to understand. The code basically does the following: 1) It reverses the string using the REVERSE Intrinsic function. 2) The INSPECT verb is used to count the number of leading spaces. 3) The number of leading spaces is subtracted from the total size of the variable. Here is a small example that illustrates the idea: working-storage section. 01 ws-string pic x(40). 01 ws-string-len
Problem: Sometimes there is a need to display the day of the week from a COBOL program. Resolution: The following code sample shows a way of calculating the day of the week from any given date. The date needs to be in the format YYYYMMDD. working-storage section. 01 ws-weekdays pic x(21) value "SunMonTueWedThuFriSat". 01 ws-week-day redefines ws-weekdays occurs 7 times. 01 ws-date pic 9(8) value 0. 01 ws-day pic 9(1) value 0. ...
Problem: Open ESQL supports the WITH HOLD syntax of the DECLARE CURSOR statement. WITH HOLD maintains resources across transactions or multiple units of work. Cursors defined by WITH HOLD will remain open after a COMMIT. This is of course dependent on whether the ODBC interface supports this functionality and whether the ODBC data source has been configured to enable this capability. If WITH HOLD is not supported you will receive a sqlcode of -19520 Connection does not support HOLD cursors on the OPEN CURSOR statement. Resolution: BUILD W/RELEASE: NETExpress 3.1 The program creates two tables in the database and inserts records into both. A cursor is opened on the first table using the 'WITH HOLD' option of the DECLARE CURSOR statement. A row is fetched and then a row from the other table is updated and committed. The next row is fetched from the table, if sucessful the "WITH HOLD" option prevented t
Problem: This demo illustrates how to access multiple databases from a single cobol program. The databases are DB2 and Sql*Server. The concept is to use named connections and the SET CONNECTION statement. At the beginning of your program a connection to each database is established. 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. All subsequent SQL will access this database until another SET CONNECTION statement is issued. Resolution: BUILD W/RELEASE: Net Express 3.1 The program will prompt you to enter your db2 datasource name, your db2 userid and password, your sql server datasource name and your sql server userid and password. The format for the userid and password is userid.password. If no password is required than merel
Problem: This demo shows how to generate and animate a dump file using the CBLCORE utility See also KB article 23217 for details of doing this using the core_on_error runtime tunable. Resolution: BUILD W/RELEASE: Net Express v4.0 including ALL03N40 WrapPack. SOURCE FILES: ========== Program Files Description ---------------- ----------------------------------------------------------- CBLCORE.CBL Test program that will cause a runtime 114 error Resource Files: ---------------- ----------------------------------------------------------- DOIT.BAT Bat file OPERATION: ======== From a NetExpress Command Prompt execute the included BAT file, doit.bat. This bat file compile for animation and link the test program then it will execute the CBLC
Problem: Example of how to use the .NET Framework Mutex class to detect if more than 1 instance of an application running. Resolution: Tested with Net Express 5 ================ INTRODUCTION ========== Example of how you can use the .Net Framework Mutex class to detect if you have more than 1 instance of an application running. REQUIREMENTS: ========== Visual Studio 2005 and .NET Framework ========================================================== Keywords: demonstration, sample, example, demo, AppInstance.zip , Mutex demo.ex demo.me d
Problem: Keyboard utility program that will test the old and new keyboard functions. If the new functions do not work and having a 16-bit character based application, the COBSW K1 switch can be used. Resolution: ========================================================== Keywords: Utility, doskey.zip demo.ex demo.ne Attachments: doskey.zip Old KB# 4361
Problem: Can COBOL support Dynamic Arrays? Resolution: Micro Focus only support Dynamic arrays in COBOL.Net where an array can be defined as:- 01 myarray object reference cMyClass occurs any. and then do:- set size of myarray to 100 On Non .Net platforms (Server Express and Net Express) then there is a need to use one of the OO Collection classes. There is an Array class (for example bytearray) that should do what is required. Depending on the requirement there are also other collection classes that could work depending on what the exact needs are. The only other solution would be to put the definition of the array in LINKAGE SECTION and allocate it dynamically. For example:- LINKAGE SECTION. 01 my-array. 03 my-item pic x(100) occurs 1 to 1000000 depening on ws-length At runtime the c
Problem: Release 5.0 .NET: Kann Net Express 5.0 .NET mit der deutschen Version von VS2005 installiert werden? Resolution: Ja, das funktioniert. Bitte beachten Sie: Dieser Hinweis gilt nicht für die Visual Studio 2005 Express Edition. Old KB# 4370
Problem: Often there is a need to read and set operating system environment variables from COBOL programs. How can this be done? Resolution: Micro Focus COBOL provides syntax that permits the reading and setting of environment variables within the Windows system. Please note the following points though: 1) Creating/changing the value environment variable it will only remain current for the duration of the COBOL run unit. Other applications will still see the original setting. 2) To call MFEXTMAP to enable the setting of environment variables. 3) To use ON EXCEPTION to test for errors when manipulating environment variables. The following example illustrates the syntax required to manipulate an environment variable valled TESTENV: $set xopen working-storage section. 01 ws-env &n
Problem: This is a "Mixed Language" 'C' and COBOL project. It was created using NetExpress version 3.1 and Microsoft Visual Studio version 4. It has been tested with Microsoft Visual Studio C/C version 6. The project illustrates how you can incorporate editing, compiling and building 'C' source programs together with COBOL source programs within a common project Resolution: SOURCE FILES: ========== Program Files Description --------------------- --------------------------------------------------------- CNCBLFH.C The initial program of this example. This program displays a couple of messages to the console &
Problem: When generating a client in the Interface Mapping toolkit an error was displayed about a missing assembly MicroFocus.COBOL.CodeDom. The error occured in Net Express V5. Resolution: Checking the Global Assembly Cache (c:\\windows\\assemblies) the file was indeed missing. The issue was resolved by opening Add/Remove programs and highlighting Net Express. You can then click on the Support link and REPAIR the install. Old KB# 4378
Problem: Is it possible to create Adobe PDF files from COBOL? Resolution: COBOL does not have any specific support for creating PDF files. However, using the PC_PRINT functions under Windows there is a possibility to utilise a PDF print driver. There are a number available including the one from Adobe. When installed, these simply offer PDF as one of the "Printers". The COBOL program can select this and generate a PDF file from the printed output. One such driver can be located at: http://www.pdfcreator.de.vu/ Micro Focus is not recommending the above and has not tested the driver with its products. We have no association with the creator of the driver and no warranty is expressed or implied. Old KB# 4369
Problem: MFSupportInfo - Utility program to gather up workstation and products information. Resolution: Attachments: MFSupportInfo.zip Old KB# 4365
Problem: PC_PRINTER routines and RAW printing for sending data to electronic mailboxes Resolution: Some multi-function printer/copier/scanners have the ability to store reports in electronic mailboxes. The PC_PRINTER_OPEN routine can be used to display a dialog box that may have options to send to mailboxes, but any embedded PCL (Printer Control Language) code in the print data will not work. Using PCL code/printer escape codes, the RAW print method should be used instead. This method is demonstrated in the printraw demo available at http://supportline.microfocus.com/examplesandutilities/nesamp.asp under the Printing category. Advanced functions such as sending to electronic mailboxes are actually implemented by using PJL (Printer Job Language) instead of PCL, embedding both in the print data is possible. For more information to consult the printer/copier/scanner's documentation for PJL codes because this is a machine-specific environment. O
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.