Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
Problem: Net Express with .NET Calling a user-created file handler in .NET gives error message when compiling: " Failed to find system program "aUserfh" " The CALLFH(aUserfh) directive is set and the file handler is in the project directory. The call to the file handler works if the DLL for the file handler is referenced in the project. However, what if there is the need to compile the source from a script with the directives in a .DIR file? Resolution: Make sure the ILREF"<your assembly name>" directive is also set or included in the .DIR file. This does the equivalent of adding a reference in the Visual Studio IDE. Old KB# 1266#COBOL#netexpress#ServerExpress#RMCOBOL#AcuCobol
Problem: CBL_DELETE_DIR only deletes empty directory by design. How to delete a directory with the files within then? Resolution: You always may delete file by file using CBL_DELETE_FILE or any other methods before using CBL_DELETE_DIR. A quick way to do this is to execute RMDIR or RD command in a x'91' function 35 (or in a WinAPI function CreateProcess). RMDIR and RD stand for Remove Directory. Here is a code using the RD command (RMDIR = RD): $set defaultbyte(00) identification division. program-id. x91fn35. working-storage section. 1 x pic x. 1 result pi
Problem: Cbllink executes three other programs: the Cobol Compiler; Cblnames; and Link. The parameter input to Cbllink, consisting of switches and filenames, determines the programs executed, the output files created, the output files retained and the Run time the program produced will utilize. The "Usage" for this program is documented as follows: usage: cbllink [-V] [-S] [-D] [-G] [-L] [-K] [-Boptions] [-Foption] [-Roption] [-Mname] [-Oname] file1 [file2,...] This can be simplified, and adjusted to improve the accuracy, as follows: usage: cbllink [switches] fileName1[.extension] [fileName2[.extension] ...] The switches you specify are actually a combination of Cbllink and Cblnames switches. The switch possibilities are covered in Cbllink & Cblnames Switches. The filename and file extension possibilities are covered in Cbllink File Types. Resolution: Cbllink & Cblnames Switches The following lists the Cbllink and C
Problem: How can you convert numeric data coming in from a csv into COBOL numerical values ? If you have a CSV file then the numeric data is in text format. These need to be converted in COBOL data items such as s9(9)v99. Resolution: You can write routines to perform the conversion but there is also a Intrinsic function numval (and numval-c) that will perform this conversion. Some example code that does this is:- special-names. class decimalchar is "0" through "9" " " "-" "." . working-storage section. 01 ws-text1 pic x(20) value "-123.34
Problem: Release 5.0: During publishing to Unix from Net Express under Windows XP SP2 Microsoft's error message occurs: C0000005 Access Violation Resolution: Creating a dump from this error message gets back a content similar as follows: This dump file has an exception of interest stored in it. The stored exception information can be accessed via .ecxr. (16fc.1694): Access violation - code c0000005 (first/second chance not available) eax=00000070 ebx=00000000 ecx=00000010 edx=002f6797 esi=01374438 edi=01374470 eip=7c90eb94 esp=0525b5e8 ebp=0525b5f8 iopl=0 nv up ei pl zr na pe nc cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000246 Unable to load image C:\\WINDOWS\\system32\\ntdll.dll, Win32 error 2 *** WARNING: Unable to verify timestamp for ntdll.dll ***
Problem: Passing parameters to a COBOL.Net WebForms application using an URL: http://testserver/testform.aspx?param1=TestValue then accessing the parameters using the "request" object. In C# this can be done using syntax such as: 'string paramvalue = Request.Params["param1"];'. How to access the parameters in COBOL? Resolution: Accessing the parameters using syntax such as: set ls-param to self::"Request"::"Params"::"Get"("param1") A full example of this syntax is attached to this article. Attachments: 2149995.zip Old KB# 1276
Problem: How to SORT a table in storage. Can this be done? Resolution: Yes, here is a sample program that illustrates how to do this: $set mf charset"ascii" Identification Division. Program-Id. LORINCE. Environment Division. Data Division. Working-Storage Section. * Sorted Numeric Values : 111 112 121 122 211 212 221 222 1 MixNumVals. 2 Pic 9(12) Value 222221112121. 2 Pic
Problem: This article documents how to install silently Micro Focus patches in the shape of .msp files Resolution: The Windows Install utility msiexec is used to install .msp files. Running: msiexec /? getting back the list of options that msiexec can use. The command line tested here for Micro Focus .msp files is: start /wait msiexec /qn /l*vx myfile.log /p myfile.msp where /qn means that no user interface will be presented and /l*vx myfile.log means that everything will be logged in myfile.log with verbose output and extra debugging information. Old KB# 1274
Problem: In Visual Studio 2005 you can now comment out blocks of COBOL Code using a menu option. Resolution: If you have a block of code highlighted you can comment out the code by using the Edit / Advanced / Comment Selection menu option. There is a corresponding "Uncomment" option. This option will comment out code using the "*>" comment syntax. Control-C and then Control-K is the keyboard shortcut for this. Old KB# 1378
Problem: Release 4.0: The 'CBL_ERROR_PROC' COBOL library routine installs or removes an error procedure to be invoked automatically when a runtime system error occurs. ProgA calls the CBL_ERROR_PROC to install the entry point of ProgB as the error procedure. ProgA and ProgB are built as separate .exe executables from the command line as follows: cbllink -fs -s ProgA.cbl cbllink -fs -s ProgB.cbl Differences in behaviour between Net Express 3.0/1 and Net Express 4.0 ---------------------------------------------------------------------------------------- Net Express seems to install the error procedure, while the CBL_ERROR_PROC in Net Express 4.0 returns a 0256 status-code and fails to install the error-handling procedure. "ERROR - Unable to install RTS error trap 0256" Resolution: A separate EXE is a separate process and has its own Run-Time when it executes. There is no way to install an error procedure that will exist in a separa
Problem: How can an empty idx file be used for rebuilding an ISAM file with a new key structure instead of specifying every key on the rebuild command line with the -k option? Resolution: For IDXFORMAT"3" and IDXFORMAT"4" files: - Copy the empty idx file to the existing dat file. - now rebuild the data file by specifying the infile only rebuild MyFile.dat specifying an outfile requires the additional option /d rebuild MyFile.dat,NewFile.dat /d For C-ISAM files = IDXFORMAT"1", please review KB: 23664 Old KB# 1253#AcuCobol#ServerExpress#RMCOBOL#COBOL#netexpress
Problem: A COBOL record layout is similar to a C structure containing arrays of characters. When the Compiler assigns a COBOL record layout, it does not take into account the alignment of binary or pointer data items, or byte ordering of binary (COMP-X) data items, required by any specific hardware platform; because of this, COBOL applications are extremely portable. However, this portability can cause problems in mixed-language applications. C structure layout is not as rigidly defined as COBOL record layout and varies quite widely from operating system to operating system. Resolution: For example, in COBOL the structure: 01 mystruct is typedef. 05 mystruct-key-1 pic x occurs 2. 05 mystruct-bin-1 pic x(4) comp-5. is six bytes long, no matter what platform it is compiled on. However, with the C compilers provided on mos
Problem: Release: Net Express 5.0.NET and Visual Studio 2005: When the program executes the OPEN INPUT for a file described as: SELECT MyFile ASSING "TheFile.Dat" a file status 3/5 is returned, indicating that the file could not be found. Resolution: In the traditional Micro Focus IDE the file is found in the project's directory. In Visual Studio 2005 the file is expected in the directory of the EXE, e.g. in the bin\\debug directory below the directory of the .cblproj. You can check where the OPEN expects the file if you OPEN a (different) file in OUTPUT mode. Old KB# 1382
Problem: Is it possible to read a line sequential file that contains tab characters i.e. x"09"? The tab control codes seem to get expanded to spaces. Resolution: By default the external file handler will convert tab characters (x"09") to spaces. This functionality can be changed via the EXTFH.CFG file. There is a configuration option called EXPANDTAB that if set to OFF will ensure that the x"09" are left in place. This can be applied to an individual file or on an application basis. An example configuration file would look like this: [TESTFILE.DAT] EXPANDTAB=OFF Please see the Micro Focus online help for full details of this and other configuration options. Old KB# 1336#RMCOBOL#ServerExpress#netexpress#COBOL#AcuCobol
Problem: In an unix environment parameters are retrieved with the DISPLAY UPON ARGUMENT-NUMBER as numbers 2, 3, and 4, (with argument 1 being the program name and path). It appears in the Windows environment they correspond to numbers 1, 2, and Is there some compiler/runtime flag that would emulate the unix environment? Resolution: Use the run time tunable arguments_are_initial=TRUE according to the documentation: This affects the COBOL command line arguments returned from the syntax ACCEPT ... FROM ARGUMENT-NUMBER and ACCEPT ... FROM ARGUMENT-VALUE. example: run myapp arg1 arg2 arg3 Returns myapp as argument 0 when this tunable is set to FALSE (default). When the tuneable is set to TRUE the trigger name (run) is returned as argument 0 and myapp as argument 1. Therefore the actual passed parameters would be 2,3,& 4 as in the unix environment. syntax: set arguments_are_initial=TRUE NOTE: This run-time tunable should be specified in
Problem: This example illustrates how the CBL_FILENAME_CONVERT call-by-name routine can be used to accomplish various filename conversions and measurements. Resolution: BUILD W/RELEASE: Net Express v4.0 and up. INTRODUCTION ========== The example program includes the code for 10 different conversions and measurements. This "Readme" file includes concise descriptions for each usage. The example program includes these descriptions together with the code that implements the example. SOURCE FILES: ========== Program Files Description ---------------- ----------------------------------------------------------- CBLFNCNV.cbl Example p
Problem: This document gives an overview of how to get started with the Micro Focus Fileshare product on a simple Network system using the TCP/IP protocol, which uses a single Fileshare server on which all data files reside. Applications run on several client machines and access and share the data files on the server through Fileshare. Both Windows and UNIX Fileshare configurations are covered. For a more detailed explanation of setting up and running CCI and Fileshare please refer to the Net Express manuals "Configuring CCI" and "Fileshare User's Guide". Resolution: This document will assume the following is true: The Fileshare server name is fsserver1. The hostname of the server machine is TESTFS and its dotted IP address is 127.0.0.1. The appropriate Net Express or Server Express Application Server (run-time) files are installed on the client systems and on the Fileshare server. Please refer to your product documentation for a list of the files, which
Problem: Running the Microsoft Vista operating system on a PC and having a problem to install FileShare. Trying to install FileShare using the usual: fsservice -i the system may have responded with: FileShare service failed to install Resolution: Under Vista there may be the need to use an "Elevated " command prompt... For example: d:\\development\\Netx50\\ilrts\\dnrts>fsservice -i Micro Focus Net Express V5 Version 5.003.0056 Copyright (C) 1984-2007 Micro Focus (IP) Limited. Fileshare Version 2 Revision 14711 FSS004-I Fileshare Service installed successfully. d:\\development\\Netx50\\ilrts\\dnrts>ver Microsoft Windows [Version 6.0.6000] To Create an Elevated Command Prompt shortcut Right click on your Command Prompt shortcut and select Properties. Click on the Adva
Problem: In graphical Dialog System how to specify what window will get focus when deleting a window. Resolution: The second parameter to the DELETE-WINDOW function allows to specify what window will get focus when the specified window is deleted. For example:- DELETE-WINDOW WIN1 WINDOWFORFOCUS Old KB# 1280
Problem: The Opacity allows to get some translucent effect on Windows so that the underlying desktop or windows can be seen. If however the property set on a MDI Clhild Window, it is possible to get unexpected painting problems in the application. Resolution: This is a restriction imposed by Microsoft. Windows and WinForms do not support MDI Child Windows having opacity set. Setting this in the application on MDI the application may have issues and unexpected behaviour when Windows are painted. Old KB# 1244
Problem: When using CBL_ routines and setting flags, it says set bit 0, bit 1, bit 2 etc. Is bit 0 on the left or right end? Resolution: - go to Net Express v5.0 Online Help - type in CBL_OR - select the topic under it 'using to set the value of a bit' - click 'display' - under the 'Parameters' area, click on the link to 'Key' - you are taken to 'Library Routines - Key' - page down - notice the lines: On Exit: Indicates which of the parameters shown are returned on exit. Where bits of one or more bytes are referenced, bit 0 is the least significant (rightmost) bit. Old KB# 1214
Problem: How to make what goes to the Application Output window printable? Resolution: Use the OUTDD compiler directive. Put the full path and filename in the OUTDD compiler directive, then you should be able to print that file. Old KB# 1212
Problem: Release: 5.0: Using the PROFILE directive, but how to get a different target directory for the IPF files? Resolution: Using the COBPRFDIR environment variable to specify an alternative directory. For example: SET COBPRFDIR=C:\\myipfdir Old KB# 1204
Problem: If an HTML "input" control (such text, radio button, etc) has "disabled" attribute, the value of this control doesn't return to CGI program. Resolution: All disabled controls on an HTML page return null/undefined values to the CGI script. A disabled text input field that contains text, for example, does not return any text to the CGI program. Likewise, a disabled radio button that is checked will not return the "on" value to the CGI. This is the default behaviour. Old KB# 1210
Problem: Using REVERSE-VIDEO to display:- display "Hello" at 1101 with REVERSE-VIDEO How does ADIS decide what colours to use? Resolution: ADIS will simple reverse the current backgound and foreground colours. It is not possible to specifically configure ADIS to use any another colour. Old KB# 1248
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.