View previous topic :: View next topic |
Author |
Message |
MVS_blob Beginner
Joined: 23 Oct 2007 Posts: 23 Topics: 9
|
Posted: Sun Jun 29, 2008 8:38 pm Post subject: size of the PROCEDURE DIVISION USING statement |
|
|
Hi,
Been stuck on this problem for some time now, and Google hasn't turned up any good results..
Does anyone know of, the limitations on the 'USING' clause on the procedure Division statement? i.e. memory size
I'm using the IBM Enterprise COBOL for z/OS 3.4.1 compiler.
Cheers. |
|
Back to top |
|
|
MVS_blob Beginner
Joined: 23 Oct 2007 Posts: 23 Topics: 9
|
Posted: Mon Jun 30, 2008 1:14 am Post subject: |
|
|
Found it: 32767 bytes.
As the Procedure division doesn't allocate memory in the 'USING' clause, then the 32767 must refer to the addresses of the individual values being passed.
1 address = 1 word = 4 bytes = 32 bits
Therefore 32767 / 32 bits = 1024 variables
That means the statement 'PROCEDURE DIVISION USING' is limited to 1024 variables?
Can anyone correct me if i'm wrong...
Also, what is classed as a variable? e.g. redefinitions, 88 LVL, OCCURS...etc |
|
Back to top |
|
|
MVS_blob Beginner
Joined: 23 Oct 2007 Posts: 23 Topics: 9
|
Posted: Mon Jun 30, 2008 1:29 am Post subject: |
|
|
Oops...
Its 32767 items, not bytes. |
|
Back to top |
|
|
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
Posted: Mon Jun 30, 2008 9:55 am Post subject: |
|
|
Just out of curiousity, why are you interested in a limitation like that? _________________ ....Terry |
|
Back to top |
|
|
MVS_blob Beginner
Joined: 23 Oct 2007 Posts: 23 Topics: 9
|
Posted: Tue Jul 01, 2008 3:05 am Post subject: |
|
|
My problem was like this:
PROGRAM1:
Code: | CALL PROGRAM2
USING DB-PCB-1
DB-PCB-2
DB-PCB-3
DB-PCB-4
DB-PCB-5 |
PROGRAM2:
Code: | PROCEDURE DIVISION
USING DB-PCB-1
DB-PCB-2
DB-PCB-3
DB-PCB-4
DB-PCB-5
|
DB-PCB-4 & DB-PCB-5 was correct in PROGRAM1
DB-PCB-4 & DB-PCB-5 was corrupted in PROGRAM2
I changed the code to:
PROGRAM1:
Code: | CALL PROGRAM2
USING DB-PCB-1
DB-PCB-4
DB-PCB-2
DB-PCB-3
DB-PCB-5 |
PROGRAM2:
Code: | PROCEDURE DIVISION
USING DB-PCB-1
DB-PCB-4
DB-PCB-2
DB-PCB-3
DB-PCB-5
|
The results were then:
DB-PCB-3 & DB-PCB-5 was correct in PROGRAM1
DB-PCB-3 & DB-PCB-5 was corrupted in PROGRAM2
Naturally, I then thought it was a size limitation error.
...The final solution I found was PROGRAM3 was missing some PCBS:
PROGRAM0:
Code: | CALL PROGRAM1
CALL PROGRAM3
|
PROGRAM3:
Code: | CALL PROGRAM2
USING DB-PCB-1
DB-PCB-2
DB-PCB-3
|
So changing PROGRAM3's code to
PROGRAM3:
Code: | CALL PROGRAM2
USING DB-PCB-1
DB-PCB-2
DB-PCB-3
DB-PCB-4
DB-PCB-5 |
made everything work perfectly. |
|
Back to top |
|
|
dsh33782 Beginner
Joined: 30 Jun 2008 Posts: 1 Topics: 0 Location: Tampa Bay Florida
|
Posted: Tue Jul 01, 2008 4:32 am Post subject: Re: size of the PROCEDURE DIVISION USING statement |
|
|
MVS_blob
When I worked at Micro Focus I saw a lot of code from Fortune 1000 customers and I've seen cases where over 2400 parameter addresses have been passed in a COBOL call statement to assembler. The actual limit in a specific case could be set by the compiler for the caller or the called language or by the environment they are running in.
If an application is passing more than just a few parameters, it might be time to redesign the interface to reduce the overhead of passing a lot of address constants.
Don Higgins
don@higgins.net
www.z390.org
MVS_blob wrote: | Hi,
Been stuck on this problem for some time now, and Google hasn't turned up any good results..
Does anyone know of, the limitations on the 'USING' clause on the procedure Division statement? i.e. memory size
I'm using the IBM Enterprise COBOL for z/OS 3.4.1 compiler.
Cheers. |
_________________ Don Higgins
don@higgins.net
www.z390.org |
|
Back to top |
|
|
MVS_blob Beginner
Joined: 23 Oct 2007 Posts: 23 Topics: 9
|
Posted: Tue Jul 01, 2008 6:25 pm Post subject: |
|
|
dsh33782, thanks for your comments.
32767 passed variables is the limit set by the COBOL for z/OS 3.4.1 compiler. (Thats alot of variables - the programs I work on don't reach anywhere near that limit)
P.S. I'm honoured that my post enticed you to join the forum. |
|
Back to top |
|
|
|
|