Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
Problem: Workbench has the feature to number the each line in a source code. Does Net Express have this feature? Resolution: There is a feature in the Net Express editor that numbers each line of a source code by placing the line number from column 73. This is done by right-clicking anywhere in the source code and click on "Renumber". To remove the line numbers, you can simply right-click anywhere in the source code and click on "Unnumber" this time. Old KB# 1527
Problem: The following example is taken from the Net Express help and shows how to use user defined functions in COBOL. This syntax is part of the ISO2002 standard but what additional compiler directives do I need to compile and run the program? FUNCTION-ID. factorial. DATA DIVISION. LINKAGE SECTION. 01 parm1 BINARY-LONG.
Problem: The time returned from an ACCEPT statment is only accurate to the hundredth of a second, is there a way to retrieve the time to milliseconds. Resolution: There is a demo out on the supportline website that uses the win api GetSystemTime which returns time to milliseconds. The sample is called gst.zip and can be downloaded from http://supportline.microfocus.com/examplesandutilities/nesamp.asp#Win32API There is another win api function that can be used called GetSystemTimeAsFileTime which returns the time in 100 nanosecond increments. This function returns the time in a FILETIME structure which can be declared in COBOL as: 01 FILETIME. 05 lowOrderDateTime pic x(4) comp-5. 05 highOrderDateTime pic x(4) comp-5. 01 redefines FILETIME.  
Problem: Customer is using Net Express 3.1 and cannot find any documentation for the CBL_ library routines. Resolution: Go to the SupportLine web site, http://supportline.microfocus.com. Then log on, under the Self-Service section go to the Patches & Fixes or Product Update section. On that page find the Net Express v3.1 Service Pack 1 section. The documentation update will be found on that page. Old KB# 1510
Problem: using the eza socket feature. Trying to run an initapi, but receives a return code of -1, and receives the error number 0. Resolution: The console showed that he EZASOKET was stopped becuase of bad data and needed to be restarted. 0918 11381705 5820 EZATEST CASSP0002I Server manager informed of process termination, pinfo = S,0000006484 11:38:16 070918 11381705 6680 EZATEST CASOP0000I 01 of 02 From (,,CSKL) EZY1298E 09/18/07 11:38:17 CLOSE CALL FAILURE TRANSACTION= CSKL 11:38:17 070918 11381705 6680 EZATEST CASOP0000I 02 of 02 From (,,CSKL) TASKID= 0015 ERRNO= 00
Problem: SQL 0440N No authorized routine name "STRIP" of type "FUNCTION" having compatible arguments was found. SQLSTATE=42884 Resolution: The DB2 strip function is available in DB2 9.1 but not in db2 8.X Old KB# 1452
Problem: When trying to run the demo ...\\Net Express 5.0\\Examples\\Visual Studio Integration\\Pinvoke on a 64 bit operating system, the demo does not run through the unmanaged call. Resolution: When using a 64 bit operating system, Visual Studio generates managed code for the 64 bit environment while the precompiled SUB.DLL is still 32 bits. The given SUB.cbl has to be recompiled to a 64 bit DLL, e.g. in a 64 bit Net Express CMD prompt e.g. by the command CBLLINK -d sub.cbl The DLL has to be copied to the bin\\debug directory. Starting the Visual Studio now from the Start-Menu still results in a failing call to the unmanaged code because the unmanaged runtime system set by PATH is still the 32 bit one. When the 64 bit Net Express CMD prompt is used to start Visual Studio, e.g. by typing the solution's name, here: PInvoke.sln, then Visual Studio gets the correct environment to run the demo or debug the managed code p
Problem: How can you insert text into the current cursor position of the RichText Edit control. Resolution: You can use the "replaceSelection" method to achieve this. The selection will be the current cursor position. Attached is an exmaple project that shows how you can use the replaceSelection method to insert text at a specific position in a richtext edit control. Attachments: rtf.zip Old KB# 1435
Problem: With the TESTCOVER directive set and the TESTCOVER environment variable set to the location of the test coverage config file no tcz file was produced. Resolution: This was caused by the TESTCOVER directivebeing set in user environment variables. The program was running in the context of a Windows Service. The environment variable therefore needs to be set as a system environment variable. Old KB# 1430
Problem: How can you dynamically change the alignment of Text in a cell of a DataGridView in .Net ? Resolution: There is an enumeration "DataGridViewContentAlignment" that allows you to set the alignment in a cell. You can use this using code such as:- set DataGridView1::"Columns"::"Item"(0)::"DefaultCellStyle"::"Alignment" to cDataGridViewContentAlignment::"TopCenter" set DataGridView1::"Columns"::"Item"(1)::"DefaultCellStyle"::"Alignment" to cDataGridViewContentAlignment::"TopCenter" A full demo is attached to this article. Attachme
Problem: What mechanisms are there to convert strings to numbers in a COBOL Program. Resolution: COBOL has the NUMVAL intrinsic function avalable on all platforms. .Net also has available some methods for converting. On the numeric data classes such as System.Int32 and System.Decimal there is the "Parse" and "TryParse" methods. Parse will attempt to convert but will throw an exception is the format of the string is not valid. TryParse will attempt to convert and will return a boolean if the conversion fails. If you expect that a numeric parse will fail then use tryparse as an exception from Parse is expensive in terms of performance in an application. Attachments: Program1.cbl Old KB# 1422
Problem: Is there a way to place TYPEDEFs where they would be useable for any of these sections FILE SECTION FDs, WORKING-STORAGE, or LINKAGE SECTION , Resolution: Typedefs can be defined in an external program (or program prototype) which is placed before the main program and is therefore available to all sections. See example below. program-id. mytypedefs is prototype. working-storage 01 STD-KEY PIC X(46) IS TYPEDEF. end-program program-id. myprogram. file section. FD .... ... USAGE STD-KEY. WORKING-STORAGE. .... Old KB# 1420
Problem: When a DLL is loaded with SET PROCEDURE-POINTER, the DLL is in use. Therefore, it is not possible to delete or replace the DLL. It only gets released once the program stops running. Resolution: Use the CANCEL statement to cancel each entry point or function that have been called in the DLL before cancelling the DLL itself. Cancelling the DLL only will not release the DLL. See the example below: SET mypointer TO ENTRY "mydll" *> mydll is in use CALL callconvention "myfunction1" using parm1, parm2, ... CALL callconvention "myfunction2" using parm3, parm4, ... ... CANCEL "myfunction1" CANCEL "myfunction2" CANCEL "mydll" *> from this point, it is possible to delete or replace mydll ... Old KB# 1523
Problem: You may want to do the following Visual Basic function in COBOL: ReDim Preserve FileArray(1 To ArraySize) It basically allows you to increase the size of your array as you need it at runtime. Resolution: You could move the large array to linkage then allocate memory for it at runtime when you know how many elements are needed and fix its address using "set address of lnk-array to the-pointer". It won't allow for a redim but gives some flexibility on the array size. Here is a technique that is used by some of our developers when they want to increase the array! They allocate a new block of memory with the new size, copy the contents across, and then free the old memory. There is a whole selection of CBL_ routines for allocating memory dynamically. Old KB# 1447
Problem: Compiling PROGRAM1.CBL with PROGRAM1.CPY as a copybook fails with "COBCH0056S COPY is recursive" [PROGRAM1.CBL] ... COPY PROGRAM1. ... Resolution: COPYEXT(CBL,CPY) is a default compiler directive that causes the compiler to pick up a copybook with CBL extension first. In a case where the copybook has the same name as the program, the compiler will pick up the program itself. To avoid this, here are two options: 1. set COPYEXT(CPY) to pick up copybooks with CPY extension first, or 2. rename the copybooks that have the same names as programs Old KB# 1405
Problem: A wrong CALL-CONVENTION can cause that the perform logic is falling through the EXIT at the end of a performed section or paragraph - especially when executing as EXE. How can the correct CALL-CONVENTION be determined? Resolution: A CALL-CONVENTION is a collection of bits, where the bit "1" means (2**1) that the callee removes the parameter off the stack. E.g.: This bit is set in the CALL-CONVENTIONs 2, 66, and 74 And is not set, if CALL-CONVENTION is omitted or is set to 0, or 8. If (this part of) the call-convention is by mistake, the CALL is executed normally. But after the return from the called program the stackpointer is corrupted. The program executes the following instructions as nothing has happened - including subsequent CALLs. But on a EXIT SECTION or EXIT PARAGRAPH a fall through may occur - instead of a return to the PERFORM statement. When the "CALL-CONVENTION 2 is CALLEE-REMOVES-STACK" is specified
Problem: RTS166 Erorr when using an Iterator on a Dictionary Object When using the DO method on a Dictionary collection it results in a RTS 166 Recursive Call Error. Resolution: This is due to the callback method being used with an alternate ENTRY point in the program. When the iterator calls the entry point it detects a recursive call and terminates with an RTS 166 error. To use Iterators with an entry point you must have a "local-storage section" in the program. It does not need any data. It just enables the program to be called recursively. Old KB# 1434
Problem: Any non-local location is considered as not trusted location by Microsoft Visual .NET Framework. Resolution: Microsoft explains how to make a location as a trusted location at the following link: http://msdn2.microsoft.com/en-us/library/bs2bkwxc(VS.80).aspx Old KB# 1448
Problem: Will an application built for the the .Net Framework V2 using Visual Studio 2005 run successfully on .Net 3.0. Resolution: This will work unchanged. Microsoft have not changed the Common Langauge Runtime (CLR) from .Net 2.0. It is still v2.0.50727. The .Net 3.0 functionality has been as libraries that exist on top of the CLR V2. As such your application will run correctly on machine with .Net V3 installed. Old KB# 1411
Problem: In a COBOL Application can you add an icon to the Windows system tray. Resolution: Attached is an example that shows how you can add an icon to the Windows System Tray and trap mouse events on it. The demo works by creating a Hidden window to receive the mouse button events on the icon. The hidden window is a custom class that intercepts the Windows messages by overriding the "windowProc" method. Attachments: SysTraySBar.zip Old KB# 1442
Problem: Other than in compiler directives within the NetExpress IDE, can the TARGETDIR environment variable for NetExpress 5.0 IDE path concatenation be exported or set? Resolution: Yes. For the sake of convenience, create a new batch file, (e.g., "NetX.bat") and include "set TARGETDIR" and PATH variable statements, then invoke NetExpress at the end of the .bat file. Place the .bat file in the root of the local C: drive, or any other location within the system path. Then create a new shortcut for this batch file on the Windows desktop. Old KB# 1497
Problem: When modifying a Cobol program in the IDE and adding a copyfile statement (when there was no CPY file linked to the program before) - this will compile cleanly. Now when you do a publish to unix --> it will fail because the newly inserted copy will not be published to unix, hence the compilation fails. Publish and/or Publish All does not work. Resolution: Reason is you always need to do an update dependencies when publishing to UNIX. Overview - Updating Dependencies Dependencies exist when one file uses another file as part of its logic flow - one file is said to be dependent on the other. For example, a COBOL source file that contains a COPY statement is dependent on the copyfile specified in the COPY statement. That is, if the copyfile changes, the COBOL source file that uses it needs to be recompiled. Net Express manages most dependencies automatically; that is, files are rebuilt automatically if their dependent files chan
Problem: When trying to add an option to our Net Express installation, we continually receive the message - 'unable to load c:\\supportdir\\xinstaln.dll' as we try to install a new option. Where is the DLL xinstaln used? Resolution: This installation process uses this module as a part of its processing. The customer was using the CD labeled 'Studio for Mainframe Migration'. For Windows XP Pro, if he went to the Windows Control Panel 'Add/Remove Programs', then 'Change', he could select the desired option. For Windows Vista it is slightly different in this area: go to 'Programs and Features', then 'Change'. Because the new releases of Net Express and Mainframe Express use the Microsoft Installer, one cannot re-insert the CD to add/remove options. Instead, one must use the Windows interface via the Control Panel. Old KB# 1517
Problem: Do you know why DB2 distributed would not like this statement? 01 WS-TIMESTAMP PIC X(26) VALUE SPACES. EXEC SQL SET: WS-TIMESTAMP = CURRENT TIMESTAMP END-EXEC It worked fine in XDB. Resolution: It will work in MFE and Net Express using XDB and will work in MFE using HCO (Host Connectivity Option) because HCO passes code to DB2 to allow this to work. This will not work in Net Express using UDB. SET :HV = CURRENT TIMESTAMP is not supported in native DB2 UDB and since HCO is not a part of Net Express this statement will not work. Old KB# 1467
Problem: The "Find in Files" option within the IDE does not always work when running Net Express 5.0 on Windows Vista. Resolution: This is a known issue related to changes that Microsoft introduced in Windows Vista. Micro Focus is working on addressing the issue and it is hoped that this will be done in Net Express 5.1. In the mean time, we suggest you set the "Windows XP SP2" compatibility property against the MFNETX.EXE program in the Net Express\\Base\\BIN folder. Old KB# 1525
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.