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

Refactor the DESR application - COBOL Tutorial

From the course: Migrating COBOL Apps

Start my 1-month free trial

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…

Contents