It is used to regroup the elementary data items of same or different groups and assign them a new name. This way a new group can be formed keeping the original groups intact.
In other words, it used to form a logical group from the elementary data items of different or same group.
In above example, EMP-DEPT-INFO will become a new group consisting of EMP-NAME, EMP-SALARY, DEPT-NAME. Note that the new group overlaps the two original groups, namely whole EMP-DETAILS and part of DEPT-DETAILS. Such overlapping is permitted provided the elementary items are all contiguous.
Important rules to be considered while using RENAMES clause:-
It must be declared at special level number 66.
The level number must begin in Margin A or any position after it. data-name-1 must begin from Margin B or any position after it.
RENAMES clause must be coded at the end of group
Entries to be grouped and renamed can be elementary data items or group data items. They, however, cannot be items of level 01, 77, 88 or another 66 entry.
Entries to be grouped and renamed must be in a sequential order
data-name-1 cannot be used as a qualifier (in OF clause).
The entries (and the entries from which they have subordinated) having OCCURS clause cannot be renamed