Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
Problem: How can I get/set the column widths in a DataGridView in a COBOL WinForms application. Resolution: There is a "Width" property on the Column object. Given the datagridview object you can access it using code such as:- set Label2::"Text" to dataGridView1::"Columns"::"Item"(1)::"Width" This code get the width of the second column (zero based index). Old KB# 3955
Problem: Net Express 5.0 supports "COPY" but many of our COBOL programs use -INC to include copybooks which throws a compiler error . Is there any directive we can use so that Net Express supports this? Resolution: The directive you require is LIBRARIAN. The full directive detail is included below: LIBRARIAN Allows -INC statements in your program. Syntax: >>-.---.-.---------LIBRARIAN--"integer"-.----->< -/- -.----.--LIBRARIAN------------ -NO- Parameters: integer The level of support required. 1 -INC statements are ignored; that is, no error message is generated. 2 -INC statements are processed. Properties: Default: NOLIBRARIAN Phase: Syntax check $SET: Any Comments: The -INC statement specifies a file for inclusion in the source program
Problem: When you use the "System.Net.Mail" classes in .Net to send an email using smtp how can you specify the logon details to the server. Resolution: To do this you can use the "System.Net.NetworkCredential" .Net Class. Some example COBOL that uses this is:- $set sourceformat"variable" program-id. Program1 as "SMTP.Program1". environment division. configuration section. repository. class cMailMessage as "System.Net.Mail.MailMessage" class cMailAddress as "System.Net.Mail.MailAddress&q
Problem: Unmanaged Cobol class has a method returning "pic x" data. Unmanaged Cobol class is compiled to dll and registered (regsvr32) regarding to rules "to use rcw to call unmanaged Cobol". A VB.NET application invokes the Cobol class (added to vb.net application references as COM) and succesfully receives the returning "pic x" data. In Unmanaged Cobol, method's returning data type is changed to "pic x(4) comp-5" to return integer value to vb.net app. Cobol app is rebuilt, unregistered and registered again. Cobol COM is removed from vb.net app references and added again to expose returning value data type change to vb.net. But returning value data type change doesnot expose to vb.net app, vb.net app still recognises the data type as string not integer. What may cause such behavior? Resolution: This behaviour is caused by the way that COM describes its interfaces. When you change the ret
Problem: How is it possible to set the SQL directive CURSOR_CLOSE_ON_COMMIT from COBOL? Resolution: Only specific SET statements can be executed through the static form of the exec sql statement - such as the ones specifically identified in the Net Express documentation i.e. set autocommit, set connection, set concurrency, set scrolloption etc. All other set statements need to be handled by the EXECUTE IMMEDIATE statement as follows: MOVE "SET CURSOR_CLOSE_ON_COMMIT ON" TO WS-MYSQL EXEC SQL EXECUTE IMMEDIATE :WS-MYSQL END-EXEC where ws-mysql is declared as a character string. Alternatively using the same method as described above, you could set the SQL directive ANSI_DEFAULTS. When enabled (ON), this option enables the following SQL-92 settings: SET ANSI_NULLS SET CURSOR_CLOSE_ON_COMMIT SET ANSI_NULL
Problem: Release 4.0: Is there a problem using CBL_CHECK_FILE_EXIST also CBL_COPY_FILE in regard to pathnames including spaces, not getting back a return code consistently? Resolution: Basically, there is no problem using CBL_CHECK_FILE_EXIST, also CBL_COPY_FILE to get back return codes correctly. Please check attached demo file to get more information about. This demo program1.cbl shows how you can use a spacey pathname pointed to drive E:. (If you do not have an E: drive change it to a drive you want). Attachments: CBLSPACE.zip Old KB# 3917
Problem: A COBOL .NET application fails to use Fileshare. Resolution: You cannot have a COBOL .NET application to use Fileshare directly. An unmanaged (non-.NET) Cobol application compiled with $SET CALLFH"FHREDIR" can however be used with Fileshare and called by a .NET application. Therefore, you can consider one of the following options: create the Cobol application that uses Fileshare as a COM object, add a reference to your managed code project, and invoke the COM object OR create it as a Windows DLL, add it as a reference in a managed COBOL .NET project, and use platform invoke to call it. You could then have your .NET (e.g. VB .NET) project call the managed COBOL project that will call the unmanaged COBOL that uses Fileshare. There is an example of using pinvoke in the .NET examples (C:\\Program Files\\Micro Focus\\Net Express with .NET\\Examples\\Pinvoke) Old KB# 3940#COBOL#AcuCobol#RMCOBOL#netexpress#ServerExpress
Problem: The Migration Development Toolkit is an addpack which eases migration from the mainframe to Enterprise Server in migration scenarios. It was designed to be used with Net Express 4.0 but not Studio 5.0. Resolution: When installing it on Studio 5.0 you will need to install the files attached to this KB. They are: PCOMMAIN.DLL, PCOMUTILS.DLL, YGREP32.DLL and several .DIR files. Attachments: Temp.zip Old KB# 3847
Problem: You can get a 173 Error Exception in .Net is you attempt to call a program that resides in a different namespace if that other assembly has not already been loaded. Resolution: You can fix this by adding the namespace to the call:- call "namespace1.program1" using ..... Old KB# 3887
Problem: CBL_COPY_FILE returns a status code of 14596 Resolution: The filename parameters that are passed to the CBL_COPY_FILE routine (and other CBL file related APIs) need to be space terminated. Ensure that you initialise the variables and make them longer than the filename you intend to use. Old KB# 3898
Problem: The following commad will give you information about what is the list of imports for a particular .exe or .dll. Resolution: At the command prompt: link /dump /imports prog.exe > report.txt notepad report.txt report.txt will show cblrtss.dll if prog.exe is pulling the Micro Focus single threaded runtime, or cblrtsm.dll if prog.exe is pulling the Micro Focus multithreaded runtime. report.txt should also show other dlls that are been pulled when prog.exe is loaded. The same command would work the same for prog.dll instead of prog.exe. Old KB# 3878
Problem: I've compiled my application with SQL(TRACELEVEL=n), yet I cannot find the resultant log file (OpenESQLTrace.XXX.log). Resolution: OpenESQL requires write permission to the current directory to create the OpenESQL trace file. If running from within the Net Express IDE, this will be the project directory. If the current directory is not writeable, OpenESQL will attempt to create the log file in the directory pointed to by the TEMP environment variable. See http://supportline.microfocus.com/mf_kb_display.asp?kbnumber=20008 for further details on OpenESQL tracing. Old KB# 3899
Problem: You will encounter a problem when installing Application Server if setup detects an existing installation of Application Server. Resolution: Run Regedit. Rename: HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall To: HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall-temp Note: Do not open the Uninstall key. Right mouse click the Uninstall key name and click the Rename button in the context menu. Type the new name and press Enter. Close Regedit. Rerun Install. At "Welcome" screen, run Regedit and rename Uninstall-temp to Uninstall. Close Regedit. Continue with installation. Old KB# 3885
Problem: A COBOL app in Net Express 4.0 outputs to a file. How do you write to the file using different Font sizes? Resolution: There is no way to select/change the font (size) of the text being output to the file. You are simply outputting text. There are PC_PRINTER_ routines in Net Express that allow you to specify the font and size to be used by the printer to print the file. Please refer to the online documentation for these library routines. Old KB# 3861
Problem: When using the .Net Framework email classes in the System.Net.Mail namespace, the method to specify that the format of the mail is HTML. Resolution: Use the "IsBodyHTML" property on the System.Net.Mail.MailMessage class. $set sourceformat"variable" program-id. Program1 as "SMTP.Program1". environment division. configuration section. repository. class cMailMessage as "System.Net.Mail.MailMessage" class cMailAddress as "System.Net.Mail.MailAddress"  
Problem: Web CGI Application. Resolution: Make DLLs of conversion objects (NMCNVRTI.obj, NMCNVRTO.obj). Use call-convention 0. Use set procedure-pointer-item to entry "dllname" to load DLLs and gain access to the internal entry points. special-names. call-convention 0 is llnk. working-storage section. 77 NMCNVRTI-pointer procedure-pointer. 77 NMCNVRTO-pointer procedure-pointer. procedure division. set NMCNVRTI-pointer to entry "NMCNVRTI" set NMCNVRTO-pointer to entry "NMCNVRTO" Old KB# 3897
Problem: When compiling a .NET project, the following errors occur: Could not find method 'New' with this signature Could not find method 'xxxxxx' with this signature Resolution: Create a new .NET project using the same source code. Old KB# 3860
Problem: Any directives or tips to help performance, not using cursors doing select into an array Resolution: Following made a significant improvement in performance: 1. move sql directives to sql program only (remove from project properties) 2. remove autocommit and thread=isolate add autofetch remaining directives were targetdb=mssqlserver ansi92entry esqlversion=3 Old KB# 3857
Problem: What are the methods ejbCreate ejbRemove ejbActivate ejbPassivate and setSessionContext used for? Resolution: These are the defined methods for a session bean as described by the EJB specification, which you can get from http://java.sun.com. Old KB# 3851
Problem: Product: Application Server for Net Express / Server for COBOL An 'C' application calling COBOL returns the following error: cannot fiind Cblrtss.dll Resolution: Set the PATH and COBDIR environment variables to point to the Application Server or Server for COBOL product: Set Path=drive:\\path\\ApplicationServerFolder;%PATH% Set Cobdir=drive:\\path\\ApplicationServerFolder; Old KB# 3877
Problem: If you have a project with for example 3 forms in it:- 1) frmMain 2) frmFirst 3) frmSecond When you run the project it loads frmMain which have the property IsMdiContainer set to true. frmFirst is running as a child of frmMain. From a button on frmFirst how can I start off frmSecond and have that as a Child of frmMain in the MDIContainer. Resolution: You can use code such as:- set ls-frmSecond to cfrmSecond::"New"() set ls-frmSecond::"MdiParent" to self::"MdiParent" invoke ls-frmSecond::"Show"() to do this. You set the parent to the parent of the current form which in this case is frmFirst. Old KB# 3882
Problem: The method to create a global temporary table under SQL Server. Resolution: With SQL Server, a global temporary table needs to be prefixed with ## . This statement will create a global temporary table ##tmptable EXEC SQL Create table ##tmptable (col1 char(10) , col2 varchar(30)) END-EXEC Old KB# 3876
Problem: Running a Cobol application on a Windows 2000 machine fails with an error that says it was not able to find SHELL.DLL Resolution: Make sure to apply Service Pack 4 (SP4) on Windows 2000. Prior to SP4, SHELL.DLL was placed in c:\\winnt\\system32\\dllcache, and it is not in the PATH environment variable. This DLL on the other hand is in c:\\winnt\\system32 with SP4, which is also in the system path. Old KB# 3840
Problem: When running a COBOL application under a local installation of Net Express Application Server you might get a Semaphore error and the application fails. Resolution: When running a COBOL application under a local installation of Application Server and the Application Server license database is also local, make sure that the ASLMFNET environment variable isn't set. This environment variable isn't required when running against a local database, only when running against a remote license database. Old KB# 3890
Problem: This oocurs when trying to do a call 'cbl_alloc_mem' The error returns - 173 module not found 'cbl_allo' The message on the 173 error displayed a truncated name such as cbl_allo Resolution: This error was encountered in a program that had a mixture of mainframe and pc coding and a mainframe dialect was being used. If this occurs use the NOMAPNAME directive and this will stop the truncation of called program Old KB# 3906
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.