|
EBCDIC Collating Sequence |
|
|
As UNIX works with the ASCII character set, numbers from zero to nine come before letters from A to Z, and that is exactly the contrary of what happens on a mainframe environment, where EBCDIC is used. Therefore some IF or PERFORM UNTIL clauses with break for condition GREATER or LOWER THAN may lead to different results depending on the chosen collating sequence. If you have written your programs taking into consideration that numeric values always follow letters, it may be necessary in some cases to change the logic of comparisons. The same may happen when supplying the lower and upper limit in the parameters cards for the program. It must be necessary in some cases to change these values to produce the same results. COBOL internal SORT too are influenced by the collating sequence and they may be controlled by using the appropriate charset. The standard way of working in UNIX is ASCII, and therefore programs automatically work in ASCII modality, except when a different COLLATING SEQUENCE is given in the SPECIAL NAMES section, or in the charset COBOL compiler directive . This allows to maintain a sequence where letters precede numbers. The following example shows how a COBOL program can be modified : ENVIRONMENT DIVISION. These lines may be automatically inserted by xcob during normalization phase that precedes compilation through MicroFocus. The ordering sequence that better fit to the logic of your programs is always an important decision which is to be taken after having analyzed which effect the changing of collating sequence may have on your programs, In any case, independently on which set of characters - EBCDIC or ASCII - you have decided to use, data are always stored by C-ISAM accordingly to the ASCII sequence, and therefore you should be careful when you want initiate positioning - by means of the START or START BROWSE instructions - on a certain record of a data set. Searching a table for a table element that satisfies a specific condition - SEARCH ALL instruction - may produce invalid results in case the table is not sorted accordingly to the used collating sequence, as in case it has been loaded with a START followed by READ sequential next statements, and you use the EBCDIC collating sequence as the records have been read using the ASCII native sequence. In this case you should change the binary search in a sequential search, done by means of the SEARCH instruction without ALL, or the table should be sorted after loading and before starting a SEARCH ALL. (i.e. using the COBOL table SORT statement) The SORT instruction orders elements in the table accordingly to the ASCENDING or DESCENDING KEY sequence you have specified when defining the occurrences of the table. Under IBM /370 mainframe COBOL, if you perform arithmetic operations on non-numeric data, it causes a program check (data exception or 0C7); if you want to have also in UNIX the same behavior, you must be sure that the F run-time switch is set to the default “+F”. If your source program contains PIC 9(n) DISPLAY usage data items which contain spaces, it may fail at run-time. MicroFocus COBOL is more restrictive than the IBM /370 COBOL compiler you are used with, so that the default actions or assumptions made by the MicroFocus COBOL after it has issued W or E level error messages may differ from those made by the IBM /370 mainframe compiler. It is i.e. the case of 88 levels following the item they refer to. The 88 level must be defined with a numeric PICTURE if the field they refer to is numeric, or alphabetic if the referring field has a PICTURE X definition. Not respecting this rule may cause conditions not to be correctly recognized. Also multiple VALUE in a 88 level should respect the correct syntax - comma followed by blank, as separator among them, otherwise only the first value is considered. Example : X2CA 03 W-HH PIC XX. MicroFocus COBOL expects at least one space after comma to separate file names in OPEN and CLOSE statements, whereas IBM /370 not. Results of a COMPUTE statement after an OVERFLOW condition are incompatible between the mainframe environment and MicroFocus COBOL. The solution consists in using the ON SIZE clause if there is the possibility of numeric OVERFLOW; you should never depend on the result if this condition occurs. MicroFocus COBOL system uses the concept of two numeric registers designed for worst-case calculation. This means you need 18 decimal digits plus one for overflow) before the decimal point for rounding capability during MULTIPLY and DIVIDE operations. You also need 18 decimal digits ( plus one for overflow) for temporary overflow during ADD and SUBTRACT operations. For this reason, intermediate result calculations by MicroFocus COBOL are more accurate than in OS/VS COBOL and VS COBOL II. An IBM /370 mainframe COBOL ACCEPT statement from SYSIN is not supported by MicroFocus COBOL; for larger amounts of data (that is, a set of parameter cards) a new sequential file is automatically created by the procedural language converter and the program is modified in order to accept them from the COMMAND-LINE. The IBM /370 COBOL DISPLAY statement to SYSOUT (or any other DDNAME) is not supported by the MicroFocus COBOL; All DISPLAYs are directed to the terminal; if a station acting as central console is provided, the DISPLAY instruction may be modified in CALL ‘CBLDISP’ which will send the message to the appropriate console (i.e. CA-UNICENTER) Under MicroFocus COBOL, when you redefine a VS COBOL II POINTER variable as a COMP field, and make an arithmetical calculation on this field to change the value of the POINTER, its behavior will not be the same as under IBM /370 COBOL. The problem is because, in MicroFocus COBOL, the POINTER has a format defined by the machine architecture, whereas the VS COBOL II POINTER uses a /370 machine architecture. MicroFocus COBOL system provides syntax in the SET statement which enables you to change the value of a POINTER. See your Language Reference for details on how to do this. The mainframe COBOL NOMINAL KEY IS clause for relative and indexed files is not supported by MicroFocus COBOL. For both types of file, it is necessary to replace the NOMINAL KEY IS clause with the ANSI standard RECORD KEY IS clause. Also, for indexed files, it will be necessary to change any Procedure Division reference to nominal key in your source program so that they reference records key. xvsamRts and MicroFocus COBOL check both the minimum and maximum record length of a variable length file when it is opened. The file status is automatically set to “39” if the attributes do not match. However the mainframe environment only checks the maximum length value. Calls to subprograms using MicroFocus COBOL system default to dynamic linkage, whereas call to subprograms on an IBM /370 mainframe default to static linkage. It is suggested to specify the NODYNAM system directive when you submit your source program to the COBOL compiler; this will cause any CALL operations to be static . see your System Reference for further details on this directive. The COBOL EXAMINE instruction is to be replaced by INSPECT. |