The common block is always the same memory space:

com a(100)

is the same as

com a(50),b(50)

that's why they have labeled common

com /label/ c(10)

The same common blocks share the same memory space. It depends on the # of elements in the block.

com /urcom/ c(10)
is the same as
com /urcom/ a(5),b(5)
or
com /urcom/ a,b,c,d,e,f,g,h,i,j

where j = b(5) or c(10), and i = c(9) or b(4)


----- Original Message ----- From: "Jacques G." <jacque...@yahoo.com>
To: "U2 Users List" <u2-users@listserver.u2ug.org>
Sent: Thursday, November 19, 2009 3:01 PM
Subject: Re: [U2] [UV] Where is the COMMON block reserved ?


Hello,

I have a question pertaining to how the shell used by the connection pooling works as it relates to memory allocation.

In the following cases:

Case 1: Program 1 has a number of variables and matrixes declared in a common section it calls Program 2 which has the same common matrixes and variables declared.

Ex: Program 1:

COM ABC(100), D,E,F
ARG = "BLAH"
CALL PGM2(ARG)

Program 2:
SUBROUTINE PGM2(ARG)
COM ABC(100), D, E,F
CRT ARG
RETURN



Case 2: Program1 doesn't have any common variables declared it calls Program2 which does have common matrixes and variables declared:

Program 1:

ARG = "BLAH"
CALL PGM2(ARG)

Program 2:
SUBROUTINE PGM2(ARG)
COM ABC(100), D, E,F
CRT ARG
RETURN


In Case 2, is the common block declared in the stack segment or will the common be declared in the same place in both cases ?



_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to