10.07.2015 Views

Enterprise COBOL for z/OS V4.2 Programming Guide

Enterprise COBOL for z/OS V4.2 Programming Guide

Enterprise COBOL for z/OS V4.2 Programming Guide

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

...Procedure Division.Move Customer-Name to Original-Customer-Name...You could instead declare the customer names above as national data items byspecifying their PICTURE clauses as Pic N(20) and specifying the USAGE NATIONALclause <strong>for</strong> the items. National data items are represented in Unicode UTF-16, inwhich most characters are represented in 2 bytes of storage.RELATED CONCEPTS“Unicode and the encoding of language characters” on page 125RELATED TASKS“Using national data (Unicode) in <strong>COBOL</strong>” on page 126RELATED REFERENCES“NSYMBOL” on page 331“Storage of character data” on page 133PICTURE clause (<strong>Enterprise</strong> <strong>COBOL</strong> Language Reference)Using data items and group itemsRelated data items can be parts of a hierarchical data structure. A data item thatdoes not have subordinate data items is called an elementary item. A data item thatis composed of one or more subordinate data items is called a group item.A record can be either an elementary item or a group item. A group item can beeither an alphanumeric group item or a national group item.For example, Customer-Record below is an alphanumeric group item that iscomposed of two subordinate alphanumeric group items (Customer-Name andPart-Order), each of which contains elementary data items. These groups itemsimplicitly have USAGE DISPLAY. You can refer to an entire group item or to parts ofa group item in MOVE statements in the PROCEDURE DIVISION as shown below:Data Division.File Section.FDCustomer-FileRecord Contains 45 Characters.01 Customer-Record.05 Customer-Name.10 Last-Name Pic x(17).10 Filler Pic x.10 Initials Pic xx.05 Part-Order.10 Part-Name Pic x(15).10 Part-Color Pic x(10).Working-Storage Section.01 Orig-Customer-Name.05 Surname Pic x(17).05 Initials Pic x(3).01 Inventory-Part-Name Pic x(15)....Procedure Division.Move Customer-Name to Orig-Customer-NameMove Part-Name to Inventory-Part-Name...You could instead define Customer-Record as a national group item that iscomposed of two subordinate national group items by changing the declarations in26 <strong>Enterprise</strong> <strong>COBOL</strong> <strong>for</strong> z/<strong>OS</strong> <strong>V4.2</strong> <strong>Programming</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!