0

How can one compare two programs in COBOL?

If one wants to know all the changes that a new program has from the old one and does not want to use the ISPF 3.13 SuperCE utility.

Practical scenario:

I have two programs which use the same base code and have independent changes. All I have to do is find those changes and merge them into 1 single program.

I am to create a Rexx tool for it.

My experience: no knowledge of Rexx whatsoever, beginner at mainframes.

Bill Woodger
  • 12,968
  • 4
  • 38
  • 47
Dipanshu
  • 17
  • 2
  • Why don't you want to use SuperCE? What Source Management package do you have? It's going to have something to do this for you, isn't it? As @cschneid indicates, actually attempting to code this from scratch in a a language and environment you don't know is going to be "tricky". If you really have to do so (I doubt it makes sense) then are ISPF Statistics "on" for the programs? – Bill Woodger Apr 27 '15 at 17:01
  • SuperCE just highlights the changes in the code but doesn't help in merging those changes. As for my scenario, I am to merge the changes to make a new edited code. Sorry, I don't understand what Source Management Package means and ISPF statistics "on" for the programs. I know it is difficult to create the code from scratch. – Dipanshu Apr 28 '15 at 06:14
  • Locate the documentation of SuperCE and discover what it can actually do. Source Control is most likely Endevor or Changeman or SCLM. It is the place where the code is stored when it is not being worked on. To know if you have ISPF statistics on, look at the edit member selection list (or similar) and if you can see information about number of lines, when created etc, then that is the ISPF statistics. If you then select a member and press PF10 (usually) the screen will shift to the right. Study the line numbers, taking great note of the last two digits. Also type COMPARE and press PF1. – Bill Woodger Apr 28 '15 at 07:50
  • Talk to your colleagues and technical support about those things if you can't get anywhere with that. If, once you have located all the information, you have nothing (I don't know why that would be so) you could also look at using Unix System Services, which has `diff` which you may already be familiar with. About the last thing you want to do is write a load of stuff which is unnecessary, particularly as a beginner. – Bill Woodger Apr 28 '15 at 07:53

2 Answers2

3

This isn't that easy - if you have 3 versions of a program (version A, the original, and 2 forks - versions B and C) you cannot blindly take version A and apply all changes made to it in version B and then version C, as version C might delete some code that version B relies upon.

You will have to manually review all of the differences to see which ones will work together and can be merged. For this, SuperC is an excellent tool.

It sounds as though at your site you have now got 2 modified version of a program, both different, and you like to combine both of these into one single program. I'm afraid this cannot be automated and will have to be done manually.

It may be relatively straightforward if both versions of the program have made changes that are in different areas of the code, or tricky if the changes are in the same area, but even for a 'straightforward' case, it still needs manual checking to ensure that changes to not impact each other.

Steve Ives
  • 7,894
  • 3
  • 24
  • 55
0

This is not a beginner's task. If you must do this, you would do it the same way you would create such a tool for Java, or C, or any other programming language; parse the language according to its syntax rules.

There are existing tools for this purpose, @Ira Baxter has pointed you at one, IBM used to have something called "version merger" but it appears to have been discontinued in 2014.

cschneid
  • 10,237
  • 1
  • 28
  • 39
  • I will note that an SO moderator deleted my answer. @cschneid [thanks!] obviously thought it was relevant. – Ira Baxter Apr 28 '15 at 11:12
  • @Ira Baxter - I'm not sure that this is a task for an expert, either! I can't think of anyway to reconcile 2 separate versions of a program into 1 via an automated method and I can;t see how parsing the source would help, unless you mean to parse the source to understand the logic and then to reconcile 2 versions into 1, which seems even harder than doing the same via a line-by-line compared. – Steve Ives Feb 03 '16 at 10:33