View previous topic :: View next topic
|
Author |
Message |
emir_soko
New User
Joined: 10 Mar 2022 Posts: 8 Location: Germany
|
|
|
|
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, |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1335 Location: Bamberg, Germany
|
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2141 Location: USA
|
|
|
|
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, |
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 |
|
|
emir_soko
New User
Joined: 10 Mar 2022 Posts: 8 Location: Germany
|
|
|
|
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 |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 734 Location: Denmark
|
|
|
|
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 |
|
|
emir_soko
New User
Joined: 10 Mar 2022 Posts: 8 Location: Germany
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
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:
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 |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
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:
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 |
|
|
|