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.

Using a century window . . . . . . . . 638Using internal bridging . . . . . . . . . 639Moving to full field expansion. . . . . . . 641Using year-first, year-only, and year-last date fields 643Compatible dates . . . . . . . . . . . 643Example: comparing year-first date fields . . . 644Using other date <strong>for</strong>mats . . . . . . . . 644Example: isolating the year . . . . . . . . 645Manipulating literals as dates . . . . . . . . 645Assumed century window . . . . . . . . 646Treatment of nondates . . . . . . . . . 647Setting triggers and limits . . . . . . . . . 648Example: using limits . . . . . . . . . 649Using sign conditions . . . . . . . . . 650Sorting and merging by date . . . . . . . . 650Example: sorting by date and time . . . . . 651Per<strong>for</strong>ming arithmetic on date fields. . . . . . 651Allowing <strong>for</strong> overflow from windowed datefields . . . . . . . . . . . . . . . 652Specifying the order of evaluation . . . . . 653Controlling date processing explicitly . . . . . 653Using DATEVAL . . . . . . . . . . . 654Using UNDATE . . . . . . . . . . . 654Example: DATEVAL . . . . . . . . . . 655Example: UNDATE . . . . . . . . . . 655Analyzing and avoiding date-related diagnosticmessages . . . . . . . . . . . . . . . 656Avoiding problems in processing dates . . . . . 657Avoiding problems with packed-decimal fields 657Moving from expanded to windowed date fields 658Part 8. Improving per<strong>for</strong>mance andproductivity . . . . . . . . . . . 659Chapter 34. Tuning your program. . . 661Using an optimal programming style . . . . . 662Using structured programming . . . . . . 662Factoring expressions. . . . . . . . . . 662Using symbolic constants . . . . . . . . 663Grouping constant computations . . . . . . 663Grouping duplicate computations . . . . . 663Choosing efficient data types . . . . . . . . 664Choosing efficient computational data items . . 664Using consistent data types. . . . . . . . 665Making arithmetic expressions efficient . . . . 665Making exponentiations efficient . . . . . . 665Handling tables efficiently . . . . . . . . . 665Optimization of table references . . . . . . 667Optimizing your code . . . . . . . . . . 669Optimization . . . . . . . . . . . . 669Choosing compiler features to enhanceper<strong>for</strong>mance. . . . . . . . . . . . . . 671Per<strong>for</strong>mance-related compiler options . . . . 672Evaluating per<strong>for</strong>mance . . . . . . . . . 675Running efficiently with CICS, IMS, or VSAM . . 676Chapter 35. Simplifying coding . . . . 679Eliminating repetitive coding . . . . . . . . 679Example: using the COPY statement. . . . . 680Using Language Environment callable services . . 681Sample list of Language Environment callableservices . . . . . . . . . . . . . . 682Calling Language Environment services . . . 683Example: Language Environment callableservices . . . . . . . . . . . . . . 684Part 9. Appendixes . . . . . . . . 685Appendix A. Intermediate results andarithmetic precision . . . . . . . . 687Terminology used <strong>for</strong> intermediate results . . . . 688Example: calculation of intermediate results . . . 689Fixed-point data and intermediate results . . . . 689Addition, subtraction, multiplication, anddivision . . . . . . . . . . . . . . 689Exponentiation . . . . . . . . . . . . 690Example: exponentiation in fixed-pointarithmetic . . . . . . . . . . . . . 691Truncated intermediate results. . . . . . . 692Binary data and intermediate results . . . . 692Intrinsic functions evaluated in fixed-pointarithmetic . . . . . . . . . . . . . . 692Integer functions . . . . . . . . . . . 692Mixed functions . . . . . . . . . . . 693Floating-point data and intermediate results . . . 694Exponentiations evaluated in floating-pointarithmetic . . . . . . . . . . . . . 695Intrinsic functions evaluated in floating-pointarithmetic . . . . . . . . . . . . . 695Arithmetic expressions in nonarithmetic statements 695Appendix B. Complex OCCURSDEPENDING ON . . . . . . . . . . 697Example: complex ODO . . . . . . . . . . 697How length is calculated . . . . . . . . 698Setting values of ODO objects . . . . . . . 698Effects of change in ODO object value . . . . . 698Preventing index errors when changing ODOobject value . . . . . . . . . . . . . 699Preventing overlay when adding elements to avariable table . . . . . . . . . . . . 699Appendix C. Converting double-bytecharacter set (DBCS) data . . . . . . 703DBCS notation . . . . . . . . . . . . . 703Alphanumeric to DBCS data conversion(IGZCA2D) . . . . . . . . . . . . . . 703IGZCA2D syntax . . . . . . . . . . . 704IGZCA2D return codes . . . . . . . . . 704Example: IGZCA2D . . . . . . . . . . 705DBCS to alphanumeric data conversion (IGZCD2A) 706IGZCD2A syntax . . . . . . . . . . . 706IGZCD2A return codes . . . . . . . . . 707Example: IGZCD2A . . . . . . . . . . 707Appendix D. XML reference material 709XML PARSE exceptions with XMLPARSE(XMLSS)in effect . . . . . . . . . . . . . . . 709x<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!