Date post: | 27-Oct-2014 |
Category: |
Documents |
Upload: | juan-lopez-villegas |
View: | 71 times |
Download: | 0 times |
CGFRNT.C00 03Jul96 10:52:07 58299 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Micro Focus Object COBOL ™
Compatibility Guide
Micro Focus®
Issue 4August 1996
CGFRNT.C00 03Jul96 10:52:07 58299 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Micro Focus has made every effort to ensure that this manual is correctand accurate, but reserves the right to make changes without notice at itssole discretion at any time.
The software described in this document is supplied under a license andmay be used or copied only in accordance with the terms of such license,and in particular any warranty of fitness of Micro Focus softwareproducts for any particular purpose is expressly excluded and in noevent will Micro Focus be liable for any consequential loss.
Micro Focus® and Animator® are registered trademarks, and Object COBOL™, Micro Focus COBOL™, VS COBOL™, LEVEL II COBOL™ and Professional COBOL™ are trademarks, of Micro Focus Limited.
IBM® and OS/2® are registered trademarks, and IBM COBOL/2™ and Systems Application Architecture™ are trademarks, of International Business Machines Corporation
Microsoft® and MS-DOS® are registered trademarks of Microsoft Corporation.Data General® and DG COBOL® are registered trademarks of Data General Corporation.RM/COBOL® is a registered trademark of Ryan-McFarland Corporation.UNIX® is a registered trademark licensed exclusively by X/Open Company Limited.
Copyright© 1987-1996 by Micro Focus LimitedAll Rights ReservedPrinted in U.S.A.
ii Compatibility Guide
CGFRNT.C00 03Jul96 10:52:07 58299 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Preface
This COBOL system supports many dialects of COBOL. This guidedescribes how to migrate applications from other COBOL systems to runwith this COBOL system.
The final part of this guide provides lists for each dialect covering thefeatures supported by this system, historical details of when the supportwas first provided and the system directives required for compatibility.
This COBOL system supports the COBOL language described in yourLanguage Reference and Language Reference - Additional Topics.
Audience The aim of this Guide is to enable you to migrate from any of theseenvironments:
IBM OS/VS COBOL
IBM VS COBOL II
Microsoft COBOL V2.2
RM/COBOL
DG Interactive COBOL
to this COBOL environment. It is intended to be used by users who wantto:
convert applications written in the selected COBOL language to theMicro Focus COBOL language, and to enhance them using theadvanced language and development features offered by thisCOBOL system
retain the use of the selected COBOL on some machineenvironments while moving to this COBOL environment on others.
Compatibility Guide iii
CGFRNT.C00 03Jul96 10:52:07 58299 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
If you fall into this category you will want to maintain a commonset of source programs which are suitable for all environments
convert the selected COBOL formatted files to the file format usedwith this system. It is assumed that you are familiar with theCOBOL language, and have access to the documents listed in thesection Related Publications below.
Any error messages and numbers that may be returned when you submityour program to this COBOL system or when you execute the resultingcode are different in the two environments. This should present noproblems, but is something of which you should be aware.
Related Publications This manual is designed to be used in conjunction with the followingmanuals which are also supplied with your system:
Object COBOL User Guide
Language Reference
Language Reference - Additional Topics
Error Messages
Programmer’s Guide to Creating User Interfaces
Programmer’s Guide to File Handling
Programmer’s Guide to Writing programs
For Conversion Series 5, you must also have access to revision 2 of TheData General Interactive COBOL Programmer’s Reference Manual.
Notation in this Manual When items are enclosed in braces { }, you may choose one and onlyone of the items in the braces.
When items are enclosed in square brackets [ ], you may choose oneof the items in the brackets or none of the items.
Running headers contain the title of the chapter and the runningfooter contains the title of the publication.
Preface
iv Compatibility Guide
CGFRNT.C00 03Jul96 10:52:07 58299 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
The page number is composed of two numbers: the first is thechapter number and the second is the page in the chapter.
Throughout this manual, system directives and their parametersare shown in the following format:
directive"parameter"
UNIX Under the UNIX operating system, you must enclose the entireparameter string in quotation marks, for example:
"NOMF RM"ANSI" REMOVE"COL""
See your Object COBOL User Guide for details of the format ofdirectives applicable to your system.
About this ManualThis manual is split into a number of parts. Each part covers particularareas of compatibility.
Part I - Conversion Series 1 - IBM/370 Mainframe Compatibility
This part describes how you can configure your COBOL system to allowyou to process IBM/370 programs (that is, programs written in IBM VSCOBOL II and OS/VS COBOL) directly. It also lists difficulties that youmay encounter when migrating IBM/370 mainframe programs to thisCOBOL system.
Part II - Conversion Series 2 - Microsoft COBOL V2.2
This part describes how you can configure your COBOL system to allowyou to process Microsoft COBOL Version 2.2 programs directly. It alsolists difficulties that you may encounter when you use your MicrosoftCOBOL Version 2.2 programs on this COBOL system.
Included in this part is a description of the REBUILD utility which,when invoked, will enable you to convert files from the MicrosoftCOBOL Version 2.2 format to this COBOL format.
Part III - Conversion Series 3 - RM/COBOL V2
This part describes how you can use this COBOL system to processVersion 2 RM/COBOL source programs directly. It also lists difficultiesthat you may encounter when you use your RM/COBOL Version 2programs on this COBOL system.
Preface
Compatibility Guide v
CGFRNT.C00 03Jul96 10:52:07 58299 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
This part also describes the Convert3 files conversion utility, whichconverts data files created by RM/COBOL programs into data files thatcan be accessed by the same programs under this COBOL system.
Part IV - Conversion Series 5 - DG Interactive COBOL
This part describes how you can use this COBOL system to process DGInteractive COBOL source programs directly. It also lists difficulties thatyou may encounter when you use your DG Interactive COBOL programson this COBOL system.
This part also describes the use of a pair of utilities:
Reform5, which reformats a DG Interactive COBOL source codeprogram so it can be submitted to this COBOL system.
Convert5, which converts data files created by DG InteractiveCOBOL programs into data files that can be accessed by the sameprograms once they have been reformatted to the datafile formatused with this COBOL system.
Preface
vi Compatibility Guide
CGFRNT.C00 03Jul96 10:52:07 58299 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
CGTOCC.C00 30Sep96 10:56:09 49922 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Table of Contents
Part I - Conversion Series 1
1 IBM/370 Mainframe CompatibilityConfiguring your COBOL System 1-1(17)
Migrating your Applications 1-4(20)
Conversion Issues 1-4(20)
General 1-4(20)
Error Message Differences 1-4(20)
Files not Supported 1-4(20)
The DISK FULL Condition 1-5(21)
Arithmetic Operations 1-5(21)
Intermediate Result Precision 1-5(21)
The COMPUTE Statement 1-6(22)
PIC 9 Items 1-6(22)
ACCEPT Statements 1-6(22)
DISPLAY Statements 1-6(22)
The SIGN SEPARATE Clause 1-7(23)
Comparisons of Alphanumeric Data 1-7(23)
Pointer Variables (VS COBOL II Only) 1-7(23)
File Input and Output 1-8(24)
File Referencing 1-8(24)
The NOMINAL KEY Clause 1-8(24)
The ACTUAL KEY and TRACK-LIMIT Clauses 1-8(24)
The TRACK AREA Clause 1-9(25)
Deleting Records 1-9(25)
Record Lengths 1-9(25)
Inter-program Communication 1-10(26)
Calls to Subprograms 1-10(26)
Compatibility Guide vii
CGTOCC.C00 30Sep96 10:56:09 49922 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Part II - Conversion Series 2
2 Microsoft COBOL V2.2 Source CompatibilityConfiguring your System 2-1(29)
Migrating your Application 2-2(30)
Conversion Issues 2-2(30)
General 2-3(31)
Source Code Beyond Column 72 2-3(31)
COBOL Concepts 2-3(31)
COMP-3 Sign Representation 2-3(31)
Declaratives 2-3(31)
The Nucleus 2-4(32)
Special-Names Paragraphs 2-4(32)
The EJECT Statement 2-4(32)
PICTURE Strings 2-4(32)
The SEGMENT-LIMIT Clause 2-4(32)
The REDEFINES Clause 2-5(33)
The VALUE Clause 2-5(33)
File Input and Output 2-5(33)
File-names 2-5(33)
OPEN ... EXTEND 2-6(34)
Record Locking 2-6(34)
Deleting Relative Records 2-6(34)
Rebuild 2-7(35)
Debug 2-7(35)
TRACE Statements 2-7(35)
Inter-Program Communication 2-7(35)
The ON OVERFLOW Phrase 2-7(35)
Screen Handling 2-8(36)
Accepting into Numeric Fields 2-8(36)
Accepting into Alphabetic Fields 2-8(36)
Numeric edited Items 2-8(36)
Incorrect Spacing 2-9(37)
Clearing the Screen 2-9(37)
Table of Contents
viii Compatibility Guide
CGTOCC.C00 30Sep96 10:56:09 49922 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Screen Scrolling 2-9(37)
Sounding the Bell 2-10(38)
Extension Subroutines 2-10(38)
Add-on Products from Micro Focus 2-12(40)
3 RebuildInvoking Rebuild 3-1(41)
The /s Option 3-2(42)
The /o Option 3-3(43)
The /r Option 3-3(43)
The /k Option 3-4(44)
The /i Option 3-5(45)
The /v Option 3-6(46)
Examples 3-6(46)
Parameter Files 3-7(47)
System Parameters 3-8(48)
Warning Messages 3-8(48)
Error Messages 3-9(49)
Command Line Errors 3-10(50)
Information Messages 3-15(55)
Conversion Errors 3-16(56)
Supplementary Information 3-20(60)
Part III - Conversion Series 3
4 Introduction to Conversion Series 3RM/COBOL Source Programs 4-1(65)
Converting Data Files 4-2(66)
Enhancing your Converted Application 4-2(66)
5 Converting an RM/COBOL ApplicationMigrating from the RM/COBOL Environment 5-1(69)
The Tabx Program 5-3(71)
Table of Contents
Compatibility Guide ix
CGTOCC.C00 30Sep96 10:56:09 49922 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
6 RM/COBOL Source CompatibilityThe RM Directive 6-1(73)
Perform Statements 6-3(75)
Table Bound Checking 6-3(75)
Types of Data 6-3(75)
COMPUTATIONAL (COMP) Data Types 6-4(76)
COMPUTATIONAL-1 (COMP-1) Data Types 6-4(76)
COMPUTATIONAL-6 (COMP-6) Data Types 6-4(76)
7 RM/COBOL Conversion IssuesProducing Executable Code 7-1(79)
Length of Nonnumeric Literals 7-1(79)
Source Code in Columns 73 to 80 7-2(80)
Linkage Section in Main Program 7-3(81)
Extended I-O Status Codes 7-3(81)
Reserved Words 7-4(82)
Numbering of Segments 7-5(83)
Program Identification and Data-names 7-5(83)
Duplicate Paragraph-names 7-6(84)
Running the Code 7-7(85)
Trailing Blanks in Line Sequential Files 7-7(85)
Undefined Results of MOVE and Arithmetic Operations 7-7(85)
Embedded Control Sequences in DISPLAY Statements 7-8(86)
Printer Output is Written to Disk 7-9(87)
Redefinition of COMPUTATIONAL or COMPUTATIONAL-6
Data Items 7-9(87)
ON SIZE ERROR Clause 7-11(89)
Field Wrap-Around 7-11(89)
COMPUTATIONAL-1 Data Items with a PICTURE other
than S9(4) 7-12(90)
File and Record Locking 7-13(91)
Initialization of Working-Storage 7-13(91)
Screen Column Number Specification 7-14(92)
Table of Contents
x Compatibility Guide
CGTOCC.C00 30Sep96 10:56:09 49922 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
End of File Notification 7-14(92)
ACCEPT Fields at the Edge of the Screen 7-15(93)
Display of Input Data in Concealed ACCEPT Fields 7-15(93)
Open EXTEND of Nonexistent File 7-16(94)
8 Converting RM/COBOL Data FilesConversion of Data Types 8-1(95)
COMP/COMPUTATIONAL Data 8-1(95)
COMP-3/COMPUTATIONAL-3 Data 8-2(96)
COMP-6/COMPUTATIONAL-6 Data 8-3(97)
DISPLAY Data 8-4(98)
Differences following Conversion 8-5(99)
Indexed Sequential Files with Duplicate Alternate Keys 8-5(99)
Program Modifications Required by Convert3 8-6(100)
The REDEFINES Clause 8-6(100)
The USAGE IS INDEX Clause 8-6(100)
The USAGE Clause with Group Items 8-6(100)
Continuation Columns 8-6(100)
The DECIMAL POINT IS COMMA Clause 8-7(101)
Uniqueness of Names in Record Descriptions 8-7(101)
DEPENDING Names 8-7(101)
Picture-strings 8-7(101)
9 Running Convert3Running Convert3 in Interactive Mode 9-1(103)
Help 9-2(104)
File Details 9-2(104)
Printfile Name 9-3(105)
Record Type Specification 9-3(105)
Identifying Record Types by Subroutine 9-4(106)
Identifying Record Types by Unique Record Item 9-5(107)
Binary Sequential Files 9-6(108)
Generate Program 9-6(108)
Escape 9-7(109)
Table of Contents
Compatibility Guide xi
CGTOCC.C00 30Sep96 10:56:09 49922 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Running Convert3 in Batch Mode 9-7(109)
The Parameter File 9-7(109)
The Listfile Parameter 9-8(110)
The Sourcefile Parameter 9-8(110)
The FD Parameter 9-8(110)
The Program Parameter 9-8(110)
The Subroutine Parameter 9-8(110)
The Sign Parameter 9-9(111)
The Identifier Parameter 9-9(111)
Record Number Parameters 9-9(111)
The Run Parameter 9-10(112)
The COMP6-COMP Parameter 9-10(112)
Example Parameter File 9-10(112)
Running Convert3 with a Parameter File 9-12(114)
10 Using the File Conversion ProgramCreating an Executable File Conversion Program 10-1(115)
Running the File Conversion Program 10-1(115)
11 Convert3 and File Conversion ProgramError Messages
Convert3 Error Messages 11-1(117)
File Conversion Program Error Messages 11-3(119)
Part IV - Conversion Series 5
12 Introduction to Conversion Series 5DG Interactive COBOL Source Programs 12-1(123)
Converting Data Files 12-2(124)
Enhancing your Converted Application 12-2(124)
Table of Contents
xii Compatibility Guide
CGTOCC.C00 30Sep96 10:56:09 49922 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
13 DG Interactive COBOL Source CompatibilityThe DG Directive 13-1(127)
Reserved Words 13-2(128)
DG International Character Set 13-2(128)
DG File Status and other Exception Values 13-2(128)
Calls 13-3(129)
Linkage Section Access 13-3(129)
Arithmetic of Group Level Items 13-3(129)
Run-time Switches 13-3(129)
Program Identification and Data-names 13-3(129)
14 Reformatting a DG COBOL Source FileUsing reform5 14-1(131)
Reformatting Rules 14-2(132)
15 Converting DG COBOL Data FilesSupported Data File Types 15-1(133)
Sequential Files 15-1(133)
Relative Files 15-2(134)
Indexed Files 15-3(135)
DG Data Types 15-4(136)
Source File Restrictions 15-4(136)
The File Conversion Process 15-6(138)
16 Running Convert5Running Convert5 in Interactive Mode 16-1(139)
Help 16-2(140)
File Details 16-2(140)
Printfile-name 16-3(141)
Record Type Specification 16-3(141)
Identifying Record Types by Subroutine 16-4(142)
Identifying Record Types by Unique Record Item 16-5(143)
Table of Contents
Compatibility Guide xiii
CGTOCC.C00 30Sep96 10:56:09 49922 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Binary Sequential Files 16-6(144)
Generate Program 16-6(144)
Escape 16-6(144)
Running Convert5 in Batch Mode 16-6(144)
The Parameter File 16-7(145)
The Listfile Parameter 16-7(145)
The Sourcefile Parameter 16-8(146)
The FD Parameter 16-8(146)
The Program Parameter 16-8(146)
The Subroutine Parameter 16-8(146)
The Identifier Parameter 16-8(146)
Record Number Parameters 16-9(147)
The Run Parameter 16-9(147)
Example Parameter List 16-9(147)
Running Convert5 with a Parameter File 16-11(149)
17 Using the File Conversion ProgramCreating an Executable File Conversion Program 17-1(151)
Running the File Conversion Program 17-2(152)
18 Error MessagesErrors Reported by Convert5 18-1(153)
Errors Reported by the Conversion Program 18-3(155)
Part V - Index
Table of Contents
xiv Compatibility Guide
CGTOCC.C00 30Sep96 10:56:09 49922 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
CGP001.C00 25Jun96 13:36:06 18031 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Part I
Conversion Series 1
CGP001.C00 25Jun96 13:36:06 18031 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Contents of Part I
Chapter 1 IBM/370 Mainframe Compatibility
CGP001.C00 25Jun96 13:36:06 18031 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
CG1SOU.C00 25Jun96 13:36:06 104893 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Chapter 1
IBM/370 MainframeCompatibility
Conversion Series 1 supports certain extensions which allow you tosubmit source programs written in IBM SAA AD/Cycle COBOL/370directly to this COBOL system. This chapter describes how you firstconfigure your system so that it emulates the behavior of IBM/370COBOL, and also gives hints on how to avoid possible areas of difficultywhen you submit your programs.
Configuring your COBOL System Before submitting your IBM/370 COBOL programs to this COBOLsystem, you must configure this system so that it emulates the behaviorof IBM/370 COBOL. You can do this in one of two ways:
Select the OS/VS COBOL or the appropriate VS COBOL II optionfrom within the Setup utility when you install this COBOL system.When you do this, a COBOL.DIR file is automatically created andcontains the system directives for the dialect you specified inSETUP.
Create a COBOL.DIR file and set certain system directivesaccording to which dialect you wish to use; that is, for OS/VSCOBOL, you set:
NOANS85NOCOBOL370 NODG NODOSVS NOIBM-MS NOMF
Conversion S
eries 1
Compatibility Guide 1-1[17]
CG1SOU.C00 25Jun96 13:36:06 104893 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
NOMS NOPC1 NORM NOSAA NOVSC2 NOXOPEN NO01SHUFFLE NOFLAGSTD OSVS FLAG FLAGAS FLAGCD
for VS COBOL II Release 3, you set:
NOANS85 NOCOBOL370 NODG NODOSVS NOIBM-MS NOMF NOMS NOOSVS NOPC1 NORM NOSAA NOXOPEN NO01SHUFFLE VSC2 FLAG FLAGAS FLAGCD
for VS COBOL II Release 1.1 or Release 2, you set:
NOANS85 NOCOBOL370 NODG NODOSVS NOIBM-MS NOMF NOMS NOOSVS NOPC1 NORM NOSAA
IBM/370 Mainframe Compatibility
1-2[18] Compatibility Guide
CG1SOU.C00 25Jun96 13:36:06 104893 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
NOXOPEN NO01SHUFFLE NOFLAGSTD VSC2 FLAG FLAGAS FLAGCD
and for VS COBOL II Release 1, you set:
NOANS85 NOCOBOL370 NODG NODOSVS NOIBM-MS NOMF NOMS NOOSVS NOPC1 NORM NOSAA NOXOPEN NO01SHUFFLE VSC2 FLAG FLAGAS FLAGCD.
See your Object COBOL User Guide for further details of theCOBOL.DIR file.
You may need to set several other directives to enable this COBOLsystem to more closely imitate the behavior of mainframe programs. Youcan select these from the Setup program. They are:
PERFORM-TYPE(OSVS) IBMCOMP NOTRUNC
All of the above directives are described in your Object COBOL UserGuide.
Conversion S
eries 1IBM/370 Mainframe Compatibility
Compatibility Guide 1-3[19]
CG1SOU.C00 25Jun96 13:36:06 104893 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Migrating your ApplicationsWhen you have configured this COBOL system as described in thesection above, you can submit your IBM/370 COBOL programs to it. Forthe command to do this, see your Release Notes.
Conversion IssuesMost of the IBM/370 mainframe programs which you submit to thisCOBOL system will be accepted syntactically and will run successfully.However, errors may occur in a number of areas.
It is probable that you will encounter few or none of these errors, but ifyou do, following the suggested solutions will greatly reduce any workinvolved in migrating your application. The known errors are detailed inthe following sections together with hints on how to overcome them.
General
Error Message DifferencesThe default actions or assumptions made by this COBOL system after ithas issued W or E level error messages may differ from those made bythe IBM/370 mainframe Compiler.
Solution
You should either review all E and W level messages carefully, or modifyyour source to remove the error(s).
Files not Supported IBM/370 BDAM and ISAM files and their corresponding languageextensions are not supported under this COBOL system.
Solution
Replace any BDAM files with ANSI relative files, and any ISAM fileswith ANSI indexed files.
IBM/370 Mainframe Compatibility
1-4[20] Compatibility Guide
CG1SOU.C00 25Jun96 13:36:06 104893 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
The DISK FULL ConditionThe file status value for the DISK FULL condition under this COBOLsystem is not the same as that under IBM/370 mainframe COBOL. ThisCOBOL system returns a hexadecimal value of X3907. An IBM/370mainframe program returns a character value of 30.
Solution
Change your source program to reflect the changed value.
Arithmetic OperationsUnder IBM/370 mainframe COBOL, if you perform arithmeticoperations on nonnumeric data, it causes a program check (dataexception or 0C7).
Solution
Under this COBOL system, you must be sure the F run-time switch is setto the default "+F".
Intermediate Result PrecisionThis COBOL system uses the concept of two numeric registers designedfor worst-case calculation. This means you need 18 decimal digits (plusone for overflow) before the decimal point for rounding capabilityduring MULTIPLY and DIVIDE operations. You also need 18 decimaldigits (plus one for overflow) for temporary overflow during ADD andSUBTRACT operations. For this reason, intermediate result calculationsby this COBOL system are more accurate than in OS/VS COBOL and VSCOBOL II.
Solution
To ensure the same accuracy between these two dialects and this COBOLsystem, replace any COMPUTE statements with a series of operationsusing user defined intermediate result fields. The size of each result fieldwill vary according to the rules documented in the OS/VS COBOL andVS COBOL II manuals.
Conversion S
eries 1IBM/370 Mainframe Compatibility
Compatibility Guide 1-5[21]
CG1SOU.C00 25Jun96 13:36:06 104893 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
The COMPUTE StatementResults of a COMPUTE statement after an OVERFLOW condition areincompatible between the mainframe environment and this COBOLsystem.
Solution
Use the ON SIZE ... clause if there is a possibility of numericOVERFLOW. You should never depend on the result if this conditionoccurs.
PIC 9 Items If your source program contains PIC 9(n) DISPLAY usage data itemswhich contain spaces, it may fail at run time.
ACCEPT StatementsAn IBM/370 mainframe COBOL ACCEPT statement from SYSIN is notsupported by this COBOL system.
Solution
For larger amounts of data (that is, a set of parameter cards) you shoulddefine a new sequential file. For a single ACCEPT of a small amount ofdata, enter the input data on the operating system command line whenyou invoke the application, in the program use the syntax:
ACCEPT data-name FROM COMMAND-LINE
DISPLAY StatementsAn IBM/370 mainframe COBOL DISPLAY statement to SYSOUT (or anyother DDNAME) is not supported by this COBOL system.
Solution
All DISPLAYs are directed to the terminal (console). If you are using thePC-DOS system, this allows you to redirect this output to a file if yourequest it at the time the application is invoked. See your PC-DOSReference Manual for further details of redirection.
IBM/370 Mainframe Compatibility
1-6[22] Compatibility Guide
CG1SOU.C00 25Jun96 13:36:06 104893 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
The SIGN SEPARATE ClauseWhen you download input data from an IBM/370 mainframe whichcontains signed numeric USAGE DISPLAY data items without the SIGNSEPARATE clause, embedded signs are not interpreted correctly.
Solution
Set the SIGN"EBCDIC" system directive when you submit yourprograms to this COBOL system. This causes this COBOL system tooutput code which interprets signed data by using the EBCDIC ratherthan the ASCII convention. See your Object COBOL User Guide fordetails of this directive.
Comparisons of Alphanumeric DataComparisons of alphanumeric data under this COBOL system are not thesame as those under IBM/370 mainframe COBOL.
Solution
Set the NATIVE"EBCDIC" system directive when you submit yourprograms to this COBOL system. This causes this COBOL system tooutput code which interprets signed data by using the EBCDIC ratherthan the ASCII convention. See your Object COBOL User Guide fordetails of this directive.
Pointer Variables (VS COBOL II Only)Under this COBOL system, when you redefine a VS COBOL II POINTERvariable as a COMP field, and make an arithmetical calculation on thisfield to change the value of the POINTER, its behavior will not be thesame as under IBM/370 COBOL.
Solution
The problem is because, in this COBOL system, the POINTER has aformat defined by the 8086 machine architecture, whereas the VS COBOLII POINTER uses the 370 machine architecture.
This COBOL system provides syntax in the SET statement which enablesyou to change the value of a POINTER. See your Language Reference fordetails on how to do this.
Conversion S
eries 1IBM/370 Mainframe Compatibility
Compatibility Guide 1-7[23]
CG1SOU.C00 25Jun96 13:36:06 104893 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
File Input and Output
File ReferencingIBM/370 mainframe COBOL programs reference data files indirectly viaDDNAMEs. This function is not implemented in this COBOL system.
Solution
To emulate this function, use the ASSIGN"EXTERNAL" directive whenyou submit your program to this COBOL system. Before execution, youcan associate the data file-names used in your program with physicalfiles via the operating system SET command.
For example, if your program contains the line:
select in-file assign to ut-s-infile.
and your data file is called C:\INFILE.DAT, you enter the command:
set infile=c:\infile.dat
which will establish the appropriate connection between the datafile-name and your application program.
The NOMINAL KEY ClauseThe mainframe COBOL NOMINAL KEY IS ... clause for relative andindexed files is not supported by this COBOL system.
Solution
For both types of file, replace the NOMINAL KEY IS ... clause with theANSI standard RECORD KEY IS ... clause. Also, for indexed files, youshould change any Procedure Division references to nominal key in yoursource programs so that they reference record key.
The ACTUAL KEY and TRACK-LIMIT ClausesThe mainframe COBOL ACTUAL KEY IS ... and TRACK-LIMIT IS ...clauses in direct files are not supported by this COBOL system.
IBM/370 Mainframe Compatibility
1-8[24] Compatibility Guide
CG1SOU.C00 25Jun96 13:36:06 104893 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Solution
Convert any direct files to relative files as the ACTUAL KEY IS ... clauseclosely resembles the RECORD KEY clause of relative files. You can then,in most cases, delete the TRACK-LIMIT clause.
The TRACK AREA ClauseThe TRACK AREA IS ... clause for indexed files is not supported by thisCOBOL system.
Solution
You should delete this clause from your source program. TRACK AREAwas an IBM extension used to improve performance of ISAM duringrandom updates. Indexed files in this COBOL system, like mainframeVSAM files, are reorganized as they are updated.
Deleting RecordsWhen you have successfully submitted your programs to this COBOLsystem, you may find that on execution you cannot delete records inrelative files.
Solution
In IBM/370 systems, you can usually delete records in relative files bymoving HIGH-VALUES to a delete byte and rewriting the record. TheANSI standard does not require (or use) an explicit delete byte.Therefore, you must change the syntax in your source program so that aDELETE operation is performed on the record.
Record LengthsThis COBOL system checks both the minimum and maximum recordlengths of a variable length file when it is opened. The file status isautomatically set to "39" if the attributes do not match. However, themainframe environment only checks the maximum length value.
Solution
Review the File Description (FD) record descriptions to ensure that allprograms referencing a variable length file use the same minimum andmaximum values.
Conversion S
eries 1IBM/370 Mainframe Compatibility
Compatibility Guide 1-9[25]
CG1SOU.C00 25Jun96 13:36:06 104893 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Inter-program Communication
Calls to SubprogramsCalls to subprograms using this COBOL system default to dynamiclinkage, whereas calls to subprograms on an IBM/370 mainframe defaultto static linkage.
Solution
Specify the NODYNAM system directive when you submit your sourceprogram to this COBOL system; this will cause any CALL operations tobe static. See your Object COBOL User Guide for further details of thisdirective.
IBM/370 Mainframe Compatibility
1-10[26] Compatibility Guide
CG1SOU.C00 25Jun96 13:36:06 104893 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
CGP002.C00 25Jun96 13:36:07 18230 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Part II
Conversion Series 2
CGP002.C00 25Jun96 13:36:07 18230 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Contents of Part II
Chapter 2 Microsoft COBOL V2.2Source Compatibility
Chapter 3 Rebuild
CGP002.C00 25Jun96 13:36:07 18230 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
CG2SOU.C00 25Jun96 13:36:07 127024 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Chapter 2
Microsoft COBOL V2.2Source Compatibility
Conversion Series 2 supports certain extensions which allow you tosubmit source programs written in Microsoft COBOL Version 2.2 directlyto this COBOL system. This chapter describes the directives you mayneed to set to submit your Microsoft V2.2 programs to this COBOLsystem, and also gives hints on how to avoid possible areas of difficultywhen you submit your programs.
Microsoft COBOL V2.2 is a DOS system. The compatibility issuesdescribed in this Part, however, apply to all versions of this COBOLsystem, with the following restriction:
Restriction: Data file conversion using Rebuild, and the MicrosoftCOBOL V2.2 extension routines, are not supported in UNIX versions ofthis COBOL system.
Configuring your System Before submitting your Microsoft COBOL V2.2 programs to this COBOLsystem, you must:
set the following system directives:
MS"2" OSEXT"COB" NOOSVS NOMF NORW NOANS85
Conversion S
eries 2
Compatibility Guide 2-1[29]
CG2SOU.C00 25Jun96 13:36:07 127024 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
NOBOUND OLDINDEX NOTRUNC AUTOLOCK NOOPTIONAL-FILE PERFORM-TYPE"RM" SIGN"EBCDIC" RESTRICT"LINE-SEQUENTIAL" RESTRICT"SEQUENTIAL"
For further details of these directives, see your Object COBOL UserGuide.
select the Microsoft COBOL Version 2.2 screen handlingconfiguration. (For details of this, see the section on configuringADIS in your Programmer’s Guide to Creating User Interfaces.)
Under DOS and OS/2, this can be done by selecting the MicrosoftCOBOL V2.2 option from within the Setup Utility. Under UNIX itmust be done manually.
Migrating your ApplicationWhen you have configured this COBOL system, you can then submityour Microsoft COBOL Version 2.2 programs to it. For the command todo this, see your Release Notes.
Conversion Issues Most of the Microsoft COBOL Version 2.2 programs which you submit tothis COBOL system will be accepted syntactically and will runsuccessfully. However, incompatibilities may occur in a number of areas.
In some minor cases, this COBOL system will produce errors whenencountering missing periods or spelling errors (for example, SOURCECOMPUTER in place of SOURCE-COMPUTER is not acceptable).
The sections below detail the known features which could produceerrors, or which may not behave in the way you expect, along with hintson how to rectify the cause of such errors, or emulate the behavior ofMicrosoft COBOL Version 2.2 programs.
Microsoft COBOL V2.2 Source Compatibility
2-2[30] Compatibility Guide
CG2SOU.C00 25Jun96 13:36:07 127024 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
General
Source Code Beyond Column 72This condition occurs if the standard TAB settings on the MicrosoftCOBOL Version 2.2 Compiler have been changed either by patching therun-time system, or by using the /O directive.
Solution
Before submitting your Microsoft COBOL Version 2.2 program to thisCOBOL system, process the program with the tabx utility (see thechapter Converting an RM/COBOL Application in the Conversion Series 3Part for details of how to do this). This expands any tab characters intospaces. You can then successfully submit your source programs to thisCOBOL system.
COBOL Concepts
COMP-3 Sign RepresentationUnder this COBOL system, unsigned COMP-3 fields produce differentsign representation from that of Microsoft COBOL Version 2.2.
Solution
You must ensure that you specify the MS"2" system directive which willcause unsigned COMP-3 fields to be treated in the same way as theywere under Microsoft COBOL Version 2.2; that is, as signed positive. Thisdirective is automatically set by the Setup utility if you select theMicrosoft Version 2.2 option.
DeclarativesAny declaratives statement which appears after a paragraph header isrejected when you submit your program to this COBOL system.
Solution
This COBOL system insists that the declaratives statement immediatelyfollows the section header, rather than the paragraph header. Amendyour source program and resubmit it to this COBOL system.
Conversion S
eries 2Microsoft COBOL V2.2 Source Compatibility
Compatibility Guide 2-3[31]
CG2SOU.C00 25Jun96 13:36:07 127024 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
The Nucleus
Special-Names ParagraphsYou may receive an error on the SPECIAL-NAMES paragraph headerwhen you submit your program to this COBOL system.
Solution
When you submit your program to this COBOL system, ensure that theSPECIAL-NAMES paragraph is inside the Environment Division.
The EJECT StatementThe EJECT IS ... statement in the SPECIAL-NAMES paragraph is rejectedwhen you submit your program to this COBOL system.
Solution
Replace the word EJECT with the word FORMFEED.
PICTURE StringsItems with PICTURE clauses such as "-.ZZ" may produce errors whenyou submit your program to this COBOL system.
Solution
If you receive errors for picture-strings which contain a "-" (minus)followed by a " . " (period), or a " . " followed by a "Z", either alter the "Z"characters to "?" characters, or add a BLANK WHEN ZERO clause.
The SEGMENT-LIMIT ClauseThe SEGMENT-LIMIT IS ... clause is treated as documentary by thisCOBOL system, although this should not produce any problems.However, segmentation is an out-dated feature of COBOL and is treatedby the ANSI standard as an obsolete feature.
Microsoft COBOL V2.2 Source Compatibility
2-4[32] Compatibility Guide
CG2SOU.C00 25Jun96 13:36:07 127024 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
The REDEFINES ClauseCertain usage of the REDEFINES clause in a Microsoft COBOL Version2.2 program will produce errors when you submit your program to thisCOBOL system. For example:
03 A. ... 03 B. ... 03 C REDEFINES A.
is not accepted by this COBOL system because C is not the next item ofthe same level after A.
Solution
In the above example, move the redefinition so that it is the next item ofthe same level, after the item it is redefining.
The VALUE ClauseA VALUE clause on an INDEX data item will produce errors when yousubmit your program to this COBOL system.
Solution
Remove the VALUE clause and use the SET statement at the start of theProcedure Division to supply an initial value to the INDEX data item.
File Input and Output
File-namesIncorrect file-names are being used by programs when you run themunder this COBOL system.
Solution
All file-names under this COBOL system must be terminated by a space,whereas under Microsoft COBOL Version 2.2, a file-name must beterminated by a null byte.
Conversion S
eries 2Microsoft COBOL V2.2 Source Compatibility
Compatibility Guide 2-5[33]
CG2SOU.C00 25Jun96 13:36:07 127024 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
OPEN ... EXTENDWhen opening a nonexistent file EXTEND, this COBOL system, unlikeMicrosoft COBOL Version 2.2, does not create the file.
Solution
You can solve this by placing the word OPTIONAL after the wordSELECT for this file.
Record LockingThe WAIT clause on a READ statement behaves differently on thetwo systems, in that the WAIT clause is actually ignored by thisCOBOL system. Instead the file status item will be updated toindicate that a record is locked.
Solution
Check for the ‘Record locked’ status and loop back to re-read therecord.
Locking syntax is ignored in the START statement under thisCOBOL system.
Solution
Alter these statements and move the appropriate locking semanticsto the SELECT statement and OPEN or READ statements for the filein question.
Deleting Relative RecordsRecords in a relative file are not deleted by this COBOL system if they arerewritten with the first byte containing LOW-VALUES.
Solution
In accordance with the warning in the Microsoft manual, we recommendthat you do not use this feature of the Microsoft COBOL Version 2.2system, but if you have used it, you should be able to replace the relevantprogram logic with a simple DELETE statement.
Microsoft COBOL V2.2 Source Compatibility
2-6[34] Compatibility Guide
CG2SOU.C00 25Jun96 13:36:07 127024 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
RebuildThe current version of Rebuild does not allow you to reorganize files sothat the keys are in descending order.
Solution
If any of your programs rely on this ordering of the records, it can besimulated by first positioning on the last record in the file (using a START<= statement with HIGH-VALUES in the key) and then using the READPREVIOUS syntax.
Note: To enable the READ PREVIOUS syntax, you must specify theMF"3" system directive, although when you do, it enables some other reserved words. See your Language Reference for details of these reserved words.
Debug
TRACE StatementsThe READY TRACE and RESET TRACE statements do not have anyeffect under this COBOL system.
Solution
You should specify the directive TRACE when you submit your programto this COBOL system and these statements will function correctly.
Inter-Program Communication
The ON OVERFLOW PhraseUnder this COBOL system, when a subprogram is not found, an ONOVERFLOW phrase on the CALL statement does not cause the programto stop with an error. Instead, the ON OVERFLOW path is followed if thesubprogram is not found (and also if there is insufficient memory).
Solution
It is very unlikely that any application is relying on a program to stopwith a fatal error. However, if this is the case, you should change thelogic in the ON OVERFLOW phrase to handle this.
Conversion S
eries 2Microsoft COBOL V2.2 Source Compatibility
Compatibility Guide 2-7[35]
CG2SOU.C00 25Jun96 13:36:07 127024 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Note: An error made when coding the program-name maycause the ON OVERFLOW phrase to be followed ratherthan stopping; this is something of which you should beaware.
Screen Handling
Accepting into Numeric FieldsInteger numeric fields are accepted differently because numeric editedfields insert digits from right to left under this COBOL system.
Solution
Change the picture-string on this COBOL system from 9(n) to Z(n) andthe insertion behavior will be the same as under Microsoft COBOLVersion 2.2.
Note: Numeric operations cannot be performed on a numeric edited field. If you do wish to perform numeric operations on this item, you must move it to a numeric item.
Accepting into Alphabetic FieldsAlphabetic fields do not allow non-alphabetic characters to be acceptedinto them under this COBOL system.
Solution
Change the PIC A(n) of the field in question to PIC X(n).
Numeric edited ItemsThe Screen Section syntax, numeric-edited-item FROM group-item, doesnot convert to edited format under this COBOL system.
Solution
Make the object of the FROM phrase an elementary numeric item andredefine it if the individual components are required.
Microsoft COBOL V2.2 Source Compatibility
2-8[36] Compatibility Guide
CG2SOU.C00 25Jun96 13:36:07 127024 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Incorrect SpacingThe Screen Section clause COLUMN PLUS 1 does not give the correctintervening space under some circumstances. For example, the lines:
02 line 1 column 1 .... 02 column plus 1 ....
will not put a space in column 2.
Solution
You should include an explicit LINE clause in the line in error. Forexample:
02 line 1 column 1 .... 02 line 1 column plus 1 ....
Clearing the Screen Under this COBOL system, your Microsoft COBOL Version 2.2 programsdo not clear the screen automatically at the start of a run.
Solution
If you want this to happen, you can insert the statement:
call x"e4"
at the start of the Procedure Division.
Screen ScrollingThe screen is sometimes scrolled when a program terminates. Thishappens only if the cursor is on the last line of the screen when the STOPRUN statement is obeyed, and is caused by a request for the operatingsystem prompt.
Solution
Simply include the following CALL statement immediately before theSTOP RUN statement to position the cursor away from the last line:
call x"e6" using result, parameter
For details of this subroutine, see your Programmer’s Guide to CreatingUser Interfaces.
Conversion S
eries 2Microsoft COBOL V2.2 Source Compatibility
Compatibility Guide 2-9[37]
CG2SOU.C00 25Jun96 13:36:07 127024 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Sounding the BellWhen you try to sound the bell by displaying an item containinghexadecimal 7, under this COBOL system, a diamond appears on thescreen instead. This is because the functionality of theACCEPT/DISPLAY module has been changed (and considerablyenhanced) in this COBOL system.
Solution
To sound the bell, change this DISPLAY statement in your sourceprogram to the statement:
call x"e5"
Extension SubroutinesThe following Microsoft COBOL Version 2.2 extension subroutines havebeen implemented in a slightly different way in this COBOL system:
EXIST RENAME REMOVE COMMAND UPCASE LOCASE EXCODE KBDAVAIL CURPOS
To avoid a possible clash with other dialects, the subroutine-names havebeen prefaced with _MS (underscore MS), and the length of parametersmust be passed to the routines (this is performed by the LENGTH OFsyntax). Therefore, the subroutine:
call "EXIST" using file-name, status
should become:
call "_MSEXIST" using file-name, LENGTH OF file-name, status
the subroutine:
call "RENAME" using old-file-name, new-file-name, status
Microsoft COBOL V2.2 Source Compatibility
2-10[38] Compatibility Guide
CG2SOU.C00 25Jun96 13:36:07 127024 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
should become:
call "_MSRENAME" using old-file-name, LENGTH OF old-file-name, new-file-name, LENGTH OF new-file-name, status
the subroutine:
call "REMOVE" using file-name, status
should become:
call "_MSREMOVE" using file-name, LENGTH OF file-name, status
the subroutine:
call "COMMAND" using command-line
should become:
call "_MSCOMMAND" using command-line, LENGTH OF command-line
the subroutine:
call "UPCASE" using data-name,number-of-chars-to-convert, status
should become:
call "_MSUPCASE" using data-name, LENGTH OF data-name,
number-of-chars-to-convert, LENGTH OF number-of-chars-to-convert, status
the subroutine:
call "LOCASE" using data-name,number-of-chars-to-convert, status
should become:
call "_MSLOCASE" using data-name, LENGTH OF data-name,number-of-chars-to-convert, LENGTH OF number-of-chars-to-convert, status
Conversion S
eries 2Microsoft COBOL V2.2 Source Compatibility
Compatibility Guide 2-11[39]
CG2SOU.C00 25Jun96 13:36:07 127024 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
the subroutine:
call "EXCODE" using exit-code
should become:
call "_MSEXCODE" using exit-code, LENGTH OF exit-code
the subroutine:
call "KBDAVAIL" using status
should become:
call "_MSKBDAVAIL" using status
and the subroutine:
call "CURPOS" using line-number, column-number
should become:
call "_MSCURPOS" using line-number, column-number
The LENGTH OF syntax used in the way indicated here will produce aWarning level error message. This message will appear only if you set thewarning level to 2 or 3 using the WARNING directive. The message canbe ignored.
Add-on Products from Micro Focus The range of Micro Focus add-on products available for use with thissystem is designed to work with the default system configuration. Youshould, therefore, be aware that if you use any of these add-on productsand you submit your program to a system with a different configuration,the results may be unpredictable.
Microsoft COBOL V2.2 Source Compatibility
2-12[40] Compatibility Guide
CG2SOU.C00 25Jun96 13:36:07 127024 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
CG2REB.C00 25Jun96 13:36:08 202274 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Chapter 3
Rebuild
This chapter describes how you invoke Rebuild, and lists the errormessages you may receive when running Rebuild.
The physical file formats used by this COBOL system for COBOLsequential, relative and indexed data files are incompatible with theformats used in Microsoft COBOL Version 1 and Version 2.2.
Rebuild, the file management utility, has a facility which converts files inMicrosoft COBOL V1 and V2.2 formats for use with this COBOL. (Youcan find details of the other facilities offered by Rebuild in yourProgrammer’s Guide to File Handling.)
Restriction: Rebuild is provided only with DOS and OS/2 versions ofthis system and runs only on DOS and OS/2.
We recommend that you make a backup copy of the file being convertedbefore using Rebuild. Rebuild takes every precaution to prevent thesource files being corrupted, but it can happen if the command line isincorrectly specified.
Invoking RebuildTo invoke Rebuild, you enter:
rebuild in-file, out-file /s.. [options]
where:
in-file is the name of the file to be converted
Conversion S
eries 2
Compatibility Guide 3-1[41]
CG2REB.C00 25Jun96 13:36:08 202274 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
out-file is the name of the file to contain the result. This must bedifferent from in-file
/s defines the format of the input file and must be specified
options can be any of the following:
/o defines the organization of the input file and output files
/r defines the record lengths and recording mode of the input fileand output files
/k defines the key structure of the output file
/i causes Rebuild to display information
/v causes Rebuild to display a running record count.
You may place the options anywhere in the command. They arefree-format with spaces allowed between fields. See your Programmer’sGuide to File Handling for details of the options.
You can add parameters to some of the options; these determine how theoption is interpreted at run time. You can specify parameters in two wayson the command line:
with the option, separating each parameter with an optional colon ( : )
by naming parameter files. See the section Parameter Files later inthis chapter for details on how to do this.
The following sections describe these options and which parameters youcan specify with them.
The /s Option The /s option is used for the conversion process to define the format ofthe input file. You must specify this option. The allowed parameters arems1 and ms2, where:
/s:ms1 indicates the input file is a Microsoft COBOL Version 1 file
/s:ms2 indicates the input file is a Microsoft COBOL Version 2.2 file
The output file will always be in the format used by this system.
Rebuild
3-2[42] Compatibility Guide
CG2REB.C00 25Jun96 13:36:08 202274 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
The /o OptionThe /o option defines the organization of the file to be converted. If theoption is omitted, indexed is assumed. The organization is identified by asingle letter parameter, where:
/o:s indicates the input file is sequential
/o:r indicates the input file is relative
/o:i indicates the input file is indexed (the default)
The output file is always the same organization as the input file, but is ina format suitable for use with this COBOL system.
The /r OptionThe /r option defines the record lengths and recording mode of the inputand output files. When you specify this option you should also specify aparameter which defines the record structure of the output file, where:
/r:frecord-length indicates a fixed length format, followed by thelength of the fixed records (the default)
/r:vminimum record length-maximum record length indicates a variablelength format, followed by the minimum and maximum lengths ofthe variable length records, separated by a hyphen (-).
In the case of variable length formats, if you specify the minimum andmaximum lengths as the same value, a variable format file will be createdwith fixed length records.
To access files created using the v parameter, you should include theRECORDING MODE V clause in the File Description (FD) of theaccessing program. RECORDING MODE F is the default. Alternatively, ifyou convert every file with a v parameter, you do not need to alter yoursource programs. Instead you must submit your programs to thisCOBOL system with the RECMODE"V" system directive set, which willmake the default recording mode variable for every FD.
If the recording mode of a file does not match the one you specified (orthe default) in the FD, an error status will be given when the file isopened.
You may omit the lengths for converting Microsoft COBOL files withfixed length records and Microsoft COBOL Version 1 relative files, but
Conversion S
eries 2Rebuild
Compatibility Guide 3-3[43]
CG2REB.C00 25Jun96 13:36:08 202274 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
not Microsoft COBOL Version 2.2 relative files. When you omit the recordlength, it will be taken as the length of the first record in the file.
For relative files, the lengths you give must be exact. If not, the recordsare not correctly transferred, but no warning is given. For sequential andindexed files, if you give a fixed length which is smaller than themaximum record size of the input file, an error will occur. If the fixedlength you give is larger than the maximum record size, or the input filehas variable records, and the fixed length is the same as the maximum,all the records will be written at the length specified, padded with ASCIIspaces.
Consider the following example settings of this /r option:
/r:f indicates that the output file is a fixed format file, with allrecords the same length as the first record in the input file
/r:f235 indicates that the output file is a fixed format file, withrecords of 235 characters in length
/r:v indicates that the output file is a variable format file, withall records the same length as the first record in the inputfile
/r:v76-76 indicates that the output file is a variable format file, withall records of 76 characters in length
/r:v23-678 indicates that the output file is a variable format file, withall records between 23 and 678 characters in length
The /k Option The /k option defines the key structure for an indexed file. You use thisoption to convert Microsoft COBOL Version 1 files whose keyinformation file (.KEY) is missing. Microsoft COBOL Version 2.2 indexedfiles contain the key information in the data part of the file. Thus, thisoption is not needed even if .KEY is missing.
The parameters for this option define the keys. The definitions of two ormore keys are separated by a colon ( : ). You can define each key as anumber of parts (split key), each part being separated by a comma ( , ).You define the key part by a start character position and length,separated by a plus (+) or L.
For alternate keys (those other than the first defined), an additionalparameter, the character d, should terminate the definition if they aredefined as "WITH DUPLICATES".
Rebuild
3-4[44] Compatibility Guide
CG2REB.C00 25Jun96 13:36:08 202274 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
For example:
/k:1+20 defines a single key, starting atcharacter position 1, length 20characters
/k:5+5:20+1d:40+2,43+10 defines three keys, the third beingsplit, and the second allowingduplicates. The first key, the recordkey, starts at character position 5,length 5; the second key, an alternatekey allowing duplicates, starts at 20,length 1; and the third key, a splitalternate key, has two parts, the firststarting at 40, length 2, the second at43, length 10. The first characterposition in a record is position 1.
The /i Option If you specify the /i option, Rebuild displays information about the inputand output files, including record lengths, file type and, for indexed files,key structure.
It is not possible to obtain information about a file without actuallyinvoking a conversion.
Examples
The command line:
rebuild oldfile,new/s:ms2/i
causes the following information for the conversion of the fixed lengthfile oldfile to be displayed:
Conversion successful - records read = 0055
Input file : OLDFILE Record length - 41 Output file : NEW
Organization - Indexed Recording mode - Fixed Record length - 41 Keys description : Start char Length
Conversion S
eries 2Rebuild
Compatibility Guide 3-5[45]
CG2REB.C00 25Jun96 13:36:08 202274 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Key -0 1+ 6
and the command line:
rebuild oldfile,new/s:ms2/r:v40-100/i
causes the following information for the conversion of the variable lengthfile oldfile to be displayed:
Conversion successful - records read = 0055
Input file : OLDFILE Largest record length - 100 Smallest record length - 45 Average record length - 75
Output file : NEW Organization - Indexed Recording mode - Variable Maximum record length - 40 Minimum record length - 100 Keys description : Start char Length Key - 0 1+ 6 Key - 1 with duplicates 10+ 5 20+ 3
The /v Option If you specify the /v option, Rebuild displays a record count on thescreen which it increments as it processes the file. This is useful if youwish to see how Rebuild is progressing. You must not use the /v optionif you are redirecting the output. This option is intended for interactiveuse only.
Examples rebuild oldms001.dat, ms001.dat /s:ms1 /o:i/r:f120 /k:1+20
rebuild oldms001.dat, ms001.dat /s:ms1 /k:1+20
These commands convert a Microsoft COBOL Version 1 indexedfile, with fixed length records of 120 characters, and a single key of20 characters starting at position 1, where the .KEY file is missing. Ifthe .KEY file is present, the /k option is not needed.
Rebuild
3-6[46] Compatibility Guide
CG2REB.C00 25Jun96 13:36:08 202274 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
rebuild oldms001.dat, ms001.dat /s:ms2 /o:i/r:f120
rebuild oldms001.dat, ms001.dat /s:ms2
These commands convert a Microsoft COBOL Version 2.2 indexedfile, with fixed length records of 120 characters. The key informationis extracted from the start of the data file. Thus, this conversion cantake place even if the .KEY index file is missing or corrupt.
rebuild oldrt549.seq,rt549.seq /s:ms2 /o:s/r:v5-1000 /i
This command converts a Microsoft COBOL Version 2.2 sequentialfile, with variable length records of between 5 and 1000 characters.
Parameter FilesAt any point on the Rebuild command line, you can specify an @character followed by the name of a parameter file. This indicates thatparameters are to be taken from the named file. The contents of theparameter file are treated as if they were part of the command line,replacing the @file-name.
The parameter file is an ASCII text file which can contain any of theoptions described in the section Invoking Rebuild earlier in this chapter.
You can specify the parameters in free format, with spaces beingnon-significant (line ends are treated as spaces). The file must not bebigger than 1024 bytes. You may include comments in the file bypreceding them with an asterisk (*). Anything following the asterisk istreated as a comment, up to the end of the line.
The following is an example of how you can specify a parameter file onthe Rebuild command line:
rebuild badms001.dat,ms001.dat @ms001.par
where:
ms001.par is an ASCII text file containing the following line:
/s:ms1 /o:i /r:v100-200 /k:1+20,25+5:40+12:60+3,85+10d
or the following lines (which are equivalent to the line above):
* Works master file - conversion parameters
/s:ms1 * Microsoft v1 indexed file /o:i
Conversion S
eries 2Rebuild
Compatibility Guide 3-7[47]
CG2REB.C00 25Jun96 13:36:08 202274 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
/r:v 100 - 200 * Variable length records /k: 1 + 20 , * prime key - first part 25 + 5 : * - 2nd part
40 + 12 : * 1st alternate key 60 + 3 , * 2nd alternate key (with duplicates) * - first part 85 + 10 d * - second part
If a parameter in a parameter file is in error, a suitable message isdisplayed on the command line.
System Parameters You can specify a set of special system parameters immediately followingRebuild on the command line. These system parameters are present foruse during development, testing and support of Rebuild. Each parameterconsists of two slashes followed by a letter followed by a space:
//q prevents banners from being displayed.
//v displays the version number of the Rebuild program itself.
Warning Messages Depending on the operation you select, some command line options areunnecessary. In these cases, the incorrect usage is indicated, but theoption is ignored and processing continues.
The option may be correct, but omission of other information sometimescauses Rebuild to select the wrong process. If this is the case, correct thecommand line and rerun. Below are the warning messages you mayreceive if you specify incorrect information on the command line:
** WARNING ** - Option ignored - /k option not needed for a reorganization
A key definition option has been used when an indexed filereorganization operation has been requested. The option is ignored.
*** WARNING *** - Option ignored - /k option not needed with /n
A key definition option has been used when an indexed filereorganization operation has been requested. The option is ignored.
Rebuild
3-8[48] Compatibility Guide
CG2REB.C00 25Jun96 13:36:08 202274 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
*** WARNING ***. Option ignored - /k option not needed for ms2conversion.
A key definition option has been used when you have requested aMicrosoft COBOL V2.2 conversion. This is not required since thekey information is held in the data file of a Microsoft V2.2 indexedfile.
*** WARNING *** - Option ignored - /r option not needed for areorganization
A record structure for a reorganization has been used when only the/n (information only) option was specified.
*** WARNING *** - Option ignored - /x option not needed for index rebuild
A key of reference option has been used when an action other thanindexed file reorganization has been selected. The option is ignored.
*** WARNING ***. Option ignored - /x option not needed for ms2conversion.
A key of reference option has been used when you have requested aMicrosoft COBOL V2.2 conversion. This is not required since thekey information is held in the data file of a Microsoft V2.2 indexedfile.
Error MessagesWhen an error is encountered, the command line is displayed, followedby an error message. For command line errors, a caret (^) is displayedunder the point in the command line where the error is detected. Theprogram sets the return code to a value other than zero to indicate thetype of error that has occurred; 9 indicates that you have made an errorwhen entering information on the command line; 2 indicates that anerror has been detected on an output file; 1 indicates that an error hasbeen detected on an input file. This code can be tested in a batch streamusing the IF ERRORLEVEL command (see your Operating Systemdocumentation for further details of this command).
The most likely cause of an error is that you have specified parameters toRebuild that do not correctly represent the input file. In most cases it isdifficult for Rebuild to determine that such a mistake has been made,since most data files carry insufficient information to make them easy toidentify. Consequently, the error presented by Rebuild may not obviouslyidentify the cause.
Conversion S
eries 2Rebuild
Compatibility Guide 3-9[49]
CG2REB.C00 25Jun96 13:36:08 202274 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Command Line Errors ***Invalid parameter combination
The parameters specified on the command line are not compatiblewith each other. The return code is set to 9. Although this messageresults from an error you made on the command line, the error isnot detected by this COBOL system until run time.
Specify valid parameters for the options you want to use.
/k option is required for conversion to indexed file
No key definition was given for the index of the file being generatedfrom a sequential or relative file.
Specify a key definition.
Data compression out of range
The integer you specified for data compression is not within theallowable range.
Data compression requires an integer in the range 0 to 255.
Data compression specified more than once
You have specified the option for data compression more than once;that is, /c:[dn][dn]
The correct format is /c:[dn][in]
Input file same as output file
You have given the output file the same name as the input file.
The output file-name must be different from the input file-name.
Index compression out of range
The integer you specified for index compression is not within theallowed range.
Index compression requires an integer in the range 0 to 7.
Index compression specified more than once
You have specified the option for index compression more thanonce; that is, /c[in][in].
The correct format is /c:[dn][in].
Rebuild
3-10[50] Compatibility Guide
CG2REB.C00 25Jun96 13:36:08 202274 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Invalid command - /n not allowed with Microsoft format file
You have specified the /n option for a Microsoft format file whichyou cannot do unless the Microsoft format file has been convertedinto the indexed file format used by this system.
You must either reenter the command line without the /n option, orconvert the Microsoft format file to the indexed file format used bythis system and enter the command line again.
Invalid command - must specify output file for conversion
You have omitted an output file-name for a conversion.
You must specify an output file-name when you want to convert afile to a different format.
Invalid command line
The command line contains an error other than those describedabove.
Check carefully the syntax, spelling, and spacing in the commandline you are trying to enter.
Invalid compression choice - must be ’d’ or ’i’
The specification of data or index compression was not correct.
When you want to specify data or index compression, you mustspecify the d or i parameters.
Invalid format
The integer you specified for index file format is not within theallowable range.
Index file formats require an integer in the range 0 to 4.
Invalid key length - cannot be zero
One of the keys you defined has a zero length, which is illegal. (Thismay be due to incorrect use of separator characters.)
Make sure that any keys you define have a valid start character. Seethe section The /k Option for details of separator characters.
Invalid key specification - key not contained in record
One of the keys, as defined, is not wholly contained in the record.This is illegal.
Conversion S
eries 2Rebuild
Compatibility Guide 3-11[51]
CG2REB.C00 25Jun96 13:36:08 202274 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
For variable length records, the key must be wholly contained in theminimum length record. This error will occur only if you specify therecord length on a /r option.
Invalid key start - cannot be zero
One of the keys defined has a start character position of zero, whichis illegal. (This may be due to incorrect use of separator characters.)
Make sure that any keys you define have a valid start character. Seethe section The /k Option for details of separator characters.
Invalid key structure - ’+’ expected
A key part parameter of the /k option is incorrect.
It must be start character position and length separated by a plus (+)or an L.
Invalid option
You have specified an invalid option.
The options you can specify are listed in the chapter InvokingRebuild earlier in this manual.
Invalid organization
The syntax of the /o option is incorrect.
The only valid organizations you can specify with the /o option ares (sequential), r (relative), or i (indexed). See the section The /oOption earlier in this chapter for details.
Invalid organization - ’i’ or nothing expected
The syntax of the /o option is incorrect.
The only valid characters after the i, s or r are the letter i (whenconverting to an indexed file) or a ’/’ (when another option isspecified).
Invalid organization - must be indexed for index rebuild
You have tried to rebuild the index or a file whose organization issequential or relative.
Make sure that the file-name you enter for rebuilding is that of anindexed file. If it is not, the rebuild will fail. See the section The /oOption earlier in this chapter for further information.
Rebuild
3-12[52] Compatibility Guide
CG2REB.C00 25Jun96 13:36:08 202274 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Invalid organization - must be indexed for reorganization
You have tried to reorganize a file index for a file whoseorganization is sequential or relative.
Make sure that the file-name you enter for reorganization is that ofan indexed file. If it is not, reorganization will fail. See the sectionThe /o Option earlier in this chapter for further information.
Invalid record length - cannot be zero
You have specified that the length of a record is zero. This is invalid.
When specifying record lengths, you must specify a length greaterthan zero which falls within the limits for record lengths for thisCOBOL system.
Invalid record lengths - maximum must not be less than minimum
The integers you have used to specify the maximum and minimumlengths of a record indicate that the maximum length is less thanthe minimum length. This is illegal.
Enter the maximum or minimum record length again, ensuring thatthe maximum length is greater than the minimum length.
Invalid record parameter - ’-’ expected
When specifying the record structure of a variable length file, youhave not separated the minimum record length and the maximumrecord length with a ’-’.
The correct format is /r:Vminreclen-maxreclen
Invalid record type - ’F’ or ’V’ expected
You have entered a record type other than fixed or variable. This isinvalid.
Enter the record type again using either f (fixed) or v (variable).
Invalid source format
The format of the /s option is incorrect.
See the section The /s Option earlier in this chapter for details of thevalid format parameter to specify with this option.
Conversion S
eries 2Rebuild
Compatibility Guide 3-13[53]
CG2REB.C00 25Jun96 13:36:08 202274 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
MS2X specified for non-indexed file
You have specified that you want to convert a Microsoft COBOLindexed file when that file is not indexed.
Make sure that you are using the /s option and the correctparameter. See the section The /s Option earlier in this chapter fordetails.
Must have key definition (/k option) with MS2X
The Microsoft key file is not present.
You must specify the /k option to enable Rebuild to set up the keysfor this file.
No output file specified for /t to refer to
You did not specify a name for the output file which was referred towith the /t option.
Specify the name of an output file for this option.
No output file specified for data compression
You did not specify an output file-name for data compression.
Specify a valid output file-name.
Number expected
You have specified another character where a number was expected.
Specify a numeric value for this parameter.
Output file was not specified for indexed output
No name was given for the output file in conversion to an indexedfile.
Specify an output file-name.
Parameter file not found
The parameter file specified on the command line cannot be found.
Check the file exists, and that the specification used on thecommand line is correct.
Rebuild
3-14[54] Compatibility Guide
CG2REB.C00 25Jun96 13:36:08 202274 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Information MessagesThe following information messages are output when Rebuild isprocessing a file:
Converting file
The file you specified is being converted from one format to another.
Rebuild aborted -
You will receive this error followed by one of the errors given in thesection Command Line Errors.
Rebuild successful
The file you specified has been successfully rebuilt.
Rebuilding file
The file you specified is being rebuilt.
Rebuilding index
The index of the file you specified is being rebuilt.
Records processed -
The indicated number of records were processed when the file wasconverted, rebuilt or reorganized.
Reorganization successful
The file you specified has been successfully reorganized.
Reorganizing file
The file you specified is being reorganized.
- records processed -
This message is output as a counter of the records that have beenprocessed.
Conversion S
eries 2Rebuild
Compatibility Guide 3-15[55]
CG2REB.C00 25Jun96 13:36:08 202274 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Conversion Errors ***Error on input file - attempt to read past eof
When reading the next record, the end-of-file was encounteredprematurely. Ensure that you have selected the correct format forthe /s option, and that the input file is not corrupt.
Note: This error is likely to occur if you try to convert aMicrosoft COBOL Version 1 sequential or relative filewith a /s:ms2 option.
The output file is closed, and should be useable, if notcomplete.
***Error on input file - bad file structure
The structure of the input file is not an indexed file in the formatused by this system. The return code is set to 1.
Ensure that the parameters are correct and that the file is notcorrupt.
***Error on input file - Communications failure
This error occurs if you have an FHREDIR configuration which tellsRebuild to access files through Fileshare Version 2 (an add-onproduct).
Remove this configuration.
***Error on input file - Disk input output error
This indicates a hardware fault. You should contact your systemadministrator if you receive this error.
***Error on input file - disk space exhausted
File processing cannot continue because there is insufficient diskspace to do so.
Ensure that the input file is not corrupt. The output file is closedand should be useable, if not complete.
***Error on input file - duplicate key - record not written:
The duplicate key was not written to the output file as this wouldhave created an invalid duplicate.
Rebuild
3-16[56] Compatibility Guide
CG2REB.C00 25Jun96 13:36:08 202274 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
***Error on input file - file is not a BTRIEVE indexed file
The file specified by /s:btrv was not recognized as a Btrieveindexed file. The return code is set to 1.
Make sure that the file you specify is a Btrieve indexed file.
***Error on input file - file is not a C-ISAM indexed file
The file specified by /s:c-isam was not recognized as a C-ISAMindexed file. The return code is set to 1.
Make sure that the file you specify is a C-ISAM indexed file.
***Error on input file - file is not a LII indexed file
The file specified by /s:lii was not recognized as a LEVEL II V2.5COBOL indexed file. The return code is set to 1.
Make sure that the file you specify is a LEVEL II V2.5 COBOLindexed file.
***Error on input file - file is not a MF indexed file
The file specified by /s:mf was not recognized as an mf indexedfile. The return code is set to 1.
Make sure that the file you specify is a mf indexed file.
***Error on input file - file is not a MF4 indexed file
The file specified by /s:mf4 was not recognized as an mf4 indexedfile. The return code is set to 1.
Make sure that the file you specify is a mf4 indexed file.
***Error on input file - file is not a variable relative file
The file specified by /o:r is not recognized as a variable relativefile. The return code is set to 1.
Specify a variable relative file.
***Error on input file - file is not a variable sequential file
The file specified by /o:s was not recognized as a variablesequential file. The return code is set to 1.
Specify a variable sequential file.
Conversion S
eries 2Rebuild
Compatibility Guide 3-17[57]
CG2REB.C00 25Jun96 13:36:08 202274 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
***Error on input file - File locked
The file you specified as your input file is locked by another process.
Try again when the file is free to be accessed.
***Error on input file - file must be indexed for rebuild
You have chosen to rebuild the index of an indexed file that is in theformat used by this COBOL system. The file is in the correct formatbut it is not an indexed file. The return code is set to 1.
Check that you have the correct file and have selected the correctaction.
***Error on input file - file must be indexed for reorganization
The input file is not an indexed file in the format used by thissystem. The return code is set to 1. You will receive this error only ifyou have omitted the /s option.
Check that you have the correct file, and that you mean to do areorganization.
***Error on input file - file not found
The input file cannot be found. The return code is set to 1.
Check that the file-name you entered is correct, and the file doesactually exist. For reorganization or index rebuild ensure that theindex file (.IDX) exists for the given indexed data file.
***Error on input file - illegal filename specified
A file-name contains an illegal character. This could be anycharacter that is not part of the permitted character set or it could bethe system-dependent delimiter, which, on most systems, is thespace.
Try the file operation again using the correct file-name.
***Error on input file - invalid /x: key-of- reference
The number specified in the key-of-reference option (/x) exceedsthe number of keys for the given file. The return code is set to 1.
Check the key required, and try again.
***Error on input file - no record size information
You have specified the /r option without specifying record lengths.
Rebuild
3-18[58] Compatibility Guide
CG2REB.C00 25Jun96 13:36:08 202274 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Make sure that you specify record lengths when you specify the /roption. See the section The /r Option earlier in this chapter for details.
***Error on input file - not MF indexed or variable format
The input file is not an indexed file, or a variable format file in theformat used by this system. The return code is set to 1. You willreceive this error only if you have omitted the /s option.
Make sure that the file you specify is either an indexed file, or avariable file whose format is recognized by this COBOL system.
***Error on input file - record size > specified
The record sizes specified in the /r option do not match those in thefile.
Correct the /r option and try the operation again.
***Error on input file - status xx***Error on input file - status 9/ yyy
An error, other than one of the above input file errors, has occurredwhile processing the input file. Possible causes are:
- the file does not exist- a hardware error has occurred opening or reading the file- the file is corrupt
The status xx is an ANSI’85 file status. If the first byte is a 9, thestatus yyy is a COBOL run-time error number. The output file isclosed, and should be usable, if not complete. The return code is setto 1.
See your Error Messages for more details of run-time errors.
***Error on output file - record length < min or > max
The record length of the output file is less than the minimum orgreater than the maximum length you specified.
Change the record lengths specified in the /r option.
***Error on output file - status xx***Error on output file - status 9/ yyy
An error has occurred processing the output file. Either the filecannot be created, or a hardware error has been encountered onopening or writing the file, or the parameters specified are incorrect.
Conversion S
eries 2Rebuild
Compatibility Guide 3-19[59]
CG2REB.C00 25Jun96 13:36:08 202274 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
The status xx is an ANSI’85 file status. If the first byte is a 9, thestatus yyy is a COBOL run time error number. The return code is setto 2.
See your Error Messages for more details of run-time errors.
Supplementary InformationProvided you have not specified the /v option, you can redirect allinformation displayed by Rebuild to a text file. To do this, usestandard redirection, > for creating a new file and >> for extendingan existing file. Thus, you can collect the results of a number ofconversions in a batch stream as the stream is processed, and viewthem on completion. For example:
rebuild olds001.dat,ms001.dat /s:ms1 /k:1+20 /i > rebuild.prt rebuild oldrt549.seq,rt549.seq /s:ms2 /o:s /r:v5-1000 /i
>> rebuild.prt rebuild badms001.dat,ms001.dat @ms001.par >> rebuild.prt
causes the information for all three conversions to be placed in thetext file, rebuild.prt, one after the other. You can view this laterusing a text editor or the "type" command.
Microsoft COBOL Version 2.2 allows the specification of keys in theSELECT clause of a program to differ from the keys actuallycontained in the file, provided the keys at variance are notreferenced. However, this version of the COBOL system will check,when the file is opened, that the keys in the file match thedescription in the SELECT clause, and return an appropriate errorstatus if not.
If this occurs, use the /i option when converting the file to displaythe key structure in the file, compare this with the key structuredefined in the program, and either change the program to match thefile, or use Rebuild again on the converted file to rebuild the index,specifying the full key description required for the file using the /koption. (See your Programmer’s Guide to File Handling for adescription of this use of Rebuild.)
When converting a Microsoft COBOL Version 2.2 file, if you do notknow the maximum record length, and the longest record is longerthan the first record in the file, running Rebuild without a /r optionwill cause an error. However, you can specify the /i option, todisplay the length of the longest record read so far. Using this
Rebuild
3-20[60] Compatibility Guide
CG2REB.C00 25Jun96 13:36:08 202274 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
length in the /r option and rerunning Rebuild will enable morerecords to be converted. The error may occur again, in which caserepeat the above procedure until the file is fully converted.
For example, the first pass:
rebuild oldfile,new/s:ms2/i
gives:
***Error on input file - record size > specified - records read = 0001
Input file : OLDFILE Largest record length - 293 Smallest record length - 253 Average record length - 546
Output file : NEW Organization - Indexed Recording mode - Fixed Maximum record length - 253 Minimum record length - 253 Keys description : Start char Length Key - 0 1+ 9
The second record was bigger than the first, so Rebuild failed afterreading it. Rerun Rebuild adding a /r option using this largestrecord length, as follows:
rebuild oldfile,new/s:ms2/r:f293/i
This gives:
***Error on input file - record size > specified - records read = 0005
Input file : OLDFILE Largest record length - 353 Smallest record length - 253 Average record length - 339
Output file : NEW Organization - Indexed Recording mode - Fixed Maximum record length - 293 Minimum record length - 293 Keys description : Start char Length
Conversion S
eries 2Rebuild
Compatibility Guide 3-21[61]
CG2REB.C00 25Jun96 13:36:08 202274 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Key - 0 1+ 9
The sixth record is bigger than the maximum given, so you need torepeat the procedure with the new largest record length, as follows:
rebuild oldfile,new/s:ms2/r:f353/i
This gives a successful conversion:
Conversion successful - records read = 0049
Input file : OLDFILE Largest record length - 353 Smallest record length - 119 Average record length - 261
Output file : NEW Organization - Indexed Recording mode - Fixed Maximum record length - 353 Minimum record length - 353 Keys description : Start char Length Key - 0 1+ 9
Rebuild
3-22[62] Compatibility Guide
CG2REB.C00 25Jun96 13:36:08 202274 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
CGP003.C00 25Jun96 13:36:09 20052 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Part III
Conversion Series 3
CGP003.C00 25Jun96 13:36:09 20052 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Contents of Part III
Chapter 4 Introduction to Conversion Series 3
Chapter 5 Converting an RM/COBOLApplication
Chapter 6 RM/COBOL Source Compatibility
Chapter 7 RM/COBOL Conversion Issues
Chapter 8 Converting RM/COBOL Data Files
Chapter 9 Running Convert3
Chapter 10 Using the File Conversion Program
Chapter 11 Convert3 and File ConversionProgram Error Messages
CGP003.C00 25Jun96 13:36:09 20052 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
CG3INT.C00 25Jun96 13:36:09 42517 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Chapter 4
Introduction toConversion Series 3
Conversion Series 3 supports certain extensions that enable you tosubmit source programs written in the RM/COBOL language directly tothis COBOL system.
You need to follow two steps to convert an RM/COBOL application andmake it suitable for input to this COBOL system:
1. Submit your RM/COBOL source programs to this COBOL system.
2. Use Convert3 to convert existing data files from RM/COBOLformat to the format used by this system.
RM/COBOL Source ProgramsTo submit RM/COBOL source programs to this COBOL system whichcontain syntax not supported in the standard COBOL language, youmust set the RM system directive. See your Object COBOL User Guidefor details of this directive. When you set the RM directive, the additionalsyntax required, as documented in your Language Reference - AdditionalTopics, is enabled.
You will need to alter your source programs only if they containRM/COBOL features which are not supported by this COBOL system.You may also want to change your source programs if they containfeatures which behave differently under both COBOL systems, in orderto force this system to emulate the behavior of the RM/COBOL system.See the chapter RM/COBOL Source Compatibility for details.
Conversion S
eries 3
Compatibility Guide 4-1[65]
CG3INT.C00 25Jun96 13:36:09 42517 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
You must run the tabx program before submitting any source programscontaining TAB characters to this COBOL system. This program expandsTAB characters into a form which can be processed by this COBOLsystem. See the chapter Converting an RM/COBOL Application for details.
Converting Data FilesConvert3, the file conversion utility, converts specified data files fromRM/COBOL format to the format used by this system. This ensures thatwhen you run your RM/COBOL programs in this COBOL environment,you can still access existing data files that they have produced.
To convert your data files to the format used by this system, you mustsupply Convert3 with the syntactically correct RM/COBOL sourceprograms which produced them.
See the chapters Converting RM/COBOL Data Files, Running Convert3 andUsing the File Conversion Program for full details on Convert3.
Any RM data file which contains both the index and the data cannot beconverted to Micro Focus format by the conversion program created byConvert3.
You must convert this data file to separate data and index files, usingRMISAM or the equivalent utility in your RM product.
Enhancing your Converted ApplicationOnce you have successfully submitted your RM/COBOL sourceprograms to this COBOL system, you may wish to take advantage ofsome of the advanced features offered to you by this system. Thesefeatures include:
enhanced screen handling, provided by a new section in yoursource programs - the Screen Section
ANSI’85 syntax
IBM mainframe COBOL syntax
report writer syntax.
Full details on these features and their associated syntax can be found inyour Language Reference and Language Reference - Additional Topics.
Introduction to Conversion Series 3
4-2[66] Compatibility Guide
CG3INT.C00 25Jun96 13:36:09 42517 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
To use these features, you must specify certain system directives whenyou submit your source programs to this COBOL system. For example,you must set the ANS85 directive if you use ANSI’85 syntax in yoursource programs. See your Object COBOL User Guide for full details ofall system directives, and the features they enable.
Conversion S
eries 3Introduction to Conversion Series 3
Compatibility Guide 4-3[67]
CG3INT.C00 25Jun96 13:36:09 42517 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Introduction to Conversion Series 3
4-4[68] Compatibility Guide
CG3INT.C00 25Jun96 13:36:09 42517 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
CG3SUB.C00 25Jun96 13:36:10 43041 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Chapter 5
Converting anRM/COBOL Application
To successfully transfer your source programs and their associated datafiles from an RM/COBOL to this environment, you must be familiarwith:
the operation of the application which you wish to transfer. Thisknowledge is necessary if you are to ensure that the results given bythe application are the same in both environments
the design and implementation of the application
the COBOL language.
Migrating from the RM/COBOLEnvironment
We advise that you carry out the following steps to ensure successfulmigration from the RM/COBOL environment to this COBOLenvironment:
1. Transfer all your source programs and their associated data files tothe target machine.
2. If your source programs contain any TAB characters, run the tabxprogram to expand them into a form that is acceptable to thisCOBOL system. See the section The Tabx Program later in thischapter for details.
3. If you wish to submit your source programs to this COBOL systemin batch mode, you must create a command file containing the
Conversion S
eries 3
Compatibility Guide 5-1[69]
CG3SUB.C00 25Jun96 13:36:10 43041 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
commands needed to do this. See your operating systemdocumentation for details of the format of the command file. Seeyour Object COBOL User Guide for full details of the commandsneeded to submit your source programs to this COBOL system.
4. Submit your source programs to this COBOL system. The commandto do this is specific to your implementation. See your ObjectCOBOL User Guide for full details.
5. Investigate the cause of any problems you may experience whenyou submit your source programs to this COBOL system. Thechapter RM/COBOL Conversion Problem Solving describes knownproblems which you may experience and gives hints on how youcan recover if you receive them. Resubmit your corrected sourceprograms to this COBOL system.
6. Test any sections of your source programs which do not use datafiles. If you receive unexpected results see the chapter RM/COBOLConversion Problem Solving for a description of known problems youmay experience in executing your source programs, and hints onhow to correct these. Alternatively, use the debugging tool,Animator, to isolate and correct any problems.
7. Ensure the ACCEPT/DISPLAY module ADIS is configuredcorrectly. See your Programmer’s Guide to Creating User Interfacesfor details.
8. Run Convert3 to convert any existing data files used by your sourceprograms to a format that is acceptable to this COBOL system. Seethe chapters Converting RM/COBOL Data Files, Running Convert3and Using the File Conversion Program for full details on how to useConvert3.
9. Finish system testing.
10. Archive your original data files to disk or tape.
If disk space on your system is limited you may not be able to have boththe old and the new copies of all your data files present on your systemat the same time. If this is the case, load and unload the data filesgradually onto your system during the conversion process.
Converting an RM/COBOL Application
5-2[70] Compatibility Guide
CG3SUB.C00 25Jun96 13:36:10 43041 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
The Tabx ProgramIf your RM/COBOL source programs contain any TAB characters, youmust run the tabx program before you can successfully submit them tothis COBOL system. This is necessary because each COBOL systemhandles TAB characters differently. Under the RM/COBOL system thefirst TAB stop is at character position 8, while subsequent TAB stops areat four character intervals up to position 72. However, under this COBOLsystem, the first TAB stop is at character position 9, while subsequentTAB stops are at eight character intervals.
The tabx program expands any TAB characters in your RM/COBOLsource programs to spaces. The resulting source code can be submittedsuccessfully to either the RM/COBOL or this COBOL system.
UNIX To run tabx on UNIX, enter the following command line:
tabx [-options] input-filename [output-filename]
DOS and OS/2 To run tabx on DOS and OS/2, enter the following command line:
tabx [/options] input-filename [output-filename]
where:
options can be any of the following:
v sets verbose mode. Any messages aredisplayed upon your screen
l parameters are read from the file specified asinput-filename
t(tab-spec) informs tabx of the positions at which TABcharacters are set. For example -t (16-8, 64)assumes tab positions are initially at position16, and then at eight character intervals up tocolumn 64. By default this is set to -t (8-4, 72)which is suitable for RM/COBOL sourceprograms.
input-filename the file containing the RM/COBOL sourceprogram
Conversion S
eries 3Converting an RM/COBOL Application
Compatibility Guide 5-3[71]
CG3SUB.C00 25Jun96 13:36:10 43041 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
output-filename the file to which the source program output bytabx, is directed. If you do not specifyoutput-filename, tabx directs its output toinput-filename, so overwriting the originalcontents of input-filename
If you do not specify any parameters, tabx displays the required formatof the parameters as above.
Examples
tabx -v myfile.cbl myfile.new
expands the TAB characters in the file myfile.cbl and outputs a new file,myfile.new.
tabx -l filelist
tabx treats each line of the file filelist as a command line.
tabx myfile.cbl
expands the TAB characters in the file myfile.cbl and overwritesmyfile.cbl with the resulting source program.
Converting an RM/COBOL Application
5-4[72] Compatibility Guide
CG3SUB.C00 25Jun96 13:36:10 43041 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
CG3SOU.C00 25Jun96 13:36:10 80123 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Chapter 6
RM/COBOL SourceCompatibility
This chapter describes the directives you may need to set to successfullysubmit your RM/COBOL programs to this COBOL system. It alsodescribes the treatment of data types by the system.
The RM DirectiveBy default, the standard COBOL language supported by this system, asdocumented in your Language Reference, already supports much of theRM/COBOL syntax and behavior. You can, however, enable someadditional RM/COBOL syntax, using the RM system directive. Settingthe RM directive when you submit your RM/COBOL source programs tothis COBOL system, ensures that most of the programs are accepted thefirst time they are submitted. The additional syntax enabled by the RMdirective is documented in your Language Reference - Additional Topics.
If you normally set the ANSI switch when you submit your RM/COBOLsource programs to the RM/COBOL system, you must specify the ANSIparameter with the RM directive when you submit these programs tothis COBOL system.
See your Object COBOL User Guide for the commands you use tosubmit your RM/COBOL source programs to this COBOL system, and toset the RM directive.
Setting the RM directive automatically sets additional system directives,namely NOTRUNC, OLDINDEX, NOOPTIONAL-FILE, RETRYLOCK,ALIGN"2" and SEQUENTIAL"LINE". See your Object COBOL UserGuide for details of these directives. The system will also behave as if youhad specified the following syntax:
Conversion S
eries 3
Compatibility Guide 6-1[73]
CG3SOU.C00 25Jun96 13:36:10 80123 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
sign trailing separate
for signed numeric data items, and:
lock mode is automatic
for each file in the program which has no explicit locking syntaxdeclared. When you set the RM directive with the ANSI parameter, thesame system directives are set as for the RM directive, except that theSEQUENTIAL directive is set as SEQUENTIAL"RECORD". Also, thesystem behaves as if you had specified the syntax:
sign trailing included
for signed numeric data items, and:
lock mode is automatic
for each file in the program which has no explicit locking syntaxdeclared.
We also recommend that you set the NOMF and NOOSVS directiveswhen you submit your RM/COBOL source programs to this COBOLsystem. This ensures that only those words which are treated as reservedwords under the ANSI ’74 COBOL standard are regarded as reservedwords by this COBOL system. For further details of these directives, seeyour Object COBOL User Guide.
Setting the NORM directive disables the syntax enabled when the RMdirective was set, and automatically resets the additional systemdirectives to NOSPZERO, TRUNC"ANSI", NOOLDINDEX,OPTIONAL-FILE, NORETRYLOCK, ALIGN"8" andSEQUENTIAL"RECORD". Additionally, the system behaves as if you hadspecified the syntax:
sign trailing included
for signed numeric data items, and:
lock mode is exclusive
for each file in the program which has no explicit locking syntaxdeclared. See your Object COBOL User Guide for details of the defaultsetting of the RM directive. The final states of the additional directives setwhen you use the NORM directive are not necessarily the same as theirinitial default states.
RM/COBOL Source Compatibility
6-2[74] Compatibility Guide
CG3SOU.C00 25Jun96 13:36:10 80123 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Perform StatementsPERFORM statements are not treated in the same way by both COBOLsystems. This COBOL system uses a stack-based perform handlingsystem, while the RM/COBOL system associates a return address with aspecific procedure name. As a result, under the RM/COBOL system, allend-points to PERFORM statements are always active until they areused. However, under this system, only the end-point of the lastPERFORM statement is active at any one time.
You must set the PERFORM-TYPE directive with the RM parameter ifthis COBOL system is to emulate the behavior of RM/COBOLPERFORM statements. See your Object COBOL User Guide for details.
Table Bound CheckingIf you try to run a program under this COBOL system which contains asubscript value greater than the size of the table to which it refers, therun-time system will produce an error indicating this. Under theRM/COBOL system, however, no such table bound checking is done.Therefore, if you wish to disable table bound checking in this COBOLsystem, you must use the NOBOUND directive. See your Object COBOLUser Guide for details of this directive.
If you use the NOBOUND directive when running intermediate code,you will be able to access data beyond a table’s bounds by using asubscript value greater than the table size. Use of the NOBOUNDdirective when you are producing intermediate code will also disablebound checking when running generated code. However, if you wish toaccess data beyond a table’s bounds when running generated code, youmust also use the directive NOBOUNDOPT.
Note: When you use the NOBOUNDOPT directive,performance will be impaired.
Types of Data The treatment of data types by this COBOL system is associated with theaction of the file conversion utility, Convert3. This COBOL system alwaysallocates the same number of bytes to the item in question, but mayredefine its contents when it is converted. Therefore, you must be awarethat if these items are redefined, and the program logic expects to find a
Conversion S
eries 3RM/COBOL Source Compatibility
Compatibility Guide 6-3[75]
CG3SOU.C00 25Jun96 13:36:10 80123 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
certain binary value in the redefinition, you may not receive the behavioryou are expecting at run time. At run time, this COBOL system may treatthe ON SIZE ERROR clause differently from the RM/COBOL system. Seethe chapter RM/COBOL Conversion Problem Solving for further details.
The following sections define how this COBOL system treatsCOMPUTATIONAL, COMPUTATIONAL-1 and COMPUTATIONAL-6types of data.
COMPUTATIONAL (COMP) Data TypesThis COBOL system treats any COMP data items in your RM/COBOLsource program as the standard Micro Focus COBOL DISPLAY format.The difference in the internal representation of such data in the twosystems is that this COBOL system always sets the most significant fourbits of each byte to the value 3, while the RM/COBOL system always setssuch bits to the value 0.
For example, under the RM/COBOL system:
PIC 999 COMP VALUE 123
is held in three bytes as hexadecimal value 01 02 03
while under this COBOL system:
PIC 999 VALUE 123
is held in three bytes as hexadecimal value 31 32 33.
COMPUTATIONAL-1 (COMP-1) Data TypesFor each data item declared as USAGE COMP-1 in your RM/COBOLsource program, regardless of its picture-string, this COBOL systemallocates a 2-byte signed binary data item. This data item is capable ofholding a hexadecimal value in the range -32768 to +32767. That is, thisCOBOL system treats each RM/COBOL USAGE COMP-1 data item asthough it had a standard Micro Focus COBOL picture-string of S9(4)COMP. See your Language Reference - Additional Topics for details onthe standard Micro Focus COBOL language.
COMPUTATIONAL-6 (COMP-6) Data TypesThis COBOL system treats any COMP-6 data items in your RM/COBOLsource program as the standard Micro Focus COBOL COMP format. If, as
RM/COBOL Source Compatibility
6-4[76] Compatibility Guide
CG3SOU.C00 25Jun96 13:36:10 80123 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
a result of this, less data space is allocated to each item than would beunder the RM/COBOL system, this COBOL system pads the space witha byte containing a zero, as shown in the following table:
Table 6-1. COMP-6 to COMP Conversion
RMCOMP-6PICTURE
clause
Bytes allocated whenconverting to Micro FocusCOBOL COMP PICTURE
clause
Number of bytescontaining leading zeros
required to precede COMPPICTURE clause
9(1) 1 NONE
9(2) 1 NONE
9(3) 2 NONE
9(4) 2 NONE
9(5) 3 NONE
9(6) 3 NONE
9(7) 4 NONE
9(8) 4 NONE
9(9) 5 NONE
9(10) 5 NONE
9(11) 5 1
9(12) 5 1
9(13) 6 1
9(14) 6 1
9(15) 7 1
9(16) 7 19(17) 8 1
9(18) 8 1
The padding byte precedes the converted field, and is therefore includedin any redefinition of group fields which contain the converted field.However, the padding byte would not be included if you redefined onlythe converted field. If you wish to ensure that the padding byte isincluded in the redefinition of the converted field, you must add a fieldat a higher level immediately before the converted field, and redefine thisnew field instead.
Conversion S
eries 3RM/COBOL Source Compatibility
Compatibility Guide 6-5[77]
CG3SOU.C00 25Jun96 13:36:10 80123 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
RM/COBOL Source Compatibility
6-6[78] Compatibility Guide
CG3SOU.C00 25Jun96 13:36:10 80123 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
CG3PRO.C00 25Jun96 13:36:11 202874 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Chapter 7
RM/COBOL ConversionIssues
The syntax of most of the RM/COBOL source programs which yousupply to this system will be accepted, and will run successfully.Sometimes, however, this COBOL system may reject some of the syntaxin your original RM/COBOL source program, or may cause yourprogram to behave unexpectedly at run time.
This COBOL system has been designed in such a way that there willprobably be few or none of these problems. If, however, you doencounter any syntax discrepancies, this section details the knownfeatures which may cause errors, or which may not behave as you areexpecting, at run time. Hints are also given on how you can either rectifythe cause of such errors, or emulate the RM/COBOL type of behaviorunder this system.
Producing Executable CodeThe following sections detail the known areas of difficulty you mayencounter when you submit RM/COBOL source programs to thisCOBOL system to produce executable code. Hints on how you can avoidthese areas are also given.
Length of Nonnumeric LiteralsThe RM/COBOL system allows you to write source programs containingnonnumeric literals in the Procedure Division that are up to 2047characters long. However, this COBOL system will accept only
Conversion S
eries 3
Compatibility Guide 7-1[79]
CG3PRO.C00 25Jun96 13:36:11 202874 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
nonnumeric literals in the Procedure Division that are up to 160characters long, as specified in the ANSI X3.23-1985 COBOL standard.
Solution
Amend your source program by creating a new data item in theWorking-Storage Section, and assigning the literal to the VALUE clause.If you then use the data item in the Procedure Division in the place of theoriginal long literal, this COBOL system will accept your sourceprogram.
Example
The RM/COBOL system accepts the following line of code but thisCOBOL system does not:
move "abc...aa" to screen-buffer.
where: abc...aa represents a literal of 1500 characters.
Change the code to:
move long-literal-1 to screen-buffer.
Define a new item in the Working-Storage section of your sourceprogram:
01 long-literal-1 pic x(1500) value "abc...aa".
You can now submit your amended RM/COBOL source program to thisCOBOL system and it will be accepted successfully.
Source Code in Columns 73 to 80This COBOL system ignores any of the code in your source programswhich lies within columns 73-80 inclusive.
Solution
The illegal COBOL code has probably resulted from expanding TABcharacters in your source program to standard TAB stops. If your sourceprogram contains TAB stops, run the tabx program before submittingyour source program to this COBOL system. This expands TABcharacters into a form which is acceptable to this COBOL system. See thechapter Converting an RM/COBOL Application for details on the tabxprogram.
RM/COBOL Conversion Issues
7-2[80] Compatibility Guide
CG3PRO.C00 25Jun96 13:36:11 202874 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Linkage Section in Main ProgramUnder RM/COBOL, if the main program has a Linkage Section, it isinitialized by the parameter passed on the command line. Under thisCOBOL system, it is illegal to reference Linkage Section items in the mainprogram.
Solution
Use the following root program to pass the command line and its lengthto your main program:
identification division. program-id. root. environment division. configuration section. source-computer. cobol2. working-storage section. 01 main-linkage. 03 cmd-length pic 9(4) binary value 0. 03 cmd-line pic x(100). procedure division. accept cmd-line from command-line. if cmd-line not = spaces inspect cmd-line tallying cmd-length for characters before initial space end-if call "main" using main-linkage. exit program.
Extended I-O Status CodesUnder RM/COBOL, your program must call an RM/COBOL internalsubprogram named C$RERR in order to get an extended file status code.Under this COBOL system, extended file status codes are reported in thesecond byte of the file status.
Solution
C$RERR can be emulated by the following program.
identification division. program-id. crerr. environment division. configuration section. source-computer. cobol2.
Conversion S
eries 3RM/COBOL Conversion Issues
Compatibility Guide 7-3[81]
CG3PRO.C00 25Jun96 13:36:11 202874 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
working-storage section. 01 mfc2-file-status. 03 mfc2-status-1 pic x. 03 mfc2-status-2 pic x. 03 mfc2-status-binary redefines mfc2-status-2 pic 99 comp-x. linkage section. 01 rm-extended-status. 03 rm-extended-status-1 pic 9. 03 rm-extended-status-2 pic 999. procedure division using rm-extended-status. move rm-extended-status to mfc2-file-status. if mfc2-status-1 = "9" move mfc2-status-binary to rm-extended-status-2 else move "00" to rm-extended-status ( 3 : 2 ) end-if exit program.
For the above example to work correctly, the first two bytes of LINKAGEitem RM-EXTENDED-STATUS must contain the COBOL file status as inthe following example:
file-control. select optional seq-file assign to random "myfile" organization line sequential status is io-file-status. working-storage section. 01 io-file-status 03 rm-extended-status pic x(4).
Reserved WordsWhen you set system directives, such as MF or ANS85, this activatesvarious features and their associated reserved words in this COBOLlanguage. As a result, you may receive errors when you submit sourceprograms to this COBOL system with such directives set, because dataitems in them might have the same names as words which are defined asreserved words.
Solution
Edit your source programs to rename the offending data item(s), or usethe REMOVE system directive to remove a specified reserved word from
RM/COBOL Conversion Issues
7-4[82] Compatibility Guide
CG3PRO.C00 25Jun96 13:36:11 202874 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
the reserved word list. See your Object COBOL User Guide for details ofthe REMOVE directive, and your Language Reference for details ofreserved words.
Example
Your RM/COBOL source program may contain the following lines ofcode:
.... 03 sort pic 99. .... move 1 to sort
If you submit this to this COBOL system you will receive an error as thissystem supports the SORT verb, while the RM/COBOL system does not.However, if you specify the REMOVE"SORT" directive when you submitthis source program to this COBOL system, you will receive no errors.
Numbering of SegmentsThe RM/COBOL system allows you to specify segment numbers greaterthan 99. However, this COBOL system conforms to segment numberlimit specified in the ANS X3.23-1985 COBOL standard, and allows youto specify segment numbers only in the range 0 to 99 inclusive.
Solution
Recode your source programs so that segment numbers greater than 99are less than or equal to 99. Make sure that any new segment numbersyou allocate do not clash with an already existing segment number.Segment numbers between 0 and 49, inclusive, are used by this COBOLsystem to indicate fixed portions of your object program, while segmentnumbers 50 to 99, inclusive, indicate independent segments. For detailson the use of segmentation and segment numbers in your sourceprograms, see your Language Reference - Additional Topics.
Program Identification and Data-namesThe RM/COBOL system allows the name given in the PROGRAM-IDphrase and a data item in that program to be the same. However, thisCOBOL system does not allow the use of the same name for thePROGRAM-ID and a data item in the program, and requires instead thateach should be unique.
Conversion S
eries 3RM/COBOL Conversion Issues
Compatibility Guide 7-5[83]
CG3PRO.C00 25Jun96 13:36:11 202874 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Solution
Change either the program-name in the PROGRAM-ID paragraph, or thename of the data item, so that you follow the conventions of this COBOLlanguage as given in your Language Reference.
Duplicate Paragraph-namesIf your program contains duplicate paragraph-names, both COBOLsystems will resolve references to the duplicate paragraph-names in thesame way, provided the duplicate paragraph-names are only referencedfrom within the sections in which they are declared. If, however, youreference a duplicate paragraph-name from a different section from theone it is declared in, the RM/COBOL system will assume that thereference is to the next declaration of the duplicate paragraph-name,whereas this COBOL system will give an error when you are producingintermediate code.
Solution
To ensure that references to duplicate paragraph-names are correctlyresolved, you must qualify a reference to a duplicate paragraph-name byadding the section-name in which it is declared.
Example
If your source code contains the following:
.... perform para-2. ....
sect-1 section. para-1. .... para-2. ....
sect-2 section. para-2. ....
the RM/COBOL system will resolve the reference to para-2 in thePERFORM statement by using the declaration of para-2 in the sect-1SECTION. Under this COBOL system, however, you must qualify thereference to the duplicate paragraph-name in your source code by usingthe PERFORM para-2 OF sect-1 statement.
RM/COBOL Conversion Issues
7-6[84] Compatibility Guide
CG3PRO.C00 25Jun96 13:36:11 202874 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Running the CodeOnce you have successfully submitted your RM/COBOL source programto this COBOL system and produced executable code, you mayencounter difficulties when you try to run this code under this system.Alternatively, the code may run but you may find that its behavior underthis COBOL system is not exactly the same as under the RM/COBOLsystem. The following sections detail known areas of difficulty you mayencounter, and offer hints on how you can avoid them.
Trailing Blanks in Line Sequential FilesThis COBOL system always removes trailing blanks from line sequentialrecords before writing the record. The RM/COBOL system removestrailing blanks from such records only if the FD entry contains 01 levelrecords of different sizes. This will not cause you any problems when yourun your converted RM/COBOL programs under this COBOL system.However, you may receive errors at run time if any REWRITE operationson line sequential files change the length of the records.
Solution
Change the file organization to sequential, or move an alternativepadding character (for example, LOW-VALUES) to the end of the recordbefore it is written. This ensures that full-length records are written.
You also need to ensure that the T run-time switch is not set, as this mayalso change the size of the record. See your Object COBOL User Guidefor details of this switch.
Undefined Results of MOVE and ArithmeticOperations
The results of MOVE statements involving numeric and alphanumericdata items can differ under the two systems. So can the results ofarithmetic operations or comparisons on numeric items which containnonnumeric data, or when a numeric data item containing nonnumericdata is moved to an alphanumeric data item in generated code.
Solution
You can overcome most of these incompatibilities by redefining the dataitems involved, or by recoding the comparisons. If you submit a program
Conversion S
eries 3RM/COBOL Conversion Issues
Compatibility Guide 7-7[85]
CG3PRO.C00 25Jun96 13:36:11 202874 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
to this COBOL system containing an alphanumeric to numeric data itemMOVE statement, a warning message will be displayed indicating this.
Example
If you submit a source program containing the following data items andprocedural statements the specified test will fail at run time:
01 numeric-field pic 9(5). procedure division. move "abc" to numeric-field. if numeric-field = "00abc" ....
When the RM directive is set, this COBOL system partially emulates thebehavior of the RM/COBOL system for alphanumeric to numericMOVEs by treating the numeric item as an alphanumeric item which isright justified. However, the above example will still fail because theRM/COBOL system treats the literal ABC as numeric, and places 00ABCin the numeric item. To make the statement run successfully under thisCOBOL system, amend the test in the source program to:
if numeric-field = " abc"
and resubmit the source program to the system.
Embedded Control Sequences in DISPLAYStatements
In your RM/COBOL source program you may have embedded controlsequences within data items which you want to be displayed. One of themost commonly used sequences is that for selecting underline:
←]4m
This COBOL system ignores such control characters at run time as theyare hardware dependent. It will try to display them as literals but theresults are undefined.
Solution
Remove the control sequences from your source program and replacewith the equivalent Micro Focus COBOL syntax. In the above example,use the syntax WITH UNDERLINE. See your Language Reference for afull description of all Micro Focus COBOL syntax available to you.Resubmit your amended source program to this COBOL system. If any of
RM/COBOL Conversion Issues
7-8[86] Compatibility Guide
CG3PRO.C00 25Jun96 13:36:11 202874 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
the syntax which you have added to your source program needs to haveadditional directives set before the system will accept it, you must setthese directives. In the above example you would need to set the 3parameter with the MF directive. See your Object COBOL User Guide fora full description of all the available directives, and your LanguageReference for a list of which reserved words are enabled by each directive.
Printer Output is Written to DiskBy default, this COBOL system writes all output intended for a printer todisk.
Solution
The way in which you can write directly to the printer is specific to yourimplementation and is given in your Programmer’s Guide to WritingPrograms.
Redefinition of COMPUTATIONAL orCOMPUTATIONAL-6 Data Items
This COBOL system fully supports the size and capacity of RM/COBOLtype COMPUTATIONAL and COMPUTATIONAL-6 data items,provided the source programs containing such items are submitted tothis COBOL system with the RM directive set. However, the internalrepresentation of such data items in this COBOL system and theRM/COBOL system is not the same. See the chapter RM/COBOL SourceCompatibility for details. This may cause you problems if you want toredefine these data items to take advantage of their internal format.
Solution
MOVE the data items concerned to other data items which are notdefined as COMPUTATIONAL or COMPUTATIONAL-6. Moving thesedata items converts the data automatically, overcoming any problemsyou may have had.
Example
The following source code is coded to take advantage of the internalrepresentation of COMPUTATIONAL-6 data items under theRM/COBOL system, and to analyze a date field:
Conversion S
eries 3RM/COBOL Conversion Issues
Compatibility Guide 7-9[87]
CG3PRO.C00 25Jun96 13:36:11 202874 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
01 birthdate-1 pic 9(6) comp-6. 01 birthdate-2 redefines birthdate-1. 03 month-2 pic 99 comp-6. 03 day-2 pic 99 comp-6. 03 year-2 pic 99 comp-6. ....
procedure division. start-up section. para-1. ....
move 082462 to birthdate-1. ....
if year-2 = 62 display "records not available for 1962."
Amend your source program to use the DISPLAY format instead ofredefining COMPUTATIONAL-6 data items, before submitting it to thisCOBOL system:
01 birthdate-1 pic 9(6) comp-6. 01 birthdate-2 redefines birthdate-1. 03 month-2 pic 99 comp-6. 03 day-2 pic 99 comp-6. 03 year-2 pic 99 comp-6.
01 birthdate-1a pic 9(6). 01 birthdate-2a redefines birthdate-1a. 03 month-2a pic 99. 03 day-2a pic 99. 03 year-2a pic 99. ....
procedure division. start-up section. para-1. ....
move 082462 to birthdate-1. move birthdate-1 to birthdate-1a. ....
if year-2a = 62 display "records not available for 1962."
RM/COBOL Conversion Issues
7-10[88] Compatibility Guide
CG3PRO.C00 25Jun96 13:36:11 202874 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
ON SIZE ERROR ClauseEach COBOL system treats the ON SIZE ERROR condition differently.The ON SIZE ERROR condition exists under the RM/COBOL systemwhen the value resulting from an arithmetic operation exceeds thecapacity for the associated data item. However, the ON SIZE ERRORcondition exists under this COBOL system when the value resulting froman arithmetic operation exceeds the capacity of the specifiedpicture-string.
Solution
Try to ensure that the capacity of any data items in your source programsis specified by a picture-string. For example, COMPUTATIONAL-1 dataitems.
Field Wrap-AroundIf, when using binary data items (that is, RM/COBOLCOMPUTATIONAL-1 format items) an arithmetic operation gives avalue which exceeds the capacity of the data item, and there is no ONSIZE ERROR clause, this COBOL system wraps-around the value of theitem. However, under the same conditions the RM/COBOL system setsthe data item to the limit of its capacity.
Solution
Specify the ON SIZE ERROR clause.
Example
Under the RM/COBOL system the following lines of code result in thevalue +32767 being stored in the data item, CALC-ITEM. However,under this COBOL system the value -32768 is stored in CALC-ITEM:
01 calc-item pic s9(4) comp-1.
procedure division. .... move 32767 to calc-item. add 1 to calc-item.
Conversion S
eries 3RM/COBOL Conversion Issues
Compatibility Guide 7-11[89]
CG3PRO.C00 25Jun96 13:36:11 202874 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
COMPUTATIONAL-1 Data Items with a PICTUREother than S9(4)
The RM/COBOL system takes note of the picture-string for theCOMPUTATIONAL-1 data item when it is used as the source of a MOVEstatement to an alphanumeric item. However, this COBOL systemalways assumes a COMPUTATIONAL-1 data item has a picture-string ofS9(4).
Solution
To produce the result you require, you must alter the definition of thetarget of the MOVE statement.
Example
The following source code causes TEST-RECORD to hold "9900" underthe RM/COBOL system, but "0099" under this COBOL system.
01 test-record pic x(4). 01 comp-1-item pic 99 comp-1. procedure division.
...
move 99 to comp-1-item. move comp-1-item to test-record.
To overcome this problem, alter the definition of TEST-RECORD asshown below:
01 test-record. 03 test-numeric-field pic 99. 03 filler pic xx. 01 comp-1-item pic 99 comp-1. procedure division. ... move 99 to comp-1-item. move comp-1-item to test-numeric-field.
This avoids moving the COMPUTATIONAL-1 data item directly to analphanumeric field.
RM/COBOL Conversion Issues
7-12[90] Compatibility Guide
CG3PRO.C00 25Jun96 13:36:11 202874 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
File and Record LockingCertain versions of the RM/COBOL system contain some software errorsin the way in which locks for files and records are handled. These errorsare not emulated in this COBOL system. For example:
indexed files do not detect or acquire locks if they are opened foroutput. This is regardless of whether you specify the WITH LOCKphrase
relative and sequential files cannot be locked exclusively
files which are opened for input can detect record locks, althoughthe RM/COBOL documentation states that they cannot. When theRM directive is set under this COBOL system, record locks can stillbe detected by files opened for input
the first record in sequential files opened for input-output is lockedwhenever any other record in that file is.
Initialization of Working-StorageThe RM/COBOL system initializes all Working-Storage items to SPACES,unless you have placed numeric data items between data items withVALUE clauses. This COBOL system initializes all Working-Storageitems without VALUE clauses to SPACES without exception.
Solution
If this feature causes you any problems, add a VALUE clause with theappropriate value to your source program and resubmit it to this COBOLsystem. This will resolve any problems which may occur if your programrelies on the initial value given to the system.
Example
The RM/COBOL system initializes the following group item to SPACES:
01 group-item. 03 item-1 pic x. 03 item-2 pic 99. 03 item-3 pic x.
However, if ITEM-1 and ITEM-3 have value clauses associated withthem, the RM/COBOL system initializes the second byte of ITEM-2 to
Conversion S
eries 3RM/COBOL Conversion Issues
Compatibility Guide 7-13[91]
CG3PRO.C00 25Jun96 13:36:11 202874 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
hexadecimal value 0 when ITEM-2 is defined as USAGE COMP (signedor unsigned) or USAGE DISPLAY (unsigned only).
Screen Column Number SpecificationThis COBOL system allows you to specify screen column numbers up toand including 999, but the RM/COBOL system allows you to specifycolumn numbers greater than 999. If you try to run an RM/COBOLsource program containing a column number greater than 999 under thisCOBOL system, the column number is truncated so that only the lastthree digits are used. If truncation of the column number occurs for anitem to be displayed on the screen, the position of that item on the screenunder this COBOL system will differ from its position under theRM/COBOL system.
Solution
Ensure that column numbers do not exceed 999. If you want an item onthe screen that has a column number greater than 999 to remain in thesame position under this COBOL system as under the RM/COBOLsystem, you will need to recode your program. See your LanguageReference for details of the use of column numbers in this COBOLsystem.
End of File NotificationThe first time you unsuccessfully try to READ a sequential file in eitherCOBOL system because you have reached the end of the file, status key 1in the FILE STATUS is set to 1 and status key 2 is set to 0. This indicatesthat there is no next logical record. If you try to READ the same fileagain, without it either having been previously closed and reopened, or ithaving been successfully started, this COBOL system continues toindicate that there is no next logical record. However, if you try to READthe same file again under the RM/COBOL system, status key 1 is set to 9and status key 2 is set to 6.
Solution
A solution to the different file statuses returned for the circumstancesgiven above will depend on the way in which your source program iscoded. We suggest that you include tests for the values 1 and 0 in statuskey 1 and 2 of the file status, respectively, at the same time as you test forthe values 9 and 6 in these status keys.
RM/COBOL Conversion Issues
7-14[92] Compatibility Guide
CG3PRO.C00 25Jun96 13:36:11 202874 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
ACCEPT Fields at the Edge of the ScreenIf your program contains an ACCEPT statement for a numeric data itemat a position on the screen where the definition of the numeric data itemwould cause the ACCEPT field to go beyond the right-hand edge of thescreen, both COBOL systems will truncate the input value. Under theRM/COBOL system, the input value will be aligned into the ACCEPTfield as an alphanumeric field, whereas under this COBOL system theinput value is aligned as a numeric field.
Solution
Change the definition of the relevant PICTURE clause from numeric toalphanumeric. Alternatively, change the PICTURE clause so that the fielddoes not go beyond the edge of the screen.
Example
If your program contains the following statement:
ACCEPT data-item AT COLUMN NUMBER 75.
where data-item is a numeric data item defined as PIC 9(10), a value of123456 entered into the ACCEPT field will be held under this COBOLsystem as "0000123456". Under the RM/COBOL system, however, thevalue in the ACCEPT field would be held as "1234560000". To allowthis COBOL system to emulate the behavior of this value when it is heldin the ACCEPT field under the RM/COBOL system, alter the definitionof the data item in your program to PIC X(10) or PIC 9(6).
Display of Input Data in Concealed ACCEPT FieldsIf you have specified OFF and ECHO clauses for the same ACCEPTstatement in your program, the RM/COBOL system will conceal anydata entered during input for that statement but on completion of inputwill display the data. This COBOL system, however, will not display thedata for this ACCEPT statement once input has been completed.
Solution
If you wish to display the data input for an ACCEPT statement with theOFF and ECHO clauses specified, you must add a DISPLAY statementafter the ACCEPT statement.
Conversion S
eries 3RM/COBOL Conversion Issues
Compatibility Guide 7-15[93]
CG3PRO.C00 25Jun96 13:36:11 202874 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Open EXTEND of Nonexistent FileBecause setting the RM directive sets the NOOPTIONALFILE directive, ifyou try to open a non-existent file for I-O or EXTEND the run-timesystem will give an error message. For I-O, RM COBOL does the same.However, for EXTEND, RM/COBOL creates the file and opens it as ifyou had specified OUTPUT.
Solution
Several solutions are available:
Add the keyword OPTIONAL to the SELECT statement. Thismakes this COBOL system create the file and open it for OUTPUT.
Create the file, empty, before running your program.
Specify the OPTIONALFILE directive. This makes this COBOLsystem create the file and open it for OUTPUT. However, thebehavior with files opened for I-O will now differ fromRM/COBOL.
RM/COBOL Conversion Issues
7-16[94] Compatibility Guide
CG3PRO.C00 25Jun96 13:36:11 202874 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
CG3DAT.C00 26Jun96 13:52:08 91231 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Chapter 8
Converting RM/COBOLData Files
In order to run Convert3 you must supply it with the name of an existingRM/COBOL source program (or COPY-file) that is syntactically correct.This source program must contain the FD and SELECT...ASSIGN entries,with any associated record definitions, concerning the RM/COBOL datafile you want to convert.
You must convert all your data files, so that the file structures and theircontents can be used under this COBOL system.
Conversion of Data TypesThe Convert3 utility converts COMPUTATIONAL,COMPUTATIONAL-3, COMPUTATIONAL-6 and DISPLAY data fromRM/COBOL format to the formats used by this system. The followingsections describe how these types of data are converted.
COMP/COMPUTATIONAL DataThe RM/COBOL system represents COMP (or COMPUTATIONAL) datain packed decimal format with one character per byte stored in each leastsignificant four-bits. The most significant half-byte always contains zero.If the picture-string specifies a signed representation, an additional byteis added to the least significant end of the string: a negative value isrepresented by the hexadecimal value x"D", and a positive value isrepresented by the hexadecimal value x"B".
Consider the following examples:
Conversion S
eries 3
Compatibility Guide 8-1[95]
CG3DAT.C00 26Jun96 13:52:08 91231 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Value Picture Clause RM Representation(Hexadecimal)
1234 PIC 9(5) COMP 00 01 02 03 04
1234 PIC S9(5) COMP 00 01 02 03 04 0B
-1234 PIC S9(5) COMP 00 01 02 03 04 0D
The conversion program produced by Convert3 converts COMP datafields into DISPLAY format, with sign trailing separate. This iscompatible with this COBOL system’s treatment of RM/COBOL COMPfields in the source program when the RM directive is set. See the chapter Rebuild in the Conversion Series 2 Part for details. If the data itemis signed, the sign byte has the most significant half-byte set tohexadecimal value 2.
After conversion, the examples above are represented as follows:
Value Picture ClauseThis COBOL’sRepresentation(Hexadecimal)
1234 PIC 9(5) DISPLAY 30 31 32 33 34
1234 PIC S9(5) DISPLAY 30 31 32 33 34 2B
-1234 PIC S9(5) DISPLAY 30 31 32 33 34 2D
COMP-3/COMPUTATIONAL-3 DataThe RM/COBOL system represents COMP-3 data in packed decimalformat with the least significant half-byte holding the sign.
This sign half-byte contains the following values:
Field RM Sign half-byte value (Hexadecimal)
Unsigned F
Signed, Positive B or F
Signed, Negative D
Converting RM/COBOL Data Files
8-2[96] Compatibility Guide
CG3DAT.C00 26Jun96 13:52:08 91231 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Consider the following examples:
Value Picture Clause RM Representation(Hexadecimal)
1234 PIC 9(5) COMP-3 00 23 4F
1234 PIC S9(5) COMP-3 00 23 4F
-1234 PIC S9(5) COMP-3 00 23 4D
The only requirement for conversion is that the sign half-byte has to bechanged for signed positive fields to hexadecimal value C. Afterconversion, the examples above are represented as follows:
Value Picture ClauseThis COBOL’sRepresentation(Hexadecimal)
1234 PIC 9(5) COMP-3 00 23 4F
1234 PIC S9(5) COMP-3 00 23 4C
-1234 PIC S9(5) COMP-3 00 23 4D
COMP-6/COMPUTATIONAL-6 DataThe RM/COBOL system holds COMP-6 data in a similar format toCOMP-3 data, except there is no sign half-byte. If a sign is indicated inthe picture clause it is ignored and has no effect. The value held is alwayspositive.
Consider the following examples:
Value Picture Clause RM Representation(Hexadecimal)
1234 PIC 9(5) COMP-6 00 12 34
123456 PIC S9(6) COMP-6 12 34 56
Conversion S
eries 3Converting RM/COBOL Data Files
Compatibility Guide 8-3[97]
CG3DAT.C00 26Jun96 13:52:08 91231 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
In order to maintain the size and capacity of the data items, this COBOLsystem treats COMP-6 data items as this COBOL’s COMP format fields,and pads the field with binary zeros where necessary. After conversion,the examples above are represented as follows:
Value Picture Clause This COBOL’sRepresentation(Hexadecimal)
1234 PIC 9(5) COMP-6 00 04 D2
123456 PIC S9(6) COMP-6 01 E2 40
The 9(5) COMP field is extended by one byte containing binary zero inorder to maintain the size of the original item. See the sectionCOMPUTATIONAL-6 (COMP-6) Data Types in the chapter RM/COBOLSource Compatibility for details.
DISPLAY DataYou should be aware of the following differences between therepresentation of numeric DISPLAY format data items, with signINCLUDED, under the RM/COBOL system and this COBOL system:
This COBOL system does not encode a sign on the data if the data ispositive, whereas the RM/COBOL system increments the value ofthe most significant half-byte by one to denote a positive value.
This COBOL system increments the value of the most significanthalf-byte by four to denote a negative value. The RM/COBOLsystem increments the value of the byte by twenty-five (that is,hexadecimal 19).
When the RM directive is set, a DISPLAY format data item with no signclause associated is treated by this system as though you had specifiedthe SIGN TRAILING IS SEPARATE clause. However, when theRM"ANSI" directive is set, the same data item is treated as though youhad specified the SIGN TRAILING IS INCLUDED clause. This is thedefault state for such data items in this COBOL system. The Convert3utility also allows you to specify the type of sign used for DISPLAYformat data items. See the chapter Running Convert3 for details on howyou can do this.
Converting RM/COBOL Data Files
8-4[98] Compatibility Guide
CG3DAT.C00 26Jun96 13:52:08 91231 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Consider the following examples:
Value Picture ClauseRM Representation (Hexadecimal)
Leading Trailing
123 PIC 9(3) DISPLAY 31 32 33 31 32 33
123 PIC S9(3) DISPLAY 41 32 33 31 32 43
-123 PIC S9(3) DISPLAY 4A 32 33 31 32 4C
After conversion, these examples are represented as follows:
Value Picture ClauseThis COBOL’s Representation
(Hexadecimal)
Leading Trailing
123 PIC 9(3) DISPLAY 31 32 33 31 32 33
123 PIC S9(3) DISPLAY 31 32 33 31 32 33
-123 PIC S9(3) DISPLAY 71 32 33 31 32 73
Differences following ConversionThe following section lists slight differences which can occur followingconversion of your data files. You do not need to modify your programs.
Indexed Sequential Files with Duplicate AlternateKeys
If you convert an RM/COBOL indexed sequential data file withduplicate alternate keys, the time order of records with duplicatealternate keys is not preserved in the conversion.
Conversion S
eries 3Converting RM/COBOL Data Files
Compatibility Guide 8-5[99]
CG3DAT.C00 26Jun96 13:52:08 91231 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Program Modifications Required byConvert3
The following sections list the areas in which you may need to makemodifications to an RM/COBOL source program before you use it asinput to Convert3.
The REDEFINES ClauseConvert3 cannot process data files whose definition includes aREDEFINES clause. If a record description in the File Section contains aREDEFINES clause, you must divide this record description into separaterecord descriptions.
You must also make sure that each record type in a file with multiplerecord types is identifiable by either:
a user-written subroutine, or
an item that is common to each record type
See the section Record Type Specification in the chapter Running Convert3for more information about handling multiple record files.
The USAGE IS INDEX ClauseConvert3 cannot process items with USAGE IS INDEX in a recorddescription. If a record description contains such an item, you can alterthe item to have a picture-string of S9(4) COMP-1.
The USAGE Clause with Group ItemsConvert3 cannot process group items with a USAGE clause at the grouplevel. To overcome this, add a USAGE clause to each elementary item inthe group.
Continuation ColumnsConvert3 cannot process source program statements with a continuationmarker in column 7. This limitation applies only from the beginning ofyour source program to the end of the file section. To overcome it alter
Converting RM/COBOL Data Files
8-6[100] Compatibility Guide
CG3DAT.C00 26Jun96 13:52:08 91231 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
the layout of your source program so that it does not requirecontinuation markers.
The DECIMAL POINT IS COMMA ClauseConvert3 cannot process the DECIMAL POINT IS COMMA clause in theSPECIAL-NAMES paragraph. To overcome this limitation remove theDECIMAL POINT IS COMMA clause.
Uniqueness of Names in Record DescriptionsAll data-names in record descriptions must be unique. Therefore, youmust remove all qualified data-names from record descriptions in theRM/COBOL source program.
DEPENDING NamesIf a record description contains a DEPENDING phrase, the data-name inthe DEPENDING phrase must occur in the same record.
Picture-stringsThe maximum length of a picture-string in a record description is 20characters. However, you can overcome this limitation by splitting anypicture-strings which exceed this limit into two, and defining a FILLERitem with a picture-string which corresponds to the size of the secondhalf of the original string.
Conversion S
eries 3Converting RM/COBOL Data Files
Compatibility Guide 8-7[101]
CG3DAT.C00 26Jun96 13:52:08 91231 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Converting RM/COBOL Data Files
8-8[102] Compatibility Guide
CG3DAT.C00 26Jun96 13:52:08 91231 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
CG3RUN.C00 26Jun96 13:53:06 138622 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Chapter 9
Running Convert3
The first step in converting your RM/COBOL data files is to use theConvert3 utility to produce a file conversion program. You must input toConvert3 the RM/COBOL source program that created the data files youare converting. When you have created a file conversion program, youcan use it to read RM/COBOL data files and convert them to the formatused by this system.
You can use Convert3 in either of two modes: interactive or batch mode.
If you run Convert3 in interactive mode, prompts are output to yourscreen for you to enter the various parameters that control theproduction of the file conversion program.
If you run Convert3 in batch mode, you must supply the necessarycontrol parameters in a file.
Running Convert3 in Interactive ModeThe Convert3 utility is entirely menu-driven when run in the interactivemode. It has an on-line help facility on each menu, which you can accessby pressing the key configured as the help key on your machine. Thisdisplays a screen of information on the facilities available on each menu.
To invoke Convert3 enter the command:
convert3
Once you have invoked Convert3 the main menu is displayed. From thismenu you can select any of the following functions:
Help
File Details
Conversion S
eries 3
Compatibility Guide 9-1[103]
CG3RUN.C00 26Jun96 13:53:06 138622 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Printfile Name
Record Type Specification
Generate Program
Escape.
To select the function of your choice, press the associated function orcharacter key, as indicated in the menu.
The following sections describe these functions.
HelpThis function is available to you when the main menu is displayed, andwhen you select either the File Details function, the Printfile Namefunction or the Record Type Specification function.
When you select this function, a help screen is displayed for either themain menu or the function you have selected.
File DetailsSelecting this function on the main menu displays a screen whichprompts you to identify which data files produced by the RM/COBOLsource program are to be converted.
Enter the following information on the screen:
1. The FD name of the file to be converted, as it appears in theRM/COBOL source program.
2. The name of the RM/COBOL source program which created theoriginal data file.
3. The name of the file conversion program which Convert3 is togenerate. This name cannot be the same as that of the RM/COBOLsource program.
4. The setting of the RM directive. This can be either R forRM/COBOL, (which will cause ORGANIZATION SEQUENTIALfiles to be treated as Line Sequential with SIGN SEPARATE) or Afor RM/COBOL with the ANSI switch set (which will causeORGANIZATION SEQUENTIAL files to be treated as RecordSequential with SIGN INCLUDE). If your program contains anyOrganization Sequential files with COMP-3 data, you must use A.
Running Convert3
9-2[104] Compatibility Guide
CG3RUN.C00 26Jun96 13:53:06 138622 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
See your Object COBOL User Guide for full details of the RMCompiler directive.
5. The conversion of COMP-6 items to VS-COMP. This can be either Y,in which case behavior is as described in the section COMP-6/COMPUTATIONAL-6 Data in the chapter Converting RM/COBOLData Files, or N, in which case COMP-6 items are not converted toVS-COMP. The default setting is Y.
Press Enter to enter the data on this screen and return to the main menu.If you specify an invalid parameter, the screen is redisplayed for you tore-enter a valid one.
Press Escape to return to the main menu without saving your entries.
Printfile NameSelecting this function on the main menu displays a screen whichprompts you to enter the name of a file to which Convert3 will write allstatus or error messages. If you choose not to enter this parameter, allmessages are output to the screen.
Record Type SpecificationSelecting this function on the main menu displays a screen which allowsyou to specify the information needed by Convert3 to process data filesthat contain more than one record type. That is, you can provide theinformation Convert3 requires for data files that have more than one 01level entry in their File Descriptions. You can uniquely determine thetype of each record in such multiple-record type files by entering one(and only one) of the following parameters:
the name of a subprogram you have written which determines thetype of the records. Convert3 will call this subprogram when itgenerates a file conversion program. See the section IdentifyingRecord Types By Subroutine later in this chapter
the name of an item in the data file record whose value determinesthe type of the records.
Press Enter to enter the data on this screen and return to the main menu.If you specify an invalid parameter, the screen is redisplayed for you tore-enter a valid one.
Press Escape to return to the main menu without saving your entries.
Conversion S
eries 3Running Convert3
Compatibility Guide 9-3[105]
CG3RUN.C00 26Jun96 13:53:06 138622 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Identifying Record Types by SubroutineYou can use a subroutine to determine each record type in a data file withmultiple types of records. The file conversion program calls thissubroutine each time it reads a record from the RM/COBOL data file.The program passes the contents of the record to the subroutine whichmust use some method to determine the type of record. The subroutinethen returns a value to the file conversion program indicating the recordtype. This value is an index to the 01 level entries in the file’s FD entry.For example, if a record corresponds to the first 01 level entry in the FD,the subroutine should return the value 1. If a record corresponds to thethird 01 level entry in the FD, the subroutine should return the value 3.
The format of the CALL statement in the file conversion program is:
call "name" using record-name, record-number, record-length
where:
name is the subroutine-name that you have suppliedon this screen.
record-name is an alphanumeric data item referring to therecord that has just been read from theRM/COBOL data file.
record-number is a PIC 99 field into which your subroutinewill return the number identifying the recordtype.
record-length is a PIC 9(6) COMP item containing the lengthof the record. This is supplied only if you areconverting a binary sequential file.
Example
Below is an example of a subroutine that you could write to identify atype of record.
linkage section. 01 record-name. 03 filler pic x(6). 03 rec-id-field pic 9(6). 01 record-type pic 99. 01 record-length pic 9(6) COMP.
Running Convert3
9-4[106] Compatibility Guide
CG3RUN.C00 26Jun96 13:53:06 138622 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
procedure division using record-name,record-type,record-length. main-para. if rec-id-field < 10 move 1 to record-type else if rec-id-field > 9 and < 80 move 2 to record-type else move 3 to record-type end-if end-if exit program.
Identifying Record Types by Unique Record ItemThe file conversion program may be able to determine a type of record ina file with multiple types of records by examining the value of aparticular data item. However, it can do this only if this value uniquelydetermines the record type.
If this is true, enter the name of the record item on this screen as itappears in the FD entry in the RM/COBOL source program. Now youmust enter a list of level 88 conditions and the record numbers that eachof these conditions identify. The record number, as with the valuereturned by a subroutine, indexes the appropriate 01 level entry in the FD.
For example, you might make the following entries on this screen:
Identifying Data Item OR User Subprogram Name [REC-TYPE-ITEM ]
record value(s)number[1] [1 thru 15 ] [2] [16 ] [3] [17 19 21 24 thru 30 ] [4] [18 20 ] [5] [22 23 ] [6] [OTHERWISE ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
Conversion S
eries 3Running Convert3
Compatibility Guide 9-5[107]
CG3RUN.C00 26Jun96 13:53:06 138622 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
The sequence in which these entries appear is significant. See the sectionExample Parameter File later in this chapter.
If the identifying data item is nonnumeric, you must ensure that eachvalue you enter is in quotation marks. For example, if REC-TYPE-ITEMin the above screen display is declared as PIC XX, you must make thefollowing entries on the screen:
record value(s) number [1] ["1" thru "15" ] [2] ["16" ] [3] ["17" "19" "21" "24" thru "30" ] [4] ["18" "20" ] [5] ["22" "23" ] [6] [OTHERWISE ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
Binary Sequential FilesIn a binary sequential file with multiple record types, the file conversionprogram can identify a record type by its length as long as no two recordtypes have the same length. However, if they do, you will have to useeither the subroutine or unique identifier method to identify the recordtype.
Generate ProgramSelecting this function from the main menu generates the file conversionprogram. You must have previously supplied Convert3 with all of thenecessary parameters to enable it to generate this program.
The message:
Creating Source
is displayed while Convert3 generates the file conversion program.
If any errors occur during generation, relevant error messages aredisplayed on the screen. If you have specified the name of a printfilethese messages are also written to that file.
Running Convert3
9-6[108] Compatibility Guide
CG3RUN.C00 26Jun96 13:53:06 138622 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
When a file conversion program has been successfully generated you arereturned to the main menu.
EscapeLeaves the Convert3 utility and returns you to your main system prompt.You are asked to confirm that this is what you want to do.
Running Convert3 in Batch ModeYou can run Convert3 in batch mode by placing all necessary controlparameters in a parameter file and running Convert3 so that it readsparameters from this file rather than from the screen.
You can include parameters for several runs of Convert3 in the sameparameter file. This means that you can write a single parameter file toconvert all of your data files at once.
The Parameter FileThe parameter file is a free format line sequential file. You can specifyone parameter per line. You can leave blank lines in the parameter file toimprove readability since they are ignored by Convert3. You can alsoinsert comment lines in the parameter file by using an asterisk (*) as thefirst non-space character in the line.
The first word on each line of the parameter file identifies the type ofparameter you are specifying. This can be any of the following (in upper-or lowercase characters):
COMP6-COMPFD IDENTIFIER LISTFILE PROGRAM RUN SIGN SOURCEFILE SUBROUTINE
In addition, a line may start with a record number followed by a valid88-level condition.
Conversion S
eries 3Running Convert3
Compatibility Guide 9-7[109]
CG3RUN.C00 26Jun96 13:53:06 138622 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
The Listfile ParameterThe listfile parameter specifies the name of the file to which Convert3will write any status and/or error messages. The parameter has thefollowing format:
listfile file-name
If you specify neither a listfile parameter nor a file-name after listfile,messages are written to the screen.
The Sourcefile ParameterThe mandatory sourcefile parameter specifies the name of theRM/COBOL source file containing the description of the data file to beconverted. The parameter has the following format:
sourcefile file-name
The FD ParameterThe mandatory fd parameter specifies the name in the FD entry of thedata file to be converted as it appears in the RM/COBOL sourceprogram. The parameter has the following format:
fd file-name
The Program ParameterThe mandatory program parameter specifies the name of the fileconversion program that Convert3 will generate. The parameter has thefollowing format:
program program-name
The program-name must not be the same name used in the sourcefile orlistfile parameter.
The Subroutine ParameterThe subroutine parameter specifies the name of a subroutine that the fileconversion program can call to determine a type of record in a file withmore than one record type. The parameter has the following format:
subroutine program-name
Running Convert3
9-8[110] Compatibility Guide
CG3RUN.C00 26Jun96 13:53:06 138622 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
The Sign ParameterThe sign parameter specifies how the sign is represented in items withUSAGE DISPLAY. The parameter has the following format:
sign included separate
If you don’t supply a sign parameter, separate is assumed as the default.
The Identifier ParameterThe identifier parameter specifies the name of an item in the file recordwhose value can be used to uniquely determine a type of record in a filewith more than one record type. The parameter has the following format:
identifier item-name
Record Number ParametersIf you have specified an identifier parameter, you must specify a numberof parameters that indicate which values of the item named in theidentifier parameter correspond to which record types. Each parameterhas the following format:
record-number condition
where:
record-number indicates a record type (1 means the first 01level entry in the FD, 2 means the second 01level entry, and so on). Record identification iscarried out in the order in which the recordnumbers are specified.
condition is an 88-level record-type which, if true,indicates that the associated record-numbergives the correct record type. The OTHERWISEcondition indicates the correct record type forthose values of the item named in the identifierparameter that you have not previouslyspecified in the Record Number parameter.
You can specify these parameters in any order of record-number, butall record number parameters must immediately follow the identifierparameter.
Conversion S
eries 3Running Convert3
Compatibility Guide 9-9[111]
CG3RUN.C00 26Jun96 13:53:06 138622 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
See the section Example Parameter File later in this chapter for an exampleof the use of these parameters.
The Run ParameterThe run parameter invokes Convert3 with those parameters that alreadyhave been read. The parameter has the following format:
run
It does not matter whether Convert3 has successfully generated a fileconversion program for one set of parameters. Convert3 continues toread the next set until the next run parameter is encountered, at whichpoint Convert3 again tries the program generation process. This cyclecontinues until all parameters in the parameter file have been read.
You must supply a run parameter.
The COMP6-COMP ParameterThe comp6-comp parameter allows you to specify whether or not toconvert COMP-6 items to VS-COMP. The parameter has the followingformat:
comp6-comp [y/n]
where:
y gives behavior as described in the section COMP-6/ COMPUTATIONAL -6 Data in the chapter Converting RM/COBOL Data Files
n means COMP-6 items are not converted to VS-COMP.
The default is y.
Example Parameter FileThe following is an example of a parameter file that generates fileconversion programs for three RM/COBOL data files.
Running Convert3
9-10[112] Compatibility Guide
CG3RUN.C00 26Jun96 13:53:06 138622 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
************************************************** * Parameters for first run *************************************************** listfile history.lst sourcefile payroll1.cbl fd employee-file program progemp.cbl sign separate identifier employee-status 2 99 103 200 201 1 1 thru 2000 3 6786 9999 2 0 thru 9999 4 otherwise run
************************************************** * parameters for second run *************************************************** sourcefile payroll2.cbl * listing will go to history.lst fd branch-file sign included program program.cbl subroutine branchek run
************************************************** * parameters for third run *************************************************** listfile logfile sourcefile payroll2.cbl fd history-file program history.abc sign included run
Notes:
In the parameters for the first run, the record number parametersfollowing the identifier parameter must be in record number order.
You can use the word "otherwise" as the 88-level condition in arecord number parameter. If none of the previous record numberparameters has successfully determined the record type, the recordtype associated with the "otherwise" condition is assumed.
Conversion S
eries 3Running Convert3
Compatibility Guide 9-11[113]
CG3RUN.C00 26Jun96 13:53:06 138622 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Record identification using record numbers is carried out in theorder in which the parameters are presented in the parameter file.Thus, in the first run:
a. An item with one of the values 99, 103, 200, or 201 is in recordtype 2.
b. An item with any other value in the range 1 to 2000 is in recordtype 1.
c. An item with value 6786 or 9999 is in record type 3.
d. An item with any other value in the range 0 to 9999 is in recordtype 2.
e. An item with any other value is in record type 4.
You can specify the same record number more than once in thesame set of record number parameters.
The listfile parameter applies to all the runs in the parameter file.The same list file will be used until another listfile parameter isread. Thus, the file history.lst is used for the first two runs, and thefile logfile is used for the third run.
Running Convert3 with a Parameter FileTo run Convert3 with a parameter file, enter the command:
convert3 parameter-filename
Each set of parameters is validated by Convert3 before the file conversionprogram is generated. If any parameters are invalid, that particular fileconversion program is not generated, and Convert3 passes to the next setof parameters in the parameter file.
You can validate the parameters in a parameter file by entering:
convert3 parameter-filename VALIDATE
The contents of the parameter file are validated, but no file conversionprograms are generated.
Running Convert3
9-12[114] Compatibility Guide
CG3RUN.C00 26Jun96 13:53:06 138622 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
CG3USI.C00 25Jun96 13:36:12 30704 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Chapter 10
Using the FileConversion Program
When you have generated the file conversion program for anRM/COBOL data file, the next steps in converting the data file are to:
1. submit the file conversion program to this COBOL system toproduce an executable file
2. run the file conversion program.
Creating an Executable File ConversionProgram
To create an executable file, submit your program to this COBOL systemas you would any other COBOL program. Your Object COBOL UserGuide contains details.
If the file conversion program requires a subroutine to determine a typeof record in a file with different types of records, remember to write andcreate executable code for the subroutine before you try to run the fileconversion program.
Running the File Conversion Program You can run the file conversion program in either interactive or batchmode.
Conversion S
eries 3
Compatibility Guide 10-1[115]
CG3USI.C00 25Jun96 13:36:12 30704 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
To run the file conversion program in interactive mode, you supply thename of the file after the run command for this COBOL system. This isthe same as running any other program. Your Object COBOL User Guidecontains more information.
This command causes the display of the following prompt:
Please enter the input data file name
Enter the name of the RM/COBOL data file to be converted and pressEnter. This file must be the file for which this file conversion programwas generated.
Now the following prompt is displayed:
Please enter the output data file name
Enter the name of the COBOL system’s data file to which theRM/COBOL data file is to be converted and press Enter. This name mustnot be the same as the RM/COBOL data file.
If any errors occur during conversion, an error message is displayed onthe screen.
To run the file conversion program in batch mode, you use the runcommand for your COBOL system, but before you press Enter type:
program-file input-file output-file
where:
program-file is the intermediate or native code file for thefile conversion program
input-file is the name of the RM/COBOL data file to beconverted
output-file is the name to be given to the converted datafile.
Using the File Conversion Program
10-2[116] Compatibility Guide
CG3USI.C00 25Jun96 13:36:12 30704 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
CG3ERR.C00 25Jun96 13:36:13 47537 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Chapter 11
Convert3 and FileConversion Program
Error Messages
This chapter describes the error messages returned by Convert3 whengenerating the conversion program and the errors returned by theconversion program itself.
Convert3 Error MessagesConvert3 returns a result code to the calling program once it has finisheda run. This code is in the form of a 3-byte number in ASCII format. If thefirst byte of this number is a 0, it denotes that Convert3 has terminated itsrun successfully and has reported no errors. Any other numberappearing as the first byte in the result code indicates that Convert3 hasdetected an error.
If an error is reported, the first byte of the result code indicates the typeof that error as shown in the table below.
Conversion S
eries 3
Compatibility Guide 11-1[117]
CG3ERR.C00 25Jun96 13:36:13 47537 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
1st Byte InResult Code
Result Valuein Remaining
BytesError Type
1 nn Print file error
2 nn Created file error
3 nn Source file error
4 yy File entries (SELECT...ASSIGN) error
5 Record description (FD) error
6 Parameter description error
7 nn Dynamic stream error
Table 11-1. Error Message Identification
nn = relevant RTS error number, see your Error Messages for details.
yy = one of the following:
01 Multiple assign clauses found in file control entry
02 Multiple reserve clauses found in file control entry
03 Multiple organization clauses found in file control entry
04 Multiple access clauses found in file control entry
05 Multiple record clauses found in file control entry
07 Multiple file status clauses found in file control entry
08 Key word expected in file control entry but word found was "xxx" (where xxx is the actual word found)
10 External file name missing in assign statement
11 Data name defined in assign clause is a reserved word
12 Quote expected at end of external file-name
20 Nonnumeric entry in reserve clause
Convert3 and File Conversion Program Error Messages
11-2[118] Compatibility Guide
CG3ERR.C00 25Jun96 13:36:13 47537 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
30 Organization type not found in organization clause
32 Inconsistent file control entry
40 Access mode not specified in access clause
41 Relative key is a reserved word in record clause
50 Record name is a reserved word in record clause
60 The word record expected in alternate key clause number
61 Data-name-3 is a reserved word in alternate record number
62 The word duplicated expected in alternate record number
71 Data-name-4 is a reserved word in file status clause
90 Continuation found in file control section
If you receive an error code which starts with the number 5 or 6, then it isnot followed by a number to identify a specific error. Instead, these errorsare of a general nature and merely indicate that an error has occurred inthe record description, or the parameter description. If you receive one ofthese errors you can detect its specific cause by looking through theparameter list in the list file. If you did not specify a list file, thisparameter list is sent to the screen.
File Conversion Program Error MessagesWhen you try to run the file conversion program, you could receive oneof the following un-numbered error messages, all of which areself-explanatory:
i/p file name invalid
o/p file name invalid
The i/p and o/p data files have the same name
Error on opening i/p file
Error on opening o/p file
Error on reading i/p file
Conversion S
eries 3Convert3 and File Conversion Program Error Messages
Compatibility Guide 11-3[119]
CG3ERR.C00 25Jun96 13:36:13 47537 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Error on writing o/p file
"record type" record-type "at record-number" is invalid
Attempt to read beyond end of i/p file
where:
i/p file name= input file name o/p file name= output file name
If you should receive any of the above errors, the file conversion programterminates immediately.
Convert3 and File Conversion Program Error Messages
11-4[120] Compatibility Guide
CG3ERR.C00 25Jun96 13:36:13 47537 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
CGP004.C00 25Jun96 13:36:13 19712 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Part IV
Conversion Series 5
CGP004.C00 25Jun96 13:36:13 19712 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Contents of Part IV
Chapter 12 Introduction to Conversion Series 5
Chapter 13 DG Interactive COBOL Source Compatibility
Chapter 14 Reformatting a DG COBOL Source File
Chapter 15 Converting DG COBOL Data Files
Chapter 16 Running Convert5
Chapter 17 Using the File Conversion Program
Chapter 18 Error Messages
CGP004.C00 25Jun96 13:36:13 19712 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
CG5INT.C00 25Jun96 13:36:14 44049 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Chapter 12
Introduction toConversion Series 5
You need to take the three steps listed below in order to convert your DGInteractive COBOL application so that it is suitable for input to thisCOBOL system:
1. Use reform5 to reformat DG Interactive COBOL source programswritten in DG Interactive COBOL CRT format.
2. Submit your DG Interactive COBOL source programs to thisCOBOL system.
3. Use Convert5 to convert existing data files from DG InteractiveCOBOL format to the format used by this system.
DG Interactive COBOL Source ProgramsYour COBOL system includes certain language enhancements that allowyou to submit programs written in DG Interactive COBOL directly to thisCOBOL system. Provided your DG Interactive COBOL source programsconform to the standard file format for your operating system, thereshould be no problems in submitting most of these programs to thisCOBOL system. You should ensure that the expansion of tab charactersin literals is not significant to the operation of your program before it isprocessed by this COBOL system.
However, if your program is written in DG CRT format, you mustreformat the source file before you submit it to your COBOL system. Asource reformatting utility, reform5, is provided, and the chapters
Conversion S
eries 5
Compatibility Guide 12-1[123]
CG5INT.C00 25Jun96 13:36:14 44049 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Reformatting a DG COBOL Source File and Converting DG COBOL DataFiles describe how you use it.
You must set the DG directive when you submit your source code to thisCOBOL system if your source code contains DG Interactive COBOLfeatures that are not supported in the standard Micro Focus COBOLlanguage, or if user-defined words are reserved words in the Micro FocusCOBOL language. Refer to your Language Reference for a list of MicroFocus COBOL reserved words, and for a full definition of all the syntaxsupported in the standard Micro Focus COBOL language. This manualalso contains a full list of the additional DG Interactive COBOL featuresenabled in the Micro Focus COBOL language when you set the DGsystem directive. Your Object COBOL User Guide contains details ofhow to set this directive.
Converting Data FilesConvert5, the file conversion utility, converts specified indexed, relativeor sequential data files, from DG Interactive COBOL format to theequivalent format used by this system. This ensures that when you runyour DG Interactive COBOL programs in this COBOL environment, youcan still access existing data files which they have produced.
In order to convert your data files, you must supply Convert5 with thesource program which produced them.
The program that you specify must already be in a format that can beaccepted by this COBOL system.
You do not need to convert line sequential files since they are already in aformat that is compatible with this system’s requirements.
Enhancing your Converted Application Once you have successfully submitted your DG Interactive COBOLsource programs to this COBOL system, you may wish to take advantageof some of the advanced features offered to you by the system. Thesefeatures include:
ANSI ’85 syntax
IBM mainframe COBOL syntax
report writer syntax.
Introduction to Conversion Series 5
12-2[124] Compatibility Guide
CG5INT.C00 25Jun96 13:36:14 44049 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Full details on these features and their associated syntax can be found inyour Language Reference and Language Reference - Additional Topics.
In order to use these features you must specify certain system directives,when you submit your source programs to this COBOL system. Forexample, you must set the ANS85 directive if you use ANSI ’85 syntax inyour source programs. See your Object COBOL User Guide for fulldetails of all system directives, and the features they enable.
Conversion S
eries 5Introduction to Conversion Series 5
Compatibility Guide 12-3[125]
CG5INT.C00 25Jun96 13:36:14 44049 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Introduction to Conversion Series 5
12-4[126] Compatibility Guide
CG5INT.C00 25Jun96 13:36:14 44049 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
CG5SOU.C00 25Jun96 13:36:14 50778 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Chapter 13
DG Interactive COBOLSource Compatibility
All of the DG Interactive COBOL syntax as defined in revision 02, datedAugust 1984, of The Data General Interactive COBOL Programmer’sReference Manual is supported by your COBOL system, with theexception of:
UNDELETE RECORD
Support is not guaranteed for any of the syntax of the DG InteractiveCOBOL language that is not documented in the above revision of TheData General Interactive COBOL Programmer’s Reference Manual.
If your DG Interactive COBOL programs perform any screen-handlingoperations you must run the adiscf facility and select the DGscreen-handling configuration option before you run them. See yourProgrammer’s Guide to Creating User Interfaces for full details of thisutility.
The DG DirectiveYour DG Interactive COBOL source programs may contain:
DG Interactive COBOL syntax which is not found in the standardMicro Focus COBOL language
DG Interactive COBOL syntax which is found in Micro FocusCOBOL, but has a different interpretation at run time.
In either case you must specify the DG directive when you submit suchsource programs to this COBOL system. Your Object COBOL User Guidecontains full details on how to set such system directives.
Conversion S
eries 5
Compatibility Guide 13-1[127]
CG5SOU.C00 25Jun96 13:36:14 50778 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Your Language Reference - Additional Topics contains the DG syntaxwhich is not found in the standard Micro Focus COBOL language. Whenyou set the DG directive, the DG syntax is enabled in the Micro FocusCOBOL language.
Features which are syntactically the same as Micro Focus COBOLfeatures but have different behavior at run time, are described in thefollowing sections of this chapter. Unless you set the DG directive at thetime the object code is produced, this syntax behaves in the standardMicro Focus COBOL manner, as documented in your LanguageReference.You do not need to amend DG Interactive COBOL sourceprograms which contain these features, but if you try to submit them tothis COBOL system without setting the DG directive they may notbehave as you expect.
Reserved WordsYour Language Reference lists all the words that are reserved in yourversion of the COBOL system. If you have included any of these wordsas user-defined words in your DG Interactive COBOL program, weadvise that you use the REMOVE directive to disable the relevantreserved words in this COBOL system. See your Object COBOL UserGuide for details of this directive.
DG International Character SetThe environment dependent feature of DG Interactive COBOL whichallows you to use an extra 69 characters in addition to the 96 charactersin the ASCII set, is not supported by this COBOL system.
DG File Status and other Exception ValuesDG Interactive COBOL file status and other exception values are notsupported by this COBOL system, as they are environment dependent. Ifyou wish to maintain a common source for programs used by bothsystems, you should maintain COPY-files of the file status valuesreturned by each system.
DG Interactive COBOL Source Compatibility
13-2[128] Compatibility Guide
CG5SOU.C00 25Jun96 13:36:14 50778 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
CallsDG Interactive COBOL system calls are environment dependent, and arenot supported by this COBOL system. Under this COBOL system youcannot pass a switch in a CALL statement; you should use LinkageSection items to communicate between programs.
Linkage Section AccessDG Interactive COBOL allows a main program to access its LinkageSection but this facility is not supported by this COBOL system. Werecommend that if a program is to be accessed as a main program, youtransfer the Linkage Section entries into Working-Storage.
Arithmetic of Group Level ItemsDG Interactive COBOL allows arithmetic of group level items, but this isnot supported by this COBOL system. We recommend that you redefinesuch fields into numeric items to overcome this problem.
Run-time SwitchesDG Interactive COBOL run-time switches A to Z, inclusive, are mappedonto switches 1 to 26, respectively, in this COBOL system. See yourObject COBOL User Guide for details of the run-time switches.
Program Identification and Data-namesThe DG Interactive COBOL system allows the Program-ID and a dataitem in that program to have the same name. However, this COBOLsystem does not allow the use of the same name for the Program-ID anda data item in a program, requiring instead that each should be unique.We recommend that you either change the program-name in theProgram-ID and in any programs that call this program, or change thename of the data item.
Conversion S
eries 5DG Interactive COBOL Source Compatibility
Compatibility Guide 13-3[129]
CG5SOU.C00 25Jun96 13:36:14 50778 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
DG Interactive COBOL Source Compatibility
13-4[130] Compatibility Guide
CG5SOU.C00 25Jun96 13:36:14 50778 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
CG5REF.C00 25Jun96 13:36:14 31831 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Chapter 14
Reformatting a DGCOBOL Source File
Source programs written in DG Interactive COBOL CRT format cannotbe accepted by this COBOL system unless you first amend them using asource file formatter. This must alter the margins in these programs, andsplit any lines in them containing more than 72 characters, into lines of 72characters or fewer. The reform5 facility is a source file formatter,supplied with Conversion Series 5, which reformats source programs inCRT format so that they are compatible with the requirements of thisCOBOL system. Any similar source file formatter can be used to reformatyour programs if you do not wish to use reform5.
If you wish to supply DG Interactive COBOL programs written in CRTformat to the file conversion utility Convert5, you must amend them firstusing reform5, or a similar source formatter.
Using reform5To invoke reform5 enter the command:
reform5
Once you have invoked reform5 the following message is displayed onyour screen:
type in input file
In response, type the name of the source file which you wish to reformat,then press Enter. The following message is displayed on your screen:
type in output file
Conversion S
eries 5
Compatibility Guide 14-1[131]
CG5REF.C00 25Jun96 13:36:14 31831 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
The name which you type in reply to this message is the name given tothe reformatted source file. This file is now in a format which iscompatible with the requirements of this COBOL system. Its name mustnot be the same as that of the input file.
To run reform5 in batch mode enter the command:
reform5 input-file output-file
where input-file and output-file are as described above.
Reformatting Rules The reform5 utility amends your source program according to thefollowing rules:
1. If the character in column 1 is an indicator (*/-), reform5 appendssix spaces to the beginning of a line.
2. If the character in column 1 is any non-space character notmentioned in rule 1, reform5 appends seven space characters to thebeginning of the line.
3. If area A (columns 1 to 4 inclusive) contains all spaces, reform5appends seven additional space characters to the beginning of theline. However, if the entire line contains spaces, it outputs a single72 character line containing spaces.
4. If a line is too long to fit onto a single 72 character line, reform5breaks it onto subsequent lines, up to a maximum of three. Wherepossible, these breaks occur at a space character to preserve theprogram’s readability.
5. If a line is expanded beyond 132 characters, reform5 truncates theline to 132 characters. This prevents any pseudo comment areasfrom being included in the program source.
If you wish, you can use any source formatter that amends your sourceprogram according to the above rules; you are not restricted to usingreform5.
Reformatting a DG COBOL Source File
14-2[132] Compatibility Guide
CG5REF.C00 25Jun96 13:36:14 31831 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
CG5DAT.C00 25Jun96 13:37:00 76935 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Chapter 15
Converting DG COBOLData Files
This chapter describes the Convert5 utility, which you must use to beable to convert your DG Interactive COBOL data files to Micro FocusCOBOL data file format. When you use the Convert5 utility, a fileconversion program is produced, which itself can be used to convertyour data files. See the chapter Using the File Conversion Program fordetails on using the file conversion program.
In order to run Convert5 you must supply it with the name of an existingDG Interactive COBOL source program (or COPY-file) that issyntactically correct. This source program must contain the FD andSELECT ... ASSIGN entries, together with any associated recorddefinitions, for the DG Interactive COBOL data file which you want toconvert. See the chapter Running Convert5 for details on runningConvert5.
Supported Data File Types Convert5 can convert sequential, relative and indexed files from DGInteractive COBOL format to Micro Focus COBOL format. You do notneed to convert line sequential files as these are already in a formatwhich is compatible with this COBOL system’s requirements.
Sequential FilesConvert5 supports sequential files with either fixed or variable lengthrecords. The default record type has fixed length records. However, it
Conversion S
eries 5
Compatibility Guide 15-1[133]
CG5DAT.C00 25Jun96 13:37:00 76935 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
will handle a sequential file with variable length records if theRECORDING MODE IS VARIABLE clause is included in the FD entry.
Relative FilesBefore transferring relative files to this COBOL environment, you mustreformat them. To do this, you must add a four-byte field containing eachrecord’s relative key, to the start of every record contained in the originaldata file. Figure 15-1 is an example of a program which performs thisreformatting for a specified relative file. It must be run on your DGmachine.
identification division. program-id. rel2seq. date-written. 10/22/85. * * this program converts a dg relative file to a * format suitable for subsequent conversion * for use with the Micro Focus system * environment division. configuration section. source-computer. dg-10. object-computer. dg-10. * input-output section. file-control.
select relative-file assign to disk "dgrelative" organization is relative access is sequential relative key is relative-key file status is file-stat.
select mf-file assign to disk "mfrelative" organization is sequential access is sequential file status is file-stat.
data division. file section. fd relative-file label records are omitted. 01 relative-rec pic x(20).
Converting DG COBOL Data Files
15-2[134] Compatibility Guide
CG5DAT.C00 25Jun96 13:37:00 76935 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
fd mf-file label records are omitted. 01 mf-rec. 03 mf-key pic 9(9) comp. 03 mf-data pic x(20).
working-storage section. 01 relative-key pic 9(4) comp value 0. 01 file-stat pic xx value "00". 01 relative-flag pic 9 value 0. 01 relative-cnt pic 9(9) value 0. 01 mf-cnt pic 9(9) value 0.
procedure division. main-procedure section. main-proc1. open input relative-file output mf-file. perform read-write until relative-flag = 1. display "relative records read = " relative-cnt. display "mf records written = " mf-cnt. close mf-file relative-file. stop run.
read-write section. read-write1. read relative-file at end move 1 to relative-flag go to read-write-exit. if file-stat not = "00" display "input file status = " file-stat stop run. add 1 to relative-cnt. add 1 to mf-cnt. move relative-key to mf-key. move relative-rec to mf-data. write mf-rec. if file-stat not = "00" display "output file status = " file-stat stop run.
read-write-exit. exit.
Figure 15-1. Relative File Reformatting
Once you have reformatted your data file, following the guidelines givenin Figure 15-1, reform5 can read it sequentially and convert it to therelative format used by this system.
Conversion S
eries 5Converting DG COBOL Data Files
Compatibility Guide 15-3[135]
CG5DAT.C00 25Jun96 13:37:00 76935 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Indexed FilesYou must pass any indexed data files which you wish to convert to Micro Focus COBOL format, through the DG Interactive COBOL utilityREORG. This enables Convert5 to read the data portion of the filessequentially. It can then convert them to the indexed format used by thissystem.
DG Data TypesThe following types of DG data are supported by this COBOLenvironment:
COMP This is identical to COMP in this COBOL system.
DISPLAY This format obeys the same rules as the DISPLAY formatin this COBOL system, except that any processing signsare stored differently. Convert5 converts the DG formatto the standard ASCII format. However, if you wish toemulate the DG behavior you can do so by manuallyamending your source code before you run Convert5.You must change the definition of these fields fromsigned numeric to alphanumeric. If you do this you mustalso set the SIGN"EBCDIC" parameter when you submityour code to this COBOL system.
You should note that Convert5 does not support the DG INDEX dataformat.
Source File RestrictionsYou should be aware of the following restrictions while using Convert5:
1. You must supply Convert5 with DG Interactive COBOL sourcecode or COPY-files that are syntactically correct.
2. You must make sure that no USAGE IS INDEX, REDEFINES orRENAMES clauses appear in the record descriptions contained inyour source code. The interpretation of records that contain suchclauses is ambiguous and thus Convert5 is unable to handle them. Ifyour source code does contain record descriptions that use USAGEIS INDEX, REDEFINES or RENAMES, before using Convert5 youshould first split such record descriptions into separate descriptions.
Converting DG COBOL Data Files
15-4[136] Compatibility Guide
CG5DAT.C00 25Jun96 13:37:00 76935 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Next, before you try to convert the relevant files, ensure that theserecords are identifiable, either by a record type field or via asubroutine. You must write such a subroutine yourself.
3. You will normally need to define the record structure of multiplerecord files if Convert5 is to run successfully. See the chapterRunning Convert5 for details.
4. The Convert5 program does not interpret those statements in yoursource program which begin with a continuation mark in column 7.Convert5 returns an error if it detects such a marker in an area ofthe source program which it needs to analyze.
5. The time order of duplicate alternate keys in indexed files cannot bepreserved when you convert such files.
6. FD and SELECT ... ASSIGN entries can be contained in a COPY-fileprovided the COPY statement is of the form:
COPY "filename".
7. Convert5 does not support any other form of the COPY statement.
8. The USAGE clause is not supported for group level data-items.
9. The phrase DECIMAL POINT IS COMMA is not supported byConvert5.
10. As all data-names in a record definition must be unique, you cannotsupply Convert5 with DG Interactive COBOL source code whichincludes qualifiers in a record.
11. Convert5 assumes that any depending name occurs in the samerecord.
12. No picture-string must be greater than 20 characters in length.
13. Composite picture-strings must not contain numeric characters.
If you supply Convert5 with DG Interactive COBOL source code that issyntactically incorrect, it outputs an error message only if it detects thesyntax error. It will then close any open files and abandon theconversion. However, Convert5 may not detect that the supplied code isinvalid and may proceed to create a file conversion program. If you thenrun this program, it may convert data incorrectly. We thus stronglyadvise that you ensure that the code which you supply to Convert5 issyntactically valid.
Conversion S
eries 5Converting DG COBOL Data Files
Compatibility Guide 15-5[137]
CG5DAT.C00 25Jun96 13:37:00 76935 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
We also advise that you supply Convert5 with a DG Interactive COBOLsource program which writes rather than reads the data file which youwish to convert. This ensures that all of the necessary informationconcerning the data files can be found in the supplied source program.
The File Conversion ProcessOnce you have supplied Convert5 with the necessary parameters (see thechapter Running Convert5 for details) it reads the specified sourceprogram, and searches for certain key-words. It then extracts thenecessary information from the entries associated with these key-words.
The File-Control paragraph is the first entry for which Convert5 searches.This entry must be located in your main source file, and it must start inmargin A. Once Convert5 has found this entry, it looks for the SELECT ...ASSIGN statement relating to the file or record which you wish toconvert to Micro Focus COBOL format. This statement can be in the mainsource file, or in a COPY-file.
Having read and extracted the relevant information from the File-Controlentry and the SELECT ... ASSIGN statement, Convert5 searches for thefollowing key-words: FD, WORKING-STORAGE, LINKAGE andPROCEDURE. These words, together with their associated entries, can becontained either in the DG Interactive COBOL source file, or in aCOPY-file.
Convert5 extracts the relevant information from all of the abovestatements, which enables it to create a file conversion program. This fileconversion program is capable of loading a file in standard Micro Focusformat which has the same organization as that quoted in the SELECT ...ASSIGN statement in the original DG Interactive COBOL source file.
If the description of the DG Interactive COBOL data file does not matchits actual format, when you try to run the file conversion program it willreport an appropriate error message and abort the current fileconversion. In this situation you must provide a source file descriptionthat Convert5 is able to process.
Converting DG COBOL Data Files
15-6[138] Compatibility Guide
CG5DAT.C00 25Jun96 13:37:00 76935 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
CG5RUN.C00 25Jun96 13:37:00 138772 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Chapter 16
Running Convert5
The first step in converting your DG Interactive COBOL data files is toproduce a file conversion program. This program reads DG InteractiveCOBOL data files and converts them to Micro Focus COBOL data fileformat.
You use the Convert5 utility to produce a file conversion program. Theinput to Convert5 is the name of an existing DG Interactive COBOLsource program, which must be syntactically correct. This sourceprogram must contain the FD and SELECT ... ASSIGN entries, togetherwith any associated record definitions, for the DG Interactive COBOLdata files you want to convert. The output from Convert5 is the fileconversion program.
You can use Convert5 in either of two modes: interactive or batch mode.
If you run Convert5 in interactive mode, prompts are output to yourscreen for you to enter various parameters that control the production ofthe file conversion program.
If you run Convert5 in batch mode, you must supply the necessarycontrol parameters in a file.
Running Convert5 in Interactive ModeThe Convert5 utility is entirely menu driven when run in the interactivemode. It has an on-line help facility for each menu, which you can accessby pressing the key configured as the help key on your machine. Thisdisplays a screen of information on the facilities available on each menu.
Conversion S
eries 5
Compatibility Guide 16-1[139]
CG5RUN.C00 25Jun96 13:37:00 138772 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
To invoke Convert5 enter the command:
convert5
Once you have invoked Convert5 the main menu is displayed. From thismenu you can select any of the following functions:
Help
File Details
Printfile Name
Record Type Specification
Generate Program
Escape.
To select the function of your choice, press the associated function orcharacter key, as indicated in the menu.
The following sections describe these functions.
HelpThis function is available to you when the main menu is displayed, andwhen you select either the File Details function, the Printfile Namefunction or the Record Type Specification function.
When you select this function, a help screen is displayed for either themain menu or the function you have selected.
File DetailsSelecting this function on the main menu displays a screen whichprompts you to identify which data files produced by the DG InteractiveCOBOL source program are to be converted.
You must enter all of the following information on the screen:
1. The FD name of the file to be converted, as it appears in the DGInteractive COBOL source program.
2. The name of a DG Interactive COBOL source program whichcontains the FD and SELECT ... ASSIGN entries, as well as anyrecord definitions, for the file to be converted.
Running Convert5
16-2[140] Compatibility Guide
CG5RUN.C00 25Jun96 13:37:00 138772 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
3. The name of the file conversion program which Convert5 is togenerate. This name cannot be the same as that of the DGInteractive COBOL source program.
Press Enter to enter the data on this screen and return to the main menu.If you specify an invalid parameter, the screen is redisplayed for you tore-enter a valid one.
If you wish to return to the main menu without saving your entries,press Escape.
Printfile-nameSelecting this function on the main menu displays a screen whichprompts you to enter the name of a file to which Convert5 will write allstatus or error messages. If you choose not to enter this parameter, allmessages are output to the screen.
When an error message is written to the printfile-name you have entered,the error message number is also displayed on your screen.
Record Type SpecificationSelecting this function on the main menu displays a screen which allowsyou to specify the information needed by Convert5 to process data filesthat contain more than one record type. That is, you can provide theinformation that Convert5 requires for data files that have more than one01 level entry in their File Descriptions. You can uniquely determine thetype of each record in such multiple-record type files by entering one ofthe following parameters:
the name of a subprogram you have written which determines thetype of the records. Convert5 will call this subprogram when itgenerates a file conversion program. See the section IdentifyingRecord Types By Subroutine later in this chapter.
the name of an item in the data file record whose value determinesthe type of the records. See the section Identifying Record Types ByUnique Record Item later in this chapter.
You cannot enter both of these parameters.
Press Enter to enter the data on this screen and return to the main menu.If you specify an invalid parameter, the screen is redisplayed for you tore-enter a valid one.
Conversion S
eries 5Running Convert5
Compatibility Guide 16-3[141]
CG5RUN.C00 25Jun96 13:37:00 138772 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Press Escape to return to the main menu without saving your entries.
Identifying Record Types by SubroutineYou can write a COBOL subroutine to determine each record type in adata file with multiple types of records. The file conversion program callsthis subroutine each time it reads a record from the DG InteractiveCOBOL data file. The conversion program passes the contents of therecord to the subroutine which must use some method to determine thetype of record. The subroutine then returns a value to the file conversionprogram indicating the record type. This value is an index to the 01 levelentries in the file’s FD entry. For example, if a record corresponds to thefirst 01 level entry in the FD, the subroutine should return the value 1. Ifa record corresponds to the third 01 level entry in the FD, the subroutineshould return the value 3.
The format of the CALL statement in the file conversion program is:
call "name" using record-name, record-number, record-length
where:
name is the subroutine-name that you have suppliedon this screen
record-name is an alphanumeric data item referring to therecord that has just been read from the DGInteractive COBOL data file
record-number is a PIC 99 field into which your subroutinewill return the number identifying the recordtype
record-length is a PIC 9(6) COMP item containing the lengthof the record. This is supplied only if you areconverting a binary sequential file.
Below is an example of a subroutine that you could write to identify atype of record.
linkage section. 01 record-name. 02 filler pic x(6). 02 rec-id-field pic 9(6). 01 record-type pic 99. 01 record-length pic 9(6) COMP.
Running Convert5
16-4[142] Compatibility Guide
CG5RUN.C00 25Jun96 13:37:00 138772 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
procedure division using record-name,record-type, record-length.
main-para. if rec-id-field < 10 move 1 to record-type else if rec-id-field < 80 move 2 to record-type else move 3 to record-type. exit program.
Identifying Record Types by Unique Record ItemThe file conversion program may be able to determine a type of record ina file with multiple types of records by examining the value of aparticular data item. However, it can do this only if this value uniquelydetermines the record type.
If this is true, enter the name of the record item on this screen as itappears in the FD entry in the DG Interactive COBOL source program.Now you must enter a list of level 88 conditions and the record numbersthat each of these conditions identify. The record number, as with thevalue returned by a subroutine, indexes the appropriate 01 level entry inthe FD.
For example, you might make the following entries on this screen:
Identifying Data Item OR User Subprogram-name [REC-TYPE-ITEM ]
record value(s) number
[1] [1 thru 15 ] [2] [16 ] [3] [17 19 21 24 thru 30 ] [4] [18 20 ] [5] [22 23 ] [6] [OTHERWISE ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
The sequence in which these entries appear is significant. See the sectionExample Parameter List later in this chapter for details.
Conversion S
eries 5Running Convert5
Compatibility Guide 16-5[143]
CG5RUN.C00 25Jun96 13:37:00 138772 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Binary Sequential FilesIn a binary sequential file with multiple record types, the file conversionprogram can identify a record type by its length as long as no two recordtypes have the same length. However, if they do, you will have to useeither the subroutine or unique identifier method described in theprevious sections to identify the record type.
Generate ProgramSelecting this function from the main menu generates the file conversionprogram. You must have previously supplied Convert5 with all of thenecessary parameters to enable it to generate this program.
The message:
Creating Source
is displayed while Convert5 generates the file conversion program.
If any errors occur during generation, relevant error messages aredisplayed on the screen. If you have specified the name of a printfilethese messages are also written to that file.
When a file conversion program has been successfully generated you arereturned to the main menu.
Escape Leaves the Convert5 utility and returns you to your main system prompt.You are asked to confirm that this is what you want to do.
Running Convert5 in Batch ModeIf you wish to run Convert5 in batch mode, you must first write aparameter file containing the parameters required by Convert5. Whenyou then run Convert5, it first validates all of the parameters you haveentered, and if these are all valid, each invocation of Convert5 extracts afull set of parameters from this file. If the parameters are not valid, noconversion takes place.
Running Convert5
16-6[144] Compatibility Guide
CG5RUN.C00 25Jun96 13:37:00 138772 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
The Parameter FileThis is a free format line sequential file which contains a parameter oneach line. If you enter any lines of space characters, these are ignored byConvert5.
The first word on each line of the parameter file identifies the type ofparameter you are specifying. This can be any of the following (in upper-or lower-case characters):
listfilesourcefilefdprogramsubroutineidentifierrun
If you enter an asterisk (*) as the first non-space character on any line,this line is treated as a comment line.
In addition a line may start with a record number (see the section RecordNumber Parameters later in this chapter) followed by a valid 88-levelcondition.
The Listfile ParameterThis parameter specifies the name of a file where any error messages orstatus values reported from Convert5 are recorded. When you specifythis parameter, it remains valid until you specify the parameter again, soensuring that all the information reported during a run can be placed inthe same listing file. If you specify the parameter again with anotherfile-name, subsequent messages are sent to this second file, while if youspecify the parameter with following spaces, these messages are sent toyour screen.
The parameter has the following format:
listfile file-name
If you specify neither a listfile parameter nor a file-name after listfile,messages are written to the screen.
Conversion S
eries 5Running Convert5
Compatibility Guide 16-7[145]
CG5RUN.C00 25Jun96 13:37:00 138772 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
The Sourcefile ParameterThis mandatory parameter gives the name of the DG Interactive COBOLsource program which Convert5 is to scan for information on the files tobe converted. The parameter has the following format:
sourcefile file-name
The FD ParameterThis mandatory parameter gives the internal name of the file as it isappears in the FD entry of the DG Interactive COBOL source programyou specified in the sourcefile parameter. The parameter has thefollowing format:
fd file-name
The Program ParameterThis mandatory parameter gives the name of the source program whichConvert5 creates. The parameter has the following format:
program file-name
The program-name must not be the same as the name used in thesourcefile or listfile parameter.
The Subroutine ParameterThis parameter gives the name of a COBOL subroutine that you supplyas it will appear in a CALL statement in the file conversion program. Forfiles which contain multiple records this subroutine will identify thecorrect record definition, allowing you to convert files of any logicalcomplexity. The parameter has the following format:
subroutine program-name
The Identifier ParameterThe identifier parameter specifies the name of an item in the file recordwhose value can be used to uniquely determine a type of record in a filewith more than one record type. The parameter has the following format:
identifier file-name
Running Convert5
16-8[146] Compatibility Guide
CG5RUN.C00 25Jun96 13:37:00 138772 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Record Number Parameters If you have specified an identifier parameter, you must specify a numberof parameters that indicate which values of the item named in theidentifier parameter correspond to which record types. Each parameterhas the following format:
record-number condition
where:
record-number indicates a record type (1 means the first 01 level entry in the FD, 2 means the second 01 level entry, and so on). Record identification is carried out in the order in which the record-numbers are specified.
condition is an 88-level record-type which, if true, indicates that the associated record-number gives the correct record type. The OTHERWISE condition indicates the correct record type for those values of the item named in the identifier parameter which you have not previously specified in the Record Number parameter. All record number parameters must immediately follow the identifier parameter, and must be in the order you want record identification to be carried out.
See the section Example Parameter List later in this chapter for an exampleof the use of these parameters.
The Run ParameterThe mandatory run parameter invokes Convert5 with those parametersthat have already been read. The parameter has the following format:
run
Example Parameter ListThe parameter list shown below is an example of a parameter file thatyou could supply to Convert5. This file generates file conversionprograms for three DG Interactive COBOL data files.
Conversion S
eries 5Running Convert5
Compatibility Guide 16-9[147]
CG5RUN.C00 25Jun96 13:37:00 138772 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
********************************** * Parameters for first run *********************************** listfile history.lst sourcefile payroll1.cbl fd employee-file program progemp identifier employee-status 2 99 103 200 201 1 1 thru 2000 3 6786 9999 2 0 thru 9999 4 otherwiserun ********************************** * parameters for second run * ********************************** sourcefile payroll2.cbl * listing will go to history.lst fd branch-file program progbran.cbl subroutine branchek run ********************************** * last run * ********************************** listfile logfile sourcefile payroll2.cbl fd history-file program history.abc run
In the above example, the parameters for the first run are designed toprovide for a file comprising four record types. These records areidentified by a data item in one of the records. If this item has the value6786 or 9999, it is record type 3. If the values lie within the range 1 to 2000excluding 99, 103, 200 and 201, it is record type 1. Any other valueswithin the range 0 to 9999 are record type 2, while any values lyingoutside this range are record type 4.
The second file which is to be converted during the run of this parameterfile also contains multiple records. However, record identification in thiscase is carried out via the user-supplied subroutine named "branchek".
The third file converted on the final run comprises only one record type,and so record identification is not necessary.
Running Convert5
16-10[148] Compatibility Guide
CG5RUN.C00 25Jun96 13:37:00 138772 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
The above example illustrates that record identification via level 88 dataitems is carried out in the order in which the parameters are presented.
Note: You can identify the same record type more than once. You mayfind this useful if more than one parameter is required to cover all possible combinations of data value.
Running Convert5 with a Parameter FileTo invoke Convert5 in batch mode enter the command:
convert5 parameter-filename
where parameter-filename is the name of your parameter file.
Convert5 now runs in batch mode, extracting a full set of parametersfrom the parameter file with each invocation.
The parameters supplied in the file are always validated completely. Ifany errors are detected during this validation, no conversion takes place.
You can validate the entries in a parameter file by entering:
convert5 parameter-filename validate
If you enter this command, the contents of the parameter file arevalidated, but no conversion takes place, even if all of the parameters arevalid.
Conversion S
eries 5Running Convert5
Compatibility Guide 16-11[149]
CG5RUN.C00 25Jun96 13:37:00 138772 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Running Convert5
16-12[150] Compatibility Guide
CG5RUN.C00 25Jun96 13:37:00 138772 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
CG5USI.C00 25Jun96 13:37:01 38700 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Chapter 17
Using the FileConversion Program
When Convert5 has successfully created a file conversion program, youmust submit this to this COBOL system to create a file you can run underthat system. This executable file conversion program converts thespecified data files of the type described in the original DG InteractiveCOBOL program from DG Interactive COBOL format to Micro FocusCOBOL format. The following sections describe how you can do this.
Creating an Executable File ConversionProgram
To prepare an executable file conversion program, you need to submitthe program to this COBOL system as you would any other COBOLprogram. Refer to your Object COBOL User Guide for details. Youshould also submit any subprogram you have named which identifiesrecords to this COBOL system.
If the original DG Interactive COBOL source program which yousupplied to Convert5 was not syntactically correct, Convert5 may haveinterpreted it incorrectly. In this case you may receive an error when youtry to submit the file conversion program to your COBOL system.
Once you have obtained an intermediate code file, you are ready to run it.
Conversion S
eries 5
Compatibility Guide 17-1[151]
CG5USI.C00 25Jun96 13:37:01 38700 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Running the File Conversion Program When you run the file conversion program, it converts those data fileswhich conform to the description given in the FD and SELECT... ASSIGNentries in the original DG Interactive COBOL source program.
The command to run your file conversion program is the same commandas for running any other intermediate code file on your system. Refer toyour Object COBOL User Guide for details.
When you run the program interactively, you receive the followingprompt:
Please enter the input-data-filename
where the name you enter is a complete and unambiguous specification(including the file extension) of the specific data file which you wish toconvert from DG Interactive COBOL format. This file must comply withthe file type as specified in the FD and SELECT ... ASSIGN entries in youroriginal DG Interactive COBOL source program. It must be in thestandard file format for your operating system, and if it is in CRT format,you must supply it to a source file formatter before passing it to the fileconversion program, as described in the chapter Reformatting a DGCOBOL Source File.
Once you have entered the name of the DG Interactive COBOL data filethat you want to convert, the following prompt is displayed on yourscreen:
Please enter the output-data-filename
The name which you enter in response to this message will be the namethat the converted data file will take. This file-name must not be the sameas the input data file-name.
The file conversion program now proceeds to convert the data file fromDG Interactive COBOL format. If any problems are encountered duringthis process, a suitable error message is displayed on your screen. See thechapter Error Messages for a full list of possible errors you may receive.
Alternatively, you can run the file conversion program in batch mode.When you run the file conversion program in batch mode, you must addto the end of the command line the input-data-filename and theoutput-data-filename, which are as specified above.
Using the File Conversion Program
17-2[152] Compatibility Guide
CG5USI.C00 25Jun96 13:37:01 38700 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
CG5ERR.C00 25Jun96 13:37:01 46092 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Chapter 18
Error Messages
This chapter describes the format of, and lists, the error messages outputby your COBOL system.
Errors Reported by Convert5Convert5 returns a result code to the calling program once it has finisheda run. See the chapter Running Convert5 for details of the calling program.This result code is in the form of a three-byte number in ASCII format. Ifthe first byte of this number is a 0, it denotes that Convert5 hasterminated its run successfully and has reported no errors. Any othernumber appearing as the first byte in the result code indicates thatConvert5 has detected an error.
If an error is reported, the first byte of the result code indicates the typeof that error as shown in the table below.
Table 18-1. Error Message Identification
1st Byte InResultCode
Result Value InRemaining Bytes Error Type
1234567
nnnnnnyy
nn
Print file errorCreated file errorSource file errorFile entries (SELECT...ASSIGN) errorRecord description (FD) errorParameter description errorMemory error
Conversion S
eries 5
Compatibility Guide 18-1[153]
CG5ERR.C00 25Jun96 13:37:01 46092 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
nn = the relevant run-time system error number; see your Error Messages for details.
yy = one of the following:
01 Multiple assign clauses found in file control entry
02 Multiple reserve clauses found in file control entry
03 Multiple organization clauses found in file control entry
04 Multiple access clauses found in file control entry
05 Multiple record clauses found in file control entry
07 Multiple file status clauses found in file control entry
08 Key word expected in file control entry but word found was "xxx"(where xxx is the actual word found)
10 External file name missing in assign statement
11 Data name defined in assign clause is a reserved word
12 Quote expected at end of external file-name
20 Nonnumeric entry in reserve clause
30 Organization type not found in organization clause
32 Inconsistent file control entry
40 Access mode not specified in access clause
41 Relative key is a reserved word in record clause
50 Record name is a reserved word in record clause
60 The word record expected in alternate key clause number
61 Data-name-3 is a reserved word in alternate record number
62 The words "with duplicates" expected in alternate record number
71 Data-name-4 is a reserved word in file status clause
90 Continuation found in file control section
If you receive an error code which starts with the number 5 or 6, it is notfollowed by a number to identify a specific error. Instead, these errors areof a general nature and merely indicate that an error has occurred in therecord description or the parameter description respectively. If you
Error Messages
18-2[154] Compatibility Guide
CG5ERR.C00 25Jun96 13:37:01 46092 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
receive one of these errors, you can detect its specific cause by lookingthrough the parameter list in the printfile. If you did not specify aprintfile, this parameter list is sent to the screen.
Errors Reported by the ConversionProgram
When you try to run the file conversion program produced by Convert5you could receive one of the following un-numbered error messages, allof which are self-explanatory:
i/p file name invalid
o/p file name invalid
The i/p and o/p data files have the same name
Error on opening i/p file
Error on opening o/p file
Error on reading i/p file
Error on writing o/p file
"record type" record-type "at record-number" is invalid
Attempt to read beyond end of i/p file
where:
i/p file name= input file-name o/p file name= output file-name
If you receive any of the above errors, the file conversion programterminates immediately.
Conversion S
eries 5Error Messages
Compatibility Guide 18-3[155]
CG5ERR.C00 25Jun96 13:37:01 46092 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Error Messages
18-4[156] Compatibility Guide
CG5ERR.C00 25Jun96 13:37:01 46092 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
CGP005.C00 25Jun96 13:37:02 17702 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Part V
Index
CGP005.C00 25Jun96 13:37:02 17702 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Contents of Part V
Index
CGP005.C00 25Jun96 13:37:02 17702 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
CGINDX.C00 30Sep96 13:13:03 90148 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Index
AACCEPT, FROM COMMAND-LINE 1-6(22)ACCEPT statement 1-6(22), 2-8(36)
alphabetic data 2-8(36)concealed fields 7-15(93)fields at edge of screen 7-15(93)
ACTUAL KEY clause 1-8(24)ADIS, configuration 5-2(70)Alphabetic data, accepting 2-8(36)Alphanumeric data, comparisons 1-7(23)Arithmetic operations 1-5(21)
group level 13-3(129)undefined results 7-7(85)
ASCII 1-7(23)ASSIGN directive 1-8(24)
BBatch mode
Convert3 9-7(109)Convert5 16-6(144)
BDAM files 1-4(20)Bell 2-10(38)Binary sequential files 16-6(144)
record type 9-6(108)Bound checking 6-3(75)BOUND directive 6-3(75)BOUNDOPT directive 6-3(75)
CCall 1-10(26), 13-3(129)Call-by-number
E4 2-9(37)E5 2-10(38)E6 2-9(37)
Character set, international 13-2(128)COBOL.DIR 1-1(17)Column 7 8-6(100), 15-5(137)Column 72 2-3(31)Column 73 to 80 7-2(80)COLUMN PLUS 1 clause 2-9(37)Columns, screen 7-14(92)
COMMA, DECIMAL POINT clause 8-7(101)COMMAND extension subroutine2-10(38)—2-11(39)COMMAND-LINE 1-6(22)Communication, inter-program 1-10(26),2-7(35)COMP usage 6-4(76), 15-4(136)
conversion 8-1(95)redefinition 7-9(87)
COMP-1 usage 6-4(76), 7-12(90)COMP-3 usage
conversion 8-1(95)—8-2(96)sign representation 2-3(31)
COMP-6 usage 6-4(76)—6-5(77)conversion 8-1(95), 8-3(97)redefinition 7-9(87)
Comparisonsalphanumeric data 1-7(23)undefined results 7-7(85)
Compatibility, DG ICOBOL source13-1(127)—13-4(130)COMPUTE statement 1-5(21)—1-6(22)Concealed fields, accept 7-15(93)Continuation character 8-6(100), 15-5(137)Control sequences, DISPLAY statements7-8(86)Conversion, RM/COBOL source6-1(73)—6-6(78)Conversion program
DG ICOBOL 17-1(151)—17-2(152)error messages 11-1(117)—11-4(120)RM/COBOL 10-1(115)—10-2(116)
Conversion Series 3 4-1(65)—4-4(68)Conversion Series 5 12-1(123)—12-4(126)Convert3 8-1(95)—8-8(102)
batch mode 9-7(109)error messages 11-1(117)—11-4(120)interactive mode 9-1(103)running 9-1(103)—9-12(114)using 10-1(115)—10-2(116)
Convert5 15-1(133)—15-6(138),16-1(139)—16-12(150), 17-1(151)
batch mode 16-6(144)interactive mode 16-1(139)parameter file 16-7(145)parameter file example 16-9(147)running 16-1(139)—16-12(150)
Index
Compatibility Guide Index-1
CGINDX.C00 30Sep96 13:13:03 90148 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Converting filesDG ICOBOL 12-2(124)Microsoft COBOL v1.x 3-1(41)Microsoft COBOL v2.x 3-1(41)RM/COBOL 4-2(66)
COPY statement 15-5(137)CURPOS extension subroutine 2-10(38),2-12(40)
DData item, overflow 7-11(89)Data types, DG ICOBOL 15-4(136)Data-names 7-5(83), 13-3(129), 15-5(137)
DEPENDING phrase 8-7(101), 15-5(137)records 8-7(101)
DDNAME 1-6(22), 1-8(24)Debugging, MS COBOL v2.2 2-7(35)DECIMAL POINT phrase 8-7(101), 15-5(137)Declaratives 2-3(31)Delete byte 1-9(25)DELETE statement 1-9(25), 2-6(34)Deleting records 1-9(25), 2-6(34)DEPENDING phrase, data-names 8-7(101)DG directive 13-1(127)DG Interactive COBOL 12-1(123)—12-4(126)Directive
DG 13-1(127)RM 6-1(73)
DISK FULL 1-5(21)DISPLAY statements 1-6(22)
control sequences 7-8(86)DISPLAY usage 8-1(95), 15-4(136)
conversion 8-4(98)Duplicate keys 3-4(44)
alternate 15-5(137)
EE4 call-by-number 2-9(37)E5 call-by-number 2-10(38)E6 call-by-number 2-9(37)EBCDIC 1-7(23)ECHO clause 7-15(93)EJECT statement 2-4(32)End of file 7-14(92)Error messages 18-1(153)—18-4(156)
convert 3 11-1(117)—11-4(120)Convert5 18-1(153)DG conversion program 18-3(155)differences 1-4(20)Rebuild 3-9(49)
Escape function, Convert3 9-7(109)
ExampleConvert3 parameter file 9-10(112)convert5 parameter file 16-9(147)Rebuild 3-5(45)tabx 5-4(72)
Exception values 13-2(128)EXCODE extension subroutine 2-10(38),2-12(40)EXIST extension subroutine 2-10(38)
FFD clause 1-9(25), 15-5(137)FD parameter
Convert3 9-8(110)Convert5 16-8(146)
Field details function, Convert5 16-2(140)File
conversion using convert 310-1(115)—10-2(116)
conversion using Convert5 15-6(138)DG ICOBOL conversion 15-1(133)—15-6(138)End of 7-14(92)MS COBOL v1.x conversion 3-1(41)MS COBOL v2.x conversion 3-1(41)RM/COBOL conversion 8-1(95)—8-8(102)
File conversionDG ICOBOL 12-2(124)RM/COBOL 4-2(66)
File details function, Convert3 9-2(104)File I/O 1-8(24)
MS COBOL 2.2 2-5(33)File referencing 1-8(24)File status 1-9(25), 7-14(92)
DG 13-2(128)Filenames 2-5(33)FORMFEED statement 2-4(32)
GGenerate program function
Convert3 9-6(108)Convert5 16-6(144)
Group items, USAGE clause 8-6(100)
HHelp function
Convert3 9-2(104)Convert5 16-2(140)
Index
Index-2 Compatibility Guide
CGINDX.C00 30Sep96 13:13:03 90148 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
IIBM
migrating applications 1-4(20)OS/VS COBOL 1-1(17)—1-10(26)SAA AD/Cycle COBOL/370 1-1(17)VS COBOL II 1-1(17)—1-10(26)
IBM/370 1-1(17)—1-10(26)Identifier parameter
Convert3 9-9(111), 9-11(113)Convert5 16-8(146)
INDEX usage 2-5(33), 8-6(100), 15-4(136)Indexed files 1-4(20), 1-9(25), 15-3(135)
locking 7-13(91)Indicator character, DG 14-2(132)Initialization, Working-Storage 7-13(91)Inter-program Communication 1-10(26),2-7(35)Interactive mode, Convert3 9-1(103)Intermediate results 1-5(21)International character set 13-2(128)ISAM 1-9(25)ISAM files 1-4(20)Issues, RM/COBOL 7-1(79)—7-16(94)
KKBDAVIL extension subroutine 2-10(38),2-12(40).KEY file 3-4(44)
LLength
nonnumeric literals 7-1(79)record 1-9(25)
LENGTH OF phrase 2-12(40)LINE clause 2-9(37)Line sequential files, trailing spaces 7-7(85)Linkage Section 13-3(129)Listfile parameter
Convert3 9-8(110), 9-12(114)Convert5 16-7(145)
Literals, nonnumeric 7-1(79)LOCASE extension subroutine2-10(38)—2-11(39)LOCK MODE clause 6-2(74)Locking
file 7-13(91)record 2-6(34), 7-13(91)
MMF directive 2-7(35)Microsoft COBOL v 2.2 2-1(29)Microsoft extension subroutines 2-10(38)Migrating applications
DG I COBOL 12-1(123)IBM 1-4(20)Microsoft v2.2 2-2(30)RM/COBOL 5-1(69)
@Z_INDEX MAIN = MOVE statement7-12(90)
undefined results 7-7(85)MS COBOL v2.2 2-1(29)MS directive 2-3(31)
NNATIVE directive 1-7(23)NODYNAM directive 1-10(26)NOMINAL KEY clause 1-8(24)Nucleus 2-4(32)Numeric edited data 2-8(36)
OOFF clause 7-15(93)ON OVERFLOW phrase 2-7(35)ON SIZE clause 1-6(22)ON SIZE ERROR clause 7-11(89)OPEN
EXTEND 2-6(34), 7-16(94)I-O 7-16(94)
OPTIONAL phrase 2-6(34), 7-16(94)OPTIONALFILE directive 7-16(94)OS/VS COBOL 1-1(17)—1-10(26)Otherwise condition, Convert3 9-9(111)Overflow, data item 7-11(89)OVERFLOW phrase 1-6(22), 2-7(35)
PParagraph-names, duplicate 7-6(84)Parameter file 9-7(109)
Convert3 9-7(109), 9-12(114)Convert5 16-7(145)example, Convert3 9-10(112)Rebuild 3-7(47)
PERFORM statement 6-3(75)PERFORM-TYPE directive 6-3(75)PIC 9 1-6(22), 2-8(36)PIC S9(4) 7-12(90)
Index Index
Compatibility Guide Index-3
CGINDX.C00 30Sep96 13:13:03 90148 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
PICTURE strings 2-4(32)picture-strings 8-7(101), 15-5(137)POINTER usage 1-7(23)Printer output 7-9(87)Printfile name function
Convert3 9-3(105)Convert5 16-3(141)
Program parameterConvert3 9-8(110)Convert5 16-8(146)
PROGRAM-ID clause 7-5(83), 13-3(129)
RREAD statement 7-14(92)
locking 2-6(34)PREVIOUS 2-7(35)
READY TRACE 2-7(35)Rebuild 2-7(35), 3-1(41)—3-22(62)
error messages 3-9(49)example 3-5(45)parameter file 3-7(47)
RECORD KEY clause 1-8(24)—1-9(25)Record length 1-9(25)Record locking 2-6(34)Record number parameter, Convert3 9-9(111)Record type
binary sequential files 9-6(108), 16-6(144)identification 9-4(106)—9-5(107),
16-4(142)—16-5(143)identification, binary sequential files 9-6(108)
Record type functionConvert3 9-3(105)Convert5 16-3(141)
Record-names 8-7(101)RECORDING MODE clause 3-3(43)REDEFINES clause 2-5(33), 8-6(100), 15-4(136)Redefinition
COMP 7-9(87)COMP-6 7-9(87)
reform5 14-1(131)—14-2(132)using 14-1(131)
Reformatting source 14-1(131)—14-2(132)Relative files 1-4(20), 2-6(34), 15-2(134)
locking 7-13(91)REMOVE directive 13-2(128)REMOVE extension subroutine2-10(38)—2-11(39)RENAME extension subroutine 2-10(38)RENAMES clause 15-4(136)Reserved words 7-4(82), 13-2(128)RESET TRACE 2-7(35)REWRITE operations 7-7(85)RM directive 6-1(73)RM/COBOL
conversion 4-1(65)—4-4(68)issues 7-1(79)—7-16(94)migrating applications 5-1(69)source conversion 4-1(65), 6-1(73)—6-6(78)
Run parameterConvert3 9-10(112)Convert5 16-9(147)
Run-time switches 13-3(129)T 7-7(85)
@Z_INDEX LTR = SScreen handling
column specification 7-14(92)configuration 5-2(70)MS COBOL 2.2 2-8(36)scrolling 2-9(37)
Screen Section 2-8(36)Scrolling, screen 2-9(37)SEGMENT-LIMIT clause 2-4(32)Segmentation, numbering 7-5(83)SELECT statement 2-6(34), 7-16(94), 15-5(137)Sequential files 15-1(133)
locking 7-13(91)SET command 1-8(24)SET statement 1-7(23), 2-5(33)SIGN clause 1-7(23), 6-2(74)SIGN directive 1-7(23)Sign parameter, Convert3 9-9(111)Sign representation, COMP-3 2-3(31)Sorce conversion, RM/COBOL 4-1(65)Source code
column 7 8-6(100), 15-5(137)column 72 2-3(31)columns 73 to 80 7-2(80)reformatting 14-1(131)—14-2(132)
Source compatibilityDG 13-1(127)—13-4(130)RM/COBOL 6-1(73)—6-6(78)
Source conversionDG ICOBOL 13-1(127)—13-4(130)RM/COBOL 6-1(73)—6-6(78)
Source file, restrictions 15-4(136)Sourcefile parameter
Convert3 9-8(110)Convert5 16-8(146)
Spacing, on screen 2-9(37)Special-Names paragraph 2-4(32)Split key 3-4(44)START statement 2-7(35)
locking 2-6(34)Static linking 1-10(26)Subroutine parameter
Convert3 9-8(110)Convert5 16-8(146)
Switches, run-time 13-3(129)SYSIN 1-6(22)SYSOUT 1-6(22)
Index
Index-4 Compatibility Guide
CGINDX.C00 30Sep96 13:13:03 90148 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
TT, run-time switch 7-7(85)Tab characters 5-3(71)Table bound checking 6-3(75)@Z_INDEX MAIN = Tabx 5-3(71)
example 5-4(72)TRACE statement 2-7(35)TRACK AREA clause 1-9(25)TRACK-LIMIT clause 1-8(24)Trailing spaces, line sequential files 7-7(85)
UUNDELETE clause 13-1(127)UPCASE extension subroutine2-10(38)—2-11(39)USAGE clause 15-5(137)
group items 8-6(100)INDEX items 8-6(100)
VValidate directive, Convert3 9-12(114)VALUE clause 2-5(33)VS COBOL II 1-1(17)—1-10(26)
WWAIT clause 2-6(34)Working-Storage initialization 7-13(91)
Index Index
Compatibility Guide Index-5
CGINDX.C00 30Sep96 13:13:03 90148 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.
Index
Index-6 Compatibility Guide
CGINDX.C00 30Sep96 13:13:03 90148 Micro Focus Confidential Proof
Copyright (C) Micro Focus 1985-1996. All rights reserved.