Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
Problem: Printing is not stopping at the end of the page additional lines are printed on the next page. Resolution: Use the compiler directive RWHARDPAGE This directive causes the Report Writer control module to execute a form feed after the last item has been printed on a page, instead of the usual multiple blank lines. This ensures that the paper is positioned correctly ready for a new page. Old KB# 2095
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: 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: 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: 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: 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
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.