Professional Documents
Culture Documents
dprocb1 pr
da 2p 0
db 2p 0
dc 3p 0
dprocb2 pr
da 2p 0
db 2p 0
dc 3p 0
c dsply a 20
c dsply b 20
c z-add 0 c 30
c z-add 0 d 30
c callp procb1(a:b:c)
c c dsply
c callp procb2(a:b:d)
c d dsply
c seton lr
CRTBNDDIR BNDDIR(BINDING1)
DSPSRVPGM SRVPGM(SRVPGM1)
So finally Our main aim to create a Main Procedures (Based on our requirements)and use the service
Program whenever its necessary.
ACTIVATION GROUP:
Is a memory allocation for the execution of job.It holds system Resources,variables,files open etc
All ILE Programs will run only in Activation Group.
While creating Program using F10,U can see the activation group.
3 types of Action Group:
1.*NEW
2.*CALLER
3.Named Activation Group(Default QILE is the named Activation Group)
Here is an simple example How the variables are reused if we use Activation Group:
*NEW
HDFTACTGRP(*NO) ACTGRP(*new)
dcounter s 10p 0 export
c eval counter=counter + 1
c counter dsply
c seton lr
*CALLER
Mostly this Activation Group can be used only for calling Program so that whatever called Program
uses Activation group....The calling program can also use the same activation Group.
The Advantage of using this is both can run in one activation group and varibales Reused,Open files
reuse etc.
Program:
C/COPY JAGADESH1/QUINNOX,JAGA
C EVAL C=A+B
C C DSPLY
C SETON LR
Here in this program I havent declared any variables...I used only copybook...Its expanded at the time
of compilation.
FREE-FORM SYNTAX:
Here no need of Factor1,Factor2,result etc As u like u can code..
and semicolon is mandatory...
Example:
fJaga if e disk USROPN
c
c/FREE
open jaga;
read jaga;
dsply eno;
/END-FREE ---------------------this is very important it should start from 8th line as /END-FREE
c* read jaga 55
c SETON LR
My Programs:
Compiled with opt-15 name:ADDPRC
Hnomain
daddprc pr 4p 0
d num1 2p 0
d num2 2p 0
d res 4p 0
d*
paddprc b export
daddprc pi 4p 0
d num1 2p 0
d num2 2p 0
d res 4p 0
d*
/free
res = num1 + num2;
return res;
eval *inlr = *on;
/end-free
p e
Create program:CRTPGM
Program . . . . . . . . . . . . > CALC
Library . . . . . . . . . . . > X4128
Module . . . . . . . . . . . . . > MOD1
Library . . . . . . . . . . . > X4128
+ for more values
*LIBL
Text 'description' . . . . . . . *ENTMODTXT
Additional Parameter