Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

What are the uses of REDEFINES

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: What are the uses of REDEFINES
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    Post subject: hi
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    Post subject:
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    Post subject:
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    Post subject: How to ensure that a table is in sorted order before applyin
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    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Another redefines in COBOL RahulG31 COBOL Programming 1 Fri Mar 20, 2015 4:09 am
No new posts Redefines clause in symbolic map MPC ... eprasad629 CICS 1 Sun Jan 15, 2012 12:18 am
No new posts Redefines usage nirmal.poikaikumaran COBOL Programming 15 Wed Mar 09, 2011 6:33 pm
No new posts Rename & Redefines srk.neeraj COBOL Programming 5 Mon Feb 14, 2011 6:06 pm
No new posts Defining REDEFINES cobol field in EZT rgupta71 CA Products 4 Mon Jan 31, 2011 9:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us