-
Notifications
You must be signed in to change notification settings - Fork 25
TypeCobolFunctionNutshell
Olivier Smedile edited this page Apr 10, 2017
·
6 revisions
identification division.
program-id. MyProgram.
data division.
working-storage section.
01 myDate1 TYPE Date.
01 myDate2 TYPE Date.
01 numberOfDays pic 9(05) comp-5.
procedure division.
*Procedure to calculate the number of days between 2 dates
declare procedure daysBetween private
input date1 type Date
date2 type Date
output nbOfDays pic 9(05) comp-5.
procedure division.
* The details of the calcul is not detailled here...
move result to nbOfDays
.
end-declare.
*Call your procedure
call daysBetween input myDate1
myDate2
output numberOfDays
goback
.
end program MyProgram.
By comparison against a standard Cobol 85 program/nested program
-
Syntax shorter than a nested program or a program
-
Name your function with more than 8 characters
-
Specify your input/output parameters
-
Control your arguments (input/output) at compilation time
-
control the number of arguments and their types
-
control the size of parameters (2017)
-
-
Propose visibility mechanism (private and public)
-
Have the return code as an implicit parameter (2017)
-
Check if caller test the return code (2017)
-
Function chaining (2017/2018)
Introduction
TypeCobol language
-
In a nutshell
-
TypeCobol concepts
TypeCobol Editor
(Type)Cobol parser API
TypeCobol architecture
- Glossary
- Main phases
- How to extend the grammar and semantic check (full example)
- File
- Text
- Code analysis steps
- Program class parser
- Type checker
- Error handler
- Grammars Composition
- Code generation
- Compilation process
(Type)Cobol concepts / reference doc
Contributing