Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
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: 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: My program is : 77 A PIC 9 VALUE 5. IF A > 0 IF A = 5 NEXT SENTENCE ELSE DISPLAY "1" END-IF DISPLAY "2" ELSE DISPLAY "3" END-IF
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: The file data was translated from EBCDIC to ASCII. From the application it is necessary that this file is sorted in EBCDIC order. Resolution: To sort in EBCDIC order , it is necessary to use the SORT-EBCDIC instruction. This instruction must be before all use and give instructions. The example is : sort fields ( 1, 4 , ch , a ) SORT-EBCDIC give FICHIER2 record(f:40) org ls use F1 record(f:40) Old KB# 2249#netexpress#COBOL#ServerExpress#RMCOBOL
Problem: If there is a need to run Server Express and Java with multiple versions of Oracle on the same machine, how can it run with one installation of Server Express? There would have to be an rtsora runtime executable created for each release. How can cobrun or cobjrun access the correct rtsora? Resolution: Use rtsora to execute their applications, rather than cobrun? i.e. # Make no changes to $COBDIR/bin/rts32* or $COBDIR/bin/rts64* # User 1:(i.e. Oracle 9) PATH=oracle[9]home/bin:$PATH LIBPATH=oracle[9]home/lib:$LIBPATH or SHLIB_PATH or LD_LIBRARY_PATH according to platform rtsora myapp.int --> will use the rtsora from $ORACLE_HOME/bin # User 2:(i.e. Oracle 10) PATH=oracle[10]home/bin:$PATH LIBPATH=oracle[10]home/lib:$LIBPATH or SHLIB_PATh or LD_LIBRARY_PATH according to platform rtsora myapp.int --> will use the rtsora from $ORACLE_HOME/bin To debug, set COBSW= A, and execute rtsora. To u
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: Programs are coded for OPEN OUTPUT and OPEN I/O Is there a way to make them READ ONLY without changing the programs? Resolution: To convert all OPEN I-O statements in a given set of programs to OPEN INPUT statements can be accomplished with a user written file-handler. The file-handler OP-CODE for OPEN I-O is x"FA02" . The user written file-handler would have to convert this to the OP-CODE for OPEN INPUT which is x"FA00". The file handler would contain the following: working-storage section. 01 open-input pic xx value x"FA00". linkage section. 01 opcode pic xx. 01 fcd. copy "XFHFCD.CPY". procedure division using opcode fcd. if opcode = x"FA02" call "EXTFH" using open-input fcd else call "EXTFH" using opcode fcd end-if exit program . Compile the programs using the CALLFH directive naming the user written file-handler and then any attempts to write or update the file should fail with an appropriate file-status code (wr
Problem: I would like to split my file into files . The split is defined by the value of one field Resolution: This is an example : The key of the split is the fifth character. The ouput files are sorted with the key that is defined as the first character SORT FIELDS(1,1,CH,A) RECORD (F 20) USE fileabc.dat OUTFIL INCLUDE=(5,1,CH,EQ,C'A') GIVE filea.dat RECORD (F 20) OUTFIL INCLUDE=(5,1,CH,EQ,C'B') GIVE fileb.dat RECORD (F 20) OUTFIL INCLUDE=(5,1,CH,EQ,C'W') GIVE filew.dat RECORD (F 20) Old KB# 2258#netexpress#COBOL#RMCOBOL#ServerExpress#AcuCobol
Problem: What is the RPM Package Manager (RPM) and what is it used for? Resolution: The RPM Package Manager is a core component for many LINUX systems, such as Red Hate and SUSE. The RPM is command line driven. It's capable of installing, uninstalling, verifying, querying and updating software package, that was installed using RPM, for the LINUX environment. That is, RPM is not valid for the Micro Focus Server Express product. Please refer to the manpage on LINUX - man rpm RPM is free software, released under the GNU GPL. Old KB# 2374
Problem: I would like to use the CICS transaction CNCL . At the moment I must use a 3270 emulator . Is it possible to run this transaction from Unix command line Resolution: This is a Cobol example that runs the cas3270 command to run CICS transaction : 01 Z1 PIC X(80). 01 Z2 PIC X(20). ACCEPT Z2 FROM COMMAND-LINE. STRING 123456 "cas3270 -rESDEMO <<!" delimited by size X"0A1B" delimited by size "CNCL " delimited by size Z2 delimited by spaces X"0A" delimited by size "EXIT" delimited by size
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: 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
Problem: Operand TIME-OF-DAY is not declared 7075 MOVE TIME-OF-DAY TO LOG-TIME-OF-DAY Is TIME-OF-DAY a microfocus extension...is it only available when the NOANS85 directive is in place? Resolution: TIME-OF-DAY is a special register data item This special register requires the compiler directive OSVS cob -uvC OSVS pgm.cbl Old KB# 2323
Problem: Using the command: p(cobsql) CSQLT=ORACLE8 KEEPCBL P(CP) SY ENDP produces the following errors * Micro Focus COBSQL Integrated Preprocessor with ASCII/EBCDIC Support * Server Express V5.0 Copyright (C)1984-2006 Micro Focus (IP) Limited. * URN AAAPA/ZZ0/00065 * CSQL-I-008: Invoking cp Preprocessor * CSQL-I-017: Creating "COSP318.cs9" * CSQL-I-018: Invoking ORACLE8 Precompiler/Translator * CSQL-I-020: Processing output of ORACLE8 Precompiler 435 IF mfsqlmsg-line(WS-DB2-ERR-LOOP)(2:4) = ' ' * 14-S********************************************* ** ** Invalid operand 438
Problem: Getting permissions errors when untarring the file. Resolution: You now have to be root to untar the update. Login as root user, create the directory where you want to install the WrapPack (this is a complete re-install, not an update or overlay), untar the files into that directory then run the install script. Old KB# 2273
Problem: In some circumstances, such as no connection to a database, the SQLCODE returned from Oracle is zero even though the SQL statement was not successful. Resolution: Using the CP pre-processor with the Pro*COBOL MODE=ANSI option can cause this problem and is caused by the expansion of the INCLUDE SQLCA statement by the CP pre-processor before the expanded code is submitted to the Pro*COBOL pre-processor. Problem can be resolved by using the SY option with the CP pre-processor which prevents the CP pre-processor from expanding the SQLCA. Please refer to the COBSQL section of the Database Access manual for more information on the CP pre-processor and the SY directive. Old KB# 2294
Problem: Error returned by Apache server when attempting to run a COBOL application error while loading shared libraries: libcobrts.so: cannot open shared object file: No such file or directory; Premature end of script headers: myapp Resolution: The error is returned because the path to the Cobol libraries was not set at the time Apache attempted to run the program. If you are not using the cobrun triggers - run the app from a script that sets the environment. #! /bin/sh COBDIR=/MyCobolDirectory PATH=$COBDIR/bin:$PATH LD_LIBRARY_PATH=$COBDIR/lib:$LD_LIBRARY_PATH export COBPATH COBDIR PATH LD_LIBRARY_PATH cobrun mycgiapp $* Then run the script from your input form: <FORM ACTION="/cgi-bin/runapp"> Old KB# 2264
Problem: In the cobol program the GOBACK statement is followed by a number. When the GOBACK statement is executed the value is not returned. How can this value be returned and displayed? Program contains GOBACK 3. Resolution: You must use RETURNING cob -xav goback2.cbl ./goback2 echo $? IDENTIFICATION DIVISION. PROGRAM-ID. GOBACK2. ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. FIRST-PARA. DISPLAY "This program is just to test GOBACK " "RETURNING 3" GOBACK RETURNING 3. Then run unix script or enter command echo $? Old KB# 2336
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: 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: 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: 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
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.