ppandey07
New User
Joined: 27 Nov 2008 Posts: 51 Location: Delhi, India
|
|
|
|
Bill O'Boyle wrote: |
Keep in mind that your WS table is around 5MB.
I imagine you've defined it this large because of the unknown number of records on the file?
So (for example), if you only use 10% of this table, then you'd be wasting 4.5MB
Is this a VSAM (KSDS/ESDS) or sequential (Non-VSAM) flat-file?
Bill |
This is sequential (Non-VSAM) flat-file. |
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
If you can inform the COBOL program of the number of records on the file, then you can define the ARRAY to LINKAGE and then use LE Callable Service routine 'CEEGTST' to obtain the correct amount of storage needed for the ARRAY.
You can define the ARRAY as a true ODO (Occurs Depending On) with the DEPENDING ON being a Binary-Fullword defined just above the actual ARRAY definition, within the "01" definition.
Example -
Code: |
01 LS-ARRAY-REC.
03 LS-ARRAY-NBR-RECS PIC S9(09) BINARY.
03 LS-ARRAY OCCURS 1 TO 99999 TIMES
DEPENDING ON LS-ARRAY-NBR-RECS
INDEXED BY X-LS-AR, X-LS-AR-MAX
PIC X(52).
|
So, for example, if the number of file-records was 100, the amount of dynamic-storage needed would be (Record-Length * Number-of-Records) + LENGTH OF LS-ARRAY-NBR-RECS.
Bill |
|