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

member list compare


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jzhardy

Active User


Joined: 31 Oct 2006
Posts: 131
Location: brisbane

PostPosted: Fri May 12, 2017 3:18 pm
Reply with quote

does anyone know how to do a member list compare on the command line in ispf ? I can be done by saving member list (save xxx), then 3.13, but I want something immediate, similar to using SRCHFOR to find text across PDS members.

eg, i want to compare X.DEV.JCL with X.TEST.JCL and see differences at the level of member names, optionally showing attribute (update, creation etc) differences.

if not, does anyone have a REXX job to do this ?
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Fri May 12, 2017 3:39 pm
Reply with quote

In Option 3.13, select the Compare Type option: 1. File.
Code:
                               SuperCE Utility                                 
Command ===>                                                                   
                                                                   More:     +
New DS Name  . . . 'X.DEV.JCL'                                             
Old DS Name  . . . 'X.TEST.JCL'                                             
PDS Member List    *         (blank/pattern - member list  * - compare all)
   (Leave New/Old DSN "blank" for concatenated-uncataloged-password panel)     
   Compare Type               Listing Type               Display Output       
   1  1. File                 3  1. OVSUM                1  1. Yes             
      2. Line                    2. Delta                   2. No             
      3. Word                    3. CHNG                    3. Cond           
      4. Byte                    4. Long                    4. UPD             
                                 5. Nolist             
Back to top
View user's profile Send private message
jzhardy

Active User


Joined: 31 Oct 2006
Posts: 131
Location: brisbane

PostPosted: Sat May 13, 2017 5:21 am
Reply with quote

I know this, but that's not what I'm looking for. I want it from a PDS list view. I suspect it's not possible without a REXX script
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Sat May 13, 2017 5:43 am
Reply with quote

Quote:
I want it from a PDS list view. I suspect it's not possible without a REXX script

I believe you can't get what you want on PDS list view, even with REXX.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Wed May 17, 2017 5:06 am
Reply with quote

If I were doing this exercise:

a. issue from command line:
Code:
 VIEW     PEDRO.CLIST.CLIST                              Row 0000001 of 000112
 Command ===> tso %mbrcomp  test.clist                         Scroll ===> CSR
    Name     Prompt          Size    Created           Changed            ID 
 . $                           20   2014/05/16   2014/05/16 10:46:41    PEDRO
 . $ADDSER                     53   2005/08/18   2013/08/14 12:51:48    PEDRO
 . $ADDSER2                    57   2007/09/05   2008/11/20 17:50:18    PEDRO
 . $ADDSER3                    76   2007/09/05   2009/07/22 08:09:25    PEDRO 


b. have the %MBRCOMP exec look at the ZSCREENI variable, which will have a copy of the screen image. Parse it out to determine the name of the PDS you are looking at (the old PDS).

c. use PARSE ARG to determine the compare data set (the new PDS).

d. Issue LMINIT for the old PDS

e. issue LMMLIST SAVE STATS(YES) for the old PDS (maybe to OLD.LIST)

f. Issue LMINIT for the new PDS

g. issue LMMLIST SAVE STATS(YES) for the new PDS (maybe to NEW.LIST)

h. VIEW NEW.LIST with an initial MACRO

I. initial macro will issue COMPARE OLD.LIST statement.

The result will be a comparison of the old member list with the new member list.

of course, this is untested.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Wed May 17, 2017 5:40 pm
Reply with quote

I have been thinking about such a compare dialog for a while and and finally got started on it. So here is the first version. This is still a work in progress. Future versions will be found here:
www.harders-jensen.com/wjtech/programs.html



Code:

REXX program MLCOMP:

/*                                                                REXX   
 Compare memberlists for 2 datasets                                     
 Syntax:  MLCOMP lib1 lib2                                               
 Notes:                                                                 
 - Both librarynames must be fully qualified, quotes are ignored.       
 - If used from ISPF 3.4 you should use MLCOMP / lib2 - otherwise       
   the library order will be reversed.                                   
*/                                                                       
 Address Ispexec                                                         
 "control errors return"                                                 
 table='T'right(left(space(translate(time('l'),' ','.:'),0),10),7)       
 arg ds1 ds2 .             /* ds1 : source, ds2 : target */             
 ds1=UnQuote(ds1)                                                       
 ds2=UnQuote(ds2)                                                       
                                                                         
 parse value '' with l1. l2.                                             
 if MakeMbrList(ds1 'l1.')<>0 then exit                                 
 if MakeMbrList(ds2 'l2.')<>0 then exit                                 
                                                                         
 cond='ALL'                                                             
 Do Forever                                                             
   Call MakeTable                                                       
   if Display()<>0 then leave                                           
   if wordpos(zcmd,'ALL SAME DIF')>0 then cond=zcmd                     
 End                                                                     
 "tbend" table                                                           
 Exit 0                                                                 
                                                                         
Display:                                                                 
 "tbtop" table                                                           
 Do forever                                                             
   zcmd=''                                                               
   "tbdispl" table "panel(MLCOMP#)"                                     
   if rc > 8 then return xmsg('Display rc' rc zerrlm,8)                 
   if rc = 8 then return 1                                               
   if wordpos(zcmd,'ALL SAME DIF')>0 then return 0                       
   if zcmd<>'' then call xmsg 'Invalid command:' zcmd                   
   Do zseln=1 to ztdsels                                                 
     if zseln>1 then "tbdispl" table                                     
     Upper zsel                                                         
     Select                                                             
       when zsel='E1' then "Edit dataset('"ds1"("name")')"               
       when zsel='E2' then "Edit dataset('"ds2"("name")')"               
       otherwise call ispmsg 'Invalid sel' zsel 'for name' name         
     End                                                                 
   End                                                                   
 End                                                                     
 Return 0                                                               
                                                               
MakeTable:                                                     
 "tbend" table                                                 
 "tbcreate" table "names(name ds1stat ds2stat note)"           
 do l1n=1 to l1.0                                               
   name=l1.l1n                                                 
   ds1stat=l1.name                                             
   ds2stat=l2.name                                             
   Select                                                       
     when l2.name='' then note='not in lib2'                   
     when ds1stat=ds2stat then note='same'                     
     when ds1stat= '' & ds2stat<>'' then note='no lib1 stat'   
     when ds1stat<>'' & ds2stat= '' then note='no lib2 stat'   
     when ds1stat<>'' & ds2stat<>'',                           
        & dds1stat>ds2stat then note='lib1 newest'             
     when ds1stat<>'' & ds2stat<>'',                           
        & dds1stat<ds2stat then note='lib2 newest'             
     otherwise note=''                                         
   End                                                         
   if cond='SAME' & note<>'same' then iterate                   
   if cond='DIF'  & note= 'same' then iterate                   
   "tbadd" table                                               
 end                                                           
 ds1stat=''                                                     
 note='not in lib1'                                             
 do l2n=1 to l2.0                                               
   name=l2.l2n                                                 
   if l1.name<>'' then iterate                                 
   ds2stat=l2.name                                             
   if cond='SAME' then iterate                                 
   "tbadd" table                                               
 end                                                           
 "tbsort" table "fields(name,c,a)"                             
 return 0                                                       
                                                                       
/* Make member list stem. Stem base = name, data= member stats */       
MakeMbrList:                                                           
 arg mmlds mmlstem .                                                   
 "lminit dataid(dv) dataset("requote(mmlds)") enq(shr)"                 
 if rc<> 0 then return xmsg("*lminit failed cc" rc,20)                 
 "lmopen  dataid("dv")"                                                 
 if rc<> 0 then  do                                                     
   call MakeMbrListFree                                                 
   return xmsg("Severe error in open:" rc ,20)                         
 end                                                                   
 mbrn=0                                                                 
 mbr=''                                                                 
 do forever                                                             
   "lmmlist dataid("dv") member(mbr) option(list) stats(yes)"           
   if rc<>0 then leave                                                 
   zz  =mbr                                                             
   mbrn=mbrn+1                                                         
   l =left(zlmdate,8) left(zlmtime,5) zluser                           
   zz=Value(mmlstem''mbrn,space(mbr))                                   
   zz=Value(mmlstem''space(mbr),l)                                     
 end                                                                   
 zz=Value(mmlstem'0',mbrn)                                             
 Return MakeMbrListFree()                                               
                                                                       
MakeMbrListFree:                                                       
 "lmmlist dataid("dv") option(free)"                                   
 "lmclose dataid("dv")"                                                 
 "lmfree dataid("dv")"                                                 
 Return 0                                                               
                                                                       
Requote: if arg(1)='' then return '';else return "'"Unquote(arg(1))"'" 
Unquote: return space(translate(arg(1)," ","'"),0)                     
XMsg: if arg(1)<>'' then say arg(1);return word(arg(2) 0,1)             


ISPF panel MLCOMP#:

)Attr                                                             
_ type(input)  color(turq) hilite(uscore)                         
@ type(output) color(turq)                                       
# type(output) color(green)                                       
+ type(text )  color(green)                                       
" type(text )  color(turq )                                       
)Body expand(\\)                                                 
%\ \Compare datasets\ \+                                         
%Cmd =>_zcmd                                                     
+                                                                 
"Primary cmds+ ALL | SAME | DIF
"Line cmds   + E1: edit ds1  E2: edit ds2                         
+                                                                 
"Library 1+ &ds1                                                 
"Library 2+ &ds2                                                 
+                                                                 
%                 Lib1-stats             Lib2-stats               
%   Name     Latest change  Userid  Latest change  Userid  Notes 
)Model clear(zsel)                                               
_z @name    #ds1stat               #ds2stat               #note   
)Init                                                             
 .zvars = '(zsel)'                                               
)Proc                                                             
)End                                                             
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Wed May 17, 2017 8:52 pm
Reply with quote

Found and corrected a bug.
See www.harders-jensen.com/wjtech/programs.html for the fix
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 -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts How to create a list of SAR jobs with... CA Products 3
No new posts Compare two files with a key and writ... SYNCSORT 3
No new posts Build dataset list with properties us... PL/I & Assembler 4
No new posts How to copy the -1 version of a membe... TSO/ISPF 4
Search our Forums:

Back to Top