From the course: Migrating COBOL Apps
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Introduce structure through subprograms - COBOL Tutorial
From the course: Migrating COBOL Apps
Introduce structure through subprograms
- [Narrator] An important way of managing complexity in an application, is to structure the code into manageable pieces, particularly with respect to the size of an individual program. I've taken out the permute code from the desr program, and created a subprogram called permute.cob. Let's have a look at it, nano -l permute.cob. I've kept the documentation and inserted it at the top of the program. In the data division, we have the local data items, the subprogram will use. The two indexes for bit permutation, and the permutation tables. Following this at line 1921, there's a linkage section which shows the parameters we expect to receive. Here we've got the permutation size, the from and to arrays, and the permutation table to use. We also have a copy of the AC structure, on which we'll perform the permutation calculations. At line 205, we have the procedure division, which has a using clause, which shows the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
Prepare to refactor code1m 56s
-
Refactor the DESR application8m 25s
-
Remove redundant labels1m 19s
-
Resize applications1m 30s
-
Make code segments generic5m 30s
-
Challenge: Refactoring32s
-
Solution: Refractoring3m 14s
-
Introduce structure through subprograms2m 39s
-
Remove dead code3m 27s
-
Refactor data1m 58s
-
The challenges of migrating to a relational database4m 4s
-
Refactoring, continuous integration, and self-testing3m 52s
-
Observations on the paradigm shift2m 21s
-
The refactoring catalog2m 44s
-
-
-