Should the programs be recompiled?

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
Kapil Sharma
Registered Member
Posts: 52
Joined: Sun Sep 29, 2013 1:46 am
Location: India

Should the programs be recompiled?

Post by Kapil Sharma »

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: 1886
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Should the programs be recompiled?

Post by Robert Sample »

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: 2799
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Should the programs be recompiled?

Post by Anuj Dhawan »

Robert Sample wrote: Wed Oct 11, 2017 5:19 pmWhile 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: 1886
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Should the programs be recompiled?

Post by Robert Sample »

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: 2799
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Should the programs be recompiled?

Post by Anuj Dhawan »

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: 825
Joined: Wed Sep 11, 2013 3:57 pm

Re: Should the programs be recompiled?

Post by enrico-sorichetti »

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-)
Kapil Sharma
Registered Member
Posts: 52
Joined: Sun Sep 29, 2013 1:46 am
Location: India

Re: Should the programs be recompiled?

Post by Kapil Sharma »

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: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: Should the programs be recompiled?

Post by nicc »

You mean you do not use Endevor or ChangeMan or Panvalet or SCLM or..?
Regards
Nic
Kapil Sharma
Registered Member
Posts: 52
Joined: Sun Sep 29, 2013 1:46 am
Location: India

Re: Should the programs be recompiled?

Post by Kapil Sharma »

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
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

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