Should the programs be recompiled?

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Previous topicNext topic

Topic Author
Kapil Sharma
Registered Member
Posts: 40
Joined: Sun Sep 29, 2013 1:46 am
Location: India

Should the programs be recompiled?

Post by Kapil Sharma » Wed Oct 11, 2017 3:30 pm

Hi,

I have a structure in a COBOL copybook like this:

Code: Select all

05 TB-ABCD-ENTRY.                                            
   10 TB-ABCD-COMPANY-CODE           PIC X(02)  VALUE SPACES.
   10 TB-ABCD-ONLINE-FRT-CONS-SW     PIC X(01)  VALUE ' '.   
      88 TB-ABCD-ONLINE-FRT-CONS                VALUE 'Y'.   
   10 FILLER                         PIC X(197).             
From the FILLER we are picking up 4 character for a new value like this:

Code: Select all

05 TB-ABCD-ENTRY.                                            
   10 TB-ABCD-COMPANY-CODE           PIC X(02)  VALUE SPACES.
   10 TB-ABCD-ONLINE-FRT-CONS-SW     PIC X(01)  VALUE ' '.   
      88 TB-ABCD-ONLINE-FRT-CONS                VALUE 'Y'.   
   10 WS-NEW-VAR                     PIC X(04).             
   10 FILLER                         PIC X(193).             
Should we recompile all the programs which are using this file. I believe we don't need to recompile as the length is not changed.


Thanks,
Kapil

User avatar

Robert Sample
Global Moderator
Global Moderator
Posts: 1338
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
Zodiac: Virgo

Re: Should the programs be recompiled?

Post by Robert Sample » Wed Oct 11, 2017 5:19 pm

While programs using the copy book do not require compilation, it is wise to always recompile every program whenever variables are added to the copy book (even if the length does not change) since there could be variables in the programs with the same name.



User avatar

Anuj Dhawan
Founder
Posts: 2611
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: Should the programs be recompiled?

Post by Anuj Dhawan » Wed Oct 11, 2017 10:28 pm

Robert Sample wrote:
Wed Oct 11, 2017 5:19 pm
While programs using the copy book do not require compilation, it is wise to always recompile every program whenever variables are added to the copy book (even if the length does not change) since there could be variables in the programs with the same name.
I always thought that there is just no need to compile the programs and it did worked over the years. Thinking about your statement, Robert, it looks like I had been lucky, most of the times! :)


Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.

User avatar

Robert Sample
Global Moderator
Global Moderator
Posts: 1338
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
Zodiac: Virgo

Re: Should the programs be recompiled?

Post by Robert Sample » Wed Oct 11, 2017 11:42 pm

Not necessarily lucky -- it would be rare indeed for a program variable to have the same name as a copy book variable since there are usually naming standards. But I did see it happen once early in my career and since then I've always erred on the side of caution.



User avatar

Anuj Dhawan
Founder
Posts: 2611
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: Should the programs be recompiled?

Post by Anuj Dhawan » Thu Oct 12, 2017 9:09 am

That make sense. Thanks - will keep that in mind.

[ Post made via Android ] Image


Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.


enrico-sorichetti
Global Moderator
Global Moderator
Posts: 881
Joined: Wed Sep 11, 2013 3:57 pm

Re: Should the programs be recompiled?

Post by enrico-sorichetti » Thu Oct 12, 2017 9:49 am

recompilation depends also on the setup of Your source control system ...
a change in a copybook might force a rebuild of all the sources including it

the sequence of command used might change depending on the source control system used


cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)


Topic Author
Kapil Sharma
Registered Member
Posts: 40
Joined: Sun Sep 29, 2013 1:46 am
Location: India

Re: Should the programs be recompiled?

Post by Kapil Sharma » Sun Dec 03, 2017 7:27 pm

Thanks all.

Hi Enrico,

What are you calling source control system? Version control tool? We are not using any version control tool and it is all manual.


Thanks,
Kapil


nicc
Global Moderator
Global Moderator
Posts: 582
Joined: Wed Apr 23, 2014 8:45 pm

Re: Should the programs be recompiled?

Post by nicc » Mon Dec 04, 2017 4:57 pm

You mean you do not use Endevor or ChangeMan or Panvalet or SCLM or..?


Regards
Nic


Topic Author
Kapil Sharma
Registered Member
Posts: 40
Joined: Sun Sep 29, 2013 1:46 am
Location: India

Re: Should the programs be recompiled?

Post by Kapil Sharma » Tue Dec 05, 2017 4:25 pm

Yes, we do not.

The mainframe system were not upgraded since last 12-13 years, as we were supposed to move to another technology but they could not so tools were not updated.


Thanks,
Kapil

Previous topicNext topic

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”