Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
Problem: This KB has the same aim than the KB No. 25663. (http://supportline.microfocus.com/mf_kb_display.asp?kbnumber=25663). ===== The demonstration is attached. Customer need: C calling COBOL AND redirect COBOL STDOUT AND retrieve COBOL STDOUT in the C code which has called a COBOL shared library ===== The main difference is that C code in KB 25663 uses C primitives dlopen & dlsym & dlcose when C code in this KB uses MF "C Functions for Calling COBOL" which makes the C code to be simpler and more portable. Another thing here is that the Cobol Shared library is loaded 3 times and cancelled every time is has been loaded, just to show that the cobcancel function & cobfunc functions CANCEL the shared library ( see in LOG file the comment "BEGIN CobolFunc Vn" n being equal to 0 or 1 or 2) ( the Cobol Shared library was relinked every time before to be called again) Resolution: The demonstration : The
Problem: Why isn't the sign displayed for a signed COMP-3 field (PIC S9V99) when executing a COBOL program that has been compiled using mainframe dialect directives (VSC2)? Resolution: Recently, the product functionality has been modified. When emulating mainframe dialects, the sign is no longer displayed when specifying a signed COMP-3 field. The change was made to align Micro Focus for improved mainframe emulation. Old KB# 2315
Problem: My table has a number of occurrences that is variable. Is it possible to manage this table dynamically ? Resolution: The example is : The table is managed dynamically The table is sort IDENTIFICATION DIVISION. PROGRAM-ID. PROG. WORKING-STORAGE SECTION. 01 TABLE-DYNAMIQUE IS TYPEDEF. 10 LI-AIDE-TABLE-CLEF PIC X(10). 10 LI-AIDE-TABLE-INDEX PIC 9(05). 10 LI-AIDE-TABLE-AFFICH &nbs
Problem: The error manual states: You are trying to open a file which you previously closed with lock, which violates one of the general rules of COBOL programming. Resolution: This error can be caused when the UNIX system runs out of file descriptors. When a program opens a file, the operating system returns a corresponding file descriptor that the program refers to in order to process the file. The command "ulimit -a" displays the current system limits. Example: $>ulimit -a time(seconds) unlimited file(blocks) unlimited data(kbytes) unlimited stack(kbytes) 8192 coredump(blocks) 0 nofiles(descriptors) 256 vmemory(kbytes) unlimited In the example above, the system lim
Problem: I would like to check the length of the source and of the target for alphanumeric Move operation Resolution: The compiler directive MOVE-LEN-CHECK ( or MOVELENCHECK) check the lengths . This directive must be used with the directive WARNING that is validated to 2 or 3. Example : -C MOVELENCHECK -C WARNING=3 At the begin of the module : 123456$SET MOVELENCHECK WARNING(3) Old KB# 2312
Problem: Is there a compiler directive or other external way to initialize data items without acutally changing the code in the program or copybook? Resolution: If a program does not explicityly initialize numeric fields the default is spaces. To be sure of having correct numeric values code the value clause in working storage or use the Procedure Division command INITIALIZE ( See the COBOL reference). The compiler directive -C SPZERO can be specified to change all spaces in numeric fields to zeroes Here is another directive that might be useful: See the Server Express Compiler Directives Reference: http://supportline.microfocus.com/Documentation/books/sx50/sx50indx.htm DEFAULTBYTE Initializes each otherwise undefined byte of the Working-Storage Section to the character given. Syntax: >>-.---.--DEFAULTBYTE--"integer"----------->< -/- Parameters: integer ASCII code of the charact
Problem: The compile works, link fails with ld: Can't find library or mismatched ABI for -llibrt.so Modified the LD_LIBRARY_PATH, but it still fails. Resolution: The default linker search path can be modified by using the LPATH environment variable. This environment variable allows you to specify which directories ld should search. If LPATH is not set, ld searches the default directory /usr/lib. If LPATH is set, ld searches only the directories specified in LPATH; the default directories are not searched unless they are specified in LPATH. If set, LPATH should contain a list of colon-separated directory path names ld should search In this case LPATH was set to /usr/lib. Changed it to the /usr/lib/ hpux64 on the ia64 HP/UX server and the link works fine Old KB# 2282
Problem: This issue occurs during migration from HPCOBOL to Server Express. The ACCEPT statement in HPCOBOL includes behavior that is an enhancement or extension of the ANSI standard ACCEPT. If the data-item being ACCEPTed already has a value, then data entered by the user overwrites the existing value on a character-by-character basis, and if the user presses Enter without entering any data, then the data-item's value is left unchanged. By contrast, the ANSI behavior is to entirely replace the existing value of the data item with whatever the user enters, and if the user enters nothing, to initialize the data item. Example code: 000001 WORKING-STORAGE SECTION. 000002 01 WS-ACCEPT pic X(10) VALUE "WOOGA". 000003 PROCEDURE DIVISION. 000004 DISPLAY "WS-ACCEPT, Press ENTER to TAKE DEFAULT: ", 000005 &
Problem: demonstration is attached. It contains I) ================== firts a COBOL code, named pipeCob.cbl, which uses UNIX primitives: pipe & write and read and close To WRITE in a pipe & READ from the pipe II) ================== A C code named pipeCob.c which ....creates a pipe ....calls COBOL ( CobolWrtPipe.cbl) ) passing to COBOL the pipe File descriptor ... .. .. the Cobol Function writes in the pipe ... Back in C code, the C code, thru the use of the read function, reads the content of the pipe filled by the COBOL function above Resolution: I) ================== Sample Cobol code which uses UNIX primitives pipe & write & read & close to I-O on a pipes Cob -x pipecob.cbl pipeCob.cbl WORKING-STORAGE SECTION. 01 int pic s9(9) comp-5 is typedef. 01 fildes. &nb
Problem: Should COBOL programs become hung for some reason, the Micro Focus debugging tool named Fault Finder, and also a stack trace obtained from the UNIX system debugger, are helpful in debugging the problem. Resolution: Fault Finder is explained in the Server Express documentation, available on the Micro Focus web site. Start at: http://supportline.microfocus.com then select "Documentation", then select a version of Server Express. From there, click "Debugging Guide", then "Fault Finder". To collect Fault Finder output, first make sure the Micro Focus runtime tunable "faultfind_level=20" is specified. Runtime tunables are specified in a "runtime configuration file". As explained in the Server Express documentation, a run-time configuration file is a text file you can edit with a standard text editor. It is an optional file (no error will be issued if it doe
Problem: STABLE or NO STABLE is an option of SYNCSORT utility EQUALS or NO EQUALS is an option of DFSORT utility DFSORT allows the user to set "option EQUALS=NO" or "option EQUALS=YES" to determine whether or not equal-key records should appear in sorted order or the order in which they are found. EQUALS tells the process to preserve the original order of the data within the "sort keys". If EQUALS is not specified, the order of the data will be unpredictable beyond the specified keys. Does MFSORT give the user this same option? Resolution: By virtue of the tree-based implementation used in MFSORT, duplicate records are returned in the order in which they were found in the input file. Unlike perhaps the DFSORT or SYNCSORT implementations in this regard, there is no overhead in producing the output in this way. This behavior cannot be changed. Duplicates are returned in order. The order in which yo
Problem: Is it to set a break on data change in Server Express? Setting a break on data change can be done in Net Express. In Net Express, the following is done to set a "break on data change": - starting animating - find the field you want to set the "break on data change" - double-click the field to bring up the Examine List - click "monitor" - right click on the monitor window and select the option "Break on change value" - this shows 3 options 1) Hex 2) Break on change value 3) Query List - when "Break on change value" is selected, the monitor window has a stop sign Is there a way in Server Express to take a screen capture of the 3 options available? Resolution: This functionality is not available in Server Express. The capability may be available in a future release of the Eclipse IDE plug-in for Server Express but will not be implemented in the character animat
Problem: When installing Server Express v5.0 on LINUX the following error occurs: "bin/cobconvstrtest: error while loading shared libraries: libstdc .so.6: cannot open shared object file: No such file or directory" This error message occurs when the target machine is setup to run only as 64-bit. That is, the target machine does not have the gcc 32-bit installed. The Server Express V5.0 product for LINUX is a dual mode product it supports both 32 bit and 64 COBOL applications. The Install script is searching for the 32 bit gcc libraries. During installation of Server Express v5.0 the installat script looks for libstdc .so.6 in /usr/lib. If the operating system on the target machine is 64-bit only, then the 64-bit gcc (libstdc .so.6) is installed in /usr/lib64 and the 32-bit libraries are not installed. Resolution: The resolution is to download and install the 32-bit version of gcc. The
Problem: If using the Host Compatibility Option (HCO) with IBM DB2 v9.1 or later, you may experience the following issues when executing the HCO command-line utilities, using cobmfhco : RTS114 against 'hcgetenv' SQL1083N The database cannot be created because the database description block cannot be processed, reason code = "6". Resolution: These are due to known issues with IBM DB2 software. At this time, no known workarounds are available. You will experience similar issues executing the IBM COBOL samples dbconf and dbmconf. If you encounter such errors, Micro Focus recommends that you contact IBM in the first instance. This document will be updated once we have received further information from IBM. Old KB# 2358
Problem: The CHANGE-MESSAGE directive is used to hide or change the severity of an checker errorss or messages. This directive takes multiple options, so getting the right syntax can be tricky. This directive replaces the HIDE-MESSAGE directive Resolution: There are 3 ways of setting this directive: 1. cob command line: -C "change-message(1146 N)" 2. Create a cobol.dir file. The checker will check to see if there is a cobol.dir file in the current directory: change-message"1146 N" 3. Use the $SET in the COBOL program - starting in column 7: $SET CHANGE-MESSAGE(1146 N) Old KB# 2251
Problem: Results of arithmentic operations are different between INT and GNT code forms Resolution: One of the things that can cause these differnces is the presence of an undetected overflow condition , otherwise known as a size error. That is the executiion of a computation or arithmentic operation is producing a result to large for the receiveing data item. To detect this condition add the ON SIZE ERROR clause to the COBOL statement - If the size error occurs, modify the size of the receiving data item. Old KB# 2344
Problem: Using the DISPLAY verb in a CGI program gives an Interrnal Server Error 500 when deployed using the Apache web server, however the same DISPLAY works fine with other web servers such as Solo. Resolution: The problem is with the way that Apache works rather than Server Express. The following can be found on the Apache website: http://httpd.apache.org/docs/2.2/howto/cgi.html#writing -----------> There are two main differences between "regular'' programming, and CGI programming. First, all output from your CGI program must be preceded by a MIME-type header. This is HTTP header that tells the client what sort of content it is receiving. Most of the time, this will look like: Content-type: text/html Secondly, your output needs to be in HTML, or some other format that a browser will be able to display. Most of the time, this will be HTML, but occasionally you might write a CGI program that outputs a gif image, or oth
Problem: How to use variable in the MFSORT configuration file ? Resolution: There are some uses of environment variables in the following script file : echo "1111Aaaaaaaaaa" > L0 echo "9999Azzzzzzzzz" >> L0 echo "4444Bddddddddd" >> L0 echo "1111BAAAAAAAAA" >> L0 echo "3333Accccccccc" >> L0 echo "sort fields(1,4,ch,a)" > cas1.srt echo "sort fields(1,4,ch,a)" > cas2.srt echo "sort fields(1,4,ch,a)" > cas3.srt echo "use L0 org ls record(f, 60)" >> cas1.srt echo "use L0 org ls record(f, 60)" >> cas3.srt echo "give \\$A1 org ls record(f, 60)" >> cas1.srt echo "use \\$A0 org ls record(f, 60)" >> cas2.srt echo "give L2 org ls record(f, 60)" >> cas2.srt echo "give L3 org ls record(f, 60)" >> cas3.srt echo "INCLUDE cond=(5,1,ss,eq,c'\\$A3')" >> cas3.srt A0=L0 A1=L1 A3=A export A0 export A1 export A3 mfsort take cas1.srt mfsort take cas2.srt mfsort take cas3.s
Problem: Results differ when running INT code versus GNT. Resolution: One thing that can cause differing results is the presence and use of an invalid numeric item in a computation. Sometimes programmers find it convient to execute INT programs using the -F runtime switch, this diaables error reporting for unitialized or otherwise invalid numneric data. In GNT code the default behavior is to assume that all numeric items contain valid data, there is no error checking enabled. This can cause the results of computations or arthmetic operations to differ from the results observed in INT code. To enable error reporting for GNT code, compile the the program using the NUMCHECK compiler directive, this will cause an error when invaid numeric data is encountered Old KB# 2343
Problem: cob -z on tictac.cbl produces an unsupported format .so file Resolution: You need to do like this sample: cob -ze "" aaa.cbl bbb.cbl ccc.cbl -o abc.so Now you can call abc.so with cobrun or from the main program by INITCALL. Old KB# 2319
Problem: A program compiled with "Dialect(mf)" does not produce any SYSOUT for DISPLAY statements. It does for DISPLAY UPON CONSOLE. Resolution: In the Help (using Net Express as an example): Reference > Compiler Directives > Compiler Directives - Alphabetical Listing > DIALECT Setting MF, the default options are listed for that dialect. NOOUTDD is the default for MF. In the same location, check the DIALECT Setting for the mainframe dialects (MVS, OS390, etc), OUTDD is the default for all of them. The description of OUTDD leads to the reason the DISPLAYs don't appear: "Causes DISPLAY and EXHIBIT statements to be written to a specified output file.." There are also Comments for OUTDD that provide more details: Comments: When OUTDD is specified, all format 1 DISPLAY statements which either have no UPON option or specify UPON SYSOUT, and all EXHIBIT statements and the output from TRACE are transformed into W
Problem: The following message is displayed : as -o /tmp/cob1HMaUa/ldtab.o /tmp/cob1HMaUa/ldtab.s Assembler : /tmp/cob1HMaUa/ldtab.s: line 7 : 1252-191 .llong should be used for relocatable expressions. cob32: error(s) in assembling /tmp/cob1HMaUa/ldtab.s Resolution: As as command is defined for 64bits mode , it is not possible to assemble a file that is created in 32bits . It is necessary to setting OBJECT_MODE=32 before compile the program. Old KB# 2361
Problem: In Server Express 5.0 WS1 when IKJEFT1A calls a program that doesn't exist, instead of causing an abend it returns a COND CODE = 0012. IBM defines the DISP clause as: DISP=(beginning disposition, normal termination disposition, abnormal termination disposition) An abnormal termination or ABnormal END is really an ABEND. Just passing a non-zero Condition Code is not enough to cause the JCL system to process the DISP clause as an abnormal termination. Generally, the application would have to call an abend routine (ILBOABN0 or CEE3ABD -LE) to provoke and abend and make the JCL to process the 3rd parameter on the DISP clause. Resolution: This has been fixed in Server Express WP4. Now IKJEFT1A produces a system ABEND S04C when the program called doesn't exist. With this abend the file disposition is processed correctly. Old KB# 2318
Problem: Execution error : cob32: Failed to locate an appropriate executable for tool 'cob32' *** Error exit code 1 Stop. Resolution: Reinstall the cobol product in clean directories. The error message is being issued from the triggers (i.e. the 'cob' utility which attempts to execute 'cob32' or 'cob64'). It would imply an issue with file permissions or a corrupt file. Please execute the following commands: ls -l $COBDIR/bin/cob $COBDIR/bin/cob?? cobfile $COBDIR/bin/cob $COBDIR/bin/cob?? sum -r $COBDIR/bin/cob $COBDIR/bin/cob?? cobmode will indicate which the default working mode to check in the output of the above commands. Ex cob32 or cob64 Make make sure $COBDIR/bin is the first directory path in the PATH environment variable. ls -l $COBDIR/bin/cob $COBDIR/bin/cob?? For eample you may find the following xrwxrwx for cob32 On a running system the permissions should be -
Problem: When examining a variable length sequential file in a hex editor, extra bytes with a value of x"00" have been inserted at the end of records. When accessing the file from a COBOL program these extra bytes do not appear in the data. Is this a problem? Resolution: These additional bytes are padding and are inserted by the file handler to ensure that the next record starts at an address which is an exact multiple of the data alignment value for the file type. They are not the result of corruption and are perfectly normal. Variable length record sequential files consist of a 128 byte header record and then a number of data records, each of which is preceeded by a 2 or 4 byte record header. Example output from od -xAd: 0000000 307e 0000 0000 0000 3037 3130 3136 3131 0000016 3235 3535 3438 3037 3130 3136 3131 3235 0000032 3535 3438 003e 0001 0000 0000 0000 0000 0000048 0100
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.