C For Cobol Programmers

Paperback (Print)
Buy New
Buy New from BN.com
$34.58
Used and New from Other Sellers
Used and New from Other Sellers
from $1.99
Usually ships in 1-2 business days
(Save 95%)
Other sellers (Paperback)
  • All (15) from $1.99   
  • New (5) from $36.23   
  • Used (10) from $1.99   

Overview

Written by an experienced business data systems designer and programmer, this new tutorial provides an ideal introduction to C for the COBOL programmer who wants to become proficient in the powerful C language. Featuring side-by-side comparisons of the syntax and constructs of the two languages, C for COBOL Programmers uses the reader's knowledge of COBOL to build a framework for learning C quickly and easily. The book introduces coded examples in C early, and in the context of a business environment. A complete chapter is devoted to explaining the important differences between COBOL and C for data handling and I/O, while another chapter focusses on C programming standards as applied to business data processing. A valuable appendix cross-references COBOL commands to C commands, operators, and functions.

Here is the ideal book for the tens of thousands of COBOL programmers in business who want to become quickly proficient in C. Written by an experienced business data systems engineer, it is a true survival guide which uses the reader's knowledge of COBOL to build a framework for learning C easily and quickly.

Read More Show Less

Product Details

  • ISBN-13: 9780805316605
  • Publisher: Pearson Technology Group 2
  • Publication date: 1/2/1996
  • Edition description: New Edition
  • Pages: 548
  • Product dimensions: 7.50 (w) x 9.25 (h) x 1.11 (d)

Read an Excerpt

This book was born of rage.

When I first tried to learn the C language in 1985, I could not find a book that made sense to me. I had been designing business systems and programming COBOL for more than 15 years. All the books on C that I found were "self-referential." That is to say, the authors had been writing C for so long that they had forgotten what it was like not to know it. I gave up after a few months. I was enraged that nobody had written a readable and useful book.

One day in 1988 my client, Rob Gillette, dropped 20 C programs on my desk and said, "Here, Jim, learn C and finish this subsystem." I went back to the bookstore and found the books to be a little better than three years before, but still not very good. I learned C, but it was a painful experience.

In 1991 I began working on business systems being developed in C. It was at this time I realized that I could write the book I had been looking for: C for COBOL Programmers.

C is just another language. Much of it works like COBOL, but with symbols instead of words. Parts of C have assumptions different from COBOL, and parts have rules different from COBOL. The purpose of this book is to use your knowledge of COBOL to teach you C. The book shows you where C works the same way as COBOL and shows you where it's different. It also focuses on the parts of C used most often in business systems.

C has some very nice features and some that are a real pain in the neck, just like COBOL.

Come on, jump in! The water's not that cold!

0805306604P04062001

Read More Show Less

Table of Contents

(Eacha chapter begins with "Introduction" and concludes with "Summary".)

Quick Guide to Chapters.

Preface.

Acknowledgements.

How to Use This Book.

1. From COBOL to C.

Introduction.

Which C? Which COBOL? Which Computer?

Sample Programs: Free On-line or Cheap by Mail.

Evolution of C.

A Quick Survey of C Compared to COBOL.

Fundamental Concepts of COBOL and C Compared.

Program Organization in COBOL and C.

A Minimal COBOL Program (Two Versions).

A Minimal C Program.

How COBOL Translates to C.

Summary.

2. Compiling, Preprocessor, Formatting, Comments.

Introduction.

Compiling Cprograms.

Using Preprocessor Directives.

Copy Code into a Program.

Program Constants.

Statement Formatting.

Using White Space.

Inserting Comments.

Summary.

3. Defining Data in C.

Introduction.

Data Names in C.

Mixed Case in Data Names: Don't Do It.

Data Types.

Common C Data Types.

COBOL Data Types and Equivalent C Data Types.

A single character.

Alphanumerics of two or more characters (string).

Integer—no decimal places.

Large integer—no decimal places.

Large decimal number.

Inadequate decimal number.

Numeric literals and constants.

Record or group item.

Record or group item template.

Group item within another group item.

Alternate method for group item template.

Data type for "no value."

Small integer.

Where to Declare Data.

DataType Modifiers.

Storage Classes.

Automatic.

Static.

External.

Register.

Summary.

4. Instructions, Keywords, and Function Calls.

Introduction.

Why C Uses Few Keywords.

When to Use Keywords/Symbol Operators and When to Use Functions.

Functions Compared to COBOL Subprograms.

Return Value of a Function.

Function Prototypes (Call Parameter Templates).

Library Function Prototypes.

Coercion and Conversion of Parameters.

Summary.

5. Terminal Input/Output.

Introduction.

Terminal I/O.

Format and display field(s) on the terminal.

Format specifiers.

Carriage control.

Displaying special characters.

Read a string of characters from the terminal.

Read one character from the terminal.

Read and format numbers and/or characters from the terminal.

Convert an alphanumeric to an integer.

Convert an alphanumeric to a long integer.

Convert an alphanumeric to a decimal number.

Convert a single character to lowercase.

Convert a single character to uppercase.

Summary.

6. File Input/Output.

Introduction.

Sequential Files.

File Handling in C.

Variable-Length and Fixed-Length Records.

Opening and Closing Files.

Open a sequential file.

Close a sequential file.

Reading Variable-Length Files.

Read a string of characters from a file.

Format and extract field(s) from a string.

Read one character from a file.

Printing and Writing Variable Length Files.

Format and write field(s) to a file.

Format specifiers.

How long is a record.

Carriage control.

Printing special characters.

FILLER.

Fixed-Length Record Processing.

Write a fixed-length record to a file.

Read a fixed-length record from a file.

AFinal Comment.

Summary.

7. Moving Data.

Introduction.

Moving Numeric and Single-Character Data.

Move a number (assign).

Move a single character (assign).

Move a structure (assign).

Moving String Data.

Move a string.

Move the first n characters of a string.

Find the length of a string.

Find the defined length of any data item.

Move and format strings and/or numbers into a string.

Append one string to another one.

Summary.

8. Arithmetic.

Introduction.

Types of Business Arithmetic in C.

C and COBOL Arithmetic Operators/Keywords.

Common Arithmetic Mistakes in C.

Intermediate Results.

Overflow.

Rounding.

Basic Arithmetic—"Compute" Style.

Addition.

Subtraction.

Multiplication.

Division.

Remainder (modulus).

Basic Arithmetic—"Adt To" Style.

Add To.

Subtract From.

Multiply By.

Divide Into.

Remainder Into.

Incrementing/Decrementing a Data Item.

Absolute Value of a Number.

Introduction.

Absolute value of an integer (int).

Absolute value of a long integer (long).

Absolute value of a double (double).

Summary.

9. If, Case (EVALUATE), and Class Tests.

Introduction.

Test one or more conditions.

COBOL and C If Statements Compared.

Numeric and Single-Character Comparisons.

Equal.

Not equal.

Greater than.

Greater than or equal.

Less than.

Less than or equal.

Test Condition Delimiters.

And and Or.

If . . . then.

Parentheses.

Nested if statements.

Curly braces and why you should use them.

Other Features.

NEXTSENTENCE(Do nothing).

Implied subjects.

Condition-names.

String Comparisons.

Case (EVALUATE) Statements.

Class Test.

Test a single character for.

Alphabetic.

Alphanumeric.

ASCII character range.

ASCII control character.

C language white space.

Decimal digit.

Hexadecimal digit.

Lowercase letter.

Printable character.

Printable character but not a space.

Punctuation character.

Uppercase letter.

Summary.

10. Flow of Control Statements.

Introduction.

IExecute a loop while a condition is true, while varying the condition.

(PERFORM ... VARYING ... UNTIL).

IExecute a loop while a condition is true.

(PERFORM UNTIL).

IInfinite loops (intentional).

ICall a function which has no parameters.

(PERFORM).

ICall a function with parameters.

(CALL).

IGo to the bottom of a loop.

ITerminate a loop and go to the following statement.

IGO TO.

IReturn control to calling function or to operating system.

(GOBACK/STOP RUN).

IReturn control to operating system.

(STOP RUN).

Isummary.

11. Calling Functions (Subprograms).

Introduction.

Files and Functions.

Scope of Data.

Three Types of Functions.

C Functions that work like COBOL subprograms.

C Functions that work like COBOL paragraphs.

C Functions that work like COBOL "Super Paragraphs" or "Super Subprograms" Program Global Data.

Function Calls.

Memory Between Function Calls.

Parameter Passing.

Pointers Explained in English.

Using a Pointer as a Parameter in Another Call.

Return Value of a Function—Part 2.

Calling Functions Using Elementary Data Items.

Calling Functions Using Structures.

Calling Functions Using Members of Structures.

Summary of Rules for Passing Parameters.

Run-Time Parameters.

Summary.

12. Table Handling.

Introduction.

What is an Array?

Tables in COBOL.

Arrays in C.

Subscript Notation.

Relative Subscripting.

Offset versus Count.

Subscript 0 and Subscript 1.

Memory Contents at Run Time.

Running Off the End of an Array.

Defining Arrays in C.

One-Dimensional Array Definition.

Multidimensional Array Definition.

Character Array (String) Definition.

String Array Definition.

Structure Array Definition.

Initializing Arrays.

Default Initialization.

Initialization at Compile Time.

Initialization by Assigning Values at Run Time.

Memory For Arrays.

Allocating a Fixed Amount of Memory at Compile Time.

Allocating a Fixed Amount of Memory at Run Time.

Linked Lists: Allocating a Variable Amount of Memory at Run Time.

Allocate memory at run time.

Return allocated memory to the operating system.

Summary.

13. C Standards for a Business Environment.

Introduction.

Why Have Standards?

How Large Should a Standards Document Be?

Who Should Develop Standards and How?

Who Should Enforce Standards and How?

Portability.

References.

A Proposed Set of C Standards for a Business Environment.

Program Organization.

Source Code Header File.

Include Files.

#define Statements.

Program Constant Fields.

typedef Statements.

Function Prototypes.

Program Variables.

Structures.

Structure typedef Names.

Data Names.

Function Names.

Comments.

Functions.

Function Documentation.

Precedence of Operators.

One Statement per Line.

Line Length.

Indentation.

White Space Between Lines.

White Space Within a Line.

Increment/Decrement Operator.

if Statements.

switch Statements.

for Statements.

Parameters.

Program Global Variables.

while Statements.

printf()and fprintf() Statements.

Banned Items, Constructs, and Techniques.

Summary.

14. C++, or What's That OOP on Your Tie?

Introduction.

References.

C++ as a Better C.

Tighter Compiler.

Reduced Need for the Preprocessor.

More Convenient Comment Symbol.

Prototypes with Teeth.

Superior Call Parameter Handling.

Consistency in Parameter Use.

New I/O functions.

C++ as a Better C: Summary.

Beyond C: C++ as an Object-Oriented Programming.

Language.

Class: A Data Type Plus the Code That Manipulates It.

Class Libraries: Buy Them, Don't Write Them.

Encapsulation: Wrapping Code Around Data.

Public and Private Members of a Class.

Allocating and Releasing Memory.

Constructors And Destructors.

A Program that Uses the string Class.

Header File for the string Class.

Function File for the string Class.

Class Summary.

Inheritance: The Path to Code Reuse.

Polymorphism: How a Function Can Be in Two Places at Once.

Ad Hoc Polymorphism: Operator Overloading.

Ad Hoc Polymorphism: Function Overloading.

Inclusion Polymorphism: Function Overloading Across Derived Classes.

Persistence and the Problem Of C++.

Summary.

Appendices.

A. Official ANSI C Keyword List.

B. Actual C Keyword List.

C. ASCII Character Codes.

D. Powers of 2.

E. Precedence and Associativity of Operators.

F. Business Utility Programs.

1. A Business Rounding Routine.

2. A Business Truncation Routine.

3. Format a double as Dollars with Commas.

4. Format a double as an Integer with Commas.

G. COBOL to CCross-Reference.

H. Obtaining Code for Examples, Business UtilityPrograms, and Standards.

Index. 0805316604T04062001

Read More Show Less

Preface

This book was born of rage.

When I first tried to learn the C language in 1985, I could not find a book that made sense to me. I had been designing business systems and programming COBOL for more than 15 years. All the books on C that I found were "self-referential." That is to say, the authors had been writing C for so long that they had forgotten what it was like not to know it. I gave up after a few months. I was enraged that nobody had written a readable and useful book.

One day in 1988 my client, Rob Gillette, dropped 20 C programs on my desk and said, "Here, Jim, learn C and finish this subsystem." I went back to the bookstore and found the books to be a little better than three years before, but still not very good. I learned C, but it was a painful experience.

In 1991 I began working on business systems being developed in C. It was at this time I realized that I could write the book I had been looking for: C for COBOL Programmers.

C is just another language. Much of it works like COBOL, but with symbols instead of words. Parts of C have assumptions different from COBOL, and parts have rules different from COBOL. The purpose of this book is to use your knowledge of COBOL to teach you C. The book shows you where C works the same way as COBOL and shows you where it's different. It also focuses on the parts of C used most often in business systems.

C has some very nice features and some that are a real pain in the neck, just like COBOL.

Come on, jump in! The water's not that cold!



Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)