Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
Problem: I need to call a C subroutine from COBOL and pass a null pointer as one of the arguments. How can I pass a NULL pointer. Example - CALL "routine" USING ARG-1, NULL, ARG-3 Resolution: Attached to this Knowledgebase article is a tar file containing a working demonstration of how to pass a NULL pointer from COBOL to C. Un-tar and then just enter "make", and the demo will run. Note that the COBOL program is only two lines but will compile and run successfully. In the CALL statement in COBOL, the trick is to declare the parameter as "by value 0 size 4". Attachments: NULL_pointer_demo.tar Old KB# 2215
Problem: This error occurred after upgrading from Oracle 9 to 10 and from Server Express 4.0 SP2 to Server Express 5.0. Everything worked fine under Server Express 4.0 and Oracle 9. Everything compiles fine with Server Express 5.0 and the connection to Oracle is working as well. Yet when running the application ORA-01017 error occurs. Resolution: Check that the fix Patch level is the same for the Server Express and the Application Server for Server Express (Runtime). Once this was brought to the same level the error disappeared. Old KB# 2246
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: filestat.c is missing from Server Express, how can file status values be customized. Resolution: The file named filestat.c file is not supplied in the Micro Focus Server Express product. There is a new mechanism in the Server Express product which will allow file status values to be converted to any desired value(s). The steps needed to enable the conversion from Micro Focus standard file status codes to other values are: Set the CONVERTSTATUS option in File Handler configuration file (extfh.cfg) for information on configuring the File Handler, see the chapter File Handler Configuration in File Handling documentation. The default filename for the File Handler configuration file is extfh.cfg however a different filename can be used and setting the EXTFH environment variable, for example: EXTFH=MYCONFIG.cfg The CONVERTSTATUS option specifies the name of a program that is ca
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: Under Windows Operating Systems, text files have a record terminator of Carriage Return-Line Feed (hex'0D0A), under UNIX, the record terminator is only a Line Feed (hex'0A'). If you need to share these files between UNIX and Windows, you have to convert the record terminator after each transfer (or FTP the file as ASCII). What happens if the file needs to be shared simultaneously between the two environments via a shared network drive? Resolution: There is a file handler configuration option called 'LSRECDELIM' which allows you to specify what record delimiter to use for Line Sequential files. The default for Windows is LSRECDELIM=0D0A and LSRECDELIM=0A for UNIX. This is defined in the extfh.cfg file as follows: [XFH-DEFAULT] LSRECDELIM=0D0A If you want to configure this on a file-by-file basis, you can specify for which file as follows: [XFH-DEFAULT] BASENAME=ON [file1.dat] LSRECDELIM=0D0A [file2.dat] LSRECDELIM=0A The ext
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: When reading a sequential file that contains tab characters( x'09' ASCII), Micro Focus COBOL is inserting multiple spaces and pushes the remaining characters out and they spill over and are read as a subsequent record. Is there a way to easily remove the tabs? Resolution: One way to get around this is to set the external file handler configuration option: EXPANDTAB=OFF in the extfh.cfg file. For how to set up the extfh.cfg file see the Server Express documentation for File Handling and look for Configuration File in the Table of Contents. Alternatively, if the tab characters are not needed for further processing of the file they can be removed permanently using the UNIX translate command. The tr command will translate strings of characters throughout a file. (See the UNIX "man" pages for tr) Here is an example: tr '\\011' '\\040\\' <filea >fileb The numbers are the O
Problem: If you need to generate a XML document with your data and some data contains "special" characters like áéíóúñ, this must be converted to UTF-8. Resolution: Just because you are generating a xml file, the runtime doesn't automatically convert ascii to UTF-8. For example if you have a string of data of 40 chars long, and you have definitions on your program of the type: 04 xml-fullname pic X(40) identified by "FullName" count in xml-fullname-count. whenever you use PIC X(n) you are defining 1 fixed byte per character, and therefore you are not defining enough space for 40 UTF-8 characters, as they can be of variable lenght. Only if they fall in the range of ASCII 7 bits, only 1 byte is required. So, if your xml field is going t
Problem: There is more than enough disk space available and there is no problem with permissions Resolution: If the install script encounters a non-zero status code for any command it will issue a message regarding disk space and permissions such as: install error, check disk space/permissions and try again. The best way to determine whats causing the error is to execute the install script using the command: sh -x install Using these options will provide debugging information for the script and make it possible to identify the failing command. Some typical causes for failure are: a) User written commands of the same name as the UNIX command being picked up before the system command - solution reconfigure the PATH variable so that UNIX system commands are found first b) Non-existant directories or commands c) Missing compoents of the operating system Old KB# 2212
Problem: I have just installed COBOL for UNIX (i.e. Server Express) for the first time, or I've made changes to the installation or to the licensing. What is a quick way to test whether Server Express can compile and run successfully? Resolution: Set the COBDIR environment variable to the Server Express location to be tested. For example: COBDIR=/opt/microfocus/cobolexport COBDIR Your machine might have more than one installation of Server Express (an old and a new version) in different locations. Decide which one you want to test, and set COBDIR to that location. After COBDIR is set and exported, enter the following commands: LD_LIBRARY_PATH=$COBDIR/libexport LD_LIBRARY_PATH [On AIX, specify LIBPATH instead of LD_LIBRARY_PATH, and on HP/UX, specify SHLIB_PATH instead] PATH=$COBDIR/bin:$PATHexport PATHCOBPATH=.export COBPATH Next, copy and paste the following six commands onto the command line: mkdir /tmp/cob_testcd $CO
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: To debug and fix a problem, Micro Focus needs a minimal portable demonstration test case capable of reproducing the problem (in other words, a "demo"). Resolution: Micro Focus cannot fix bugs based on verbal descriptions. A simplified source code demonstration is required, which can be compiled and run, and can re-create the problem symptoms. Screen shots show problem symptoms on end user's machines, or it might be possible to dial in or use a Net Meeting to witness a problem, and this is valuable information when debugging, but not enough information to actually fix the problem. The problem must be recreated and studied on machines at Micro Focus, so Micro Focus engineers can debug it in the presence of the Micro Focus internal product source code. Trying to work based on a verbal description, Micro Focus engineers might study the product's internals and find a discrepancy that seems related to the symptoms, and prod
Problem: In some Unix platforms the following example code gives unexpected results (different from 0). 01 WK-NUMER-12 PIC 9(12). 01 WK-QUOTIENT-06 PIC 9(06). 01 WK-REMAINDER PIC 9(02). 01 WK-CHECK PIC 9(01). PROCEDURE DIVISION. MOVE 114600120320 TO WK-NUMER-12. MOVE 0 TO WK-QUOTIENT-06 WK-REMAINDER. &nbs
Problem: Compile program with 149,000 byte if statement with else clauses inside one section receive cob32: erros in compilation Resolution: Program has a large number of ELSE statements. Reference File Handler Manual: System limits: Numbers of ELSE Clauses If a program contains IF statements with very many ELSE clauses, the program might fail to compile.Problem can be resolved by increasing the size of the mian stack using the COBMAINSTACK environment variable; for more information see the entry for COBMAINSTACK in the appendix Environment Variables in your User's Guide EXPORT COBMAINSTACK=XXXXXX Old KB# 2105
Problem: Error occurs on select and insert of data via OpenEsql to sqlserver. String data, right truncation (SQLCODE 000000001) Running SQLServer 2000. Datadirect ODBC64 v 53. Resolution: Correct by using OpenESQl in 32 bit mode with Datadirect 32 bit ODBC data sources Server Express currently support OpenESQL in 32-bit mode,....to providing support for accessing 64-bit ODBC data sources from OpenESQL will be within the SX 5.1 timeframes. There is no commitment date at this time Old KB# 2203
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: Here is an example of calling the Fileshare Manager API to shutdown or restart a fileshare server. Note that security must be turned in fileshare to do this. Resolution: Program-ID. fsmanager. Working-Storage Section. 01 fsmgr-param-block. 05 fsmgr-function-code pic x(02) comp-x. 05 fsmgr-error-status pic x(02) comp-x. 05 fsmgr-fileshare-name pic x(16). &nb
Problem: This error occurs during compile after upgrading to new release. Previous release truncated to 30 characters. Resolution: To be compatible with the earlier versions of COBOL, code the compiler directive MF. If MF"10" or lower is specified, data names are truncated to 30 characters. -C MF=10 Old KB# 2106
Problem: If mfosrt is used to try and create one file from another, with a greater record length in the output file, then the result is not as expected. The scenario: Input file indata: 01234567890123456789012345678901234567890123456789 Desired output file outdata: 012345678901234567890123456785678900 0 0 4567890123456789 mfsort_directives, the directives file: USE indata ORG LS RECORD F,50 sort fields=copy OUTFIL GIVE outdata ORG LS RECORD F,75 OUTREC=(1,25,26,4,26,6,C'0',6X,C'0',7X,C'0',8X,35,2,37,7,44,7) The command line: mfsort take mfsort_directives The actual output: 012345678901234567890123456785678900 0 viz. the output is being truncated. Resolution: This is a bug, which will be fixed in due course. There are a couple of workarounds. both which entail changing th
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: 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: I use the File handler configuration parameters TRACE , TRACEFILENAME . Now I would like to read the trace file . Resolution: Under UNIX : The command is cobfhrepro2{nn} /g{name of the trace file} /a /d /n{name of the data file} cobfhrepro2{nn} nn is 32 or 64 /a /d : all information xfhrepro.log is the name of the output file with information if /n is omitted , the information are for all data files Old KB# 2178#ServerExpress#COBOL#RMCOBOL#netexpress#AcuCobol
Problem: Customer gets syntax error 1238-S "Conflict with REENTRANT Directive" when using Oracle makefiles to compile .pco source code. Adding "-P -C settings" to COBFLAGS in the makefile creates a .lst file. REENTRANT"1" is indeed specified in the settings. Resolution: Experimentation shows that REENTRANT"1" gets turned on when the "-t" cob flag is specified. The -t flag should be specified when compiling for database access -- and Oracle's makefiles do specify it. Regarding conflict with REENTRANT, the Server Express Documentation in the area of "Multi-threaded Programming", "Considerations When Creating Reentrant Programs", says: > > Use of some COBOL features will preclude reentrant > > compilation; most of these COBOL features are obsolete or > > archaic in ANSI Standard COBOL and their use should be >
Problem: Java Objects Leak when being used from COBOL. When using many Java objects from COBOL it was found that the Java Objects were not garbage collected by the Java runtime. Resolution: In order for the Java runtime (JVM) to reclaim objects created from COBOL then COBOL needs to finalize the object reference. For Example:- class myjava is "$java$myjavaclass" 01 myjava object reference. invoke myjava "new" returning myjava invoke myjava "aMethod" invoke myjava "finalize" returning myjava The "finalize" call is required to prevent any Java object leaks. Old KB# 2102
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.