From the course: Migrating COBOL Apps
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Refactor the DESR application - COBOL Tutorial
From the course: Migrating COBOL Apps
Refactor the DESR application
- [Instructor] Let's take a look at our desr code and see how we might start to refactor it. Nano minus l desr.cob. We'll go down to the procedure division. And we can see at line 425 that the program has a simple set of steps within an outer loop. The loop sets the account number. And for each account, the code starting at line 426 performs three sections, and then displays the resulting PIN. The desr IP code starts at line 441 and we can see it has two parts, A and B. The function name isn't particularly helpful in understanding what it's doing. And neither of the data items. We can see both parts of the section start by setting the index I1 to one and then looping until I1 is 65. The first loop executes line 445 64 times. At each iteration dividing the value of account by two. And putting the remainder into the seventh AC array. We can deduce that the result of this loop is to represent the value in account…
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
-
(Locked)
Refactor the DESR application8m 25s
-
(Locked)
Remove redundant labels1m 19s
-
(Locked)
Resize applications1m 30s
-
(Locked)
Make code segments generic5m 30s
-
(Locked)
Challenge: Refactoring32s
-
(Locked)
Solution: Refractoring3m 14s
-
(Locked)
Introduce structure through subprograms2m 39s
-
(Locked)
Remove dead code3m 27s
-
(Locked)
Refactor data1m 58s
-
(Locked)
The challenges of migrating to a relational database4m 4s
-
(Locked)
Refactoring, continuous integration, and self-testing3m 52s
-
(Locked)
Observations on the paradigm shift2m 21s
-
(Locked)
The refactoring catalog2m 44s
-
-
-