COBOL Copybook Supported File Formats

6-4 Oracle Fusion Middleware Users Guide for Technology Adapters complexType sequence --COBOL declaration : 10 Name PIC X5-- element name=Name type=string nxsd:style=fixedLength nxsd:padStyle=tail nxsd:paddedBy= nxsd:length=5 sequence complexType element User Inputs You are expected to provide the following information: ■ Target namespace for the native schema to be generated ■ Character set of the host computer on which the data file was generated. By default, this is set to EBCDIC ebcdic-cp-us. ■ Byte order of the host computer on which the data file was generated. By default, this is set to big-endian. ■ Record delimiter, which is typically the new line character, or no delimiter, or any user-supplied string. ■ Container tag name for generated native schema. By default, this is set to Root-Element. COBOL Clauses Table 6–1 describes COBOL clauses. The numeric types covered in Table 6–1 are stored as one character per digit. Support for clauses is defined as follows: ■ Y indicates that the clause is supported. ■ N indicates that the clause is not supported. ■ I indicates that the clause is ignored. Table 6–1 COBOL Clauses Numeric Types Stored as One Character Per Digit COBOL Clause Design-Time Support Run-Time Support Supported Synonyms Comments PIC Xn Y Y XXX… Alphanumeric – An allowable character from the character set of the computer. Each X corresponds to one byte. PIC An Y Y AA… Alphabetic – Any letter of the alphabet or space. Each A corresponds to one byte. PIC 9n DISPLAY Y Y 9999… Any character position that contains a numeral. Each nine is counted in the size of the item. OCCURS n TIMES Y Y Fixed-length array JUSTIFIED Y Y For A and X types. Right justifies with the space pad. Data is aligned at the rightmost character position. REDEFINES Y Y Allows the same computer memory area to be described by different data items. Native Format Builder Wizard 6-5 The numeric types described in Table 6–1 are stored as one character per digit. Table 6–2 describes the numeric types that are stored in a more efficient manner. PIC 9mV9n DISPLAY Y Y Size = n+m bytes OCCURS DEPENDING ON Y Y NA BLANK WHEN ZERO I I Ignored RENAMES N N This is rarely seen in COBOL Copybooks INDEX N N Four-byte index SYNCHRONIZE D I I SYNC NA POINTER N N NA PROCEDURE-P OINTER NA FILLER Y Y NA Table 6–2 COBOL Clauses Numeric Types Stored More Efficiently COBOL Clause Design-Time Support Run-Tim e Support Supported Synonyms Comments USAGE [IS] Y Y Both these keywords are optional. PIC 9n COMP Y Y COMPUTAT IONAL, BINARY, COMP-4 Length varies with n: ■ n = 1-4 2 bytes ■ n = 5-9 4 bytes ■ n = 10-18 8 bytes COMP-1 Y Y COMPUTAT IONAL-1 Single precision, floating point number that is four bytes long. COMP-2 Y Y COMPUTAT IONAL-2 Double precision, floating point number that is eight bytes long. PIC 9n COMP-3 Y Y PACKED-D ECIMAL, COMPUTAT IONAL-3 Two digits are stored in each byte. An additional half byte at the end is allocated for the sign, even if the value is unsigned. PIC 9n COMP-4 Y Y COMPUTAT IONAL-4 Treated the same as a COMP type and given its own data type for customizing requirements. PIC 9n COMP-5 N N Capacity of the native binary representation. PIC S9n DISPLAY Y Y PIC S99… Sign nibble in the rightmost zone by default. S is not counted in the size. Table 6–1 Cont. COBOL Clauses Numeric Types Stored as One Character Per Digit COBOL Clause Design-Time Support Run-Time Support Supported Synonyms Comments 6-6 Oracle Fusion Middleware Users Guide for Technology Adapters The following clauses can be added to impact the sign position. ■ SIGN IS LEADING Used with signed zoned numerics. ■ SIGN IS TRAILING Used with signed zoned numerics. ■ SIGN IS LEADING SEPARATE The character S is counted in the size. ■ SIGN IS TRAILING SEPARATE The character S is counted in the size. Table 6–3 describes picture editing types. PIC S9n COMP Y Y Same as COMP. Negative numbers are represented as twos complement. PIC S9n COMP-3 Y Y NA PIC 9mV9n COMP Y Y Length is the same as COMP. PIC 9mV9m COMP-3 Y Y Length = Ceiling n+m+12 Note: These assume that the numerics are stored using IBM COBOL format. If these are generated for other platforms with different data storage formats, then a custom data handler for that type must be written. Table 6–3 Edited Pictures Edited Pictures Supported Editing Types Unsupported Editing Types Edited alphanumeric Simple Insertion: Bblank 0 , Edited float numeric Special insertion: . period Edited numeric ■ Simple Insertion: Bblank 0 , ■ Special insertion: . period ■ Fixed Insertion: cs + - CR DB Inserts a symbol at the beginning or end ■ Floating Insertion: cs + - ■ Zero suppression: Z ■ Replacement insertion: Z + - c Table 6–2 Cont. COBOL Clauses Numeric Types Stored More Efficiently COBOL Clause Design-Time Support Run-Tim e Support Supported Synonyms Comments Native Format Builder Wizard 6-7 Edited pictures are more for presentation purposes and are rarely seen in data files. It is assumed that the editing symbols are also present in the data. For example, if you have: 05 AMOUNT PIC 999.99 then, this field is six bytes wide and has a decimal point in the data. Simple, special, and fixed insertions are handled by this method. Floating insertion, zero suppression, and replacement insertion are not supported.

6.1.2 Editing Native Schema Files

You can edit an existing native schema generated using the Native Format Builder wizard by sampling a delimited, fixed length, or complex type file. To edit an existing native schema select the Edit existing option in the Choose Type page of the Native Format Builder wizard, and click Browse to navigate to the location of the existing schema file and then select the native schema file that must be edited. The Native Format Builder wizard guides you through the editing of the native schema file. Figure 6–3 shows the Native Format Builder - Choose Type page with the Edit existing option selected. Figure 6–3 The Native Format Builder Wizard - Choose Type Page Before you edit a native schema file, you must ensure that the sample file specified in the annotation within the schema exists. This annotation is automatically added when the native schema is generated the first time from the sample file. For example, if the specified sample file path in the annotation is --NXSDWIZ:C:\Temp\Book1Out.csv:-- and if the file is not located at the path specified, then the wizard displays an error. Note: You can not edit native schemas generated from a Document Type Definition DTD or COBOL Copybook file types. 6-8 Oracle Fusion Middleware Users Guide for Technology Adapters

6.2 Native Schema Constructs

This section provides an overview of the various constructs of native schema used to translate the native format data to XML and also explains the usage of these native schema constructs. This section includes the following topics: ■ Section 6.2.1, Understanding Native Schema Constructs ■ Section 6.2.2, Using Native Schema Constructs

6.2.1 Understanding Native Schema Constructs

Table 6–4 shows the constructs applicable only on the schema tag. Table 6–4 Constructs Applicable Only on the schema Tag Construct Description byteOrder The byte order of the native data as bigEndian or littleEndian. encoding The encoding in which the actual data is stored. UTF-8 is typically recommended for interoperability and Unicode support. You can specify any legal encoding supported by the Java runtime environment. For a complete listing of supported encodings, visit http:download.oracle.comjavase6docstechnotesguides intlencoding.doc.html Note that you You can specify the encoding in the NXSD associated with the adapter proxy meta data. For example, nxsd:encoding=iso-8859-1 nxsd:alwaysQuote Set to true if quotes must be forced around native non-xml data in the outbound. headerLines A positive integer specifying the number of lines to be skipped, before translating the native data. headerLinesTerminated By Skip until the specified string, before translating the native data. standalone If declared, adds the standalone attribute in the XML declaration prolog of the translated XML, with the actual value as that specified in nxsd:standalone. Allowed values are true and false. stream Whether the data is stored as characters or bytes. Allowed values are CHARS and BYTES. uniqueMessageSeparato r String specifying the unique message separator in the native data, in case of a batch of messages. version The type of native data. Possible values are NXSD, DTD, XSD, and OPAQUE. xmlversion If declared, adds the XML declaration prolog to the translated XML with the actual value as that specified in nxsd:xmlversion. Allowed values are 1.0 and 1.1. outboundHeader String specifying the header value to be inserted in the outbound message. dataLines Integer specifying the number of lines to process in the native file.