Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
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: 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: 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: 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: 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: 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: Do ODBC drivers come with Net Express? Resolution: The only ODBC driver shipped with Net Express 4.0 or later is for use with the Micro Focus SQL Option (XDB). For details on ODBC driver vendors, there is an independent ODBC portal at http://www.sqlsummit.com/ODBCPORT.HTM , which has a link to a list of ODBC driver vendors. Micro Focus does not endorse, recommend, or otherwise suggest that these products either do or do not work with any version of Micro Focus products. Old KB# 7026
Problem: How to look up the Process ID from the current process? Resolution: The following will show the Process ID (PID) of the current process. 01 CurrentProcessId DWORD. 01 pSessionId DWORD. call cc74 "GetCurrentProcessId" returning CurrentProcessId Another way to do this is with the use of API: There are different ways for APIs for Win9x Platforms and for NT/2000/XP/2003 Platforms. For Windows 2000 etc... You need the Process Status Helper API http://msdn.microsoft.com/library/?url=/library/en-us/perfmon/base/process_status_helper.asp?frame=true For Windows 9x you need the ToolHelp Library http://msdn.microsoft.com/library/?url=/library/en-us/perfmon/base/process_status_helper.
Problem: After installing Net Express .NET enhancement you can not start the .NET IDE also the NetX4.0 IDE because there is a hint that the file dte.olb fails. Resolution: You should try to re-register this Microsoft file via regsvr32 from command-line, probably it was unregistered during the installation procedure. This file can be found in ..\\common files\\Microsoft Shared\\MSEnv. Old KB# 7015
Problem: Editing or Debugging Copybooks When editing or debugging a program, you step into a copybook, then the editor or debugger will not position correctly thereafter. Microsoft Knowledgebase number: KB830514 Resolution: We advise you to apply the Microsoft Visual Studio fix for this problem, before using Net Express with .NET. You can download the fix from our Micro Focus SupportLine website (http://supportline.microfocus.com) under the "Patches & Fixes" for Net Express 4.0 with .NET <<KB830514.zip>> contains two EXEs NDP1.1-KB830514-X86.exe and WindowsServer2003-KB830514-x86-ENU.exe (one of the exe is for Windows Server 2003) Old KB# 7038
Problem: Please send an example of conversion of 'YYYYMMDD' date format to integer format and then conversion to Julian date plus reverse conversion back to 'YYYYMMDD'. Resolution: This conversion begins with a date consisting of the year, the month and day (20040827) stored in a data item named "YYYYMMDDItem". The INTEGER-OF-DATE intrinsic function is used to convert this date into an integer value that is the number of days elapsed since December, 31, 1600, in the Gregorian calendar (147,432) with the result stored in a data item named "integerDate". Next, the DAY-OF-INTERGER intrinsic function is used to convert the "integerDate" item into a Julian date of the form YYYYDDD storing the result (2004240) in the data item named "julianDate". Reversing this conversion is accomplished by using the INTEGER-OF-DAY intrinsic function to convert the "julianDate" data item to an integer valu
Problem: Got back this error and have to use INITIALIZE for numeric data items. Resolution: Yes, you will get back this error also if the VALUE clause is not used for data items at compile time. The reason for this is (s. Language Reference Chapter 3:Language Fundamentals): >The initial state of a data item depends on the presence or absence of a VALUE clause in its data description entry...< Therefore, you have to adjust all data items to the correct numeric data type to avoid error 163. You can get additional information from KB article#17644. Old KB# 7024
Problem: When trying to remotely debug a program on a UNIX machine the following error appears: "Remote Machine not found" Resolution: Instead of using the IP-Address use the machine name to be put that in the "Remote Machine Name" box. This can be found in Animate > Settings > 'execute remotely' section in the bottom left corner. Old KB# 7070
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.