1) can we display the index?
Answers were Sorted based on User's Feedback
Answer / shan
Ya correct,
To be more clear,
Declare a variable with usage is index (01 WS--VAR-DISPLAY
USAGE IS INDEX)
then SET WS-VAR-DISPLAY to WS-INDEX
Display WS-VAR-DISPLAY
| Is This Answer Correct ? | 12 Yes | 7 No |
You can't directly display the Index. But you can create a normal numeric field in your working storage and set that to the Index.
Example:
01 WS-TABLE.
05 WS-CUSTOMER PIC X(25) OCCURS 10 INDEXED BY INDEX1.
01 WS-NUMERICS.
05 WS-INDEX-COUNT PIC 9(02) VALUE 0.
SET WS-INDEX-COUNT TO INDEX1.
DISPLAY WS-INDEX-COUNT.
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / naina
Yes, we can!!!
The easiest way, which would work in all versions of COBOL
is
SET W-S-VAR-PICS9(9)-USAGE-DISPLAY TO THE-INDEX-U-WANT-TO-
DISPLAY
DISPLAY W-S-VAR-PICS9(9)-USAGE-DISPLAY
| Is This Answer Correct ? | 4 Yes | 5 No |
how will u retreive value from a table.write it with syntex. 01 ws-table 05 ws-table1 occurs 10 times. 05 ws-table2 occurs 10 times. the above is 2 dimensional array..how will u retrieve 1st element of an array
How can we find that module can be called – whether DYNAMICALLY or STATICALLY?
I have two files , file1 is input file it contains 10,20,30,....,records but i want to display the records in file 2 as reverse order .how can we do by using jcl& cobol(dont use array) please any one can tell me the answer
what is the minimum number of lines a Cobol program should have to successfully compile and run
11 Answers ABC, Societe Generale,
how to convert the recors form vsam file to db2 table tru file aid
A s9(4). B v9(4) value 0.21 can i move this?
What is JOBLIB and STEPLIB in JCL? what is the purpose of using it?
01 a pic s9(5) value '-12345' how it will be stored
Why we need to use redefine clause when we can define the variable seperately... what is actual need....
01 a pic x(4) value 'abcd' 01 b pic 9(3) can we move from a to b.if possible what would be stored in b.
how we can reverse the string in the cobol for example satheesh can be reveresed as hseehtas
how can we find total no of records in a file ....is there any utility......?