Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
Problem: There is a need to determine what database to connect to at runtime, to override the default set up through the ODBC DSN. Resolution: 1. Using a EXEC SQL USE DATABASE END-EXEC statement to change database, but this cannot be a host variable but is a hardcoded name. 2. Using a connection string (with a named connection is necessary) as specified in Format 6 of Connect syntax Format 6 >>----EXEC SQL---CONNECT USING input_connection----------> >-----.-------------.---.---------------------.----------> --AS db_name- --WITH-.----.-PROMPT- -NO- >-----.------------------------------.------END-EXEC---->< --RET
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: getting an ILLOGIC (Eibresp=21, 110) when trying to read a RRDS file. The CFLE program (DFHZDFDM) reads it fine. It is a standard CICS READ. EXEC CICS READ DATASET (WS-DATASET) RIDFLD (WS-RECORDKEY) INTO (WS-RECORDAREA) LENGTH (WS-RECORDLEN) EQUAL NOHANDLE &nb
Problem: The COBOL intrinsic function random generates after each program start the same sequence of numbers again - it is a pseudo-random number. How can a better random number be generated? Resolution: The WinApi UuidCreate computes a unique random number. The probability to get the same number twice on different computers is very low, because UuidCreate uses the Ethernet or token-ring hardware address for this computer to be unique between different computers. Please check, if the UUID computed with the attached demo resolves your requirements. Attachments: UUID.zip Old KB# 1295
Problem: There is no FTP routine in Cobol to access and interact with a FTP server. This however can be done by using the Windows Internet (WinINet) application programming interface (API). Resolution: BUILD W/RELEASE: Net Express v5.x ============ INTRODUCTION ========== The attached demo uses the Windows Internet (WinINet) application programming interface (API) to interact with FTP protocols to access Internet resources. It is using WinInet functions to accomplish the following tasks: 1. open Internet session (InternetOpen) 2. log on to FTP server (InternetConnect) 3. determine current directory (FtpGetCurrentDirectory) 4. change directory (FtpSetCurrentDirectory) 5. create new directory (FtpCreateDirectory) 6. upload file (FtpPutFile) 7. rename file (FtpR
Problem: How can you validate numerics in a .Net Winforms TextBox control. Resolution: The keypress event in .Net allows you to trap when a key is pressed on the keyboard and interpret what key was pressed. This allows you ensure that only digits , "." , " " and "-" are entered. More complex checking can also be performed on the TextChanged Event. This is fired when the Text in a textbox is changed and allows you to check the full text that is in the control. Some examples of using these events to handle numeric checking is:- method-id. "textBox1_KeyPress" final private. linkage section. 01 sender object. 01 e S-W-Forms-KeyPressEventArgs. procedure division using by value sender e. &n
Problem: Releases 4.0 5.0: As part of the execution of an application it might be neccessary to force the application to re-read the File handler Configuration Parameters file. For more details on how to use the File Handler configuration file check the File Handler programming guide, chapter 6. Resolution: To accomplish this you can use the CBL_CFGREAD_EXTFH call. The call forces the File Handler to reread its configuration file. Syntax: call "CBL_CFGREAD_EXTFH" using filename returning status-code Parameters: filename pic x(n). status-code See Key On Entry: filename The file to look for. The name can contain a path, and must be terminated by a space. If the filename is null (x"00"), the File Handler looks for the file using the standard search order (see the topic Searching Conventi
Problem: Are there any general tips on how to inprove file access performance? Often we are asked about buffers, and if there is a way to make read only data read faster? Resolution: Things to consider are: Exclusive access (OPENINPUTSHARED/READSEMA). For a file that is accessed many times, have a consider using the LOADONTOHEAP EXTFH (external file handler) configuration option and/or SEQDATABUG EXTFH configuration option. Each of these is documented in the Net Express help. Also from the Net Express help, under the File Handler help>performance: You can take various steps to improve the performance of the File Handler. These all involve the use of various configuration options. Details are as follows: You can increase the number of indexed file nodes that are cached, as opposed to being held on disk. You specify the number of nodes with the INDEXCOUNT configuration option. We recommend a setting of 32, but you can choose a larger
Problem: How to interpret Micro Focus runtime error values. Resolution: BUILD W/RELEASE: Any Micro Focus Cobol product. INTRODUCTION ========== This isn't a programming example, although a program is part of the illustration. What it is about is how COBOL Run-time errors are sometimes mis-handled by application programs. SOURCE FILES: ========== Program Files Description ---------------- ----------------------------------------------------------- Rte.cbl Example COBOL program that creates a list of possible Run-time errors in &nb
Problem: The classic tools were shipped as Addpack in NX 4.0 The classic tools were not shipped with NX 5.0 Resolution: The Classic Tools AddPack is attached to this document. These tools are not supported i.e. No corrections for defects are available. Take the following steps to use the tools: 1) Unzip the attached ZIP in to a folder on your PC e.g. c:\\ClassicTools. 2) Copy the following files from \\NetExpress50\\Base\\BIN to c:\\ClassicTools. mflang01.lbr mflang05.lbr mflangdf.lbr 3) Rename the original files in \\NetExpress50\\Base\\BIN to *.old i.e. create a backup of them! 4) Run the INST.BAT file in the c:\\ClassicTools folder. 5) Copy all the files in c:\\ClassicTools to \\NetExpress50\\Base\\BIN. Run the tools as follows: * SCREENS by entering SCREENSW.EXE. * MFFINDER by entering MFFINDER.EXE or MFFINDEW.EXE. * SOURCE FILE COMPARE by e
Problem: OS: Windows By default Dialog truncates text on a Button when it is larger than the button size. Resolution: There's a demo called buttontext.zip, which demonstrates how to use Windows API calls in order to make the test go over multiple lines. To locate the demo, go to the Micro Focus Supportline website. Click on the 'Self-Service' link, then click on the 'Examples & Utilities' link and is located under the 'Dialog System' category. (http://supportline.microfocus.com/examplesandutilities/nesamp.asp) Old KB# 1337
Problem: How can I set focus on an ActiveX control in Dialog. For example if my focus is on a entry field how can I reset focus on an ActiveX grid control. Resolution: You should use the "setfocus" method of the activex. Some example Dialog to do this is:- INVOKE OCX-01-OBJREF "SETFOCUS" $NULL Old KB# 1282
Problem: Solution is only to have on-line the LINK.exe Version 8 thru PATH environment variable and the link Version 8 libraries thru LIB environment variable... These ressources having to be invoked firtsly before the ones delivered under Net Express ( ie: [NetxInstallDIR]\\base\\bin\\link.exe & [NetxInstallDIR]\\base\\lib\\user32.lib & kernel32.lib & advapi32.lib & msvcrt.lib & gdi32.lib & advapi32.lib LINK.exe version 6 is delivered with Net Express... Resolution: Working in a DOS command prompt and manage so Net Express uses MS LINK.exe Version 8 ================= 1) ---> Launch Visual Studio 2005 Command Prompt this shortcut launches ... %comspec% /k ""C:\\Program Files\\Microsoft Visual Studio 8\\VC\\vcvarsall.bat"" x86 which correctly sets PATH & LIB envt vars so MS LINK.exe Version 8 can be used .... ====> You c
Problem: Net Express has built-in support for the following character sets. The numbering convention used for single-byte character sets is that defined by the CCIT/ITU country code. Resolution: Support is provided for the following character set conversions, except where indicated: " EBCDIC to ANSI " ANSI to EBCDIC MFCODESET Character set AUTOMATIC Determined from the Windows country setting AUTO Determined from the Windows country setting DEFAULT US English 0031 Dutch 0033 French 0034 Spanish 0039 Italian 0043 German (Austrian) 0044 UK English 0045 Danish 0046 Swedish 0047 Norwegian 0049 German 0081 Japanese Katakana Extended 0082 Korean 0086 Simplified Chinese 0351 Portuguese 0358 Finnish 0437 US English 0500 International (Latin 1) 0886 Traditional Chinese 0939 Japanese Latin Extended 9122 Japanese Katakana Old KB# 1310
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: 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: Passing a non-recognisable or non-existent date to the INTEGER-OF-DATE intrinsic function returns a value of 0. Example; C:\\>type Pro1.cbl DATA DIVISION. WORKING-STORAGE SECTION. 01 RET PIC 9(8). PROCEDURE DIVISION. MOVE FUNCTION INTEGER-OF-DATE(20060229) TO RET. DISPLAY RET. GOBACK. C:\\>runc Pro1 00000000 Is the function defined to return value 0 for any non-existent date? Resolution: Please refer to documentation. A search for 'intrinsic function' in the Index points to: 'Reference > COBOL Language > Part 2: Program Definition >
Problem: Release 4.0: The creation of apslastdir key works for AS service-pack update. Application Server installed to a non-default location using the following command line: setup -s f1Drive:\\FolderName\\NewSetup.ISS For example, setup -s f1C:\\MFAS40\\NewSetup.ISS The concern is that MF AS setup files will be packaged to a seft-extract file for our customer to download. They will probably extract it to a network drive for their users to run MF AS silent install (Setup.Bat in our case). What we will have to ask them to do is to edit Setup.bat to specify where the NewSetup.Iss is located. Also, when distributing MF AS setup files on a CD with Setup.Bat. They cannot run Setup.bat directly from the CD, because they have to update Setup.Bat to specify the location of NewSetup.Iss. Resolution: Here is what is in the batch file to do the silent install using newsetup.iss file from a different location. Application Server
Problem: A Net Express application is occassionally getting a File status error 9/199 returned when reading a sequential file. This is associated with messages in the Event Log - GetLastError() returned 64. Resolution: A 9/199 message indicates that the filehandler has received a message from the operating system that it does not understand. As we know, the Windows Event Log has indicated that Windows has issued an error message - GetLastError() returned 64 - which looks to be the real problem. Taking a look on the references on the Microsoft support site, this would point towards a newtwork traffic issue that is then subsequently throwing a 9/199 Referring to the Microsoft system error codes from this URL: http://msdn2.microsoft.com/fr-fr/library/ms681382.aspx Then seeing that a returned code of 64 = ERROR_NETNAME_DELETED 64 The specified network name is no longer available - meaning the environment has encountered network problems. De
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: How can I clear the highlighting after a text search? Resolution: Please choose View->Clear->Text Finds from the menu to clear the highlighting. Old KB# 1368
Problem: Visual Studio 2005 How to convert a character string of numeric digits into its equivalent numeric value - not as simple as moving the value of an alphanumeric data-item to a numeric (floating-point) data-item, as the decimal point may be lost. Resolution: Attached is a structured COBOL approach to converting the string to its numeric decimal equivalent. It splits the string on the decimal point into its integer and fractional parts; then performs a COMPUTE to work out the numeric decimal equivalent and store it in a numeric data item. This is just one approach. Attachments: testStrtoDec.cbl Old KB# 1263
Problem: Net Express 4.0 with .NET (2003) A C# web service calling a COBOL program built as a DLL causes COBOL exception: Edit 129: The File "D:\\...\\FILENAME.CBL" is marked as read-only. Build tab shows: Generating system database Generating classes... Failed to create database file. Check that existing file is not locked. Attempted to create file : C:\\Documents and Settings\\All Users\\Application Data\\Micro Focus\\NetExpress\\4.0\\SYSTEM.DAT The attempt to create a new system database failed The original database will be restored Resolution: Check that the PATH variable is pointing to the application dlls and the COBOL runtime system Old KB# 1262
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: 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
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.