A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/TypeCobolTeam/TypeCobol/wiki/TypeCobolFunctionNutshell below:

TypeCobolFunctionNutshell · TypeCobolTeam/TypeCobol Wiki · GitHub

Skip to content Navigation Menu Search code, repositories, users, issues, pull requests...

Saved searches Use saved searches to filter your results more quickly

Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert TypeCobolFunctionNutshell

Olivier Smedile edited this page

Apr 10, 2017

·

6 revisions Functions and procedure in a Nutshell
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. 
Advantages of function/procedure

By comparison against a standard Cobol 85 program/nested program

Toggle table of contents Pages 55

Clone this wiki locally

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4