View previous topic :: View next topic |
Author |
Message |
Vidhya Kalyanasundaram Beginner
Joined: 03 Sep 2007 Posts: 4 Topics: 1
|
Posted: Mon Sep 03, 2007 11:32 pm Post subject: Regarding Easytrieve Table Overflow |
|
|
1.When a table is declared in an Easytrieve Program as :
FILE EMPLOYEE TABLE ( 1000 )
- It indicates the table, EMPLOYEE is located in a file, external to your
EZT program identified by the logical name of the table file
(mentioned in the JCL part i.e the DDNAME)
- The literal 1000 indicates the Max.No.Of Entries in the table.
2. EASYTRIEVE PLUS build this external table EMPLOYEE,dynamically with
the number of records (from the file specified in the DDname)just prior
to its usage by loading the table dynamically.
3. Here incase if the number of records from the EMPLOYEE file specified
in the DD statement exceeds 1000, the table overflow takes and the
following statement get displayed in the SPOOL ending the job with
MAXCC=16 :
*******A008 TOO MANY TABLE ENTRIES - EMPLOYEE
*******A014 PREMATURE TERMINATION DUE TO PREVIOUS ERROR(S)
Is there any way to load the records one by one into the table from the file and having a record count which can be incremented when each record enters the table?
So that when its about to reach the Max.Entries we can display a message to increase the table size rather than job ending abruptly. |
|
Back to top |
|
 |
Vidhya Kalyanasundaram Beginner
Joined: 03 Sep 2007 Posts: 4 Topics: 1
|
Posted: Mon Sep 03, 2007 11:33 pm Post subject: |
|
|
Hai,
( ONE MORE ISSUE )
When the number of records in the file EMPLOYEE(which is specified in the DD statement) going to be loaded into the external table EMPLOYEE defined in the Easytreive program is 9000 but i have specified the limit for the external table as follows:
FILE EMPLOYEE TABLE (6000)
ARG 1 3 A
DESC 4 13 A
IARG W 3 A VALUE 'AAN'
IDESC W 13 A
*
JOB INPUT NULL
DISPLAY IARG
STOP EXECUTE
As the table limit has exceeded it should throw an error as follows:
*******A008 TOO MANY TABLE ENTRIES - EMPLOYEE
*******A014 PREMATURE TERMINATION DUE TO PREVIOUS ERROR(S)
----But this piece of code dint throw this error
But it throws the same error only when we perform a search on that table in the JOB-SECTION as:
FILE EMPLOYEE TABLE
ARG 1 3 A
DESC 4 13 A
IARG W 3 A VALUE 'AAN'
IDESC W 13 A
*
JOB INPUT NULL
DISPLAY IARG
SEARCH EMPLOYEE WITH IARG GIVING IDESC
STOP EXECUTE
So we can come to a conclusion that the table is getting loaded prior to the JOB-SECTION during the SEARCH operation.
Is there any way to trace the count of records in the file before the JOB statement?
Please help me in getting the count in a variable before the job statement!!!!!!!
So that when the count xceeds the limit, will stop the EXECUTION with a warning message?????
Please reply to satisfy this requirement!
Thanks in advance.
Vidhya |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12377 Topics: 75 Location: San Jose
|
Posted: Tue Sep 04, 2007 5:41 am Post subject: |
|
|
vidya,
Please do NOT post the same question in multiple forums. Easytrieve has the option of loading the internal tables just like cobol. check this
Internal table declaration
Code: |
T-EMPLOYEE-TABLE W 16 A OCCURS 6000
T-NAME T-EMPLOYEE-TABLE 03 A
T-DESC T-EMPLOYEE-TABLE +03 13 A
|
Internal table load
Code: |
W-SUB = 1
GET EMPFILE
DO WHILE NOT EOF EMPFILE AND W-SUB < 6000
T-NAME (W-SUB) = EMP-NAME
T-DESC (W-SUB) = EMP-DESC
W-SUB = W-SUB + 1
GET EMPFILE
END-DO
IF W-SUB > 6000
DISPLAY '*******************************'
DISPLAY '** **'
DISPLAY '** INTERNAL TABLE ERROR **'
DISPLAY '** **'
DISPLAY '*******************************'
RETURN-CODE = 3000
STOP
ELSE
DISPLAY 'TOTAL EMPLOYEES LOADED : ' W-SUB
END-IF
|
Internal table lookup(search )
Code: |
W-SUB = 1
EMP-FOUND = 'N'
DO WHILE W-SUB < 6000 OR EMP-FOUND = 'Y'
IF W-EMP-NAME = T-NAME (W-SUB)
CODE STATEMENTS TO BE DONE WHEN THE EMP NAME IS FOUND
EMP-FOUND = 'Y'
END-IF
W-SUB = W-SUB + 1
END-DO
|
Quote: |
FILE EMPLOYEE TABLE (6000)
ARG 1 3 A
DESC 4 13 A
IARG W 3 A VALUE 'AAN'
IDESC W 13 A
*
JOB INPUT NULL
DISPLAY IARG
STOP EXECUTE
As the table limit has exceeded it should throw an error as follows:
*******A008 TOO MANY TABLE ENTRIES - EMPLOYEE
*******A014 PREMATURE TERMINATION DUE TO PREVIOUS ERROR(S)
----But this piece of code dint throw this error
|
The code did not throw any error because, you did NOT refer the internal table.
your job input is null and you are displaying a Working storage variable. Just because you defined the file in the pgm does NOT mean the system will open the file and start reading.
The next code gave an abend because you are referring to the internal table. Easytrieve then loads the file and does the validation against the table limit and hence the error.
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
Vidhya Kalyanasundaram Beginner
Joined: 03 Sep 2007 Posts: 4 Topics: 1
|
Posted: Tue Sep 04, 2007 6:29 am Post subject: |
|
|
Hai,
Sorry for posting it twice.I am not sure about under which topic, this query has to be posted
You are talking about Internal Table(Array which is almost same as Cobol Array with OCCURS clause)
But my question is with regard to External Tables(Correct me if i am wrong).
I need to monitor the overflow of External Table which gets dynamically loaded in the JOB-SECTION when SEARCH is done.
This is the explanation regard to External and Instream tables for your reference:
Instream Tables :
Instream tables are specified by the INSTREAM subparameter of the TABLE option on the FILE statement. Instream tables are created by coding the table data immediately following the associated library definition statements for the table
file. Table data is ended by the word ENDTABLE in the first eight positions of a
record. Instream data is 80 characters per record. Table size is limited only by the
amount of available memory. The next exhibit illustrates an instream table
definition.
FILE WEEKDAY TABLE INSTREAM
ARG 1 1 A
DESC 3 9 A
1 SUNDAY
2 MONDAY
3 TUESDAY
4 WEDNESDAY
5 THURSDAY
6 FRIDAY
7 SATURDAY
ENDTABLE
External Tables:
If you specify the TABLE option with no subparameter, the file is an external table whose maximum number of entries is limited by a value in the options table established at installation. If the number of entries in your external table is larger than the default value, you can code a numeric literal as the subparameter of the TABLE option to specify the maximum number of entries.
A file which meets the following criteria can be defined as an external table:
1.An existing file that is in ascending order by the field used as a search
argument
2.A file created by having its name specified as the TO parameter of a SORT
statement which is sorted into ascending order by the search argument. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12377 Topics: 75 Location: San Jose
|
Posted: Tue Sep 04, 2007 8:57 am Post subject: |
|
|
Quote: |
You are talking about Internal Table(Array which is almost same as Cobol Array with OCCURS clause)
But my question is with regard to External Tables(Correct me if i am wrong). I need to monitor the overflow of External Table which gets dynamically loaded in the JOB-SECTION when SEARCH is done.
|
Vidhya Kalyanasundaram,
You CanNOT Monitor the dynamic table load overflow. You can raise the installation limit for table entries or load the table into an internal table as shown in the code and abend if you exceed the limit.
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
Vidhya Kalyanasundaram Beginner
Joined: 03 Sep 2007 Posts: 4 Topics: 1
|
Posted: Thu Sep 13, 2007 6:38 am Post subject: |
|
|
Thank You ! |
|
Back to top |
|
 |
|
|