Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
Problem: The ability to pipe input and output between commands is a powerful feature of Unix. Can Cobol programs pipe to or from Unix commands and/or other Cobol programs? Resolution: Yes. The way in which a pipe file name is specified is documented in programming guide manual "File Handling", chapter "Filenames", section "Setting up Pipes". The pipe direction (in, out, or bidirectional) character, the name of the other command, and that command's command line arguments may be specified as a literal in the SELECT statement or as the value of the DD_assign-name environment variable. Examples: select infile assign to '<cat $COBDIR/etc/cobver' organization is line sequential. *The "<" character defines an input pipe to the program. select infile assign to external filespec &nbs
Problem: The RTS error on failure is one which may be caused by an environment variable setting problem, e.g. 173, 211, 114, etc. How to check the environment while running in CGI mode and compare it to the command line environment? Resolution: One good way to compare environments is to run the mfsupport utility from the successful command line environment and from the cgi environment. A comparison of the environment sections of both output files may reveal the problem. However, it is not simple to run mfsupport in the cgi environment. To do the latter, write a small cgi program which contains the following fragments: 01 mfsupport-command-line. 10 mfsupport-command pic x(200) value 'mfsupport > /dev/null 2>&1'. &
Problem: After applying a fix patch to Server Express 4.0 SP2 a customer noticed a difference between the COMPUTE statement in that it correctly calculates an int file but gave the wrong results in a gnt file. Resolution: After setting the Compiler directive HOSTARITHMETIC the desired results were achieved. There is a KB article about HOSTARITHMETIC as new compiler directive: (KB 19918) which is recommended to read as it contains detailed information to this compiler directive. Old KB# 4512
Problem: For ACCEPT FROM ENVIRONMENT-VALUE the COBOL Language reference states: If no previous DISPLAY with a mnemonic-name associated with an ENVIRONMENT-NAME has been performed, or if the specified environment variable does not exist, the imperative statement associated with an ON EXCEPTION phrase is executed. The value in identifier is undefined in this case. ***************** But, what happens when an environment variable has a value of NULL? In Server Express 4.0 the ON EXCEPTION will be executed if the environment variable in not set or if it is set to a NULL value. In OCDS 4.1 for UNIX, the ON EXCEPTION is only executed when an environment variable does not exist. Also, in C the getenv() function can distinguish between an environment which isn't set, an environment variable set to NULL and an environment variable that is set. The following C program shows the possible results: $ cat envtest.c #include <stdio.h> #include <stdlib
Problem: The command is cob -z prog.cbl . The Intermediate Code file and the object file are created . The Callable Shared Object file is not created . This message is also displayed if the command is cob -x prog.cbl Resolution: These messages are displayed when the environment variable LIBLIST is validated : If $LIBLIST is validated to a file that has a size to zero : the message is : "cob64: can not execute" If $LIBLIST is validated to a file that does not exist ,the message is : "cob64: error opening: name of the file " If $LIBLIST is validated to a file that exists ,the message is : "cob64: illegal format in name of the file" the file is displayed $LIBLIST specifies an alternative file for Cob to use; you should not use it unless a Micro Focus representative asks you to. Old KB# 4491
Problem: NetExpress 5.1 not printing in Microsoft Windows Vista Ultimate (Assumption is made that a default printer has been defined, and that it is connected to a USB port, not a legacy LPT parallel port) Resolution: In Vista, right-click on the NetExpress 5.1 icon, select "Properties", select "Compatibility Mode", and select "Microsoft Windows XP Service Pack 2 (SP2)". Click "OK". NetExpress should now print on USB printer. Old KB# 4452
Problem: The output filename for XML should be "C:\\Files\\My File\\DATA.XML" However, after the program ran without any error a file "C:\\Files\\My" has been generated. Obviously the SPACE is truncating the name. SELECT XML-STREAM ASSIGN "C:\\Files\\My File\\DATA.XML" ORGANIZATION IS XML FILE STATUS IS XMLSTAT. XD XML-STREAM. &nb
Problem: A column defined as numeric (10,0) and the host variable declared as PIC X(10). If the value was 500 when selected from the database the host variable contained ' 500'. With the Oracle 10.x pre-compiler the host variable contains '500 ' and this is causing a problem within the application. Resolution: Use the Oracle precompiler directive picx=varchar2. Old KB# 4418
Problem: Can't get to their data files on the Unix machine. Is there some other way than using SAMBA to make the data on the Unix machine accessible to Windows and Net Express? Doing a NetX publish to Unix is not an option, either. Resolution: Unfortunately, there is no way aside from SAMBA to achieve this capability. If the Unix people can set things up so that Windows sees the Unix file system as a mapped drive, then Net Express will work with it. Old KB# 4411#netexpress#COBOL#AcuCobol#RMCOBOL#ServerExpress
Problem: This demo will show how you can use Windows Script Host (WSH) objects to create a shortcut from a COBOL application. Resolution: INTRODUCTION ========== This demo shows how to create a shortcut from a COBOL application on Windows. DESCRIPTION ========= This demo shows how you can create a shortcut on the Start Menu. It uses an api to get the location of the Start Menu and then creates a shortcut in that directory. After running the demo you should find a Link in your StartMenu that opens the Micro Focus home page. SOURCE FILES ========= wshshortcut.cbl CreateShortCut.app ========================================================== Keywords: demonstration, sample, example, demo, CreateShortcut.zip, Shortcut demo.ex demo.ne Attachments: wshshortcut.zip Old KB# 4409
Problem: For batch applications using cbllink.exe on the command line, how are the "Application Complete" and "Click OK" pop-up windows suppressed? Resolution: When invoking cbllink.exe from the command line, omit the "/g" command line switch. The "/g" switch marks the executable as a graphical application. When running unattended, batch-mode applications should not be marked as graphical, since this would require operator intervention for responding to pop-up windows. Old KB# 4426
Problem: Applications that perform very large SORT operations can often take quite some time to complete the process. However it is possible to inrease the performance of a SORT application by increasing the amount of memory used by SORT by conguring the SORTSPACE environment variable. Resolution: By default, SORT uses 1MB of memory when performing SORT operations. This amount can be increased however by setting the SORTSPACE environment variable to specify a greater amount of memory, for example SET SORTSPACE=256MB The more memory you define, the quicker the sort. We found that using the settings below produced the following results when performing a SORT operation against 1 million records: SORTSPACE TIME TAKEN 2MB 39s 1
Problem: In .NET WinForms how to show a form as a Modal Dialog Box? Resolution: Showing a form as a Modal Dialog Box by using the "ShowDialog" method. This will display the form as a Dialog Box and return a value that allows to determine if OK orCANCEL was pressed. For example: set ls-result to ls-Form4::"ShowDialog"(self) The ShowDialog method takes the parent window as a parameter. Old KB# 4408
Problem: When creating a new mapping for a Web Service from legacy COBOL code, you may find in doing so that the case of the legacy COBOL code is lost - for example all converted to lowercase. This may cause you a problem if you have a requirement for the case to be as in the original code, for example (lower-) CamelCase. Resolution: Specify the PRESERVECASE directive in your program program: $SET PRESERVECASE This will then ensure that the original case is preserved as required. Old KB# 4429
Problem: How can you disable the Keyboard BEEP in a Character Dialog screenset ? When you enter the maximum number of characters in a field a BEEP is output to notify the user that there has been an error. Resolution: You can configure this behavour in the Dialog DSDEF.CFG config file. To disable the BEEP on end of field you need to add NOBEEP-EOF. There are also options NOBEEP-EOS and NOBEEP-INVALID which turn off BEEPs on end of screen and invalid keys respectively. Old KB# 4448
Problem: Using a Treeview control how can you put a Node into Edit Mode ? A tree view allows you to edit the label of a TreeViewItem. Can you programmatically force a item into this mode. Resolution: You can do this using the "EditLabel" method. The following code snippit shows how you can create a treeviewitem and put it into edit mode:- INVOKE aTreeview "addItemZ" USING aTreeView Term-Field RETURNING ws-treenode &n
Problem: In Winforms you can use the Tooltip provider to add tooltips to controls. This allows you to define tooltips at design time for the controls on a Form. How can you change tooltip text at runtime from COBOL ? Resolution: You can do this using code such as :- invoke tooltip1::"SetToolTip"(numericupdown1 , "New Text for tooltip") tooltip1 is an instance of the tooltip provider that was added to the form. Old KB# 4437
Problem: Is it possible to pass an ODBC connection from another language such as C or powerbuilder and use the connection from OpenESQL. Resolution: This is not supported. In COBOL you can do a GET HDBC or a GET HENV to get some ODBC handles to the OpenESQL connection. These handles can then be used in direct ODBC API calls. However you cannot be passed an ODBC connection from C or Powerbuilder and bind that as an OpenESQL connection. Under .Net you can do something like this if you use ADO.Net. You can be passed a .Net connection and transaction object and then bind the ado.net connection object to OpenESQL. That however is only under .Net. Please see KB 24812 from more information on sharing a connection in .Net. Old KB# 4451
Problem: The .NET Framework comes with a Print Preview control to be used to give the user a preview of a document. How to use this control to present multiple pages of print? Resolution: When using the PrintPage event you get passed an instance of System.Drawing.Printing.PrintPageEventArgs. This has a boolean property "HasMorePages" that you can use after printing a page to tell WinForms that another page needs to be printed. Some example code that uses this is: method-id. "printDocument1_PrintPage" final private. 01 ls-left-margin pic s9(9) comp-5. 01 ls-top-margin pic s9(9) comp-5. 01 ls-count pic s9(9) comp-5. &n
Problem: Using "Suggest word" name that is larger or smaller than the original name, columns 73 and beyond are shifted right or left respectively. Changing a data name manually by using the keyboard, columns beyond 73 are not affected whether in insert or overtype mode, this should happen when using "SUGGEST WORD". Resolution: "SUGGEST WORD" is a function of find and replace that has setting outside the EDITOR settings. 1. Select the binoculars icon to move the cursor to the find window. 2. If "Replace" option is not visual select the last icon that looks like 3 staked arrow heads pointing up to expand the "Find Replace" window. 3. Select the "Between margins only button" to have "SUGGEST WORD" honor the margins Old KB# 4445
Problem: Release 5.0.NET: Just testing an own COBOL preprocessor mypreproc.gnt using this compiler directive PREPROCESS as usual, and got this: Execution error : file 'c:\\path\\mypreproc.gnt' error code: 114, pc=0, call=1, seg=0 114 Attempt to access item beyond bounds of memory (Signal 11) Is there a hint available what to do to prevent this, because not involving any VS2005.NET environment mypreproc is running as well. Resolution: Yes, be aware of the following: (1) It seems the mypreproc preprocessor is looping round the last line of source code. Under managed compiles, the compiler reads the source code in 2 phases and it's looping in phase1 until it runs out of memory. However this is unlikely to be the final problem. A preprocessor for managed compiles needs to be reentrant. It does n o t mean about the REENTRANT directive, the pre-processor needs to be able to be called repeatedly
Problem: You can use the WinHTTP COM objects in Windows to issue HTTP Request from a COBOL Application. How can you specify timeout values for the HTTP Request ? Resolution: WinHTTP has a "setTimout" method that allows you to specify :- ResolveTimeout ConnectTimeout SendTimeout ReceiveTimeout To call this from COBOL you would first need to set the OLE Dispatch type as the method name starts with "set" so by default COBOL would attempt a property fetch. The code on COBOL you need to issue would be:- invoke olesup "setDispatchType" using by value 0 ******* The next line would force a timeout * invoke ws-winhttp "setTimeouts" using by value 500 500 500 500 ******* We can set to something more reasonable for the
Problem: Need a way of obtaining a random sample from approximately 960,000 claim numbers. Can the RANDOM function be used for this task. Resolution: The RANDOM function is not really geared towards such a task. The RANDOM function will generate a unique sequence of RANDOM numbers given a seed value argument. The return value from the function will be a floating point COMP-2 number with a value greater than 0 and less than one so it will always be a fractional number and can sometimes be negative. If this function is used to generate a specific range of numbers then the result should be multiplied by a constant value and the result should be checked that it falls within the specified range. Old KB# 4447
Problem: Given: 01 MyData PIC X(1000). When MyData contains an Ampercent sign, it cannot be used as a normal character so it is substituted as AmpercentHash38Semicolon. When parsing MyData by XML PARSE the ampercent is not returned neither as CONTENT-CHARACTER nor as CONTENT-CHARACTERS Hint: The wording Ampercent, Hash, Semicolon used in that article to avoid viewing garbage characters in an HTML environment. Resolution: When using AmpercentHash38Semicolon the ampercent is returned in the register XML-NTEXT as CONTENT-NATIONAL-CHARACTER Event. Also, when specified as AmpercentHashx26Semicolon = its hex value. When using AmpercentampSemicolon the ampercent is returned in the register XML-TEXT as CONTENT-CHARACTER Event. When MyData contains: <data>My Data AmpercentampSemicolon Your Data</data> 3 Events will occur and the text have to be concatenated, i.e. by a STRING with POINTER. Old KB# 4435
Problem: A macro was created in msexcel to fill column "J" with color Gray. Editing the macro shows the following VB code. Sub Macro1() Columns ("J:J").Select With Selection.Interior .ColorIndex = 15 .Pattern = xlSolid End With End Sub Question: What's wrong with this code? invoke ExcelObject "getColumns" using z"J" returning CellRange. invoke CellRange "setColorIndex" using by value 15. invoke CellRange &n
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.