Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
Problem: A customer had a script called (say) ggg, and a program (say) ggg.cbl. The script was in a directory pointed at by PATH, and the program was in a directory pointed at by COBPATH. If he typed 'anim ggg', then Animator picked up the script, rather than the program. Why was this? Resolution: Animator can debug .int, .gnt, .so, executables, core files and running processes. So when you type anim nnn the animator will first check to see if 'nnn' is number and, if so, see if it can dynamically attach to a process with that pid. Next, it will search for exes, down $PATH. It that fails, it will search using the standard RTS rules (using $COBPATH and the program_search_order tunable, etc). Finally, it checks to see if it's been asked to debug a core file. In this case, as a script is an executable, it was be picked up first. The ideal solution is not to have s
Problem: How do you use the h2cpy utility to convert pstat.h to pstat.cpy Output is not aligned correctly with 64 bit application using the following command to create: h2cpy /usr/include/sys/pstat.h -I /usr/include -e lp64 h2cpy /usr/include/sys/pstat.h -I /usr/include -e ilp64 Resolution: The pstat_ functions is used to obtain system and process information. Create pstat.cpy with the following command: h2cpy /usr/include/sys/pstat.h -I /usr/include -D_PSTAT64 It will create pstat.cpy with the following: 01 pst-status is typedef. 02 pst-idx usage l-long. 02 pst-uid usage l-long. 02 pst-pid &n
Problem: I can't run the XML tutorial . Cob2xml command can't create files and displays errors about undefined functions . Resolution: Server Express 5.0 is validated with the version 7 of the C compiler . It is necessary to install this version. To verify the version : Login : root lslpp -L vac.C must display the line : vac.C 7.0.0.0 Old KB# 4562
Problem: After applying a fix patch to Server Express 4.0 SP2 a customer noticed a difference between the COMPUTE statement in that it correctly calculates an int file but gave the wrong results in a gnt file. Resolution: After setting the Compiler directive HOSTARITHMETIC the desired results were achieved. There is a KB article about HOSTARITHMETIC as new compiler directive: (KB 19918) which is recommended to read as it contains detailed information to this compiler directive. Old KB# 4512
Problem: Which compiler flag should I use in order to have the objects to be created in a directory other than the current one? Resolution: Use the -Ngnt flag then specify the file location for the output file. cob -u -Ngnt="/tmp/testxx/tictac.gnt" tictac.cbl This example causes tictac.gnt file to be written to the /tmp/testxx directory. Old KB# 4522
Problem: There are three ways to determine the number of records in an Indexed file. Resolution: Option 1 - The record count is at offset offset x"40" and is 8 bytes long in the Micro Focus indexed file formats 3,4 and 8, which contains the index. Micro Focus provides a special op code h"0003" to read the header into the record buffer. Refer to the documentation - File Handler, chapter 7.4 Operating Code. Option 2 - The rebuild utility options -n or -f will return the number of records in the file, if the information is present. Option 3 - Calculate the number of records in the Micro Focus ISAM file (format 0) - take the length of the file and divides by the overall record length. This is actually one byte longer than the data record. Old KB# 4558#AcuCobol#RMCOBOL#netexpress#ServerExpress#COBOL
Problem: Opening a file in a "MAIN" program and reading its records in another program "SUB" which is called by "MAIN" results in a file status=47 means: "A READ or START operation has been tried on a file not opened INPUT or I-O." Must the file be opened in each program? Resolution: NO! Please specify in the FD the EXTERNAL clause and add this FD to the SELECT in each program which uses the file. BTW: The variables of the FD are external variables and have the same value in each program where specified. The core of the attached 4 files: ------------------------------------ program-id. Sub. copy SEL. copy FD. display "read: " REC(1:20) read MyFile. display "read: " REC(1:20) ---------------------
Problem: On UNIX the file name default is file-base-name for the data portion aand file-base-name.idx for the index portion of a file. The following explains how to change these default naming converntions. Resolution: In the extfh.cfg configuration file you can specify the option IDXNAMETYPE. The IDXNAMETYPE option specifies the format of the filename type for both the data file and index file,present. if presnet. IDXNAMETYPE={0|1|2} where the parameters specify how the the name of the index file (if present) is derived from that of the data file: 0 By discarding any extension and adding the extension .idx 1 By simply adding the extension .idx 2 Like 1 except that the data file name is modified by adding the extension .dat For example, if the data file name presented to the File Handler is abc.def, the options shown above give the following data and index file names: 0 abc.def and abc.idx
Problem: If the database connection criteria is being passed to Pro*COBOL via a compiler directive, is there a way to prevent this from being displayed on the console? Note the line: * CSQL-I-005: Passing userid=abcd/wxyz@INST1 to ORACLE Precompiler in the output of a compilation of an Oracle COBOL program.. Resolution: These messages are actually coming from the COBSQL portion of the COBOL compiler * CSQL-I-005: Passing userid=abcd/wxyz@INST1 to ORACLE Precompiler This message is only displayed if the CONFIRM directive is set. Removing the CONFIRM directive should resolve the problem. Old KB# 4517
Problem: How can locks be ignored on files opened for Input? Resolution: Set the filehandler option IGNORELOCK in the extfh.cfg file. The IGNORELOCK option specifies whether to ignore locks on files open for Input. IGNORELOCK= {ON|OFF} Default: OFF Old KB# 4556
Problem: When moving a source that contains special characters from a different platform (i.e. Windows, HP...) to Linux you may find that you get compilation errors in those lines. For example the following code: working-storage section. 01 m2 pic x(02) value "m²". PROCEDURE DIVISION. (where the characters in the non-numeric literal are U 006D and U 00B2) could produce the following compilation error: 14 working-storage section. 15 01 m2 pic x(02) value "mý". 16 *1004-E****************************************************************( 0)** ** &
Problem: The ability to pipe input and output between commands is a powerful feature of Unix. Can Cobol programs pipe to or from Unix commands and/or other Cobol programs? Resolution: Yes. The way in which a pipe file name is specified is documented in programming guide manual "File Handling", chapter "Filenames", section "Setting up Pipes". The pipe direction (in, out, or bidirectional) character, the name of the other command, and that command's command line arguments may be specified as a literal in the SELECT statement or as the value of the DD_assign-name environment variable. Examples: select infile assign to '<cat $COBDIR/etc/cobver' organization is line sequential. *The "<" character defines an input pipe to the program. select infile assign to external filespec &nbs
Problem: What is UTF-8? Does Server Express support UTF-8 or UTF-16 format Resolution: What is utf-8? UTF-8 is the Unicode Transformation Format-8. The "Uni" part of "Unicode" comes from "Universal", so it is not only for the English language. Unicode can be used in several formats. In particular, UTF-8 is the one used by default by XML because it is the most complete code without increasing the size of the file too much. It is variable and the number of bytes used to represent a character depends on in which part of the Unicode table the character is. The 8 part of UTF-8 is sometimes misleading, as you could tend to think that all characters are represented with 8 bits, but that is not the case... UTF-8 uses 1 byte only with characters within the ASCII code (only the first 7 bits) and that makes it compatible with ASCII. It is the only UNICODE encoding that is compat
Problem: By default, characters whose hex values are less than X'20' will have a null byte (X'00') inserted before each such character. This allows the Micro Focus file handler to read such characters correctly when the file is read, but it may cause compatiiblity issues with files used by other programs. Resolution: If null suppression is desired, despite possible read issues with the Micro Focus file handler and some other programs, there are four ways to turn off the feature: 1. Use the INSERTNULL=OFF option in the file handler configuration file. See reference manual "File Handling" for details of using a configuration file and the INSERTNULL option. 2. export COBSW=-N. However, if there is an active configuration file with INSERTNULL=ON, the COBSW setting is ignored. 3. Call X'91", function 47. See reference manual "Library Routines", "Alphabetical list of library routines"
Problem: A customer reported a problem that after upgrading from OCDS 4.1.40 to SX 4.0 SP2, the application which writes to a line sequential file the records couldn't be seen - it's as if the buffer on the file is far too big. In this particular problem a number of MQ interface programs write to logfiles. These interfaces allow the application to communicate with other systems on other servers. The interface programs are running in the background all day long and the only way to see if they are active/working is to check the logfiles which are updated every 15 seconds. On OCDS this worked, viz. the files got updated regularly. However with SX the logfiles are not being updated directly and it can be 30 minutes before the physical file is updated - which sounds like stuff is still in the buffer. Is there a way to get the old functionality back? I looked at SEQDATBUF, but the default is 4096, and the SX 5.0 docs say that the *minimum* is 4096, so I can't see a way of dro
Problem: How to 'OPEN EXTEND' a Line Sequential file in shared mode? "shared mode" meaning than more processes will be able to open the same Line Sequential at the same time. This KB applies to Server Express and Net Express. Resolution: Just add in the SELECT clause the LOCK MODE clause, as pasted and attached below IDENTIFICATION DIVISION. PROGRAM-ID. wfilsEXT. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION.
Problem: Call of the "make all" (Make-File see below) returns the following error: Undefined first referenced symbol in file SQLADR sample1.o SQLBEX sample1.o SQLADRVC sample1.o ld: fatal: Symbol referencing errors. No output written to sample1 make: Fatal error: Command failed for target 'sample1' # # AUTOMATICALLY GENERATED MAKEFILE - DO NOT MODIFY # # Makefile created usin
Problem: The following rebuild results in an error. $ cat F.seq AAAA0001 AAAAAAAAAA AAAA0002 AAAAAAAAAABBBBB AAAA0003 AAAAAAAAAA AAAA0004 AAAAAAAAAADDDDD AAAA0005 AAAAAAAAAA AAAA0006 AAAAAAAAAA1234567890 BBBB0001 BBBBBBBBBBAAAAAA BBBB0002 BBBBBBBBBB BBBB0003 BBBBBBBBBBCCCCCC BBBB0004 BBBBBBBBBB BBBB0005 BBBBBBBBBBEEEEEE $ rebuild --v F.seq,F1.ism -o:lseq,ind -I -k:1 8 -r:v20-30 RBD 102.14.445 21APR05 File : F1.ism Organization :&
Problem: For ACCEPT FROM ENVIRONMENT-VALUE the COBOL Language reference states: If no previous DISPLAY with a mnemonic-name associated with an ENVIRONMENT-NAME has been performed, or if the specified environment variable does not exist, the imperative statement associated with an ON EXCEPTION phrase is executed. The value in identifier is undefined in this case. ***************** But, what happens when an environment variable has a value of NULL? In Server Express 4.0 the ON EXCEPTION will be executed if the environment variable in not set or if it is set to a NULL value. In OCDS 4.1 for UNIX, the ON EXCEPTION is only executed when an environment variable does not exist. Also, in C the getenv() function can distinguish between an environment which isn't set, an environment variable set to NULL and an environment variable that is set. The following C program shows the possible results: $ cat envtest.c #include <stdio.h> #include <stdlib
Problem: The following compilation command fails with the error "cob64: warning: -u overrides -x" cob -x -L/u01/oracle/db/10.2.0/lib/ -L/usr/shlib /u01/oracle/db/10.2.0/precomp/lib/cobsqlintf.o \\ -lclntsh -lnbeq10 -lnhost10 -lnus10 -lnldap10 -lldapclnt10 \\ -lnsslb10 -lntcp10 -lntcps10 -lnsslb10 -lntcp10 -lntns10 \\ -lkstat -lnsl -lsocket -lgen -ldl -lsched \\ -R/u01/oracle/db/10.2.0/lib -laio -lposix4 -lm -lthread Resolution: The compilation command is poorly formed, an option is specified which is not supported by the Micro Focus 'cob' command The invalid option is the '-R' - This is an option for the UNIX link editior, When 'cob' parses the options the -R is essentially ignored, the next character captured is the 'u' which is meaningful to the cob command but is causing contention with the -x specified earlier in the command line. Resolution and explanation of options used in compile: -u Compiles
Problem: A customer had a routine that used libcurses for screen handling. When this was called from Animator, the application crashed out of animator, displaying the command line prompt, locking up the session and leaving a looping "rts32" process. Resolution: This is actually a complex area. The libcurses routine does not work correctly if anything else changes the screen (without notifying it). curses works by keeping an internal representation of the screen contents, cursor position, etc. When the program asks curses to change what's on the screen (or, more precisely, when it wants to change anything about the state of the tty), curses computes a hopefully optimal set of control codes (based on the tty description in termcap/terminfo) and display characters and sends that to stdout. If anything else has changed anything about the tty state, curses' internal representation will be wrong, so the commands it sends to the tty will be wr
Problem: Error occurs on Solaris 10 with Java 1.4.2 Trying to run cobjrun: Sorry unable to load libcobjvm_java2 If libcobjvm_java2 is on shared library PATH, then ensure 'libjava' and 'java' are found on the PATH/Shared Library PATH. Resolution: This was caused by a problem with the LD_LIBRARY_PATH related to Java 1.4.2_X: First export JAVA_HOME to point to the Java directory. Then run the Server Express COBOL/Java setup utility. $COBDIR/bin/cobsje -v This resolves the problem. Old KB# 4506
Problem: What are the differents ways of debugging my applications ? Resolution: INTRODUCTION Animator enables you to debug Micro Focus Cobol applications. You can debug all types of application: single-threaded, multi-threaded, with Language C, created in intermediate code file, created in generated code file, callable shared object or system executable code file. This document is to help you to start the debugging. The manual Debugging Guide describes the Animator and debugging. PREPARING FOR ANIMATION To animate the application, you must compile and generate your application with the directives and the options required. The directive of the compilation is ANIM, and the option of the generation is g. By default, the directive ANIM is setting. When a program is compiled or generated to be animated, the file with name of the program as basename is created with the extension .idy. This file contains additional information required by Animator.
Problem: The following message is displayed : << *** This script must not be run from inside the product directory. exiting ... >> Resolution: To install a fixpack , it is necessary to create a temporary directory. This directory must not be $COBDIR and, also, must not be a subdirectory of $COBDIR. Old KB# 4529
Problem: In trying to use the imtkmake, and a 115 error occurs: [root@LinuxMTO mapdemo]# imtkmake -defmap src=book.cbl service=wmapserv type=webservice -generate Micro Focus Interface Mapping Toolkit v1.0.00 Copyright (C) 2004 Micro Focus International Ltd. All rights reserved. Execution error : file '' error code: 115, pc=0, call=1, seg=0 115 Unexpected signal (Signal 6) [root@LinuxMTO mapdemo]# imtkmake -defmap src=book.cbl service=wmapserv type=webservice Micro Focus Interface Mapping Toolkit v1.0.00 Copyright (C) 2004 Micro Focus International Ltd. All rights reserved. Execution error : file '' error code: 115, pc=0, call=1, seg=0 115 Unexpected signal (Signal 6) [root@LinuxMTO mapdemo]# Resolution: For some reason the installation of Server Express wasn't correct and after a reinstall of the product this error disappeared and the deployment worked fine.
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.