Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
Problem: How can you validate numerics in a .Net Winforms TextBox control. Resolution: The keypress event in .Net allows you to trap when a key is pressed on the keyboard and interpret what key was pressed. This allows you ensure that only digits , "." , " " and "-" are entered. More complex checking can also be performed on the TextChanged Event. This is fired when the Text in a textbox is changed and allows you to check the full text that is in the control. Some examples of using these events to handle numeric checking is:- method-id. "textBox1_KeyPress" final private. linkage section. 01 sender object. 01 e S-W-Forms-KeyPressEventArgs. procedure division using by value sender e. &n
Problem: This example illustrates how the CBL_FILENAME_CONVERT call-by-name routine can be used to accomplish various filename conversions and measurements. Resolution: BUILD W/RELEASE: Net Express v4.0 and up. INTRODUCTION ========== The example program includes the code for 10 different conversions and measurements. This "Readme" file includes concise descriptions for each usage. The example program includes these descriptions together with the code that implements the example. SOURCE FILES: ========== Program Files Description ---------------- ----------------------------------------------------------- CBLFNCNV.cbl Example p
Problem: Passing parameters to a COBOL.Net WebForms application using an URL: http://testserver/testform.aspx?param1=TestValue then accessing the parameters using the "request" object. In C# this can be done using syntax such as: 'string paramvalue = Request.Params["param1"];'. How to access the parameters in COBOL? Resolution: Accessing the parameters using syntax such as: set ls-param to self::"Request"::"Params"::"Get"("param1") A full example of this syntax is attached to this article. Attachments: 2149995.zip Old KB# 1276
Problem: Solution is only to have on-line the LINK.exe Version 8 thru PATH environment variable and the link Version 8 libraries thru LIB environment variable... These ressources having to be invoked firtsly before the ones delivered under Net Express ( ie: [NetxInstallDIR]\\base\\bin\\link.exe & [NetxInstallDIR]\\base\\lib\\user32.lib & kernel32.lib & advapi32.lib & msvcrt.lib & gdi32.lib & advapi32.lib LINK.exe version 6 is delivered with Net Express... Resolution: Working in a DOS command prompt and manage so Net Express uses MS LINK.exe Version 8 ================= 1) ---> Launch Visual Studio 2005 Command Prompt this shortcut launches ... %comspec% /k ""C:\\Program Files\\Microsoft Visual Studio 8\\VC\\vcvarsall.bat"" x86 which correctly sets PATH & LIB envt vars so MS LINK.exe Version 8 can be used .... ====> You c
Problem: In Character Dialog there is a procedure P000. In global dialog this is called the first time a character screenset is called and in local dialog it is called when a panel is first entered. What is the equivalent of this is Graphical Dialog System. Resolution: In GUI Dialog there is a SCREENSET-INITIALIZED event in global dialog. This is executed when the screenset is run for the first time. Its only called first time and will not execute on re-entry to the screenset following a RETC etc. On specific windows you could also use the WINDOW-CREATED event as an equivalent for P000. Old KB# 1279
Problem: A quick trick on how to speed up the loading of the Net Express product is by disabling the Splash screen when the product is started. Resolution: To do this after loading Net Express you go to the Option pull down menu, choose Customize and then click on the Workspace tab. Under the Workspace tab you will find a pull down menu called "Splash screen", you then choose "None". Finally, just click on OK. From this point on the Splash screen will no longer show when invoking the Net Express product. Old KB# 1312
Problem: The formatDateToOLE method in the olesup class only supports putting dates into a OLE Date. The OLE date format uses a floating point number with the decimal portion representing the time portion. Resolution: You can manually enter the time format into the OLE date field using code such as:- program-id. "ConvertDateToOLE". ***************************************************************** * * Program ConvertDateToOLE * * Author davs - MicroFocus SupportLine * * T
Problem: How to SORT a table in storage. Can this be done? Resolution: Yes, here is a sample program that illustrates how to do this: $set mf charset"ascii" Identification Division. Program-Id. LORINCE. Environment Division. Data Division. Working-Storage Section. * Sorted Numeric Values : 111 112 121 122 211 212 221 222 1 MixNumVals. 2 Pic 9(12) Value 222221112121. 2 Pic
Problem: How can the e-mail program be determined which is installed on the Windows PC Resolution: Please have a look into the registry. Step1: Directly under \\\\HKEY_CLASSES_ROOT the entries for the e-mail protocols pop and smtp can be found. The subentry PROTO HANDLER shows a (different) CLSID for each of used protocols. Step 2: This CLSID references its own entry under \\\\HKEY_CLASSES_ROOT\\CLSID. Open the subentry belonging the CLSID found in step 1. There, on the next level, the subentry InprocServer32 shows the DLL which handles the actual protocol for the search started in step 1. Old KB# 1394
Problem: Many customers use share names to map the data files that they are using with their applications. For example instead of using the following: SELECT INPUT-FILE ASSIGN TO "DRIVE:\\DIRECTORY\\FILE.DAT" ORGANIZATION IS ........ ............ The SELECT statement is being altered with the following: SELECT INPUT-FILE ASSIGN TO "\\\\MACHINE\\DIRECTORY\\FILE.DAT" ORGANIZATION IS ........ This is done to avoid having to map a drive to another machine in most circumstances. Reso
Problem: Bei einem Kunden funktioniert jetzt die Software, die mit Net Express 3.1 ohne Application Server entwickelt wurde, nicht. Es wird vermutet, dass es an dem zuvor installierten Net Express 4.0 Application Server liegt. Wie kann bei einem Kunden der Application Server von NE 4.0 wieder deinstalliert werden? Resolution: (1) Eine Deinstallation wird wie folgt vorgenommen: Start -> Systemsteuerung -> Software -> und den Micro Focus Application Server in der Liste der installierten Programme markieren und deinstallieren (2) Nachfolgend sollte in der Windows-Registry der Schluessel 'Micro Focus' geloescht werden, damit der dort eingetragene Verweis auf den Installationsort des Application Servers ebenfalls entfernt wird: Start -> Ausfuehren...-> regedit-> HKEY_LOCAL_MACHINE -> SOFTWARE -> Schluessel 'Micro Focus' loeschen (3) Die Vorgehensweise unter (1) und (2) kann automatisiert werden
Problem: Is it possible to read a line sequential file that contains tab characters i.e. x"09"? The tab control codes seem to get expanded to spaces. Resolution: By default the external file handler will convert tab characters (x"09") to spaces. This functionality can be changed via the EXTFH.CFG file. There is a configuration option called EXPANDTAB that if set to OFF will ensure that the x"09" are left in place. This can be applied to an individual file or on an application basis. An example configuration file would look like this: [TESTFILE.DAT] EXPANDTAB=OFF Please see the Micro Focus online help for full details of this and other configuration options. Old KB# 1336#RMCOBOL#ServerExpress#netexpress#COBOL#AcuCobol
Problem: Releases 4.0 5.0: As part of the execution of an application it might be neccessary to force the application to re-read the File handler Configuration Parameters file. For more details on how to use the File Handler configuration file check the File Handler programming guide, chapter 6. Resolution: To accomplish this you can use the CBL_CFGREAD_EXTFH call. The call forces the File Handler to reread its configuration file. Syntax: call "CBL_CFGREAD_EXTFH" using filename returning status-code Parameters: filename pic x(n). status-code See Key On Entry: filename The file to look for. The name can contain a path, and must be terminated by a space. If the filename is null (x"00"), the File Handler looks for the file using the standard search order (see the topic Searching Conventi
Problem: Net Express has built-in support for the following character sets. The numbering convention used for single-byte character sets is that defined by the CCIT/ITU country code. Resolution: Support is provided for the following character set conversions, except where indicated: " EBCDIC to ANSI " ANSI to EBCDIC MFCODESET Character set AUTOMATIC Determined from the Windows country setting AUTO Determined from the Windows country setting DEFAULT US English 0031 Dutch 0033 French 0034 Spanish 0039 Italian 0043 German (Austrian) 0044 UK English 0045 Danish 0046 Swedish 0047 Norwegian 0049 German 0081 Japanese Katakana Extended 0082 Korean 0086 Simplified Chinese 0351 Portuguese 0358 Finnish 0437 US English 0500 International (Latin 1) 0886 Traditional Chinese 0939 Japanese Latin Extended 9122 Japanese Katakana Old KB# 1310
Problem: Release: Net Express 5.0.NET and Visual Studio 2005: When the program executes the OPEN INPUT for a file described as: SELECT MyFile ASSING "TheFile.Dat" a file status 3/5 is returned, indicating that the file could not be found. Resolution: In the traditional Micro Focus IDE the file is found in the project's directory. In Visual Studio 2005 the file is expected in the directory of the EXE, e.g. in the bin\\debug directory below the directory of the .cblproj. You can check where the OPEN expects the file if you OPEN a (different) file in OUTPUT mode. Old KB# 1382
Problem: My SQL Server stored procedure takes a list of parameters and returns a result set what is the required syntax to call this stored procedure? Resolution: from docs: If a stored procedure call returns a result set, it must be used in a cursor declaration, thus: EXEC SQL DECLARE cursorName CURSOR FOR storedProcecureCall The stored procedure is then called by OPENing the cursor and FETCHing result set rows, like any other type of cursor. Currently OpenESQL supports only a single result set. The code for calling a stored procedure that has two input parameters and returns a result set containing 3 output values for each fetched row would be something like the follows: exec sql declare c1 cursor for &n
Problem: When using client-side cursors with SQL Server 2000 or earlier, there is a limitation of only allowing one active cursor per connection. Attempting to open a second client-side cursor will issue an error "connection is busy processing another hstmt". It is not possible to use separate connections for each cursor as this could lead to locking issues. Resolution: SQL Server 2005 has implemented support Multiple Active Result Sets (MARS). MARS removes this constraint/limitation and allows multiple queries or stored procedures to be performed on a single connection. In order to take advantage of MARS with Net Express, the program must be compiled with the following directives : SQL(DBMAN=ODBC, TARGETDB=MSSQLSERVER, MARS) or, if using a DSN-less connection, specify MARS_Connection=YES within the Connection String. This capablility is provided with Net Express 4.0 all06n40 wrappack (and later). Note that the ODBC DSN used must be the SQL Native Client driver,
Problem: File Handling; for indexed files under exclusive access mode, the maximum size is 4 GB by default using MF format (IDXFORMAT 3) and default FILEMAXSIZE at 4. Because fileshare open file in exclusive mode, does it mean that the maximum is also 4GB even multiple processes are using fileshare to gain access to a file concurrently. As the documentation does not mention fileshare, please confirm. Resolution: Fileshare opens the files exclusively and maintains the locks. Even if two separate process are accessing the records thgrough fileshare the locks are still being maintained under the control of fileshare. Therefore as the file is opened exclusively the limits are the same as any other process opening the file exclusively. Old KB# 1376#COBOL#ServerExpress#AcuCobol#netexpress#RMCOBOL
Problem: This error was encountered on a machine with Net Express 5.0 with Support for .Net installed. This error was encountered after installing the Micro Focus Net Express 5.0 WrapPack 2, NXP3250020077.msp. After completing the install process they tried to open a .NET COBOL solution and received the following error: Unable to load C:\\Program Files\\Micro Focus\\Net Express 5.0\\Packages\\cblprj.dll Resolution: The wrappack installation notes state that before installing this WrapPack, you must uninstall Net Express support for .NET in Net Express 5.0 if you have it installed. To uninstall the Net Express support for .NET: Go to Add or Remove Programs in Windows Control Panel. Navigate to Micro Focus Net Express 5.0. Click Change. Follow the wizard and choose to uninstall the Net Express support for .NET. You can reinstall the updated Net Express support for .NET after installing the WrapPack using the same procedure as above but choosin
Problem: A problem has been encountered when attempting to install NetExpress 3.1 on a machine running Windows 2000. (However, this may occur with other versions of the product and operating systems). Despite there being more than sufficient disk space available, the system reports that there is insufficient space and so the installation aborts. Resolution: To overcome this problem, carry out the following steps: 1) First, log on as Administrator 2) Enter into the registy and open the following keys: HKEY_LOCAL_MACHINE SOFTWARE Micro Focus delete the "Micro Focus" key and close Regedit. 3) Empty the contents of the environment variables TEMP and TMP and then ensure that they point to C:\\Temp 4) Disactivate any AntiVirus software 5) Ensure that there are no other installations of Application Server x NetExpress on the machine in question. 6) Attemp
Problem: Gets a 119 error when an EXE calls a DLL Resolution: Had a cobol exe calling a cobol dll - was also always using the link wizard for the creation of the EXE and DLL settings -- just highlight the EXE and DLL (separatly) and look at the build settings manually the exe had the system programs included - so did the dll - this caused the problem *** take off the system programs from dll - you do not need them if the exe has them also if you get an mf_id_dynlnk_lib_check error - this is caused by the exe being single threaded and the dll being multi threaded - again look at build settings manually and make sure everything matches now everything is single and shared dynamic - exe has system pgms - dll does not Old KB# 1306
Problem: Can not locate the 'text find and replace' window within the IDE window Resolution: Click on the View | Dockable Windows menu option within the IDE and see if the 'text find and replace' window is ticked or not. If it is not ticked, then tick it. If it is already ticked then click on the 'Window' menu and select either 'Tile Horizontally' or 'Tile Vertically' or 'Cascade' or 'Tile Docked Windows' or 'Arrange Floating' to locate the floating 'text find and replace' window. When the 'text find and replace' window is located, right click on the window and tick the option to 'Allow docking'. Then drag and dock the window to a specific location. Old KB# 1267
Problem: The SHA1 is a standard hashing algorithm that given a sting of bytes will produce a hash code for the string. Any changes to the string would result in a very different hash code so it can be used to ensure a message has not been tampered with. How you use this algorithm in .Net COBOL ? Resolution: The .Net Framework contains an implementation the SHA1 algorithm. You can use these classes from COBOL. An example project that does this is attached to this RPI. The program code is:- $set sourceformat"variable" program-id. HashIt as "SHA1Hash.Hashit". environment division. configuration section. repository. class cSHA1Managed as "System.Secu
Problem: Using MFSORT utility but it may also has a requirement to define collation sequence in some cases. For example: sort input file a.inp on position1, size 10 , output file is a.out Command for this using MFSORT is: mfsort sort fields(1,10,ch,a) use a.inp give a.out So the question is how to define Collation Sequence using MFSORT? By definition MFSORT supports DFSORT syntax, but what about about alternate collating sequence (ALTSEQ Control Statement). How does this work on WINDOWS, and how to use it with different code pages? Resolution: In this example to presume the codepage in question is 1250. ALTSEQ function can be used in MFSORT by using the same command as in DFSORT. The attached demo - demo.zip contains a file to sort where we want to sort the file as if an 'A' has the same value as an 'a' and a 'B' as a 'b'. By sorting with 'SORT FIELDS=(1,10,AQ
Problem: What Net Express features can you not use when running in 64bit on the Window operating system. Resolution: The Net Expess online help for Net Express 5.0 documents the following features are not supported in 64-bit: Dialog System (Character and GUI) GUI Class Library Panels Version 2 HyHelp The following features are not currently supported in 64-bit: COBSQL Enterprise Server SQL Option (XDB) Old KB# 1284
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.