IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

What are the uses of REDEFINES


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pravien

New User


Joined: 22 Feb 2005
Posts: 11
Location: chennai

PostPosted: Mon Aug 22, 2005 8:02 pm
Reply with quote

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
View user's profile Send private message
vijayamadhuri

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Mon Aug 22, 2005 9:49 pm
Reply with quote

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
View user's profile Send private message
sonalig

New User


Joined: 22 Aug 2005
Posts: 7
Location: India

PostPosted: Wed Aug 24, 2005 4:01 pm
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Sep 04, 2005 12:49 am
Reply with quote

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
View user's profile Send private message
prasanth_thavva

New User


Joined: 28 Jul 2005
Posts: 86
Location: Chennai

PostPosted: Sun Sep 04, 2005 10:49 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Cobol redefines for Signed pictured c... COBOL Programming 4
No new posts Another redefines in COBOL COBOL Programming 1
No new posts Redefines clause in symbolic map MPC ... CICS 1
No new posts Redefines usage COBOL Programming 15
No new posts Rename & Redefines COBOL Programming 5
Search our Forums:

Back to Top