This is my first post here and i will start my adventure here with a question ( easy one ) about call statement.
I learnt that when we use the call statement we have to pass the same parameters to the procedure division of the callable program, something like:
-> CALL XPTO using PARM1 PARM2 PARM3
So, we need to :
-> Procedure division using PARAM1 PARAM2 PARAM3
But today i saw a program passing 6 PARAMS and the callable program was only receiving 4 in the procedure division . How does it work ? I thought that would crash, am i wrong ? :s
Another doubt, and this is a stupid doubt that are freaking my mind:
Working Storage :
01 PARAM-1 PIC X (32140).
01 PARAM-2 PIC X (32140).
01 PARAM-3 PIC X (32140).
CALL xpto using PARAM-1 PARAM-2 PARAM-3
On the XPTO program they have
PROCEDURE DIVISION USING VAR1 VAR2 VAR3
And on the linkage they are declared something like this
01 VAR1 PIC X (400).
01 VAR2 PIC X (400).
01 VAR3 PIC X (400).
Did you notice that we are actually passing 32140 for each parameter and only receiving 400 for each one ? IDoes t's supposed to work ? HOW ? Compiler tricks ? or just normal ?
Thanks a lot!