C For Cobol Programmersby Jim Gearing
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… See more details below
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.
- Pearson Technology Group 2
- Publication date:
- Edition description:
- New Edition
- Product dimensions:
- 7.50(w) x 9.25(h) x 1.11(d)
Table of Contents
(Eacha chapter begins with "Introduction" and concludes with "Summary".)
Quick Guide to Chapters.
How to Use This Book.
1. From COBOL to C.
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.
2. Compiling, Preprocessor, Formatting, Comments.
Using Preprocessor Directives.
Copy Code into a Program.
Using White Space.
3. Defining Data in C.
Data Names in C.
Mixed Case in Data Names: Don't Do It.
Common C Data Types.
COBOL Data Types and Equivalent C Data Types.
A single character.
Alphanumerics of two or more characters (string).
Integerno decimal places.
Large integerno 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."
Where to Declare Data.
4. Instructions, Keywords, and Function Calls.
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.
5. Terminal Input/Output.
Format and display field(s) on the terminal.
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.
6. File Input/Output.
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.
How long is a record.
Printing special characters.
Fixed-Length Record Processing.
Write a fixed-length record to a file.
Read a fixed-length record from a file.
7. Moving Data.
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.
Types of Business Arithmetic in C.
C and COBOL Arithmetic Operators/Keywords.
Common Arithmetic Mistakes in C.
Basic Arithmetic"Compute" Style.
Basic Arithmetic"Adt To" Style.
Incrementing/Decrementing a Data Item.
Absolute Value of a Number.
Absolute value of an integer (int).
Absolute value of a long integer (long).
Absolute value of a double (double).
9. If, Case (EVALUATE), and Class Tests.
Test one or more conditions.
COBOL and C If Statements Compared.
Numeric and Single-Character Comparisons.
Greater than or equal.
Less than or equal.
Test Condition Delimiters.
And and Or.
If . . . then.
Nested if statements.
Curly braces and why you should use them.
Case (EVALUATE) Statements.
Test a single character for.
ASCII character range.
ASCII control character.
C language white space.
Printable character but not a space.
10. Flow of Control Statements.
IExecute a loop while a condition is true, while varying the condition.
(PERFORM ... VARYING ... UNTIL).
IExecute a loop while a condition is true.
IInfinite loops (intentional).
ICall a function which has no parameters.
ICall a function with parameters.
IGo to the bottom of a loop.
ITerminate a loop and go to the following statement.
IReturn control to calling function or to operating system.
IReturn control to operating system.
11. Calling Functions (Subprograms).
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.
Memory Between Function Calls.
Pointers Explained in English.
Using a Pointer as a Parameter in Another Call.
Return Value of a FunctionPart 2.
Calling Functions Using Elementary Data Items.
Calling Functions Using Structures.
Calling Functions Using Members of Structures.
Summary of Rules for Passing Parameters.
12. Table Handling.
What is an Array?
Tables in COBOL.
Arrays in C.
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.
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.
13. C Standards for a Business Environment.
Why Have Standards?
How Large Should a Standards Document Be?
Who Should Develop Standards and How?
Who Should Enforce Standards and How?
A Proposed Set of C Standards for a Business Environment.
Source Code Header File.
Program Constant Fields.
Structure typedef Names.
Precedence of Operators.
One Statement per Line.
White Space Between Lines.
White Space Within a Line.
Program Global Variables.
printf()and fprintf() Statements.
Banned Items, Constructs, and Techniques.
14. C++, or What's That OOP on Your Tie?
C++ as a Better C.
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.
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.
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++.
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.
and post it to your social network
Most Helpful Customer Reviews
See all customer reviews >