IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

rexx tool to compare source code


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
janmejay
Warnings : 1

New User


Joined: 22 Jun 2007
Posts: 85
Location: bangalore

PostPosted: Mon Jul 28, 2014 1:29 pm
Reply with quote

I want to develop a tool using rexx which will compare the Test version with Production version of Same program and merge the code automatically in the test program if any unmatch found. can anyone give some idea on this ?
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Mon Jul 28, 2014 1:41 pm
Reply with quote

Why that? icon_question.gif
Assuming that the production program is the original, and the test program is the modified version, "merging" as you explain it merely consist in restoring the original.
For this, you can simply do "DEL ALL NX" followed by "COPY prod-member"

Alternatively, you can edit the test version, do a "COMPARE prod-member X" and look at the differences.
You can then easily delete added lines or restore deleted ones.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Jul 28, 2014 1:42 pm
Reply with quote

why reinvent the wheel ...

read about ALL the capabilities of ISPF SUPERC
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Mon Jul 28, 2014 5:03 pm
Reply with quote

Ok for SUPERC, but it depends of the ambition of the project

For source code ( in a language or another ) , for me:

Code:
if zonea = zoneb then

equals to
Code:
if   zonea     =  zoneb     then

or even to
Code:
if zonea = zoneb    ,
then
Back to top
View user's profile Send private message
janmejay
Warnings : 1

New User


Joined: 22 Jun 2007
Posts: 85
Location: bangalore

PostPosted: Mon Jul 28, 2014 5:25 pm
Reply with quote

Actually in our case, when someone changes moved to production, its the responsibility of developer to merge his changes if the same program available in other test environment's by other users. so currently we are manually merging the code to keep sync in Production.

will it be possible to develop a Rexx toll , which will run in the Test program to compare with production program and merge the changes in Test Program automatically ..
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Mon Jul 28, 2014 5:27 pm
Reply with quote

small remark : not a Rexx toll but a Rexx tool
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Mon Jul 28, 2014 6:05 pm
Reply with quote

The ISPF Edit COMPARE command is ideal for this. It shows you the code differences as labels and temporary lines. To incorporate a line from the production code, you can use the MD (make data) line command on the temporary line.

COMPARE makes code retrofits fun and easy!

Ok, I am exaggerating about the 'fun' part. But it does make it easy.
icon_cool.gif
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Mon Jul 28, 2014 9:39 pm
Reply with quote

I do not think you explained the scenario well... I imagine it is a case of two different change streams: the development of new line items and service to existing production code. You do not want the defect resolved in release 1 to appear again in release 2.

It is not a case of comparing two files... you want to compare 1) the original source with 2) the service to see what was changed, then you want to determine which of those changes get promoted to 3) the development library. That is three files.

There will be some lines added, some deleted, others reformatted. I do not think you want to 'automatic merge', but rather, you want the developer to merge the code. If you have more than one person involved, you may want to have code reviews along the way. That is where the 'fun' part is.

My experience is that you want to promote the service changes to development soon after they are promoted to production. Otherwise you have the risk of too many service changes at the same time, which makes it hard to do. And it might invalidate your unit testing. And also you have the 'what the heck was I trying to do?' factor... you tend to forget the purpose of some things unless it is fresh in your mind.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Jul 29, 2014 6:17 pm
Reply with quote

janmejay wrote:
Actually in our case, when someone changes moved to production, its the responsibility of developer to merge his changes if the same program available in other test environment's by other users. so currently we are manually merging the code to keep sync in Production.
OK, you are talking about Parallel Development...
That is a different story, and a compare is just not enough...
I would recommend to forget about a "tool" and to start thinking about a "product".

Basics are:
You must have a Baseline: the same production source that is being modified by two different programmers.
When one of the programmers moves his program to prod, you have to build a Delta file (between the baseline and modif #1).
And when the second programmer moves his program, you must apply the Delta file to the program.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
Search our Forums:

Back to Top