| iMatix home page | Libero home page | Libero documentation | << | < | > | >> |
![]() Version 2.32 |
Code fragments:
***************** MODULE FUNCTION NAME ***************** MODULE-FUNCTION-NAME. EXIT . PRIVATE-FUNCTION-NAME. MOVE OK-EVENT TO THE-NEXT-EVENT MOVE ERROR-EVENT TO THE-EXCEPTION-EVENT MOVE "YES" TO EXCEPTION-RAISED .
COBOL has a reputation for encouraging large unwieldy programs. This is justified to the extent that the language is verbose. I think it's more due to the fact that COBOL programs tend to be written and maintained under particular pressures: get it working, now, and who cares if it is a little unwieldy. You don't often see COBOL code competing on the open market for software where program size and speed are important.
People working in COBOL expect monsters, so often get them. Now, I've spent a lot of my life writing COBOL - perhaps half a million lines or so, and I know that this unnecessary suffering. Of course it is possible to write clean, organised, commented code without Libero. It is just a lot more effort, and I'm lazy.
This schema is for batch programs and subroutines. Batch programs are often the largest and most complex COBOL programs, and often benefit from a dialog. I've not seen a lot of subroutines that really needed a a dialog; the expression calculator is one example. Also, if you split a large batch program into smaller subroutines, these can be complex enough to warrant a dialog. Very roughly, I would reckon that a COBOL program of more than 1000 lines is worth building around a dialog.
000100 01 CALCPK-CONTROL. 000200*CONTENTS 000300 02 CALCPK-OPERATION PIC X. 000400 02 CALCPK-FEEDBACK PIC X. 000500 02 CALCPK-POINT-CHAR PIC X. 000600 02 CALCPK-ERROR-RETURN. 000700 03 CALCPK-ERROR-CODE PIC X(2). 000800 03 CALCPK-ERROR-MESG PIC X(30). 000900 02 CALCPK-ERROR-POSN PIC 9(2). 001000 02 CALCPK-EXPRESSION. 001100 03 EXPR-CHAR PIC X OCCURS 80 TIMES. 001200 02 CALCPK-RESULT PIC S9(9)V9(9). 001300 02 CALCPK-VARIABLE PIC S9(9)V9(9) OCCURS 5 TIMES.
| << | <
| > | >>
| Libero's Languages | The Awk Language | The C Language | The C++ Language | The COBOL Language | The GNU Borne-Again Shell Language | The Java Language | The Microsoft Setup Basic Language | The MS Visual Basic Language | The Perl Language | The Rexx Language | The UNIX C Shell Language | The UNIX Bourne Shell Language | The UNIX Korn Shell Language | The 80x86 Assembler Language |
![]() Copyright © 1996-97 iMatix |