Presentation is loading. Please wait.

Presentation is loading. Please wait.

Procedures.

Similar presentations


Presentation on theme: "Procedures."— Presentation transcript:

1 Procedures

2 Differences between Dynamic and Static Calls

3 What is a Procedure?

4 Differences Between Procedures and Sub-routines
Sub-routines must be local to the program Sub-routines use global variables Sub-procedures can be recursive

5 Procedure Prototype and Program Interface
Every program has one Coded as part of the Definition Specs D Name ETDS Functions D Main PR EXTPGM(‘XXX’) D Main PI

6 Procedure Prototype The calling program must have prototypes for each procedure that it calls. Prototypes include as list of the variables that are passed to the procedure

7 Coding a Procedure Start/end with a P-Spec Paddproc B Daddproc PI
Dnewnum S 0 /free newnum += 1; /end-free P E

8 Passing Parameters by Value
Must include the VALUE keyword in the procedure prototype and procedure interface The prototype Dcelsius PR D Value The procedure interface D PI Dfahrenheit Value

9 TEST(DE) Tests dates TEST(DE) dateformat datestring

10 %date() Converts a character string to a date field
new_date = %date(charString: dateformat)


Download ppt "Procedures."

Similar presentations


Ads by Google