diffrence between renames and redifnes with examples
Answers were Sorted based on User's Feedback
Answer / khasim
We can regroup using RENAMES.
02 MM PIC X(2).
02 DD PIC X(2).
02 YY PIC X(2).
66 DATE RENAMES DD TRRU YY.
We can devide an Element to multiple elements using
REDEFINES.
02 DATE1 X(6).
02 DATE2 REDEFINES DATE1.
05 MM PIC X(2).
05 DD PIC X(2).
05 YY PIC X(2).
This is main defference.
Remaining things all know.
| Is This Answer Correct ? | 16 Yes | 2 No |
Answer / swathi.k
Redefines are used to reuse the storage space where as
renames are used to regroup the elementary items.
Ex:For redefines
01 A.
02 PIC X(6) VALUE 'SWATHI'.
02 REDEFINES A PIC X(2).
fOR RENAMES
01 A.
02 B PIC X(5).
02 C PIC X(5).
02 D.
03 D1 PIC X(2).
03 D2 PIC X(5).
02 E PIC X(6).
66 GROUP1 RENAMES C THRU E.
2.Redefines are coded with 0 to 49 level numbers where
as renames are declared with 66 level no.
3.pic clause is required for redefines where as pic clause
is not used for renames.
| Is This Answer Correct ? | 18 Yes | 8 No |
Answer / chaitanya chandana
redefines can use the any level no(0-49)...
but renames uses the 66 level no...
redefine may not perform subsequent to earlier data-item.
rename perform subsequent to earlier data-item.
Plz correct me if any mistake to my answer..
| Is This Answer Correct ? | 6 Yes | 4 No |
How to declare if emp-name = AAAAA""BBB in working-storage section. After display emp-name should print like AAAAA""BB
I had 100 records and i want to execute last three records by using cobol programming?what will be coding?
What is the meaning of 'Eject' verb in cobol?
Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?
have in 100 records in a file i want to move only matched records to one output_file1 and nonmathed records are moved to another output_file2 ... any one can provide logic code
I have a variable account-number declared as comp-3, s9(10) comp-3 in a file. How do i find a particular account number say 123456 in that file?
what is s013u000 for?
) what is the difference between AID and HANDLE AID?
What is the size of s9(19)comp3? explain
Under which scenario you would go for a static call as opposed to dynamic call?
I've one string with spaces ( I N D I A ). My question is I want remove the spaces & combine in to single string without space (INDIA).How we can write the cobol program & wich options we need to use. Please let me know.
what is the default print format? in cobol