View previous topic :: View next topic
|
Author |
Message |
op
New User
Joined: 31 Oct 2006 Posts: 48 Location: Chennai
|
|
|
|
Hi,
Can we use array in EASYTREV(EZTPA00).
If yes, can anyone given an example for declaration and its usage down the line.
Thanks a lot in advance.
Best Regards,
Om Prakash |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi there,
There are two type of table
a) Instram Table: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. Check with your data center to determine this value. 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 that meets the following criteria can be defined as an external table:
■ An existing file that is in ascending order by the field used as a search argument
■ A file created by having its name specified as the TO parameter of a SORT statement that is sorted into ascending order by the search argument. |
|
Back to top |
|
|
op
New User
Joined: 31 Oct 2006 Posts: 48 Location: Chennai
|
|
|
|
I declared an array MONTH-TABLE as shown below. How to give values to the array. Please help.
DEFINE MONTH-TABLE W 10 A +
OCCURS(12) +
VALUE( +
'JANUARY ', +
'FEBRUARY ', +
*******B016 INVALID OR CONFLICTING KEYWORD - VALUE 'MARCH ', +
'APRIL ', +
'MAY ', +
'JUNE ', +
'JULY ', +
'AUGUST ', +
'SEPTEMBER ', +
'OCTOBER ', +
'NOVEMBER ', +
'DECEMBER ') +
INDEX(MONTH-INDEX) |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Code: |
DEFINE MONTHS W 120 A VALUE +
'JANUARY +
FEBRUARY +
...
NOVEMBER +
DECEMBER ' |
Code: |
DEFINE MONTH MONTHS 10 A +
OCCURS (12) INDEX (MONTH-INDEX) |
|
|
Back to top |
|
|
op
New User
Joined: 31 Oct 2006 Posts: 48 Location: Chennai
|
|
|
|
Can't we pass values to the array MONTH without using an intermediate variable. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
It is just a redefinition, the first for overall size and filling the entries, the redef for the array. |
|
Back to top |
|
|
|