View previous topic :: View next topic
|
Author |
Message |
pravien
New User
Joined: 22 Feb 2005 Posts: 11 Location: chennai
|
|
|
|
Hi forum,
wish u good day.
Here are my questions which i faced in interview.
1.What are the uses of REDEFINES?
2.How to ensure that a table is in sorted order before applying search all? |
|
Back to top |
|
|
vijayamadhuri
Active User
Joined: 06 Apr 2005 Posts: 180
|
|
|
|
Quote: |
1.What are the uses of REDEFINES? |
the purpose is to represent two different mappings for the same storage area.
Quote: |
How to ensure that a table is in sorted order before applying search all? |
u first use the sort in the cobol pgm and then use search all.[/quote] |
|
Back to top |
|
|
sonalig
New User
Joined: 22 Aug 2005 Posts: 7 Location: India
|
|
|
|
Hi Pravien,
To add up to vijayamadhuri, the REDEFINES clause is used to fill the tables with pre-defined values and to represent two different interpretations for the same data which is share the same memory locations.
Yes, u can sort the table before applying SEARCH ALL, but as per my knowledge, there is no way for COBOL to raise an error if the table data is not sorted actually.
Reg,
Sonali. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Usually tables are loaded sequentially from external media. During that process you can include code to verify that the current rec has a higher key than the last.
Depending on the complexity of the table, this can be a simple exercise or a nightmare. |
|
Back to top |
|
|
prasanth_thavva
New User
Joined: 28 Jul 2005 Posts: 86 Location: Chennai
|
|
|
|
hi,
1> in working storage declaration
01 a
05 occurs 50 times ( cluase i forget ) but we can ASC/DESC...clause in this declaration
2> externally we need to use SORT ...
SORT WORKFILE ON ASC/DSC KEY WS-KEY
USING F1(INPUTFILE) / INPUT PROCEDURE F1
GIVING F2(OUTFILE) / OUT PUT PROCEDURE F2
IF IT IS NOT IN SORTED ORDER IT GIVES ABEND.,,,,,
THE ABOVE TWO WORKS WELL ,,,,
bye seeing that we can ensure whether
BYE all d best |
|
Back to top |
|
|
|