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

REXX editmacro to compare two members and their output


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

New User


Joined: 10 Mar 2022
Posts: 8
Location: Germany

PostPosted: Thu Mar 10, 2022 3:29 am
Reply with quote

Hello guys, I have just started rexx and mainframe less than 2 months, and I need to figure out how to make macro that will compare two members.
Can you help me out a little bit
Any help is welcomed
thanks, icon_biggrin.gif icon_biggrin.gif icon_biggrin.gif
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1335
Location: Bamberg, Germany

PostPosted: Thu Mar 10, 2022 3:38 am
Reply with quote

See https://www.ibm.com/docs/en/zos/2.4.0?topic=statements-compareedit-compare. Also SUPERC/E is a good start to look at.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2141
Location: USA

PostPosted: Thu Mar 10, 2022 6:28 pm
Reply with quote

emir_soko wrote:
Hello guys, I have just started rexx and mainframe less than 2 months, and I need to figure out how to make macro that will compare two members.
Can you help me out a little bit
Any help is welcomed
thanks, icon_biggrin.gif icon_biggrin.gif icon_biggrin.gif

1) From my experience, after initial starting with REXX, it may take from 1 to 3 years before you might be able to create any really useful tool of this kind. (Unless somebody else presented the solution to you).

2) Compare of two members has been implemented so many times by now, and it is available, for instance, as online COMPARE command in ISPF VIEW/EDIT, and as batch utility SUPERC.

RTFM, RTFM, and RTFM, please!
Back to top
View user's profile Send private message
emir_soko

New User


Joined: 10 Mar 2022
Posts: 8
Location: Germany

PostPosted: Thu Mar 10, 2022 8:04 pm
Reply with quote

Sergeyken,
I know for superc but I could use macro to give return of warnings and errors from superc when it compares two members, so I want to make it even more compatible like to read only specific codes ec. • IBM1043I I SYSPRINT IS CONTEXTUALLY DECLARED AS FILE.
and not the whole thing as superc gives us. to read lets say that particular code and one line above and one line bellow
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 734
Location: Denmark

PostPosted: Thu Mar 10, 2022 9:52 pm
Reply with quote

Ok I'll bite. The following is a modified snippet from a program of mine, showing how to run SUPERC from a REXX pgm. It can easily be modified to run as an edit macro. It will be up to you to analyze the SUPERC output.

Code:
 lib1='TEST.LIB1(XYZ)'                                       
 lib2='TEST.LIB2(XYZ)'                                       
 cc=GetDataDif()                                                     
 exit 0                                                             
                                                                     
/* Run SUPERC to detect members where data differs */               
GetDataDif:                                                         
 ddlist='supci olddd newdd deldd outdd sysin'                       
 Call XTso "free dd("ddlist")"                                       
 cc=Bpxwdyn('alloc dd(olddd) da('lib1') shr')                       
 cc=Bpxwdyn('alloc dd(newdd) da('lib2') shr')                       
 cc=bpxwdyn('alloc dd(outdd) new delete',                           
            'cyl space(1,10) unit(sysda) reuse')                     
 cc=bpxwdyn('alloc dd(deldd) new delete tracks space(3,3) unit(vio)')
 zz=listdsi('olddd file')                                           
 parse value sysrecfm syslrecl with rf1 lr1 .                       
 zz=listdsi('newdd file')                                           
 parse value sysrecfm syslrecl with rf2 lr2 .                       
 if left(rf1,1)='V' then lr1=lr1-4                                   
 if left(rf2,1)='V' then lr2=lr2-4                                   
 cols ='CMPCOLM 1:'min(lr1,lr2)                                     
                                                                     
 cc=Bpxwdyn('alloc dd(supci) dummy')                                 
 p='COVSUM NARROW ALLMEMS SYSIN(SUPCI)'                             
 Address attchmvs "ISRSUPC P"                                       
 cc=rc                                                               
 address tso "execio * diskr outdd (stem text. finis)"               
 call xtso "free dd("ddlist")"                                       
 if cc>1 then do                                                     
   say 'Bad rc='cc                                                   
   do n=1 to text.0                                                 
     say '->' text.n                                                 
   end                                                               
 end                                                                 
 if cc=0 then Return xmsg('No differences')   
 do tn=1 to text.0                                                   
   say text.tn                                                       
   /* do something with text.tn */                                   
 end                                                                 
 Return 0                                                           
                                                                     
XTSO: trace off; zz=outtrap(word(arg(2) '$.',1))                     
        address tso arg(1);zz=outtrap('off');xtsorc=rc;return rc     
XMsg: if arg(1)<>'' then say arg(1);return word(arg(2) 0,1)         
[/code]
Back to top
View user's profile Send private message
emir_soko

New User


Joined: 10 Mar 2022
Posts: 8
Location: Germany

PostPosted: Thu Mar 10, 2022 10:06 pm
Reply with quote

Mr. Willy Jensen, You are the man.
This one looks like a lot of help for me
Thank you so much

I will keep you updated of my progress.
O would need to make a few changes like having a few different parameters "all" for all output messages, "e1" for specific lines in the dataset, and "prod" for quality compiles.

But thanks for this one
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Thu Mar 10, 2022 10:39 pm
Reply with quote

Quote:
to read lets say that particular code and one line above and one line bellow


1. You can issue the COMPARE command without any parms to see the settings panel. You can set how many lines to other lines to show.

2. Issue COMPARE command with EXCLUDE parameter:
Code:
COMPARE (membr2)  X
and it will show the changed lines as well as a few lines before and after for context.

The beauty of the COMPARE command is that it shows you both the old line and the new line. You can decide which line is better and you can use the MD (makedata) line command to bring the annotations into the data.
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: Sun Mar 13, 2022 8:35 am
Reply with quote

Pedro wrote:
Quote:
to read lets say that particular code and one line above and one line bellow


1. You can issue the COMPARE command without any parms to see the settings panel. You can set how many lines to other lines to show.

2. Issue COMPARE command with EXCLUDE parameter:
Code:
COMPARE (membr2)  X
and it will show the changed lines as well as a few lines before and after for context.

The beauty of the COMPARE command is that it shows you both the old line and the new line. You can decide which line is better and you can use the MD (makedata) line command to bring the annotations into the data.
The COMPARE command is brilliant. It has become my first choice when syncing two versions of source code.
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 Run rexx with JCL Job CLIST & REXX 1
No new posts Run rexx in batch job CLIST & REXX 7
No new posts Does anyone know rexx for VSE CLIST & REXX 3
No new posts TSO ALLOC In REXX Needs Improvement JCL & VSAM 3
No new posts JCL sort to compare dates in two file... DFSORT/ICETOOL 2
Search our Forums:

Back to Top