Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
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: 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: Customer has a script written in-house that uses the 'rebuild' command to rebuild some data files. Since upgrading their version of COBOL, the script has begun failing with: build.rad1 /v1/hosp/seqrad/RAD0.dat,/v1/h1/rad/RAD0 -o:seq,ind -k:1 41 -r:f72 -i -e ***Error during sort operation - status 9-037 Resolution: File status 9-037 means a permission problem. I notice the script changes directories to $COBDIR/bin and invokes rebuild with "dot-slash": ./rebuild. The rebuild input and output files are specified by full path and are located elsewhere, but at the time rebuild is running, the current working directory is $COBDIR/bin. The Server Express install script sets permissions such that a common user cannot disturb official files and directories. The user running this script does not have permission to write in $COBDIR/bin -- this is intentional. Although the rebuild input an
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: 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
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: 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: 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: 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: Under AIX 5.2 (64bits) The command cobmode displays 64 I try with the Micro Focus example ( pi.cbl ) cob -x pi.cbl The following message is displayed << ld: 0711-736 ERROR: Input file /tmp/cobcp4xUa/%cob0.o: XCOFF64 object files are not allowed in in 32-bit mode. >> Resolution: This message is displayed if the environment variable LIBLIST is validated. The file defined in this variable is for 32bits mode. As this variable should not be used unless a Micro Focus Support representative asks you to, you must unset it . Old KB# 2184
Problem: Using SOURCEFORMAT"FREE", getting syntax errors during compilation, for example: -------------------------------------------------------------- *-- File msbilling.scb, Line 2016 -- HOST CODE * 301-S ( 34)** ** Unrecognized verb * 641-S*********************
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: 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: A copy of the Readme file is attached to this article. Resolution: Attachments: Server Express v5 WS03 AIX.zip Old KB# 2195
Problem: When customer run their application with core_on_error=1 in the cobconfig.cfg file. There may be a problem occassionally getting more than one core file. Resolution: To change the naming convention of the core file then: On AIX 5.2 (or later), you change the name used for a core dump file, from core, to core.. by exporting the CORE_NAMING environment variable (to any value). On Solaris, the 'coreadm' command allows you to configure the format of the filename, and location, of the core file. The 'coreadm' utility is also listed as a new feature in HP/UX 11i v3. On Linux, you can change the name used for a core dump file, from core, to core., via the following command (run as root): echo 1 > /proc/sys/kernel/core_uses_pid and return to the default name of 'core', using: echo 0 > /proc/sys/kernel/c
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: We are trying to install the fixpack and are getting the following: --------------------------------------------------------- | | | Micro Focus Self Extracting Archive | | &nbs
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: 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: I downloaded a fixpack from the Micro Focus web site, and it turned out to be a file with the extension ".encr". What is this .encr extension? How should this file be treated? Resolution: Fixpacks for Server Express, downloaded from the Micro Focus web site, have the extension ".encr". This means "encrypted". They are actually executable files, and are self-extracting archives. It is a proprietary format. Use the UNIX "chmod" command to give them execute permissions, then execute them. They will self-extract. After that you will have a ".tar" archive file. But they will self-extract only in the presence of the correct version of Server Express. This prevents people from trying to install a fixpack onto the wrong version of the Server Express product. So, before executing them, set the COBDIR environment
Problem: Is there a way to insure that the "cob" compile command uses the xlc_r compiler with C code? It appears to be defaulting to xlc and causing compile issues with C code. Is it possible to override the cob default at a user and/or server level? xlc_r invokes the thread safe version of xlc. It should be used when any kind of multi-threaded code is being built. Resolution: When linking C code the -x,CC flags are required when using the cob command - this in combination with a C source file i.e. .C will invoke the xlC (C compiler) if the -t option is also used the xlC_r (reentrant C ) compiler will be used. cob -t -x,CC mypgm.C It is possible to configure the C and C compilers used by cob on a per session basis. To set the C compiler, set the environment variable CC, and for C use the environment variable CCOO. Assuming ksh, put the following in .prof
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: 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: 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: What are the benefits of moving a 32 bit application to 64 bits? Is it possible to run a 32 bit application on an Operating System with a 64 bit architecture? Do I need an additional license if I run my application in 64 bit mode? Resolution: What are the benefits of moving a 32 bit application to 64 bits? It depends on the application. If the application takes advantage of the 64 bit address space because it handles big amounts of information, then it will run better and faster. Otherwise, "normal" applications that don't take advantage of the bigger address space would run even slower. The other reason why users need to migrate to 64 bits is that a part of their application, i.e. the data base manager, needs to be 64 bits. Then the whole application needs to be 64 bits as you can not mix 32 bits and 64 bits parts within the same application. Is it possible to run a 32 bit application on an Operating System with a 64 bit arc
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.