Beginning COBOL for Programmers
Format: PDF / Kindle (mobi) / ePub
Beginning COBOL for Programmers is a comprehensive, sophisticated tutorial and modular skills reference on the COBOL programming language for established programmers. This book is for you if you are a developer who would like to—or must—add COBOL to your repertoire. Perhaps you recognize the opportunities presented by the current COBOL skills crisis, or are working in a mission critical enterprise which retains legacy COBOL applications. Whatever your situation, Beginning COBOL for Programmers meets your needs as an established programmer moving to COBOL.
Beginning COBOL for Programmers includes comprehensive coverage of ANS 85 COBOL features and techniques, including control structures, condition names, sequential and direct access files, data redefinition, string handling, decimal arithmetic, subprograms, and the report writer. The final chapter includes a substantial introduction to object-oriented COBOL.
Benefiting from over one hundred example programs, you’ll receive an extensive introduction to the core and advanced features of the COBOL language and will learn to apply these through comprehensive and varied exercises. If you've inherited some legacy COBOL, you’ll be able to grasp the COBOL idioms, understand the constructs, and recognize what's happening in the code you’re working with.
Today’s enterprise application developers will find that COBOL skills open new—or old—doors, and this extensive COBOL reference is the book to help you acquire and develop your COBOL skills.
other programming languages. Iteration, selection, and assignment are all done differently in COBOL than in languages like C, Java, and Pascal. But on the whole, these differences are fairly minor—more a question of nuance than a radical departure. When you are familiar with how iteration and selection work in other languages, COBOL’s implementation requires only a small mental adjustment. Assignment might create more of a hiccup, but there is nothing too radical even in that. The real difference
the quotient and the remainder in one operation: DIVIDE 215 BY 10 GIVING Quotient REMAINDER Rem. 01 Quotient PIC 999 VALUE ZEROS. 01 Rem PIC 9 VALUE ZEROS. Quotient Rem Before 000 0 After 021 5 Let’s Write a Program Listing 4-2 presents a very simple program that takes two single-digit numbers from the keyboard, multiplies them together, and then displays the result. This program uses only one of the three classic constructs of structured programming. These constructs are u Sequence u
control (by which I mean program statement execution) can fall into, or through. An open subroutine has access to all the data items declared in the main program, and it cannot declare any local data items. Although an open subroutine is normally executed by invoking it by name, it is also possible, unless you are careful, to fall into it from the main program. In BASIC, the GOSUB and RETURN commands allow you to implement open subroutines. Example 6-2 is a short BASIC program that illustrates
GetEmployeeData END-PERFORM CLOSE EmployeeFile DISPLAY "************* End of Input ****************" OPEN INPUT EmployeeFile READ EmployeeFile AT END SET EndOfEmployeeFile TO TRUE END-READ PERFORM UNTIL EndOfEmployeeFile DISPLAY EmployeeDetails READ EmployeeFile AT END SET EndOfEmployeeFile TO TRUE END-READ END-PERFORM CLOSE EmployeeFile STOP RUN. GetEmployeeData. DISPLAY "nnnnnnnnnSSSSSSSSSSSSSSSFFFFFFFFFFyyyyMMddG" ACCEPT EmployeeDetails. Summary This chapter provided a gentle introduction to
size and placement are merely conventions. The type code can be placed anywhere in the record and be of any size and any type. The ShopReceiptsFile uses the character H to indicate the ShopDetails record (the header record) and S to indicate the SaleReceipt record (the sales record). To detect the type of record read into the buffer, you could use statements such as IF TypeCode = "H" or IF TypeCode = "S". But this is COBOL. It offers a better way. You can define condition names to monitor the