Shall i use redefine when renaming of variables is required



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Shall i use redefine when renaming of variables is required

Postby gouravar » Sun Jul 02, 2017 10:04 pm

Hi,

I am working on a task to change the variable names of a copybook which has around 300 variables. These variables are then used in approx 40 programs. The reason behind changing the name of variables is to give them meaningful names. Out of these 40 programs, my application is the owner of 10 programs.

Now if we simply change variables I have to change and compile all 40 programs.

Does this will be a good approach to redefining all 300 variables with their name and same pic clause. 10 programs which come under my application will be changed to use the new variable names and other 30 programs will be recompiled as it is.

Please share your thoughts on same. Also, please let me know if I am missing something to consider.

Thanks in advance.
gouravar
 
Posts: 6
Joined: Tue Jun 12, 2012 10:36 pm
Has thanked: 3 times
Been thanked: 0 time

Re: Shall i use redefine when renaming of variables is required

 

Re: Shall i use redefine when renaming of variables is requi

Postby Robert Sample » Mon Jul 03, 2017 7:11 pm

Or, you could update the copy book and place comment line(s) before or after each variable giving what it is used for. Then you don't have to recompile a single program.

If you start changing variable names in the copy book, you need to recompile EVERY program using the copy book -- period. Otherwise, there could be issues (such as duplicate variable names) that are not discovered until a production job blows up at 3 AM and the compile to fix the problem then blows up for the copy book issues.

In general, the fewer changes made to production programs, the better. And changing variable names just to make them meaningful is rarely a good use of anyone's time, and it adds potential problems to boot. Avoid this type of busywork whenever you can.
Robert Sample
Global moderator
 
Posts: 3354
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 219 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post