Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
Problem: How can COBOL access the system time? How can I write a program that will display a clock showing the system time, in real time, for the purpose of checking the system time's accuracy? Resolution: Following is a complete COBOL program (not a fragment). It will compile as written: 000001 01 time-ws pic 9(08) value zeroes. 000002 01 filler redefines time-ws. 000003 05 ws-hours pic 99. 000004 05 ws-minutes pic 99. 000005 05 ws-seconds pic 99. 000006 05 ws-hundredths pic 99. 000007 01 count-ws pic 9(8) value 0. 000008 000009 procedure division. 000010 loop-top. 000011 accept time-ws from time 000012 display ws-hours at 0303 000013 ":" at 0305 000014 ws-minutes at 0306 000015  
Problem: There is known defect where in some cases the results of a COMPUTE statement may be incorrect when executing in machine native code on Intel x86 platforms. Resolution: This error can be avoided by using the -g flag when compiling the machine native code executable. The error is introduced by a incorrect assumption in the code optimization routine used by the compiler. The -g flag alters the optimization routines used by the compiler so that the error is avoided. A permanent correction for this error will be released in a Fixpack for Server Express V4.0 SP3. Old KB# 2157
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: When linking a application under Server Express which has been precompiled with the Sybase precompiler, cobpre, the following error was returned: ld: fatal: libcobrts.a: open failed: No such file or directory This did not occur with Object COBOL Developer Suite. Resolution: The makefile being used was written to work with Object COBOL Developer Suite (OCDS). Under Server Express, a number of the modules, including the COBOL run-time, have been repackaged. Whereas under OCDS, the COBOL runtime was shipped as libcobrts.a, under Server Express, it is provided as a shared object. After updating the makefile to remove the hardcoded reference to the archive, the application linked cleanly. Old KB# 2144
Problem: Compiler appears to automatically redefine "usage comp" fields to comp-5. When field is referenced receive non-unique data name error. This occurs when using the Oracle preompiler PROCOB Resolution: By default pcbcfg.cfg (in $ORACLE_HOME/precomp/admin) defines: comp5=yes define=comp5 Changing COMP5=YES to be COMP5=NO will resolve this issue. COMP5=YES can also be overridden at compile time by passeing COMP5=NO in the list of directives to be passed to the Pro*COBOL precompiler as follows: PREPROCESS(COBSQL) CSQLT=ORACLE8 ENDC COMP5=NO P(CP) ENDP The only effect this directive has is on the code generated by the Oracle precompiler. As COMP and COMP-5 are the same byte ordering on AIX, the change should not impact the application. To see what I mean, with this small app : 01 a pic s9(4) comp-5 value 23. 01 b pic s9(4) comp value 23. &nbs
Problem: Porting application from HPUX 11/23 PA-RISC to HPUX 11/23 Itanium. Compile cobol module with cob, using ld to link linker produces the warning: ld: (Warning) Unsatisfied symbol "_mFldhandle" in file xxx.o This cobol module is one several modules compiled to .obj for inclusion in a shared liabrary. The shared library is built, but at runtime the above Unsatisfied symbol "_mFldhandle" is not being resolved. SHLIB_PATHs, and LD_LIBRARY_PATH are set which /cobol/lib shared lib to use with the -l flag on the ld command to resolve this symbol Resolution: When linking Cobol you must use cob. . IBM, HP and other take the same approach with C . You must use the C tool to link C applications. _mFldhandle is not defined in any library in $COBDIR/lib. This symbol is created by cob, locally to each shared object, as part of the link process. It is used as part of cancel processing, and shared object load/unload
Problem: Used rebuild infile, outfile but still having problems. Resolution: What the above command does is use the index tree to recover the file and will only recover records for which there is an index entry. The correct/recommended Rebuild command to use to recover a corrupt file is: Rebuild infile, outfile -d -e which will recover all valid records. The -d option tells Rebuild to ignore the index tree and scan for all valid data records that will be included in the outfile. The -e option indicates to Rebuild to continue to process the input file when an illegal duplicate record is encountered. All illegal duplicates are discarded from the outfile and are directed to a file with the base name of the infile with the extension .err. Old KB# 2173#AcuCobol#RMCOBOL#netexpress#COBOL#ServerExpress
Problem: When running a COBOL program with working storage defined as: 30* test structure with mixed case. 31* 32 01 XML-str. 33 05 XML-nbr-comp pic 9(03) value 111. 34 05 XML-nbr-fund pic 9(05) value 22222. 35 05 XML-nbr-acct pic 9(15) value 333333333333333. The procedure division XML code OPEN OUTPUT OUTFILE. 46 XML GENERATE WS-XML-BUFFER 47 FROM XML-str 48 COUNT IN WS-XML-CNT 50 WRITE OUTFILE-REC FROM WS-XML-BUFFER The problem is that the output tags are all uppercase, rather than mixed case <XML-STR><XML-NBR-COMP>111</XML-NBR-COMP><XML-NBR-FUND>22222</XML-NBR-FUND><XML-NBR-ACCT>333333333333333</XML-NBR-ACCT></XML-STR> The problem is that their web service programs are looking for mixed case. Resolution: If you are using the directive DIALECT(ENTCOBOL) then it should work okay. However you are using
Problem: Debian is a free operating system which uses the Linux kernel (the core of the operating system), but most of the basic operating system tools come from the GNU project. http://www.debian.org/ So are Micro Focus Linux / UNIX products certified on Debian? Resolution: Micro Focus products are not supported on Debian. Micro Focus only supports the Enterprise editions of SuSE and Red Hat Linux. While it may be possible to install and run Server Express on other Linux distributions, the amount of support we would be able to offer will be limited. This is because each UNIX product is built on a platform made up of a combination of operating system, C and C compiler, assembler, and system linker each with a particular version. In addition to this there may be specific patches required and on certain Server Express platforms there are also JVM/JDK components required. This combination is referred to as the product 'referenc
Problem: I have problem generating the .gnt files. When I do a "cob -u progname.int" I am getting this: * Rejected - TARGET"386-16" cob32: error(s) in code generation: CSBM0201.int What does this mean? Resolution: The compiler directive TARGET"386-16" is not a default setting; this directive specification is apparently a customization made by early developers of the application and carried forward with the application ever since. TARGET"386-16" tells the Native Code Generator to produce machine code for a 16-bit Intel 386 chip (probably an early PC). It has been several years since 16-bit 386 chips were state-of-the-art. Remove the specification of this directive and proceed. Old KB# 2140
Problem: Error compiling program being migrated from Object COBOL. cob32: error opening: /tmp/cobxyz/a.out Error in compiling and linking file xyz.cob Compile command: cob -C IBMCOMP -xv -Q -o xyz.exe xyz.cob Resolution: The -Q flag passes option to the system linker (See the Server Express User's Guide > 10. Descriptions of cob Flags). In this particular case it was not followed by a valid linker option. The "-o" is supposed to be passed to cob causing it to take the next parameter as the ouput name, in this case xyz.exe. This affected the intermediate workfile a.out created by the cob/lilnk process. Removing the -Q resolved the problem. Old KB# 2216
Problem: A copy of the Readme file is attached to this article. Resolution: Attachments: Server Express v5 WS03 Suse_x86_64.zip Old KB# 2196
Problem: How to set the record delimiter on UNIX like it is on Windows so that it behaves the same when displaying CRLF. Resolution: LSRECDELIM can be used to set the record delimiter on UNIX to CRLF as it is on a PC. Old KB# 2192
Problem: How to specify paths in an environment variable Resolution: The use of, and interpretation of, ":" and "." in PATH type variables (PATH, LD_LIBRARY_PATH etc) is often misunderstood. ":" is the directory separator. A colon at the beginning (or end) of the environment variable value means a null path at the beginning (end) of the search order. A null path means the same as ".". That is, the current working directory. "::" in the middle of the env-var value is equivalent to ":.:", which obviously means search the current directory at that point in the order. A frequent mistake is "::" at the end of the value, which means search the current directory twice. Example of setting COBDATA- export COBDATA=:/home/data/directory This would cause the search order to be the current directory then /home/data/directory Incidentally - if you specify COBDATA then the current directory wi
Problem: Intermediate level code code (int) is portable between Windows and UNIX. Can you take an int module and that uses DB2 and run it on UNIX? Resolution: Although int level code is portable this is not true where database access is required, as database precompilers generate different COBOL code across platforms (and also between 32-bit and 64-bit platforms). COBOL applications that use databases need to be precompiled on the target platform. Old KB# 2104
Problem: When this error is encountered on AIX systems it is generally due to the fact that the LIBPATH environment variable is not set up correctly. exec(): 0509-036 Cannot load program /usr/lib/cobol/bin/rts32_t because of the following errors: 0509-150 Dependent module libcobrts_t.2.so could not be loaded. 0509-022 Cannot load module libcobrts_t.2.so. 0509-026 System error: A file or directory in the path name does not exist. cob32: error(s) in compilation: /diapason/diap524/tst/source/FMMOV005.cob Resolution: Make sure that the LIBPATH environmental variable points to $COBDIR/lib set LIBPATH=$COBDIR/lib:$LIBPATH this should solve the problem. Old KB# 2101
Problem: We are trying to install the fixpack and are getting the following: --------------------------------------------------------- | | | Micro Focus Self Extracting Archive | | &nbs
Problem: Platforms: x86 and zSeries Resolution: Server Express 5.0 can run on SuSE LINUX Enterprise Server 10 as long as the following change is made: The $COBDIR/etc/cobopt files need updating to point to the correct compiler object files. The following is an example of the changes needed: On the x86 platform: Original product cobopt file: set GCC_LIB=/usr/lib/gcc-lib/i586-suse-linux/3.3.3 Updated cobopt file: set GCC_LIB=/usr/lib/gcc/i586-suse-linux/4.1.0 On the zSeries platform: Original product cobopt file: set GCC_LIB=/usr/lib64/gcc-lib/s390x-suse-linux/3.3.3/32 Updated cobopt file: set GCC_LIB=/usr/lib64/gcc/s390x-suse-linux/4.1.0/32 Without these changes the Server Express product cannot
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: Use the following program as an example and a template, when you need to write a COBOL program that will rebuild an existing indexed file. The program reads the file from beginning to end and writes each record to a new file. This is a way of creating a fresh version of the indexes and their B-trees, and of removing records that were marked for deletion but weren't yet physically deleted, and of otherwise getting the file into a new and fresh state. It is an alternative to using the "rebuild infile, outfile" command. Resolution: The example "rebuild" program below is based on the demonstration program "stockioa.cbl", which gets installed with the Server Express product, and can be found in the directory $COBDIR/demo/locking. Before running the example "rebuild" program below, perform the following steps: mkdir /tmp/test-rbld cd $COBDIR/demo/locking cp stockioa.cbl /tmp/test-rbld cd /tmp/test-rbld cob stockioa.cbl
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: 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: In Object COBOL Development Suite De-referencing a NULL pointer in C was treated as zero. With Server Express it now returns the error: Execution error : file '<file-name>' error code: 114, pc=0, call=1, seg=0 114 Attempt to access item beyond bounds of memory (Signal 11) Passing the NULL is not a problem. De-referencing a NULL pointer in the C PROGRAM is the problem. The error occurs when you use "cob -x" to compile the C program, but does not occur when you just use straight "cc". But dereferencing a NULL pointer is supposed to be an undefined operation in C. Resolution: With Server Express we now put "-z" on the ld command line. The -z was added to the HP-UX liblist because using it is widely considered best practice on that platform. Dereferencing a null pointer in C causes
Problem: The following error was encountered when compiling a simple demo program (eg. tictac.cbl) with option -u in 32 bit mode: # cob -uk tictac.cbl 174 move zero to xcount,ocount,factor *1125-W************************ ** ** Punctuation character not followed by a space. Assume space. *1125-W******************************* &n
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
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.