Join Peggy Fisher for an in-depth discussion in this video Solution: Update employee salaries, part of Learning COBOL.
- In this challenge, we're starting to introduce…file processing, specifically sequential file processing.…I don't know about you, but I like this section…because now, when I want to run my program multiple times…to check different input,…I don't have to type it in every time.…I can just read the file.…OK, I want to show you, again,…one solution to this challenge.…This challenge was designed to have us…open an input file, apply a change to the salary field…for the employees to give them a 3% raise…and create a new employee file.…
But I did add a little twist: I wanted to see…how you would do if I asked you to…close the file in the program and reopen…the new employee file as input the second time,…and then use that information to print a report.…All right, let's walk through the code.…We start on line seven in our file-control section…by defining our two files.…The employee file starts as an input file,…and it's assigned to the file EES.DAT.…Then, on line 11, we have to create a new employee file…with the new salaries and that's assigned to EES.NEW.…
This course is designed to help new and experienced programmers alike add COBOL (or add COBOL back) to their skill set. Peggy Fisher shows how to get a COBOL development environment up and running and how to start programming. She reviews COBOL's data types and constants, control structures, file storage and processing methods, tables, and strings. Challenges issued along the way will help you practice what you've learned.
- Downloading and installing Cygwin and GNU COBOL
- Editing, compiling, linking, and running COBOL programs
- Describing data in COBOL
- Working with verbs and expressions
- Using branching
- Reading and writing sequential files
- Updating and deleting records
- Working with relative and indexed files
- Creating and searching tables
- Handling strings