Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
Problem: If there are multiple copies of MFDS running, by default cobesdebug will only connect to the one running on port 86. Therefore only the regions running under that copy of MFDS will be available to cobesdebug. Resolution: cobesdebug uses the mf-client.dat to determine which port to use to connect to MFDS. Modify $COBDIR/etc/mf-client.dat to point to whatever port MFDS is using. Ex. mrpi://localhost:8686 Old KB# 2303
Problem: Arithmetic statements produce different results when run in int form and other program forms(.gnt,.so, or executable) Resolution: In some cases different results for arithmetic statements are produced when running programs compiled to int executable form versus running the same program compiled to .gnt (or other object code) form. There are a number of different causes for this problem/symptom. One possible cause is that the arithmentic operation is constructed in a way that allows the result prodcuced to be larger than the the capacity of the data item where the result is to be stored. INT code hides these kinds of things, while object code forms do not. To determine if a particular arithmentic operation is failing because of this unintended overflow condition, modify the statement to include the ON SIZE Error clause. examples: Original suspect statment COMPUTE C = A * B Test for Size Error COMPUTE C = A * B ON SIZE ERROR STOP "SIZE
Problem: Within the general subject of multi-threaded COBOL programming, the distinction between "local-storage" and "thread-local storage" may not be clear. This Knowledgebase article illustrates the difference, with an explanation and example source code. Resolution: In the documentation for both Server Express and Net Express, there is a book named "Multi-threaded programming", where this subject is generally covered. The documentation says thread-local storage is "persistent across calls". This means you can call a single individual COBOL program repeatedly within the same thread, and it will "maintain state" across calls, that is, it will remember the values in its thread-local storage from the last time it was called in that thread. Local-storage is different, because local-storage is initialized each time a program is entered (that is, values from previous calls are not remembered). The
Problem: I migrate my application from Object Cobol Developer Suite. In my application , the box is with color and the lines are cut by characters . It runs fine with Object Cobol Developer Suite . With Server Express , The color stops at the first character . Resolution: The terminfo source file for the emulation linux was modified between Object Cobol Developer Suite and Server Express. It is necessary to use the terminfo source file that is delivered with Object Cobol Developer Suite . The source file linux-ocds.src is : # Reconstructed from file: /opt/cobol/d4200/tbx/terminfo/l/linux # Produced by mfinfocmp (Micro Focus terminfo) linux|linux console, am, bce, eo, mir, msgr, xenl, xon, colors#8, cols#80, it#8, lines#25, pairs#64, acsc= ^P\\,^Q-^X.^Y0\\333'^Da\\261f\\370g\\361h\\260i\\316j\\331k\\277l\\332m\\300n\\305o~p\\304q\\304r\\304s_t\\303u\\264v\\301w\\302x\\263y\\363z\\362{\\343|\\330}\\234~\\3
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: I work in UNICODE ( UTF16 ) My group is defined as : 01 Z1 . 02 Z11 PIC N. 02 FILLER PIC N. 02 Z12 PIC N. 02 Z13 PIC N. 02 Z14 PIC N. How do I do to initialize Z1 to spaces ( UTF16 ) Resolution: As INITIALIZE statement does not affect elementary FILLER data item, the FILLER data item has the same value before and after INITIALIZE. It is possible to use the compiler directive -C REMOVE=FILLER. Old KB# 2277
Problem: In a Windows environment it is possible to use the WIN API GetSystemTime which returns time to milliseconds. However, is there a similar functionality for UNIX platforms? Resolution: The standard functions ftime() and gettimeofday(), both of which are part of the Single UNIX Specification. ftime() is an outdated function; gettimeofday() is preferred for new code. To use either of those functions in COBOL you will have to convert the appropriate structure from the system's version of /usr/include/sys/time.h to a COBOL group item, then call the function passing the item by reference. For example, on Solaris 9, in a 32-bit environment: ----- $set sourceformat(free) identification division. program-id. time-in-ms. data division. working-storage section. 01 timeval-32bit. 02 seconds pic x(4) comp-5. 02 micr
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: 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: 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: Using Source Format Fixed. Why is an asterisk treated as a comment in the sequence number area? Resolution: Specify Compiler directive NOMFCOMMENT Please reference the Cobol Language Manual Fixed Format In fixed format, the COBOL source record is divided into the following areas: Columns 1 - 6 Sequence number Column 7 Indicator area Column 8 - 11 Area A Columns 12 - 72 Area B A COBOL source record can extend up to a maximum of 80 columns in length. The contents of columns 73 to 80 are ignored by the COBOL system. Sequence Number A sequence number of six digits can be used to identify each source program line. If the first character position of the sequence number field contains an asterisk, or any nonprinting control character (less than the character SPACE in the ASCII collating sequence), then the line is treated as comment and is not output to the listing file or device. This facility allows an output listi
Problem: Demo - print flow of data from Unix on Default Printer of a Windows PC thru File Share ======= This KB is the next step of the KB 25059 http://supportline.microfocus.com/mf_kb_display.asp?kbnumber=25059 Which implements the STEP 5) of this KB === 5) Regards to the File Handler called by FS server thru the use of the /ap parameter Another scenario, could be, On the File Handler order 'OPEN OUTPUT' I use a MF PC_PRINTER_OPEN On the File Handler order 'WRITE' I use a MF PC_PRINTER_WRITE On the File Handler order 'CLOSE' I use a MF PC_PRINTER_CLOSE === ======= On File Share Server side (WINDOWS) The File Handler invoked by File Share thru the use of the /ap parameter is named here mymffhPCPR Depending on the existence of a CONSTANT named SaveOfTheFilePrinted If Exists: Il will SAVE on FS Server side (Windows) the 'Data stream' received thru File Share And will print the 'Data stream'
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: 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: I would like to use animator with my COBOL modules in Intermediate Code. In my COBOL modules I insert Oracle SQL Language. The ANIMATOR loops on verb CALL 'SQLBEX' or STOP RUN. COBSW= A export COBSW rtsora program01.int Resolution: When a Cobol module program01.cob ( the output file of the command procob progam01.pco ) is generated ( for example in Generated Code ), the file program01.idy can't be use to anim program01.int. If it is use , anim loops . So It is necessary to generate in two phases: Compile : cob program01.cob save the files program01.int & program01.idy Generate : cob -u program01.int and use the saved files to anim But it is possible to anim the Generated Code file after use the command: ob -ug program01.int Old KB# 2322
Problem: Sample demonstration which uses: >> a File Share Server on Windows side, This File Share server using a 'Virtual File Handler' thru the use of the FS Server /ap option for files having to ne printed on the winfows default printer >> a File Share client on UNIX or Windows side ( both work ), File Share client which writes on the FS server described above to print on the windows default printer Resolution: 1) Environnent On Windows Net Express ( Test was done with NE 5.0 Websync4 ) On Unix Server Express 5.0 ( Test was done with SE 5.0 Websync4 ) Acronym used: FS = File Share 2) Launching of the demonstration Unzip the demonstration on a Working directory 21) Launch File Share Server on windows Launch FSDB.bat from a Net Express command prompt 22) Launch FS client on Windows Open the Net Express project Cont
Problem: In the past, on Suse and Red Hat Linux, MQ series did not support interoperability with MF COBOL, so Micro Focus provided to some customers (as a special case), two .gnts and a .so (named MQCONN.gnt, MQCONNX.gnt, and mfmqsup.so), consisting of routines that map MQ calls within COBOL (for example MQOPEN, MQGET, etc.) onto the C support within MQ, as a way of facilitating interoperability between Server Express and MQ Series. A customer had been using these files successfully, but when this customer upgraded from SX v5.0 to SX v5.0 WP4 (i.e. they installed WP4), they began receiving an MQ error: reason 2012 calll not valid for current environment MQRC_ENVIRONMENT_ERROR Resolution: In the past, modules named MQCONN.gnt and MQCONNX.gnt were not supplied with Server Express, but beginning with WP4 for SX v5.0, they are supplied as part of the "Enter
Problem: In cases where differing results are observed between the .INT version of a program and the .GNT,Callable shared object, or UNIX executable version of the same program there are a few basic steps to take in identifying the root cause of the difference. Resolution: The first thing to do is identify the line of code in the program where the difference can be observed, in most cases this will be an arithmetic operation or possible an evaluation operation (IF , EVALUATE etc). Make sure that the fields used in the offending statement contain expected values before proceeding, if any element contains an incorrect or unexpected value then the root cause of the difference has not yet been identified, you'll have to work backwards to see where the error is introduced. Once the offending statement is identified insert some code after the offending statement which will clearly indicate success or failure of the suspect operation. For example if the suspect
Problem: Sample message: ld: warning: file /opt/lib/cobol/lib/libcobrts.so: section .dynsym: symbol [25]: global symbol has no name Resolution: This error occurs because Server Express is being used on an operating system with a C compiler that is newer than the version it was developed on. To see the Reference Environment for the Server Express that it installed see the file $COBDIR/docs/env.txt. It will list the C Compiler used when Server Express was developed. For instance: C Compiler ---------- cc Forte Developer 7 C 5.4 2002/03/09 This will be followed by the command to be executed on the current machine to see which C Compiler is installed locally: cc -V 2>&1 |cut -c5-80|head -1 If these do not match that would cause this kind of error. In this case because it is only a warning, the messages can be safely ignored. Old KB# 2326
Problem: 'fuser' is a standard UNIX command which displays the PIDs of processes using the specified files or file systems. In the default display mode, each file name is followed by a letter denoting the type of access: c current directory. e executable being run. f open file. f is omitted in default display mode. r root directory. m  
Problem: 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 C code here uses C primitives dlopen & dlsym & dlclose.... It's better to use MF "C Functions for Calling COBOL" which makes the C code to be simpler and more portable. see KB 25667 which uses MF cobcall & cobcancel & cobfunc (http://supportline.microfocus.com/mf_kb_display.asp?kbnumber=25667) Resolution: The demonstration : The C code CCobStdout.c ...>Sets en environnent variable (setenv primitive) ...>Gets the content of this environment variable (getenv primitive) ...>Loads a COBOL shared library (dlopen primitive) ...>Finds the location of a Cobol function (dlsym primitive) ...>Calls the COBOL function
Problem: MySQL is the worlds most popular open source database because of its consistent fast performance, high reliability and ease of use. Can MySQL database be used with Net Express and Server Express? Resolution: Although the product documentation talks about specific databases such as DB2, Informix, Oracle and Sybase, it is possible to use any RDMS with OpenESQL and the relevant ODBC driver. Pre-requisites: 1. An ODBC driver manager such as unixODBC 2. An ODBC driver such as the one available from MySQL (version 3.51 was used to test the demo programs mentioned in this article) The unixodbc.org and mysql.com websites provide comprehensive documentation on installing and configuring the manager and driver. Please refer to $COBDIR/docs/readme.txt for details on the platforms supported by OpenESQL. Minimum ODBC configuration when connecting to database on local system: If using unixODBC the following configuration information goes into
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: 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: There are development shops that need to test multiple versions of Oracle. The problem is that once the development shop(s) create a rtsora using one version of Oracle there isn't a way to animate using another version. Is there a way to be able to animate both versions? Resolution: Create an environment that will point to the rtsora you want to use: export ORARTS=<my-orarts-for-9.x> or export ORARTS=<my-orarts-for-10.x> To animate .int and .gnt using your custom rtsora use: COBSW= A $ORARTS my-command-line Old KB# 2267
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.