Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
Problem: Is there a variable (or function), similar to file status code, that can be queried to find out if a file was opened for input / i-o etc ? Resolution: You can use the "fcdreg" compiler directive, the "FH--FCD" special register and the "xfhfcd.cpy" copy book to gain access to the "fcd" file descriptions compiled into your program. Define your "fcd" in your linkage section (1 myFcd.) followed by a copy statement retrieving the "xfhfcd.cpy" COBOL copy book delivered with your development system. In your procedure division set addressability to your "fcd" in your linkage section with a set statement. Compile your program with the "fcdreg" and "qual" compiler directives. 000010$ set fcdreg qual 000020 file-control. 000030 select myLogicalFile assign 'MYDATA.DAT' ... 000040 linkage section. 000050 1 myfcd. 000060 copy xfhfcd.cpy. 000070 procedure division. 00008
Problem: COBOL Web Service Clients default to PIC X(100) for Strings. This can cause issues as more than 100 characters may be returned in a string. Resolution: You can amend the WSDL for a WebService to specify the expected string size and then generate the COBOL Client from the amended WSDL. An example of this is below:- <?xml version="1.0"?> <definitions name="CATrafficService" targetNamespace="http://www.xmethods.net/sd/CATrafficService.wsdl" xmlns:tns="http://www.xmethods.net/sd/CATrafficService.wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:new="new"> <types> <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="new"> <simpleType name="string2"> <restriction base=&q
Problem: When running the dfconv utility I am getting an DFC507 error. Resolution: For numbers above 500, subtract 500 and then look for that number in the RTS Error Messages topic. (9/007) COBRT007 Disk space exhausted (Fatal) The disk is full. Resolution: This error can be trapped, but once it has been reported you must do a STOP RUN immediately to terminate your program's run. When your program has terminated, delete any files that you no longer need. Alternatively, if your operating system supports this, put a new disk in a floppy disk drive and redirect your program's file operations to this. ################################### Check that you have the correct drive, also whether you are pointing to a folder that is read-only Old KB# 7085
Problem: In DG COBOL, a file is restricted to 4 alternate keys, what is the maximun number of alternate keys supported by Net Express? Resolution: Net Express allows up to 252 alternate keys in an indexed file. Old KB# 7140#RMCOBOL#netexpress#AcuCobol#ServerExpress#COBOL
Problem: Compiler error "unknown class" when building a .NET project that references classes in another project. Resolution: If you reference a class that exists outside the project you are building, be sure to include the namespace for the class being referenced in the repository. In Net Express with .NET, there is a "Default Namespace" under the "Common Properties"..."General" area. You can see the project properties by right-clicking on the project name in the Solution Explorer window and choosing "Properties" from the pop-up menu. The namespace will default to the project name. If you blank-out this name, you don't have to prefix the class name with a namespace in the repository. As an example, if I defined a class called "MyClass" in the "MyProject" project with a default namespace of "MyProject", then you would reference this class in the repository as: REPO
Problem: If you want to make an colour expressed in Red Green Blue (as in the GUI Class Library) then you cannot simply subtract a value from each of the RGB values. Resolution: To make an RGB lighter you first need to convert and RGB value to a H S L value. This is Hue Saturation and Light, and is an alternate way of expressing a colour numerically. The L can then then be altered to lighten the colour, and then HSL can be converted back to RGB. There are well know algorithms to do this, and I have attached a COBOL implementation to this KB Item. Attachments: RGBtoHSL.cbl Old KB# 7080
Problem: How to search for files with a certain extension (e.g. *.cbl) in a directory using a Cobol program. Resolution: Use the X'91' function 69 routine. A loop can be used to retrieve many matched files as shown in the excerpt of code below: [...] move 'd:\\dir\\*.cbl' to f-filein move spaces to f-fileout call x'91' using f-result, function-code, *>69 f-parameters. move 1 to f-action perform search-files until f-error = 1 or 2 [...] search-files. if f-attrout >= 32 display f-fileo
Problem: If an application creates a .NET dialog box and then tries to make it modal to an unmanaged character-base app built as graphical, it won't seem to be purely modal. This is because the text window runs in its own thread so if the dialog box is created in the main thread each window will be using a different message queue and so the text window will still be able to process messages (such as Close). There is an EnableWindow API on Windows to enable/disable message processing on a window, that could normally be used within a Dialog Box, but there may not be any equivalent in .NET so the C# code would need to access it via a platform invoke to the unmanaged API. The application would call EnableWindow(hwnd, false) when the dialog box is entered (on the Activate event maybe) and EnableWindow(hwnd, true) before the dialog box is removed (on the Closing event). Resolution: If an application creates a .NET dialog box and try to make it modal to an unmanaged
Problem: From time to time, you may encounter the need to uninstall one or more FixPacks, AddPacks, or Service Packs that you have installed for the Net Express, Mainframe Express, and/or Revolve products. There are two separate mechanisms that you can use to accomplish this task. Resolution: They are: 1) Go to the Windows Control Panel (select the Start button and then Settings > Control Panel) and select the "Add/Remove Programs" function. You should see the individual FixPacks, AddPacks, and Service Packs for the products listed in the list of programs. Simply select the individual 'Packs' that you wish to uninstall and select the 'Change/Remove' button to uninstall. 2) You can also use the Webpacks utility to perform the same task. The Webpacks utility can be found at http://supportline.microfocus.com. Use your SupportLine login ID and Password to logon. Under
Problem: I'm getting a return File Status code of 35 with a spacey directory/file name: MOVE 'C:\\PROGRAM FILES\\SAMPLEFILE.TXT' TO WS-FILE. Resolution: When using dynamic file assignment, you need to use double quotes for spacey paths. If you were using static file assignment it isn't necessary- Because of the spacey path you need to change this move statement MOVE 'C:\\PROGRAM FILES\\SAMPLEFILE.TXT' TO WS-FILE to add " s around the file path and name (i.e. single quote double quote) MOVE '"C:\\PROGRAM F
Problem: An attempt to do an INSERT into a MS Excel worksheet fails with SQL error code -39 that says "invalid character value for cast specification null." Resolution: Make sure the value to be inserted is allowed in the receiving field. For example, inserting a non-numeric value into a numeric field will fail with the SQL error code -39. To resolve it, either change the receiving field as alpha or make sure the value is numeric before inserting it. Old KB# 7109
Problem: How can I autoconnect to an Oracle database when using procob / COBSQL ? In OpenESQL.ODBC you can by using the SQL(INIT) directive to connect to a database. How can you do this using Oracle and the COBOL Precompiler (procob) ? Resolution: Procob has the AUTO_CONNECT configuration option. Old KB# 7074
Problem: This article documents two simple extensions to the Micro Focus Dialog System ListView control/object. Both new features are implemented by modifying the standard generated ListView control program within Micro Focus Net Express. Resolution: This article covers the ability to change the column headings and to set focus on the ListView control. This uses a modified version of the standard Micro Focus Dialog System ListView demo to illustrate the extensions detailed in this article. You may wish to download the attached demo so that you can review the code while reading. Our first addition to the ListView functionality is the ability to change the column headings after the control has been created. This required us to add a new function (UPDATE-HEADER) to the ListView control program (LVIEWCTL.CBL). Firstly, open the LVIEWCTL.CBL source file within Net Express, and review the new code. All the
Problem: What functions are supplied with Net Express that allow an application to establsih if a file exists within a given path and then also what functions allow you to delete it? Resolution: There are 2 routines supplied with Net Express that can check\\delete files in given paths - including paths that contains spaces. Please note that these functions do not work against paths that contain wildcard characters. The first function is CBL_CHECK_FILE_EXIST - this checks whether a file exists and returns details if it does. The other is CBL_DELETE_FILE Both routines are fully documented in the Net Express help. It is recommended when specifying the path concerned that it is enclosed in quotes so as to ensure that the spaces in the folder names are accepted. Old KB# 7114
Problem: This error may be encountered when compiling a COBOL program from a project. Resolution: This error is caused by the fact that the "message files" cannot be located. These files are found in mflang*.lbr. In order to solve the problem, the PATH environment variable should be changed so that it can locate these files. Old KB# 7128
Problem: A non-COBOL program will be passing parameters to a COBOL program, and some of the parameters will be floating point items. Resolution: COMP-1 and COMP-2 are "floating point" numeric USAGE data items. They are defined as follows: 77 single usage comp-1. 77 double usage comp-2. COMP-1 is a "single precision" floating point item. COMP-2 is a "double precision" floating point item. COMP-1 items use four (4) bytes of storage. COMP-2 items use eight (8) bytes of storage. The COMP-2 item's greater precision is a consquence of the additional memory that allows support of larger numbers. These items can be initialized with a "floating point" literal. The literal format is unique. [sign] mantissa E [sign] exponent The "sig
Problem: How can ORA_ROWSCN be accessed from Net Express? Net Express 4.0 Oracle 10g OpenESQL/ODBC Oracle ODBC driver 9.02.00.63 Resolution: It is possible to access ORA_ROWSCN by defining a TIMESTAMP host variable: ... 01 my-rowscn-hvar sql type is timestamp. ... ... exec sql select ora_rowscn, last_name into :my-rowscn-hvar, :my-last-name from employees where employee_id = 188 end-exec ... Please note that Oracle's documentation would indicate that this is an Oracle 10g feature only. Old KB# 7129
Problem: I can use the following if I know the table name, but need something when tablename is not known at compile time - exec sql declare ccurs cursor for query odbc columns tablename 'table' end-exec Resolution: You need to use dynamic sql: 1. declare the cursor to be used to fetch the column information EXEC SQL declare vcurs cursor for dynamic_sql END-EXEC 2. &n
Problem: A third party source code control product is installed using the SCCS interface as recommended by Micro Focus. However, after starting Net Express the 'Source control' menu item has not appeared. Resolution: If the 'Source Control' menu has not appeared, the Net Express IDE has failed to load the specified SCCS interface dll. First check that the dll specified in the registry exists. For example: If you have a Merant (Serena) PVCS VM installation, the registry setting is HKLM\\SOFTWARE\\SourceCodeControlProvider\\Data = SOFTWARE\\Merant\\Integrations\\SCC Check what HKLM\\SOFTWARE\\Merant\\Integration\\SCC\\SCCServerPath Data value is. In that case this is set to C:\\program files\\merant\\devint\\vm\\devint\\bin\\pvcs_ifc.dll When you start Net Express, it loads this dll, which is the SCCS interface dll. If the load fails, no 'Source Control' menu will be displayed, and as described above: The re
Problem: PLS-00422 no PL/SQL translation for the bindtype given for this bind variable Cause: A host variable was passed (by an Oracle Precompiler program, for example) to PL/SQL for binding. However, its datatype is not compatible with any PL/SQL datatype. So, the binding failed. Action: Change the datatype of the host variable to make it compatible with a PL/SQL datatype. Calling a stored procedure with COMP variable. Using Oracle precompiler. Resolution: Ensure that the host variable definitions are suitable for the columns being used. For example, with a host variable defined as PIC S9(13) COMP, this should be changed to either PIC S9(9) COMP for an integer field, or PIC S9(13) COMP-3 for a decimal-type field. Old KB# 7112
Problem: What are the steps required to embed a specific icon into an executable? Resolution: To associate an icon to an executable file (.exe or .dll): Have your project open in the release build or at least so you see the executable in the left hand window. Then: 1. From the tool bar select File > New > Resource 2. Highlight icon, right click and select Import- then browse to your desired .ico (icon) file and select it 3. Save the resource file created by selecting File > Save 4. Add the rc file to the project source pool (right hand side of project) 5. Drag the rc file to left hand side and make sure it is added under the executable - you should get the message 'would you like to add compiled types to the package' - Answer Yes and select OK (the .res file will now appear under executable) 6. Rebuild project and look at executable in Windows Explorer and it will appear as the specified icon Old KB# 7
Problem: There is an issue when installing Net Express 4.0 on the D: drive of Windows 2003 Server machine using the standard setup.exe. When trying to compile programs you may get the error: ASLM: Semaphore failure ERRNO 1002 Resolution: The problem here is that the setup process attempts to create a log file on the c:\\ drive by default, and if you don't have a c:\\ drive, it can't write the log. To avoid this problem, you can redirect the log file elsewhere by supplying a parameter to the setup command. So, drop to a command prompt an change directory to the location of the setup.exe (let's assume this is on D:\\) and type the command D:\\setup\\setup.exe /ini=d:\\setup\\nxsetup.ini /logfile=r:\\thelogfile.txt This will run the setup.exe from your D:\\ drive and write the logfile to your r:\\ drive. Alternatively, you can uninstall the product from the D: drive and resintall it on the default C: drive.
Problem: The WHEN-COMPILED is a special register that can be used as the subject of a MOVE to a 20 position field. 01 DISPLAY-COMPILE-TIMESTAMP PIC X(20). MOVE WHEN-COMPILED to DISPLAY-COMPILED-TIMESTAMP. Resolution: Old KB# 7066
Problem: Changes to DSDEF.CFG are effective when using the Net Express IDE, but not when using Application Server. Where does it have to be located so that the file is picked up? Resolution: Place the dsdef.cfg file in the current directory of the application OR Set the DSDIR environment variable to the drive and path to where the file is located DSDIR=drive:\\path\\dsdef.cfg Old KB# 7037
Problem: The same CGI (or any CGI's) runs with previous versions of IIS, but when it is executed on IIS 6.0 of Windows 2003, IIS returns error 404. Resolution: This error is expected, as the default behavior in IIS 6.0 is to prevent any CGI's and ISAPI's applications being executed. Users will have to register each CGI or each ISAPI in IIS to allow it to be executed. To register a CGI or an ISAPI: 1. Start IIS Manager from Administrative Tools 2. Expand (local computer) 3. Click on "Web Service Extensions" 4. Follow the instructions on the right hand pane on how to add a new web service extension Old KB# 7029
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.