Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
Problem: A demonstration of using the Consolidated Trace Facility (CTF) on UNIX The Consolidated Trace Facility (CTF) is described in the Server Express documentation, in the "Reference" section, in a book named "Consolidated Tracing Facility". To augment the explanation, this is a demonstration, including working code, a configuration file, and a driving shell script. Resolution: Attached to this article is a file named "ctf-demo.tar". Download this to a UNIX machine, un-tar into a working directory, then run the driving shell script "do.sh". All the code in this example works, so you can use it as a model to customize your own debugging approach. The demonstration program "pi.cbl" from $COBDIR/demo/debug is used as an example program. The shell script named "do.sh" shows how to set the required environment variable MFTRACE_CONFIG. Event codes in the trace output can be cry
Problem: What is a Zoned Decimal and how is it represented in COBOL? Resolution: A zoned decimal is a USAGE DISPLAY item where every digit is represented using one byte character, the corresponding ASCII or EBCDIC character is used for each digit. If a zoned decimal is Signed and the SIGN clause is not specified (nor the NUMERIC SIGN special-names clause is specified), then the sign is stored in the second part of the last byte together with the last digit, using "C" for postive values or "D" for negative values. This behaviour can be changed by adding the SIGN clause, ie: 05 my-zoned-decimal PIC 9(5) USAGE DISPLAY SIGN TRAILING SEPARATE. The general format is SIGN [IS] {TRAILING | LEADING} [SEPARATE [CHARACTER]] Old KB# 2231
Problem: How to suppress all Error messages of the compiler Resolution: The compiler directive WARNING specifies the lowest severity level of errors : NOWARNIG : Unrecoverable and Severe messages are reported WARNING=1 : ( Default) Unrecoverable, Severe and Error messages are reported ( Error : error that the compiler has tried to correct) WARNING=2 : Unrecoverable, Severe, Error and Warning messages are reported WARNING=3 : Unrecoverable, Severe, Error , Warning and Informational messages are reported Old KB# 2225
Problem: SDE will either return a blank screen and you will get a call stack when he selects F4=Animate from the main menu and enters the program name Resolution: This is a known problem is Server Express v5.0 with a PRN ending in "9j.j3.50.02". This has been fixed in the latest fixpack. Solution is to download and install the latest fixpack. Old KB# 2219
Problem: Application hangs on any OPEN statement Resolution: Are the files being open on an NFS mounted disk? If so ensire that the NFS locking daemons are running - rpc.statd and rpc.lockd Without the locking mechanism COBOL will not be able to OPEN a file. Old KB# 2207#RMCOBOL#AcuCobol#netexpress#COBOL#ServerExpress
Problem: When linking big cobol object files on RHEL 4.5, the linker ld prints an error like: ld: /tmp/cob5HrVpd/ldtab.o: Can't relax br at 0x42 in section '.fini'. Please use brl or indirect branch. ld: can't relax section: Bad value Resolution: There is a patch to help overcome that particular error. http://www.gelato.unsw.edu.au/archives/linux-ia64/0004/0141.html After updating binutils from version 2.15 to version 2.17, the problem disappeared. This is a bug in the version included in RHEL 4.5. Old KB# 2190
Problem: Try the following on HP-UX PA-RISC and HP-UX Itanium cd /usr/bin ls -l dig host kermit nroff You will see that these system utilities are approximately twice as large on Itanium. Resolution: HP have written an article about this which can be found at: http://h21007.www2.hp.com/dspp/files/unprotected/hpux/Itanium-Memory-Usage.pdf The PDF file is attached. Attachments: Itanium-Memory-Usage.pdf Old KB# 2118
Problem: Quickstart tip for publishing Net Express applications to UNIX systems Resolution: Quick Start to Net Express ==>UNIX Publishing The UNIX Publishing feature is a tool that facilitates deployment of applications which are developed an unit tested using Net Express to UNIX systems running Server Express. The UNIX publish feature has been available in Net Express from V3.1 onward, this article uses Net Express 4.0 in testing and demonstrating the steps required in order to publish an application to a UNIX platform. Its important to note that the UNIX Option is not part of the default Net Express installation. If you neglected to install it, it can be found on your Net Express distribution media. There are two main tasks required in order to successfully publish your application, the Setup and secondly the actual publishing of the application. There are two different communications methods that can be used when you publish y
Problem: Is there a way to force entry fields in upper case in the Screen Section ? Something like the UPPER clause of the ACCEPT statement. Resolution: There is a call to ADIS (x'AF') that can be used to force lower case characters to be converted to upper case. Program-ID. upcase. Data Division. Working-Storage Section. 01 Ws-Title pic x(50). 01 Ws-Field-1 pic x(10). 01 set-bit-pairs &n
Problem: Any non COBOL main program that calls any COBOL application, including Micro Focus EXTFH, needs to be linked using the Micro Focus cob interface. Resolution: You can find 2 references in the documentation at: http://support.microfocus.com/Documentation/books/sx50/sx50indx.htm - Bookshelf > Program Development > 11. Interfacing with C Programs - Bookshelf > User's Guide > 8. Linking to System Executables > Simple default linking And also, within the cob flags section also in Bookshelf > User's Guide > 10. Descriptions of cob Flags, the following flags might be of interest: -CC c_ption CC cplus_option -Q ld_option among others... Old KB# 2194#RMCOBOL#AcuCobol#COBOL#ServerExpress#netexpress
Problem: When an error occurs in an application program, the routine idenified by cbl_error_proc should be executed. Testing reveals that the error procedure is executed when running the application, but not when the application is animated. When the application is animated errors are displayed on the animator screen, and the error procedure is not being executed. Resolution: Animating an Error Procedure ---------------------------- It is not possible to animate through an error procedure, that is, code called by CBL_ERROR_PROC. When an error occurs, animator gains control and displays a message, before normal RTS closedown occurs. It is in RTS closedown that error and exit procs are executed. Hence, error and exit procs are not animatable. Old KB# 2129
Problem: Sample attached is just a demonstration which applies recommendations of KB 19691 Customer has questions on using large XML files with Net Express http://supportline.microfocus.com/mf_kb_display.asp?kbnumber=19691 What does this sample show? =========================== It just shows the chapter 3) of the KB 19691 ... 3. You can use the CBL_OPEN_FILE and CBL_READ_FILE byte stream routines to read the data directly from the XML document in managable blocks of 100KB or more. You can then use INSPECT and STRING statements to parse the data read to find the first <childdocn> start tag and the last </childdocn> end tag in the data buffer and then extract this information into another buffer such as XML-BUFFER PIC X(100000). In the SELECT statement for your XML enabled file you can have ASSIGN TO ADDRESS OF XML-BUFFER. Then when you open the file you can do a READ NEXT through each of the <childdocn> elements in the XML-BUFFER until
Problem: Trying to compile into executable with "cob -x". Getting error message: "Can't open Z for reading: No such file or directory" Tried adding "-vDD" onto the "cob" command line, example: cob -x -vDD <file.cbl> This causes the "cob" command to become more verbose and to reveal everything it is doing behind the scenes. In this case it revealed that the error message was coming from the system assembler "as": Entry points defined in module: UNS500.o *UNS500 as Z DA1.1 -o /usr/unitest/tmp/cobAAAa00372/%cob0.o /usr/unitest/tmp/cobAAAa00372/%cob0.s Assembler messages: Can't open Z for reading: No such file or directory Z:0: Can't open DA1.1 for reading: No such file or directory Resolution: The user in this case had PATH set such that the assembler
Problem: On versions post 2.2 of Server Express this error may occur when trying to create an indexed file from a line sequential file maintaining the record format defined in the previous file. The loader is a C program which includes an FCD structure with the FCD3 format and a code which sets the value of the FCD field - all set to OPEN OUTPUT and DYNAMIC ACCESS MODE. If the not-ordered key is encountered, the following error is returned: write error: status = 2/1 So is it possible to create an Micro Focus indexed file from a sequential file containing the record including the keys but not in ascending order? Resolution: In earlier releases of the product the sequence checking was performed on the basis of the K switch. However, at some stage in the life-cycle of the product, it was changed so that this would have to be sent via a tunable. The value used in the access mode byte of the FCD specifies only that this FCD uses a file sta
Problem: Using cross-session animation in the correct way, i.e. starting "cobanimsrv" in one window, and starting the program with "cobrun" in another window (using the same working directory and the same userid), the Animator came up, and the user could Step, but if the user tried "Query" on a data item, the Animator crashed, briefly flashing error 114 then disappearing. Redirected stdout and stderr from the failing cobanimsrv session to capture the full text of the error 114 message. The 114 was being reported on file "cdi2", which is the COBOL system internal module responsible for loading ".idy" files. Resolution: Environment variable LD_PRELOAD was set. It was preloading a shared object built with "cob -z" containing Oracle client routines. This is a valid and recommended way of bringing Oracle client routines into the COBOL runtime system. Temporarily un-setting the LD_
Problem: Items with value clauses within a group level entry are reset to defaults spaces for alphabetic and zeroes for numeric. How can the coded values be retained? Resolution: The correct command is initialize ws-group all to value. If items have been coded with value clauses these values will be restored when the items are initialized even if they have been set to other values in the meantime. Old KB# 2113
Problem: Operating System: SuSE LINUX 10 (SLES 10) Product Verson: Server Express 5.0 cob -x tictac.cbl ld: cannot find -lgcc Resolution: The file $COBDIR/etc/cobopt includes a line like this: set GCC_LIB=/usr/lib/gcc-lib/i586-suse-linux/3.3.3 This sets the environment variable GCC_LIB, which is later used by the "cob" command in cooperation with the file $COBDIR/lib/liblist, at the time "cob" creates an executable by invoking the "ld" linker. If there is no file named "libgcc.a" in the $GCC_LIB directory at this time, then the error occurs: "ld: cannot find -lgcc". Check to see if the file libgcc.a is in the location path that is set by the GCC_LIB environment variable. To determine which gcc version is active on a system, check in /user/bin for all files beginning with gcc, for example: cd /usr/bin ls -l gcc* If more than one version is in
Problem: System-wide default directives are contained in a cobol.dir file, either in the source directory or in $COBDIR/etc/cobol.dir. However, there are a few programs which cannot be compiled correctly without overriding one or more of the default directives. Resolution: In this example, the "RM" (Ryan-McFarland dialect) directive is set in cobol.dir, but must not be used for ore or two special programs, so NORM ("NO" "RM") must be set. There are several ways to accomplish the override, all based upon the same concept: If there are conflicting directives, e.g. RM and NORM, the last one the compiler "sees" is used. From the documentation, manual "User's Guide", Chapter "COBOL System Interface (Cob)", section "Specifying Compiler Directives", the directive processing order is: (any or all of the following do not necessarily exist for a given
Problem: Open input to a file that does not exist continues to the read, without error. Resolution: If the file does not exist, OPEN INPUT causes an error status, unless the file is optional. Defining a file status data item is optional. If a file status data item is not declared and a serious file error occurs, the COBOL run-time system displays an error message and aborts your program. You should check the file status data item after each input/output operation, to see if the operation completed successfully. For example, when your program is writing to disk, there might not be enough disk space to complete the WRITE operation. If you have not defined a file status data item and you run out of disk space, the run-time system displays an error number and aborts the program. If you have a file status data item defined (for the file you are writing), it is updated and the program continues to run. The program can then check the file status data item, det
Problem: Code that relies on the compiler directive: PREPROCESS"window1" (see the documentation; this implements ACUCOBOL windowing syntax) compiles correctly but encounters errors during Animation. Certain COPY books cannot be found by the Animator, even though they exist and are correctly specified in the source code. The problem did not occur in Object COBOL Developer's Suite, nor in Server Express versions prior to v5.0. It began to occur in SX v5.0. Resolution: The problem is fixed by fixpack 14, or fixpack levels subsequent to 14, for SX v5.0. Old KB# 2154
Problem: Is there a way to tell whether the Server Express product is operating in 32 versus 64-bit mode? Resolution: There is a command named "cobmode" (all one word, lowercase) that will reveal the current bit mode (whether 32 or 64) in which Server Express is operating. This command resides in $COBDIR/bin, where the "cob" command resides, and should already be on a person's PATH environment variable, so if the "cob" command can be found, so can "cobmode". Enter "cobmode -?" to see a usage screen; the command takes several optional flags: Usage: cobmode [-v] [-a|-l|{-s|-u|-d [32|64]}] [-t <toolname>] Where: -s Operates on the SYSTEM default -u Operates on the USER default -d Operates on the DIRECTORY default &
Problem: Micro Focus supports several internal formats for indexed files, including: IDXFORMAT"1" IDXFORMAT"2" IDXFORMAT"3" IDXFORMAT"4" IDXFORMAT"8" An existing indexed file of unknown format can be examined by the "rebuild" command to determine its type. Use the "-n" flag of "rebuild" to report the file's properties without actually rebuilding the file, for example: rebuild -n <filename> In the output, rebuild indicates the IDXFORMAT in a field named "Format", but uses a different set of descriptions in place of: IDXFORMAT"1" IDXFORMAT"2" IDXFORMAT"3" IDXFORMAT"4" IDXFORMAT"8" Resolution: The shell script attached to this Knowledgebase article creates and then compiles a COBOL program, which in turn creates files of various IDX format, then the shell script runs "rebuild -n" for each file to show how rebuild behaves. Just download the script and run it like: sh doit.sh It reveals that rebuild report
Problem: In a 32 bit environment you might get the following error: Load error : file 'bin/cobchecker32' error code: 173, pc=0, call=1, seg=0 173 Called program file not found in drive/directory In a 64bit environment the error would be: Load error : file 'bin/cobchecker64' error code: 173, pc=0, call=1, seg=0 173 Called program file not found in drive/directory Resolution: This error means that the cob command is unable to find the syntax checker module of the compiler. This means that you have not installed the full Server Express product. Installing either the Server or Enterprise Server product will not install the compiler tools. In a development environment you need to install the Server Express product, this will include all files you need to test any type of COBOL program. You only need to install the Server or Enterprise Server produ
Problem: What is the procedure to debug Non-Cobol shared object Resolution: When developing a mixed-language application and need to debug a non-COBOL shared object that dynamically loads another non-COBOL shared object, you might find that the system debugger will not allow the setting of any breakpoints in the callable shared object until it has been loaded. To debug the program in this circumstance, set a breakpoint on a function called mF_cso_loaded(); this enables viewing when the run-time system loads and unloads shared objects from memory. When the callable shared object has been loaded, breakpoints can now be set. The function mF_cso_loaded() is called whenever a callable shared object is loaded or unloaded. It has two arguments; the first is the name of the callable shared object being loaded or unloaded, while the second is set to zero for a load, non-zero for an unload. Old KB# 2112
Problem: If the output to STDOUT is redirected to a file or to another program, you won't see any DISPLAY or DISPLAY UPON CONSOLE in the user's terminal. This will also happen if you are running under a Application Server or Transaction manager like Micro Focus Enterprise Server or IBM TX-Series, etc... Resolution: A DISPLAY UPON CONSOLE just uses the standard i/o device. Please have a look at: http://support.microfocus.com/Documentation/books/sx50/sx50indx.htm Bookshelf > Program Development > 15. Device Handling for a list of devices that you can use with the UPON clause. If the standard output device is redirected externally, you might want to try using SYSERR instead, but that might also be redirected... cobrun myprog > standardoutputfile 2> standarderrorfile Old KB# 2227
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.