Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
Problem: This demo shows how you can use ActiveX Data Objects (ADO) from a Net Express application. For more information on the Methods/Properties and events being used here please see the Microsoft Platform SDK documentation:- http://msdn.microsoft.com/library Resolution: BUILD W/RELEASE: Net Express V3.1 and MDAC 2.5. In order to use this demo you need to have the Microsoft Data Access componants (MDAC) installed. This is available for download at http://www.microsoft.com/data/ This demo has been written and tested using Net Express V3.1 SOURCE FILES: ========== Program Files Description ---------------- ----------------------------------------------------------- ADOData Main ADO Sample Code A DOEvents ADO COM Event
Problem: Release: Net Express 5.0 Consuming from a jsp and a Servlet, deployed on TOMCAT 5.0.28, a Java Bean generated by MF Interface Mapping Toolkit (IMTK) which, thru J2SE, invokes a Service deployed on Micro Focus Enterprise Server Resolution: ============================================ The step of Micro Focus Knowledge Base article 23173 was about consuming a bean generated by Micro Focus Interface Mapping Toolkit by a sample JAVA client launched under a JVM ( ie: java client ), this Bean generated by MF Interface Mapping invoking thru J2SE a Service deployed on Micro Focus Enterprise Server. KB 23173 Sample JAVA J2SE sample which invokes a service deployed on MF Enterprise Server http://supportline.microfocus.com/mf_kb_display.asp?kbnumber=23173 ============================================ The present STEP is about consuming the Bean above generated by
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: C and COBOL, 32bit, mixed language application interface examples Resolution: C calling COBOL ------------------- The COBOL program must be completed first to provide an import library needed to complete the C program. Use the CASE compiler directive. This will preserve the mixed case function names. Specify call-convention 74. This is a Windows 95/NT Standard call. It corresponds to APIENTRY. A call-convention specified in the procedure division header applies equally to each entry statement in the procedure division. C integer items are 32bits, pic xxxx usage comp-5. C character strings are null terminated, z'STRING' or 'STRING' & x'00'. Numeric values, integers and longs, are passed/received by value. Character strings and records (structures) are passed/received by reference. Compile and link the COBOL program from the command line as follows: cbllink -v -k -l -d -FS C2CBLDLL.CBL The -v switch i
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: Utility, written in C, which allows you to test your printer (independent of COBOL). You will need to modify the C code, so a C compiler is required to use it. Resolution: INTRODUCTION ========== Example of how to do a printer driver check using a non-cobol program. REQUIREMENTS ========== C Compiler OPERATION: ======== Edit the C source, printercheck.c Use the example by modifying the line below to your printer name: char name[] = "PrinterName"; Example: printer name is: \\\\prodsup2\\hp340_5s. This would be coded as: char name[] = "\\\\\\\\prodsup2\\\\hp340_5s";. Attachments: printercheck.zip Old KB# 4366
Problem: Release:4.0 Redirecting output from the Generate Client using WSDL feature This method was tested with Net Express 4.0 with All Websync WrapPack v4.0.008. Resolution: The Generate Client using WSDL option from the Service menu of the Net Express IDE will create a Web Service client program, proxy program, and copyfile, but it will place them in the project directory. To want to place these files in different locations, it may be better to use the imtkmake command line utility to do the job. The idea here is to create a batch file with the commands necessary to generate the files and move them to the locations where to have them to be. It can add this batch file as a Tool to the IDE (Integrated Development Environment). As an example, the project directory is C:\\MyProject and there is a CBL subdirectory for source code, a CPY subdirectory for copyfiles, and a WSDL subdirectory for any .wsdl files, to place the appropriate files in those directorie
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: 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: 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: There may be times when you need to coordinate work between multiple instances of a process that are sharing a resource. One process will use the resource while another waits for access to that same resource. To do this, you can use the CreateMutex and WaitForSingleObject Win32 API functions. Resolution: We can use the CreateMutex Win32 API function to protect a shared resource from simultaneous access by multiple processes. Each process must wait for ownership of the mutex before it can execute the code that accesses the shared resource. See the comments in the source files of the attached demo for details. Additional details of these functions can be found at http://msdn.microsoft.com/library/ Attachments: Mutex.zip Old KB# 4289
Problem: An HTML - Form with Disabled Input Fields does not return the values back as expected. When sending the form the data in the disabled input fields are displayed normally. After submitting the data however these fields with ACCEPT HTML-FORM are not returned back. Why is this? Resolution: The reason this is happening is that Disabled fields do not return any value to the server. Therefore the form fields get 0. (not the data expected). See for further explanation: http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.12.1 Old KB# 4297
Problem: When installing Net Express 5.0, getting the message "Installer terminated prematurely" at the step "deleting services". Resolution: If a previous uninstallation of Net Express was not done completely, Micro Focus Directory Service (MFDS) may not be uninstalled. Please reboot the PC and try again. The reboot may take a while longer than usual when the operating system removes the no-longer existing service. Old KB# 4323
Problem: Release: 4.0 Beim Starten des COBOL-Programms wird folgender Fehler gemeldet: Der Prozedureinsprungpunkt "CBL_CTF_TRACER_GET" wurde in der DLL "cblrtss.dll" nicht gefunden. Was könnte das Problem sein? Resolution: Die gefundene Laufzeitumgebung passt nicht zum Compiler, mit dem das Programm übersetzt wurde. Bitte stellen Sie dem Programm neben der aktuellen Entwicklungsumgebung die passende Laufzeitumgebung (Runtime) zur Verfügung. Die aktuellen Versionen sind: all08n40.exe für die Entwicklungsumgebung / aps10a40.exe für den Application Server (Runtime) Old KB# 4305
Problem: What is the meaning of exception error 65537? Resolution: The 65537 error normally indicates an OLE exception of some description during runtime. We would suggest you review the following Micro Focus knowledgebase articles for further information: http://supportline.microfocus.com/mf_kb_display.asp?kbnumber=21875 http://supportline.microfocus.com/mf_kb_display.asp?kbnumber=18139 Old KB# 4281
Problem: If you try to run the Net Express demo program PRINTRAW you might get the error "OPEN PRINT A" PG not found" Resolution: This demo will be linked with Microsoft's SDK winspool.lib, therefore the demo will run correctly if you have the right path addressed while linking the demo project. You should check first: Project Build Settings -> Tab: Link -> Category: Advanced under 'Link with these LIBs' - you need a path correctly pointing to winspool.lib. There is a demo 'printrawHP6P' attached that uses a HP LaserJet 6P printer - you are able to change the name under 'printer-name' in printraw.cbl. For additional information check the README file included, but be aware the demo runs for ESC codes supported by this model and other HP LaserJet printers only. Attachments: printrawHP6P.zip Old KB# 4283
Problem: Using Visual Studio 2005 and NX 5.0: When opening an existing .NET COBOL project or creating a new one and then doing a build the following error message would occur: "Either the project file is invalid, or no project configuration matches the current active configuration. This project will not build, and Language Service parsing will be inaccurate until the project is fixed." Resolution: Go to Add/Remove programs, highlight Net Express 5.0, click on the link that says "click here for more support information", then click the Repair button. Old KB# 4303
Problem: Net Express 4.0 Net Express hangs when opening source files if developing on a Unix machine (eg using SAMBA to access the source as NT files across the network). This will happen if the IDY files exists on the unix box. Resolution: You are only able to open the source file after the IDY file is deleted. This is fixed in fixpack all07n40.exe. The problem is also fixed in Net Express 5.0 GA version. Old KB# 4293
Problem: Are Centrino Core 2 Duo processors that are 64-bit capable compatible with Net Express 5.0 64 bit? Resolution: According to:- http://www.intel.com/products/centrino/duo/310199.pdf the chip is compatible with X64. This should be compatible with 64-bit applications created for X64 as long as they have a 64-bit operating system installed onto it. Old KB# 4300
Problem: How to pass a Picture Object to an Active X control? Resolution: The control will expect an IPicture interface. You can pass this from COBOL using the GUI and OLE Class libraries as follows:- - Create an OLEPicture object from our class library (perhaps the fromICON or fromBitmap) - use GetDomainObject to get an object reference - pass that object reference as the parameter This should then pass the Picture to the control as expected. Old KB# 4326
Problem: MFCLBINP Error 402 when calling/invoking COBOL COM component created with the Interface Mapping Toolkit. Resolution: MFCLBINP Error 402 means "program/entry point not found". The program not found would be the one that the COM interface was built for, your subprogram that you used in the Interface Mapper. If your COBOL subprogram is a .DLL, you can place it in the same directory as the program that uses the COM interface to your subprogram, or you can append the PATH environment variable on the machine to where this .DLL resides. If your subprogram is an .int or .gnt module, you can specify it's location using the COBDIR environment variable. Old KB# 4329
Problem: If you have an object reference instance, is it possible to tell if it is a CharArray or a something else at runtime. Resolution: You can use the "class" method on the object and compare that to the class in class-control. Example program is attached. The code to do this is:- $set ooctrl( P) program-id. TestClass. ****************************************************************** * * Author - Micro Focus Technology Support (davs) * ****************************************************************** special-names. call-convention 74 is winapi
Problem: Where are the options for the javac compiler call specified? To change the option -g:none which can be seen in the compiler output window, also to have -g as an option. Resolution: To find these options for the EJB generation in the file deploy.mfscript, which is located in the Net Express\\base\\bin directory. For any java compile, to specify the options in the mfj.cfg-file, where to be specified javac.exe to be called in the IDE. (Doing so with EJB does not set the -g option, because the compiler would be started as javac -g -g:none which overwrites the intended -g settings.) For java files in the IDE, to specify also the java compile options with right-clicking on the java file on the left side in the project view. Choose build settings and change to the tab compile. Old KB# 4309
Problem: If you have a segmented program (one in which SECTIONs have segment numbers), you may notice that the reference count for a particular paragraph is incorrect. The reference count (how many times the paragraph is referenced) can be seen by hovering the mouse over a paragraph name after the program has been compiled. Resolution: To get an accurate reference count, you will need to compile the program with the NOQUALPROC compiler directive. Old KB# 4272
Problem: Release 4.0 above: Installation - Install NetExpress on Microsoft Terminal Server and/or Citrix Resolution: To use Netexpress on a Terminal Server or with Citrix you have to ensure the following things: This file system.dat in ..\\documents and settings\\all users\\application data\\micro focus\\netexpress\\4.0 must have normal user rights. The user needs to have read access to HKEY_CLASSES_ROOT and HKEY_LOCAL_MACHINE. They also need write access over HKEY_CURRENT_USER/Software/Micro Focus for Net Express. Old KB# 4275
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.