Hi!
Thanks BillyBoyo and Dick.
The Dick's solution was one we tested, with some slight difference. Look at our code at the routine:
WORKING STORAGE
01 WCA-PRUEBA PIC 9(9) VALUE ZEROS.
01 TAB-INTERNA.
05 TAB-SDO OCCURS 4000 TIMES.
10 LIS-MTO-RDO-GR.
15 COD-CLI-CD PIC S9(9).
15 COD-CTA-CD PIC S9(9).
15 COD-TIP-DOC-CD PIC X(2).
15 NUM-DOC-NU PIC X(30).
--------- etc -----------------------------
01 MOV-INTERNA.
15 FILLER PIC S9(9).
15 FILLER PIC S9(9).
15 FILLER PIC X(2).
15 FILLER PIC X(30).
-------------- etc --------------------------
Both have the same qty of fields.
LINKAGE SECTION.
01 LLAMADA PIC X(7).
* ----------------------------------------
PROCEDURE DIVISION USING LLAMADA.
IF WCA-PRUEBA = ZERO
MOVE 999 TO WCA-PRUEBA
MOVE 'PRIMERA' TO LLAMADA
INITIALIZE TAB-INTERNA
MOVE TAB-INTERNA TO MOV-INTERNA
ELSE
MOVE 'RESTO' TO LLAMADA
MOVE MOV-INTERNA TO TAB-INTERNA.
GOBACK.
When the pgm calls to the routine for first time, find WCA-PRUEBA = 0, then took the INITIALIZE and move to the other set.
The difference with your suggestion was that the other set of data are inside the routine.
But . . . .
We test this option and compare with the original way and the results didn´t go the best:
Test 1 to 4: the original code with a sentence INITIALIZE TAB-INTERNA at each call. Test 5 to 8: the results testing with the code descripted before:
Test Elapsed Time CPU Time Serv. Units % WFL
1 1.50 0.58 14039k 66
2 1.70 0.59 14237k 38
3 0.50 0.50 12816k 97
4 2.10 0.74 18247k 30
5 8.2 1.25 30001k 20
6 1.7 1.22 29381k 68
7 1.4 1.21 29231k 95
8 1.6 1.21 29333k 74
The WFL values is an average we took from RMF for each test.
Thanks a lot for read from the beginning until here.