Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
Problem: A customer migrating from the mainframe found that some of his programs were failing with the above error during execution. This was due to PERFORM VARYING statements where the subscript either started at zero, or went past the highest value in a table (e.g. went to 11 when the OCCURS was 10). Whilst he appreciated that such programming practices might be considered unsatisfactory, it was important that the programs should run, unmodified, on the new UNIX platform. Resolution: The compiler directive NOBOUND stops the automatic checking of subscripts at runtime (the default is BOUND). If you are building to generated code, you should also look at the NOBOUNDOPT directve, though using this may impact performance. Old KB# 4538
Problem: The following compilation command fails with the error "cob64: warning: -u overrides -x" cob -x -L/u01/oracle/db/10.2.0/lib/ -L/usr/shlib /u01/oracle/db/10.2.0/precomp/lib/cobsqlintf.o \\ -lclntsh -lnbeq10 -lnhost10 -lnus10 -lnldap10 -lldapclnt10 \\ -lnsslb10 -lntcp10 -lntcps10 -lnsslb10 -lntcp10 -lntns10 \\ -lkstat -lnsl -lsocket -lgen -ldl -lsched \\ -R/u01/oracle/db/10.2.0/lib -laio -lposix4 -lm -lthread Resolution: The compilation command is poorly formed, an option is specified which is not supported by the Micro Focus 'cob' command The invalid option is the '-R' - This is an option for the UNIX link editior, When 'cob' parses the options the -R is essentially ignored, the next character captured is the 'u' which is meaningful to the cob command but is causing contention with the -x specified earlier in the command line. Resolution and explanation of options used in compile: -u Compiles
Problem: There are three ways to determine the number of records in an Indexed file. Resolution: Option 1 - The record count is at offset offset x"40" and is 8 bytes long in the Micro Focus indexed file formats 3,4 and 8, which contains the index. Micro Focus provides a special op code h"0003" to read the header into the record buffer. Refer to the documentation - File Handler, chapter 7.4 Operating Code. Option 2 - The rebuild utility options -n or -f will return the number of records in the file, if the information is present. Option 3 - Calculate the number of records in the Micro Focus ISAM file (format 0) - take the length of the file and divides by the overall record length. This is actually one byte longer than the data record. Old KB# 4558#AcuCobol#RMCOBOL#netexpress#ServerExpress#COBOL
Problem: READY TRACE is set up in an online program. The trace compiler directive was set. When the program executes the trace logging is written directly to the online screen. How can the ready trace output be directed to a physical log file? Resolution: Trace output defaults to standard out. Try setting the OUTDD compiler directive to redirect the file. A simple example would be compile the program with the directive: cob -C OUTDD=SYSOUT myprogram.cbl then establish the desired location for the log file. export SYSOUT=/home/dir/myfile.txt For more information on the OUTDD compiler directive, see the online documentation at: http://supportline.microfocus.com/Documentation/books/sx40sp2/stpubb.htm Old KB# 4542
Problem: On UNIX the file name default is file-base-name for the data portion aand file-base-name.idx for the index portion of a file. The following explains how to change these default naming converntions. Resolution: In the extfh.cfg configuration file you can specify the option IDXNAMETYPE. The IDXNAMETYPE option specifies the format of the filename type for both the data file and index file,present. if presnet. IDXNAMETYPE={0|1|2} where the parameters specify how the the name of the index file (if present) is derived from that of the data file: 0 By discarding any extension and adding the extension .idx 1 By simply adding the extension .idx 2 Like 1 except that the data file name is modified by adding the extension .dat For example, if the data file name presented to the File Handler is abc.def, the options shown above give the following data and index file names: 0 abc.def and abc.idx
Problem: How can locks be ignored on files opened for Input? Resolution: Set the filehandler option IGNORELOCK in the extfh.cfg file. The IGNORELOCK option specifies whether to ignore locks on files open for Input. IGNORELOCK= {ON|OFF} Default: OFF Old KB# 4556
Problem: By default, characters whose hex values are less than X'20' will have a null byte (X'00') inserted before each such character. This allows the Micro Focus file handler to read such characters correctly when the file is read, but it may cause compatiiblity issues with files used by other programs. Resolution: If null suppression is desired, despite possible read issues with the Micro Focus file handler and some other programs, there are four ways to turn off the feature: 1. Use the INSERTNULL=OFF option in the file handler configuration file. See reference manual "File Handling" for details of using a configuration file and the INSERTNULL option. 2. export COBSW=-N. However, if there is an active configuration file with INSERTNULL=ON, the COBSW setting is ignored. 3. Call X'91", function 47. See reference manual "Library Routines", "Alphabetical list of library routines"
Problem: When moving a source that contains special characters from a different platform (i.e. Windows, HP...) to Linux you may find that you get compilation errors in those lines. For example the following code: working-storage section. 01 m2 pic x(02) value "m²". PROCEDURE DIVISION. (where the characters in the non-numeric literal are U 006D and U 00B2) could produce the following compilation error: 14 working-storage section. 15 01 m2 pic x(02) value "mý". 16 *1004-E****************************************************************( 0)** ** &
Problem: How does the Dialog export command help me as a developer? Resolution: The export command allows a developer to dump every detail about a dialog screenset. This both helps with debugging and also re-coding. Alt/F10 brings up the export option where a filename.txt file can be designated for output. Pressing the SPACE bar allows you to toggle which components are selected Components Screenset Dets Data Block Error Messages Validations Global Dialog Panels This is followed by a list of panels which can be de-selected by use of SPACE. For debugging, one is usually only interested in a subset of panels. The resultant output is a text file containing every detail of the selected components. This is part of the Global Dialog setion. GLOBAL DIALOG CASE-SENSITIVITY ON EK F1 [RETC ] &nb
Problem: When you have say about 3000 ints and 50 users. It can happen that a file in I/O is locked. How can you find out in the runtime who locks the file or which runtime process as you could kill all but that's not very user friendly. Resolution: There is a tool in Server Express which is not documented (yet). It's called 'wholock'. It's quite simple to use: wholock filename dfed filename This opens the file in the data file editor Then use the command: wholock /support/cmc/filename result: Process 15098 (cmc) on tty pts/4 holds 1 read and 1 write locks Old KB# 4528#ServerExpress#RMCOBOL#netexpress#AcuCobol#COBOL
Problem: You may be trying to do a very simple rebuild on a small ISAM file but for some reason the command is not finding the input file to be rebuilt (even though it is in the present working directory). You may have been following the suggestions in the manual & it seems like it should work.... Resolution: The first thing to consider is the way the file is named. If it is FILENAME.dat and FILENAME.idx, then you are probably using the IDXNAMETYPE filehandler configuration option. By default, the name of the data portion of the indexed will be exactly as specified in ASSIGN clause in the SELECT statement of the program. Therefore, if the program has ASSIGN "CCSTAT.dat", then the data part of the file would be CCSTAT.dat - however the indexed part of the file would be created as CCSTAT.dat.idx. For you to have the file extensions as you have - CCSTAT.dat and CCSTAT.idx, you probably have the IDXNAMETYPE configuration option set to 2 in the fil
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
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.