Use one of these three methods to put values in a table: Load the table dynamically.
Load the Table Dynamically
If the initial values of your table are different with each execution of your program, then the table can be defined without initial values, and the changed values can be read into the table before your program refers to the table. To load a table, use The PERFORM . . . VARYING statement, either subscripting or indexing. When reading data to load your table:
When testing for the end of a table, use a named value giving the item count, rather than using a literal. Then, if you make the table bigger, you need to change only one value, instead of all references to a literal.
Initialize the Table
You can load your table with a value during execution with the INITIALIZE statement. You can move:
You can use INITIALIZE to move another value into each table element. For example, to fill a table with Nines (9)s,
INITIALIZE TABLE-ONE REPLACING NUMERIC DATA BY 9.
You cannot use INITIALIZE for a variable-length table (one that was defined using OCCURS DEPENDING ON).
Assign Values When You Define the Table
If your table contains stable values (for example a table that contains the days and months of the year), it is useful to set specific values your table holds when you define it. Define static values in the Working-Storage Section in one of three ways:
It causes Y(l) to be initialized to A, Y(2) to B,... Y(5) to E, and finally the object of the ODO (X) is initialized to 3. Any subsequent reference to TABLE-THREE (such as DISPLAY) would refer to the first three elements, Y(1) through Y(3).
It causes all the X elements (I through 5) to be initialized to AA, all the Y elements (1 through 5) to be initialized to 19, and all the Z elements (1 through 5) to be initialized to BB. T-OBJ is then set to 3.
IBM Mainframe Related Interview Questions
|IBM Lotus Notes Interview Questions||IBM-CICS Interview Questions|
|COBOL Interview Questions||Linux Interview Questions|
|IBM-JCL Interview Questions||IBM Mainframe Interview Questions|
|IBM AIX Interview Questions||IBM WAS Administration Interview Questions|
|IBM Lotus Domino Interview Questions||IBM Integration Bus Interview Questions|
|Mainframe DB2 Interview Questions||Unix Production Support Interview Questions|
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.