Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
Problem: If you are using the "InsertAfter" method of the selection object to enter text into a Word document then the selection is expanded with the new text. This can cause problems when you jsut want to apply formatting (Bold etc) to some of the text. If you apply Bold then it applies to all the selection. Resolution: You can use the "Collapse" method of the selection object reset the selection down to just the current text entry position. Some example code to perform this is:- *> Here we want to do collapse and bold the next text set wdCollapseEnd of ws-direction to true invoke theSelection "Collapse" using ws-direction invoke theSelection "
Problem: My SQL Server stored procedure takes a list of parameters and returns a result set what is the required syntax to call this stored procedure? Resolution: from docs: If a stored procedure call returns a result set, it must be used in a cursor declaration, thus: EXEC SQL DECLARE cursorName CURSOR FOR storedProcecureCall The stored procedure is then called by OPENing the cursor and FETCHing result set rows, like any other type of cursor. Currently OpenESQL supports only a single result set. The code for calling a stored procedure that has two input parameters and returns a result set containing 3 output values for each fetched row would be something like the follows: exec sql declare c1 cursor for &n
Problem: Many customers use share names to map the data files that they are using with their applications. For example instead of using the following: SELECT INPUT-FILE ASSIGN TO "DRIVE:\\DIRECTORY\\FILE.DAT" ORGANIZATION IS ........ ............ The SELECT statement is being altered with the following: SELECT INPUT-FILE ASSIGN TO "\\\\MACHINE\\DIRECTORY\\FILE.DAT" ORGANIZATION IS ........ This is done to avoid having to map a drive to another machine in most circumstances. Reso
Problem: Problem running getdirectory demo. Getdirectory.cbl was not properly built. Resolution: Cleanup procedure for Rebuilding GetDirectory demo. 1) Open up the getdirectory project. 2) In the IDE on the left hand side delete everything for type of build DEBUG and also delete everything for type of build RELEASE. 3) Close down Net Express. 4) Manually, outside of Net Express IDE, go to the folder where to have the getdirectory demo. Delete everything in the debug and release folders. 5) Bring up the getdirectory.app again in the Net Express IDE. Go to the Release build for Type of Build. 6) On the right hand side from the source pool, drag over the getdirectory.cbl to the Release &nb
Problem: When using client-side cursors with SQL Server 2000 or earlier, there is a limitation of only allowing one active cursor per connection. Attempting to open a second client-side cursor will issue an error "connection is busy processing another hstmt". It is not possible to use separate connections for each cursor as this could lead to locking issues. Resolution: SQL Server 2005 has implemented support Multiple Active Result Sets (MARS). MARS removes this constraint/limitation and allows multiple queries or stored procedures to be performed on a single connection. In order to take advantage of MARS with Net Express, the program must be compiled with the following directives : SQL(DBMAN=ODBC, TARGETDB=MSSQLSERVER, MARS) or, if using a DSN-less connection, specify MARS_Connection=YES within the Connection String. This capablility is provided with Net Express 4.0 all06n40 wrappack (and later). Note that the ODBC DSN used must be the SQL Native Client driver,
Problem: Using MFSORT utility but it may also has a requirement to define collation sequence in some cases. For example: sort input file a.inp on position1, size 10 , output file is a.out Command for this using MFSORT is: mfsort sort fields(1,10,ch,a) use a.inp give a.out So the question is how to define Collation Sequence using MFSORT? By definition MFSORT supports DFSORT syntax, but what about about alternate collating sequence (ALTSEQ Control Statement). How does this work on WINDOWS, and how to use it with different code pages? Resolution: In this example to presume the codepage in question is 1250. ALTSEQ function can be used in MFSORT by using the same command as in DFSORT. The attached demo - demo.zip contains a file to sort where we want to sort the file as if an 'A' has the same value as an 'a' and a 'B' as a 'b'. By sorting with 'SORT FIELDS=(1,10,AQ
Problem: Release 5.0: Using COM Automation with Microsoft Word then how to perform a find and replace in the documents. Resolution: The work demo supplied with Net Express V5 in the COMDEMOS directory contains an example of this in Word5.cbl. The code that performs a find and replace is:- invoke theDocument "getParagraphs" returning theParagraphs invoke theParagraphs "item" using by value 2 returning theParagraph invoke theParagraph "getRange" returning theRange invoke theParagraph &
Problem: Using the PC_PRINTER routines in Net Express, how to set the margins of the output? Resolution: (1) To control the margins of reports generated then there is an advice that instead of using the PC_PRINT_FILE call to "manually" control the printing of the reports by using a combination of the PC_PRINTER_OPEN, PC_PRINTER_CONTROL, PC_PRINTER_WRITE and PC_PRINTER_CLOSE calls. This would mean that the program would have control over each line of the reports. (2) Another way to control this and still to use the PC_PRINT_FILE call would be to create the report file with the appropriate leading spaces that would fulfill the needs. Old KB# 1299
Problem: Can a computer be identified by a program? Resolution: The WinApi GetCurrentHwProfile retrieves information about the current hardware profile for the local computers producing a GUID. On every call, GetCurrentHwProfile computes the same GUID on the same hardware but a different GUID on a different hardware. This GUID should be unambiguous between different computers. Attachments: GUID.zip Old KB# 1294
Problem: Trying to do a positioned delete for mysql table and it isn't working. Resolution: For MYSQL to work you need to compile with the sql directive SQL(USECURLIB=YES) and need to set SCROLLOPTION to STATIC and CONCURRENCY to OPTCCVAL (these can either be specified through the EXEC SQL SET statement or specified in the DECLARE CURSOR statement). From on-line docs: Positioned Update ODBC supports positioned update, which updates the row most recently fetched by using a cursor. However, not all drivers provide support for positioned update. With some ODBC drivers, the select statement used by the cursor must contain a FOR UPDATE clause to enable positioned update. Most data sources require specific combinations of SCROLLOPTION and CONCURRENCY to be specified either by SET statements or in the DECLARE CURSOR statement. If this fails to work, the ODBC Cursor Library provides a restricted implementation of positioned update which can be enabled by compi
Problem: When using the CallUnManagedDll Sample which can be found on the supportline website an COBOLRuntimeException Error appeared. 174 file not in directory. Resolution: As described in the readme in the demo itself (and also in the source code *text* part) you need to add the cobcdll.dll and the cobcalldll.dll in the references. Also the kernel32.dll in windows/System32 needs to be added. Old KB# 1254
Problem: Is there a PDF version of the documentation available for Net Express v5.0 Resolution: Regretably no. As an alternative you can use the online documentation provided with the product or use the web based documentation that is available from the following link; http://supportline.microfocus.com/productdoc.asp The direct link to the Net Express v5.0 documentation is; http://supportline.microfocus.com/documentation/books/nx50/nx50indx.htm Old KB# 1359
Problem: Unix Options: Setup disabled Resolution: Ensure that the Unix options are installed and a project is opened or create a new project. Old KB# 1297
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: The .Net framework v2.0 introduced some new classes for ftp such as System.Net.FtpWebRequest. How can you use these classes from COBOL to perform an FTP request. Resolution: The exmaple project is attached. Some sample code to perrform ftp in .Net is:- $set sourceformat"variable" *********************************************************** * * Author - Micro Focus SupportLine * * Date - Aug 2006 * * Demo of .Net Framework 2.0 class for FTP File Transfer * &nbs
Problem: When using the Examine feature of the Net Express Animator by clicking on the "Change" button a grayed out window will appear that will not permitting to change the value of the data item. Resolution: One possible cause is that one of the Micro Focus OCX was not registered properly during installation or that the version registered is too old. The OCX is valueedit.ocx. That file can be found in c:\\program files\\common files\\Micro Focus, where the last part of the directory structure could also be Merant, depending on the product installation. Go to a command prompt and then do a directory change to go to the above mentioned location and register the OCX, i.e. regsvr32 valueedit.ocx Still experiencing this problem? Please contact your local SupportLine office to pursue. Old KB# 1311
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: The RaisePostBackEvent receives every event from an ASPX page. In contrast to other events like Button1_clicked, the RaisePostBackEvent routine isn't automatically generated from the COBOL wizard. How can the RaisePostBackEvent routine be implemented in COBOL. Resolution: Add the following code to the generated class: method-id. "RaisePostBackEvent" protected override. procedure division using by value a-source as System-PostBack eventArgument as string. invoke super "RaisePostBackEvent" using value a-source eventArgument &
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: Release 5.0: Showing and hiding Windows when mixing graphical and character Screens. When you are doing a phased conversion of a character based application to a GUI it is often useful to hide the character screen window so that the user cannot click in the character window when control is on a graphical window. If the user does this then the character portion of the application will not response as control is currently in the character screen. Resolution: If the application EXE is built as a "graphical" application or started using the RUNW trigger EXE (int or gnt code) then any character screen are run in the COBOL Text Window. When the COBOL Text Window is used for character screens there is a runtime call PC_WIN_HANDLE that allows you to get the HWND windows handle. This allows you to manipulate the Window using standard Win32 api calls. The ShowWindow api with the SW_HIDE flag can be used to hide the Text window when required and
Problem: The sample printer exit (SAMPPRNX) shipped with Net Express is incomplete and does not compile. Resolution: Attached to this article is a full and updated set of files for SAMPPRNX. Copy the attached files to your <install-dir>\\Examples\\Net Express IDE\\SAMPPRNX directory, and rebuild the project. Please note: when deploying the exit to an enterprise server, you should place the executable files in a location on the COBPATH. Attachments: cascbprn.cpy Old KB# 1222
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
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.