Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"-INCLUDE" "EX" "EXEC" differences??

Status
Not open for further replies.

NorthNone

Programmer
Jan 27, 2003
445
US
What is the difference between "-INCLUDE" and "EX" and "EXEC"??
When to use which?
Many thanks!

---------------------------------------
The customer may not always be right, but the customer is ALWAYS the customer.
 
-INCLUDE X will include whatever is in data set X in your code.

If X were -TYPE this is included and your code was
TABLE FILE ZZ
DO SOMETHING
END
-INCLUDE X
SOME MORE STUFF

Your code would then be:
TABLE FILE ZZ
DO SOMETHING
END
-TYPE this is included
SOME MORE STUFF

For example, this is a great way to include (share) common routines among programs and cut down on maintenance. Style sheets are often -INCLUDEd for common look and feel.

I'm not sure that there is a big difference between EX and EXEC but in any case the verb needs an object. Typically, a program is EXECuted is in EXEC myprog.

 
EX and EXEC are the same. They must be stand alone procedures. If they require parameters, you must explicitly pass them. EX MYPROC PARM1=VAL1,PARM2=VAL2....

Since -INCLUDE brings the code into the calling procedure, it can be any peice of code and will also inherit the parameters from the calling fex.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top