Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
Problem: A index file that works fine on windows gets a 9 error when running on a UNIX system. looking up the hex tables 9 means actually a corrupted file. Resolution: The problem is that on UNIX the idx file had another ending. Neukue.idx should really be neukue.dat.idx. 9 means a corrupt file there is a Compiler Direktive: IDXNAMETYPE The IDXNAMETYPE option specifies the format of the filename type for both the data file and, if present, the index file. Syntax: IDXNAMETYPE={0|1|2} Parameters: 0 Leave the filename of the data file the same. For the index file, discard any extension and add the extension .idx. 1 Leave the filename of the data file the same. For the index file, add the extension .idx.. 2 For the data file, add the extension .dat. For the index file, add the extension .idx. Properties: Default: 1 Comments: The name of the index file (if present) is derived from that of the data file. For example, if the data f
Problem: How can one access locale date/time within Cobol? Resolution: This demo demonstrates using strftime to format the local time in the default representation for the current locale: $set sourceformat(free) mf working-storage section. 01 time-parameters. 03 time-now pic x(4) comp-5. 01 localtime-parameters. 03 localtime-tm pointer. 01 strftime-parameters. 03 locale-time pic x(60). 03 buffer-size pic x(4) comp-5. 03 format-string pic xxx value z"%c"
Problem: We have a product developed in C that uses the MicroFocus file handler (extfh). The product works on a variety of Unix platforms, but we are having problems porting the product to RedHat Linux. When we attempt to open the file, a 9/142 error occurs. Resolution: This is a problem with byte-ordering. Using the CTF utility with the following options: mftrace.level=info mftrace.comp.mf.mffh.xfh#base=true produced a trace which showed the Opcode being passed to the File Handler Open was 01FA, instead of FA01: 15:04:55.295 MF.MFFH.XFH 65536 1 "M" 01FA Old KB# 2012#netexpress#AcuCobol#ServerExpress#COBOL#RMCOBOL
Problem: Trying to animate a core file from a COBOL application sent from another location. Resolution: When trying to animate a core file on a server different from where it was created requires an exact copy of the executable that generated the core as well as exact copies of any shared libraries and callable shared objects that were loaded at the time of the fault. copies of any .int and .gnt and the associated .idy and source files for all of the above. The operating system must also be at exact same level. The Server Express product must also be identical. In all, it's usually easiest to animate a core file on the machine that the core file was produced on. Old KB# 2078
Problem: File status 9/104 when trying to Open a file. Resolution: You specified a data-name for a file-name instead of a literal, and the data item contained only spaces when you tried to open the file. Resolution: Recode your program specifying the correct file-name. Example Wrong: Select myfile assign to file1. open output file1. File status 9/104 Correct: Select myfile assign to file1. move "empl-file" to file1. open output file1. File status 0/0 Old KB# 2009#ServerExpress#COBOL#AcuCobol#RMCOBOL#netexpress
Problem: When attempting to call a third party application from within a COBOL program the call does not work. Resolution: If a COBOL program needs to execute a third party application which exists as an executable program, i.e. .EXE extension, then the COBOL CALL statement cannot be used. An .EXE must be run as a separate process by using the WINAPI function CreateProcessA or the COBOL library function CBL_EXEC_RUN_UNIT. There are samples of both of these on the microfocus.com supportline web site under Examples and Utilities. Old KB# 1608
Problem: Is it possible to change the SORT/MERGE operation to a 3rd party? Resolution: The compiler directive CALLSORT defines the program to be called to handle all SORT/MERGE operations. The syntax is as follows: CALLSORT "sort-name" "sort-name" is the root-name of a program to be called to process sorts and merges. The default is - CALLSORT"EXTSM" Old KB# 2000#ServerExpress#RMCOBOL#COBOL#netexpress#AcuCobol
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. If you want to change the filename typeu 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&nbs
Problem: Which directives take precedence over which ones? Resolution: The Compiler processes the directives in the following order, and if a directive is specified more than once, the Compiler uses the last setting: 1. Directives set in project properties 2. System-wide directives file, i.e. COBOL.DIR 3. $SET statements in the source code 4. User directives file, i.e. USE(aFile.DIR) From the command line, the order is a follows: 1. System-wide directives file, i.e. COBOL.DIR 2. $SET statements in the source code 3. User directives file (i.e. USE"aFile.DIR") or inline directives If for example ANIM is defined in UserDefined.DIR and the command line is done as follows: COBOL Program1.CBL USE(UserDefined.DIR) NOANIM; The last specified directive will be used by the compiler, i.e. NOANIM, so no IDY file will be produced. If the order of USE and NOANIM are switched, then the ANIM in the directive will be used by the compiler. Note:
Problem: The FDCLEAR directive will clear the record buffer area after every Write operation Resolution: The syntax for the FDCLEAR directive is: FDCLEAR "[1 or 2]" NOFDCLEAR Specifying the integers 1 or 2 will: 1 Specifies that the record buffer for a file should be cleared after every write operation. The buffer is cleared to the value specified by the DEFAULTBYTE directive. 2 As for 1, but the record buffer is also cleared after the initial OPEN statement. Comments: The FDCLEAR directive is effective while the SELECT clauses are being processed. Use $SET statements before and after each SELECT clause to apply this feature to selected files. Alternatively, use it once before processing any SELECT statements to apply it to all files in a program. The FDCLEAR directive is ignored for files subject to a
Problem: Using COPY ... REPLACING ... gives user-name not unique errors even though the variable name is unique. The problem only occurs when using the CP preprocessor with COBSQL. Resolution: Solution tested on Red Hat Enterprise Linux 4 & Server Express 5. By default pcbcfg.cfg (in $ORACLE_HOME/precomp/admin) defines: comp5=yes define=comp5 Changing COMP5=YES to be COMP5=NO will resolve this issue. COMP5=YES can also be overridden at compile time by passeing COMP5=NO in the list of directives to be passed to the Pro*COBOL precompiler as follows: PREPROCESS(COBSQL) CSQLT=ORACLE8 END-C COMP5=NO P(CP) ENDP Old KB# 2037
Problem: Program a calls program b with 4 linkage parameters. Progam b is only using 3 parameters. Can this be flagged as an error at compile time? Resolution: To make this work code a prototype copybook. A sample of how to do this is attached. To get the compiler to complain about incorrect parameters in a CALL statement, the compiler must first know what a correct CALL looks like. Supplying a CALL prototype does this. CALL prototypes are supplied in a special format (usually implemented in a COPY file for the sake of reuse) I have attached a demo to this note, the demo shows how to define CALL prototypes for user written programs. When you define a prototype you must define everything about it. The data types being passed, the way the item is passed, even the size and usage clause needs to be defined in the prototype. Once the prototype definitions are in the
Problem: Sort causes a runtime system failure, error message is rts 173 load error on file EXTSM The failure occurs when SORT is the first file io operation attempted in the application. Resolution: The error ocurrs because the run time system dynamic loader can not find the Net Express sort module (EXTSM) EXTSM is linked with a part of the Micro Focus filehandler (MFFH.DLL) - The EXTSM module will be loaded along with MFFH.DLL if any other file io operation is executed prior to the SORT statement To Resolve: Create EXTSM.DLL file and place in the Net Express runtime directory Use the following command to create a Extsm.dll. cbllink -d -RS -k -v extsm.obj>cbllink.txt<Enter> or Place the extsm.dll in the folder where the application is executing. This will make the sort available to all .EXE and .DLL programs. Cbllink.txt will capture all the details published by the "verbose" switch (-v) and the "keep" switch (-k) will retain the modul
Problem: We are compiling under Server Express, using cob -iv, and idy files are being created. These are filling up our temp directory, and we do not use them. How can we without creating the .idy files? Resolution: These files are created at compile time. To stop these from being created, you can set the NOCSI directive. N.B - this directive is only included in Server Express products from 4.0 onwards, for backwards compatibility, as described in the documentation: CSI This directive is reserved for internal use by this COBOL system. Because it might appear in the list of settings, it is included for completeness. It is not intended for your use, and its setting should not be changed. Syntax: >>-.---.-.----.--CSI----------------------->< -/- -NO- Parameters: None Properties: Default: CSI Phase: Syntax check $SET: Initial Dependencies: CSI sets ANIM at
Problem: When using the Animator to step through code a "File below not found" error can sometimes occur when a copybook is encountered, even though the copybook exists and is correctly named. This is especially prevelent when using the CP preprocessor to expand copybooks. Example: COPY MYFILE REPLACING ==:OLD:== ==NEW==. Resolution: There are potentially two problems here. Firstly there is a bug in Server Express which will be fixed in Server Express 4.0 SP4 and Server Express 5.0 WS3. Applying this fix should resolve most issues. The second potential problem is related to Unix's case sensitivity. You must ensure that the case of the copybook is consistent, i.e the whole name plus extension is either uppercase or lowercase, not a mixture. Using the compiler directives FOLDCOPYNAME and COPEXT can also help: E.G. COPYEXT(CPY,cpy), FOLDCOPYNAME(LOWER) Using the above directives wit
Problem: How to convert a given UTC time into a local time using Net Express functions ? Resolution: This intrinsic function CURRENT-DATE delivers the difference back inbetween GMT (Greenwich Mean Time => UTC => Universal Time, coordinated) and the time running onto a local machine. For example: 01 myDateTime pic x(21). . move function CURRENT-DATE to myDateTime . Positions 17 up to 21 from myDateTime having included a content of: 0100 onto a local machine running under Central European Time (CET), means UTC 1 hour. Net Express documentation files: All details can be found here: Help -> Index -> CURRENT-DATE function -> COBOL Language Old KB# 1588
Problem: When deploying a service to the local host using cobimtk the following error appears "Fatal Error: MccListServiceProviders returned 12 (an external component failed)" And mccerror.txt contains the following: Sun 19 Nov 2006 12:29:50 PM PKT BindToDS: MLDAP error binding to provider: 0x51 SERVER_DOWN Sun 19 Nov 2006 12:29:50 PM PKT MccDoListServiceProviders: no configured directories are available Sun 19 Nov 2006 12:29:50 PM PKT MccListServiceProviders: DoListServiceProviders failed: (12) an external component failed Resolution: The errors in mccerror.txt mean that MLDAP couldn't connect to Micro Focus Directory Services (MFDS, running as mfds) and none of the configured directories are available. (By default, the only directory is MFDS at localhost:86.). So the first thing to check is that mfds is running ok on the machine ps -ef | grep mfds and that the Micro Focus Enterprise Server Administration pages can b
Problem: When migrating from Micro Focus Workbench COBOL to Server Express you can experience different results as Workbench COBOL. How can I get the same results. Resolution: The ARITHMETIC compiler directive specifies how arithmetic expressions are to be evaluated. Setting the ARITHMETIC compiler directive to TRUNC20 - Will truncate the number of digits to the right of the decimal point to 20 at each step of the evaluation of the expression. This provides similar results to the truncation provided in COBOL Workbench. You should only use this directive if you need to obtain evaluation results similar to those provided in COBOL Workbench. If you specify TRUNC20, you must not change the setting of the INTLEVEL Compiler directive from its default value of 2. This means that you cannot use some of the newer features, such as numeric pictures with more than 18 total digits, with the TRUNC20 parameter. The default value for ARITHMETIC is &q
Problem: A customer used the "rebuild" command with its conversion options, to convert an IDX3 file into an IDX8 file. [Strictly speaking the original file wasn't converted "in place", instead the rebuild command creates a new IDX8 file and populates it with the data from the original IDX3 file]. A common reason for converting an IDX3 to an IDX8 is so the file can safely grow to very large sizes (when used in conjunction with the FILEMAXSIZE file handler configuration option). But the customer noticed that the new IDX8 file consisted of only one disk file instead of two. IDX3 files have a data portion with a basename, and an indexed portion with an ".idx" extension, for example "CUSTDATA" and "CUSTDATA.idx". But the new IDX8 file did not have an accompanying ".idx" portion. Is this the intended behavior? Resolution: The answer is yes, IDX8 files are "monolithic", that is, they occupy just one inode (one disk file).&
Problem: Why do I occasionally receive a 9/037 (access denied) file status when opening a file using LOCKTYPE(2)? Resolution: When using LOCKTYPE(2) the File Handler creates a separate data file with the extension .LCK, against which record locks will be held. When a COBOL program closes a file, the File Handler attempts to delete the lock file as it is no longer required. The problem arises when this delete operation coincides with another process that is attempting to open the same data file. If this process attempts to create a lock file currently being deleted by the first process a 9/037 can be returned by the operating system. This issue is typically only likely to occur if multiple processes open and close the same files repeatedly. Possible workarounds: Check the file status following an OPEN operation and reattempt an open if you receive a 9/037 error. Do not use LOCKTYPE(2) for fil
Problem: Can an empty idx file be used for rebuilding a C-ISAM file with a new key structure instead of specifying every key on the rebuild command line with the -k option? Creating a new idx file, copying it to the data file, and rebuilding the C-ISAM data file by one of the following commands o rebuild infile o rebuild infile, outfile result in a message like "records read = 0" Resolution: The Micro Focus C-ISAM file handler will by default use the logical end of file marker obtained from the index file header to determine the maximum number of records to process in the data file. If the index file is corrupted or a mismatching index file is overlaid for a given data file, using Rebuild with default behaviour will not recover all the records in the data file but only those specified by the logical end of file marker. Rebuild now contains functio
Problem: The application is using OpenESQL to retrieve data from an Oracle table. One of the columns is defined as a VARCHAR(5) and contains the value "AN " with trailing spaces left intact. If the WHERE clause of the SELECT statement is compaing the colun to a literal value of "AN " it will retrieve the the rows containg this value. But if the WHERE clause is changed to compare against a host variable of PIC X(5) which contains the value "AN " then no rows will be returned. The user would like to know why. Resolution: Here is the explanation: OpenESQL is working as expected --- the problem here is space padding on varchar fields. For a standard character data type in a database that has a length of 5, "AN" and "AN " are identical; however, this is not the case when it comes to the variable character data type --- indeed "AN&quo
Problem: How to accept and convert characters to uppercase from an ADIS screen? Resolution: To convert characters accepted to uppercase Use the following call: call x"af" using adis-function adis-parameter where: 01 adis-function pic x comp-x value 1. 01 adis-parameter 03 bitpair-setting pic x comp-x value 1. 03 bitpair-section pic x value "2". 03 bitpair-index pic x comp-x value 85. 03 bitpair-count pic x comp-x value 1. Note: The above is documented in "Chapter 2: Enhanced ACCEPT/DISPLAY Syntax". Old KB
Problem: RTS166 Erorr when using an Iterator on a Dictionary Object When using the DO method on a Dictionary collection it results in a RTS 166 Recursive Call Error. Resolution: This is due to the callback method being used with an alternate ENTRY point in the program. When the iterator calls the entry point it detects a recursive call and terminates with an RTS 166 error. To use Iterators with an entry point you must have a "local-storage section" in the program. It does not need any data. It just enables the program to be called recursively. Old KB# 1434
Problem: The following code causes the second print line to overlay the first: select pfile assign printer organization line sequential. fd pfile. 01 pf-record pic x(60). working-storage section. 01 report-line1 pic x(60) value "Report Line 1". 01 report-line2 &nb
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.