Page 1 of 1

Using ISPF how to change one word in members of a PDS?

Posted: Fri Apr 18, 2014 10:19 am
by utkarsh
Hi,

I've a PDS with many members and I want to change one word/string to another. Is there any command to change the word in all the members for the given PDS.

Thanks

Re: Using ISPF how to change one word in members of a PDS?

Posted: Fri Apr 18, 2014 2:52 pm
by enrico-sorichetti
check if ...

FILEMANAGER
FILEAID
IPOUPDTE or similar

are available at Your site

Re: Using ISPF how to change one word in members of a PDS?

Posted: Fri Apr 18, 2014 3:33 pm
by Anuj Dhawan
Your subject line talks about ISPF and your post is also in ISPF part of the Forum but with native ISPF you won't be able to do it. As Enrico said, do you've File-Aid (With File-Aid I've done this) or similar product available at your shop that might help you? Otherwise you might want to write a small REXX for this.

Re: Using ISPF how to change one word in members of a PDS?

Posted: Fri Apr 18, 2014 4:56 pm
by zprogrammer
Pseudocode something like this could be done

1.Get the members
2.Edit the dataset with Macro for all members / selected members
3.End process

Re: Using ISPF how to change one word in members of a PDS?

Posted: Fri Aug 05, 2016 2:50 pm
by utkarsh
I used File-Aid to this finally. viewtopic.php?f=24&t=777 thread has also helped in this.

Re: Using ISPF how to change one word in members of a PDS?

Posted: Fri Aug 05, 2016 8:02 pm
by nicc
Thanks for coming back with your solution! If only more people would do this (and as soon as possible after the solution was found).
Posted solutions provide a better forum.

Re: Using ISPF how to change one word in members of a PDS?

Posted: Sat Aug 06, 2016 12:49 am
by Lbdyck
There are numerous tools that will do this. Some have been mentioned but one of the best, and free, is the PDS command which can be found on FILE 182 on the CBTTape.org site.

Another approach is to write a rexx exec that lists all the members of the pds and then invokes an ispf edit macro on each member. that edit macro can then issue the change command to change the word within each member.

Re: Using ISPF how to change one word in members of a PDS?

Posted: Sat Aug 06, 2016 3:17 pm
by enrico-sorichetti
even if the original topic is pretty old...
see here how to apply a macro to all the member of a pds

Code: Select all

/* comment  $apply is an edit macro which will apply the edit macro passed as a
/* comment  parameter to all the member of a pds
/* comment  to use it .... open a new, emty pds member and..
/* comment  type in the command line "$APPLY name_of_the_macro"
/* comment 
/* comment  included are 3 samples  
/* comment   
/* comment  $UNPACK.. the name tells
/* comment  $RENUM... 
/* comment  $UNNUM
/* comment


/*REXX - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* $APPLY                                                            */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Trace "O"

Parse Source _system _called _commnd .

If Sysvar(SYSISPF) /= "ACTIVE" Then Do
   Say left(_commnd,8)"- Ispf is not active. Command not executed"
   Exit 4
End

call $init_

call $ispex "CONTROL ERRORS RETURN"

if $isred("MACRO (ZPARMS) NOPROCESS ") = 0 then do
   _parms = strip(translate(zparms))
end
else do
   zerrsm = "Invocation ERROR"
   zerrlm = left(_commnd,8)"- Must be invoked as an edit macro"
   call   $ispex "SETMSG MSG(ISRZ002) "
   Exit 1
end

call getopt_

if _help then do
   call  $ispex "DISPLAY PANEL("zerrhm") "
   exit 1
end

If _parms = ""  Then do
   zerrsm = left(_commnd,8)"- No Parms"
   zerrlm = left(_commnd,8)"- Enter The 'MACRO' to be run ....."
   call   $ispex "SETMSG MSG(ISRZ002) "
   Exit 1
end

macro = _parms

call $isred "(DATASET) = DATASET"
call $isred "(CURRNT)  = MEMBER"
call $isred("(DATAID)  = DATAID" )

call $isred("DELETE .ZFIRST .ZLAST" )

lmo_rc = $ispex("LMOPEN DATAID("dataid") OPTION(INPUT) ")

count  = 0
member = ""

lmmlist  = "LMMLIST DATAID("dataid") OPTION(LIST) MEMBER(MEMBER) "
do while 0 = $ispex(lmmlist)
   if strip(member) /= strip(currnt) then do
      done = "EDITED"
      edit = "EDIT DATAID("dataid") MEMBER("member") MACRO("macro") "
      zrc = $ispex(edit) 
      if zrc = 0 then , 
         done = "SAVED" 
      else if zrc = 4 then , 
         done = "NOT SAVED RC("zrc") " 
      else , 
         done = "UNEXPECTED RC("zrc") " 
      count = count + 1
      line  = dataset"("member")"
      call  $isred "LINE_AFTER " Line " = DATALINE (LINE) "
   end
   else ,
      done = "NOT SELECTD"
   line  = left(done,13) dataset"("member")"
   call  $isred "LINE_AFTER .ZLAST = DATALINE (LINE) "
end

lmo_rc = $ispex("LMMLIST DATAID("dataid") OPTION(FREE) " )
lmo_rc = $ispex("LMCLOSE DATAID("dataid") " )

if _endmsg then do
   zedsmsg = left(_commnd,8)"- Done "count
   zedlmsg = left(_commnd,8)"- " || Count || " Members Modified"
   call   $ispex "SETMSG MSG(ISRZ000) "
   exit 1
end

Exit

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                                                                   */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
$init_:

   ini_0tr  = trace("O")
   _help    = 0
   _endmsg  = 1
   zerralrm = "YES"
   zerrhm   = "ISR2MACR"

   _plis.0   = 2
   _plis.1   = "? H HELP"
   _pset.1   = "_help = 1"

   trace value(ini_0tr)
   return

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                                                                   */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
$ispex:
   isp_0tr = trace("O")
   Address ISPEXEC arg(1)
   isp_0rc = rc
   trace value(isp_0tr)
   return isp_0rc

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                                                                   */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
$isred:
   isr_0tr = trace("O")
   Address ISREDIT arg(1)
   isr_0rc = rc
   trace value(isr_0tr)
   return isr_0rc

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                                                                   */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
$tsoex:
   tso_0tr = trace("O")
   Address TSO arg(1)
   tso_0rc = rc
   trace value(tso_0tr)
   return tso_0rc

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                                                                   */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
getopt_:
opt_0tr = trace()
do _l = 1 to _plis.0
   _parm._l = ""
   do _w = 1 to words(_plis._l)
      _p = wordpos(word(_plis._l,_w),_parms)
      if _p /= 0 then do
         if _parm._l = "" then do
            _parm._l = strip(word(_parms,_p))
            if symbol("_pset._l._w") = "VAR" then ,
               interpret _pset._l._w
            else ,
               interpret _pset._l
         end
         _parms = delword(_parms,_p,1)
      end
   end
end
Trace value(opt_0tr)
return

/*REXX - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*  $UNPACK                                                          */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Trace "O"

Parse Source _system _called _commnd .

If Sysvar(SYSISPF) /= "ACTIVE" Then Do
   Say left(_commnd,8)"- Ispf is not active. Command not executed"
   Exit 4
End

call $init_

call $ispex "CONTROL ERRORS RETURN"

if $isred("MACRO (ZPARMS) NOPROCESS ") = 0 then do
   _parms = strip(translate(zparms))
end
else do
   zerrsm = "Invocation ERROR"
   zerrlm = left(_commnd,8)"- Must be invoked as an edit macro"
   call   $ispex "SETMSG MSG(ISRZ002) "
   Exit 1
end

call $isred "(PACK) = PACK "
if pack = "ON" then do
   call $isred "PACK OFF"
   call $isred "END"
end
else do
   call $isred "CANCEL"
end

Exit

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                                                                   */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
$init_:
   ini_0tr  = trace("O")
   zerralrm = "YES"
   zerrhm   = "ISR2MACR"
   ini_0rc  = 0
   trace value(ini_0tr)
   return ini_0rc

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                                                                   */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
$tsoex:
   tso_0tr = trace("O")
   Address TSO arg(1)
   tso_0rc = rc
   trace value(tso_0tr)
   return tso_0rc

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                                                                   */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
$ispex:
   isp_0tr = trace("O")
   Address ISPEXEC arg(1)
   isp_0rc = rc
   trace value(isp_0tr)
   return isp_0rc

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                                                                   */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
$isred:
   isr_0tr = trace("O")
   Address ISREDIT arg(1)
   isr_0rc = rc
   trace value(isr_0tr)
   return isr_0rc

/*REXX - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* $RENUM                                                            */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Trace "O"

Parse Source _system _called _commnd .

If Sysvar(SYSISPF) /= "ACTIVE" Then Do
   Say left(_commnd,8)"- Ispf is not active. Command not executed"
   Exit 4
End

call $init_

call $ispex "CONTROL ERRORS RETURN"

if $isred("MACRO (ZPARMS) NOPROCESS ") = 0 then do
   _parms = strip(translate(zparms))
end
else do
   zerrsm = "Invocation ERROR"
   zerrlm = left(_commnd,8)"- Must be invoked as an edit macro"
   call   $ispex "SETMSG MSG(ISRZ002) "
   Exit 1
end

call $isred "(NUMB) = NUMBER"
numb = translate(strip(word(numb,2)))
if numb = "OFF" then ,
   call $isred "NUMBER ON"

call $isred "RENUM"
call $isred "END"

Exit

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                                                                   */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
$init_:
   ini_0tr  = trace("O")
   zerralrm = "YES"
   zerrhm   = "ISR2MACR"
   ini_0rc  = 0
   trace value(ini_0tr)
   return ini_0rc

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                                                                   */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
$tsoex:
   tso_0tr = trace("O")
   Address TSO arg(1)
   tso_0rc = rc
   trace value(tso_0tr)
   return tso_0rc

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                                                                   */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
$ispex:
   isp_0tr = trace("O")
   Address ISPEXEC arg(1)
   isp_0rc = rc
   trace value(isp_0tr)
   return isp_0rc

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                                                                   */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
$isred:
   isr_0tr = trace("O")
   Address ISREDIT arg(1)
   isr_0rc = rc
   trace value(isr_0tr)
   return isr_0rc

/*REXX - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* $UNNUM                                                            */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Trace "O"

Parse Source _system _called _commnd .

If Sysvar(SYSISPF) /= "ACTIVE" Then Do
   Say left(_commnd,8)"- Ispf is not active. Command not executed"
   Exit 4
End

call $init_

call $ispex "CONTROL ERRORS RETURN"

if $isred("MACRO (ZPARMS) NOPROCESS ") = 0 then do
   _parms = strip(translate(zparms))
end
else do
   zerrsm = "Invocation ERROR"
   zerrlm = left(_commnd,8)"- Must be invoked as an edit macro"
   call   $ispex "SETMSG MSG(ISRZ002) "
   Exit 1
end


call $isred "(NUMB) = NUMBER"
numb = translate(strip(word(numb,2)))
if numb = "OFF" then ,
   call $isred "NUMBER ON"

call $isred "RENUM"
call $isred "END"

Exit

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                                                                   */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
$init_:
   ini_0tr  = trace("O")
   zerralrm = "YES"
   zerrhm   = "ISR2MACR"
   ini_0rc  = 0
   trace value(ini_0tr)
   return ini_0rc

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                                                                   */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
$tsoex:
   tso_0tr = trace("O")
   Address TSO arg(1)
   tso_0rc = rc
   trace value(tso_0tr)
   return tso_0rc

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                                                                   */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
$ispex:
   isp_0tr = trace("O")
   Address ISPEXEC arg(1)
   isp_0rc = rc
   trace value(isp_0tr)
   return isp_0rc

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                                                                   */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
$isred:
   isr_0tr = trace("O")
   Address ISREDIT arg(1)
   isr_0rc = rc
   trace value(isr_0tr)
   return isr_0rc

Re: Using ISPF how to change one word in members of a PDS?

Posted: Sat Aug 06, 2016 4:21 pm
by enrico-sorichetti
since I am at it

here is an ISPF Dialog to "mass change" strings in a PDS
it has member name filtering facilities
and process members using a string found/not found logic
( process a member if it contains/does-not-contain string )


note note note
the FROM and TO strings can be any valid FROM/TO string accepted by ISPF
done some elementary checking for bad tokens,
a symptom of a missing check is a return code of 20 fro edit
note note note

REXX scripts
MASSCHG
MASSCHG2

panel(s)
MASSCHG

skels
MASSCHG1
MASSCHG2
MASSCHG3

support elements
panel(s)
XNOHELP
messages
XMSG00

the scripts

Code: Select all

/* REXX */
Trace "O"

Parse Source _sys _how _cmd .

chgcmd = _cmd

If Sysvar(SYSISPF) \= "ACTIVE" Then Do
   Say left(_cmd,8)"- Ispf is not active. Command not executed"
   Exit 4
End
/*
call $ispex "CONTROL ERRORS RETURN"
 */
xRC = $ispex("FTOPEN TEMP")
If xRC \= 0 Then Do
   xmsgsm = left(_cmd,8)"- RC("xRC")"
   xmsglm = left(_cmd,8)"- RC("xRC") FTOPEN "
   call    $ispex "SETMSG MSG(XMSG001) "
   exit
End
disp = 0

do while ( $ispex("DISPLAY PANEL(MASSCHG) ") = 0 )

   cmax = strip(cmax)
   filt = strip(filt)
   opts = space(opts)
   if  opts = "" then ,
       opts = "ALL"
   exclSTR = strip(exclSTR)
   inclSTR = strip(inclSTR)

   call $ispex "VPUT (CMAX, OPTS, exclSTR, inclSTR ) SHARED "
   do  i  = 1 to cmax
       if  symbol("fromSTR"i) \= "VAR" then
           z =  value("fromSTR"i,"")
       if  symbol("toSTR"i) \= "VAR" then
           z =  value("toSTR"i,"")
       call $ispex "VPUT (fromSTR"i" toSTR"i") SHARED "
   end

   call $ispex "FTINCL MASSCHG1 "
   disp = 1

   /* LMINIT */
   xRC = $ispex("LMINIT DATAID(ID) DATASET("dsnm") ENQ(SHR) ")
   If xRC \= 0 Then Do
      xmsgsm = left(_cmd,8)"- RC("xRC")"
      xmsglm = left(_cmd,8)"- "zerrlm
      call    $ispex "SETMSG MSG(XMSG001) "
      iterate
   End

   /* LMOPEN */
   xRC = $ispex("LMOPEN DATAID("ID") OPTION(INPUT) ")
   If xRC \= 0 Then Do
      xmsgsm = left(_cmd,8)"- RC("xRC")"
      xmsglm = left(_cmd,8)"- "zerrlm
      call    $ispex "SETMSG MSG(XMSG001) "
      call    $ispex "LMFREE DATAID("ID") "
      iterate
   End

   memb = ""
   coun = 0
   lmmlist = "LMMLIST DATAID("ID") OPTION (LIST) " || ,
             "MEMBER(MEMB) PATTERN("filt") "
   do while ($ispex(lmmlist) = 0 )
      edit = "EDIT DATAID("id") MEMBER("memb") MACRO(MASSCHG2) "
      xEDRC = $ispex(edit)
      if xEDRC = 0 then ,
         done = "SAVED"
      else ,
         done = "NOT CHANGED"
      coun  = coun  + 1

      call $ispex "VGET (CHGS,ERRS) SHARED "
      call $ispex "FTINCL MASSCHG2 "
   end
   /* LMMLIST FREE */
   xRC = $ispex("LMMLIST DATAID("ID") OPTION (FREE) ")

   /* LMCLOSE */
   xRC = $ispex("LMCLOSE DATAID("ID") ")
   If xRC \= 0 Then Do
      xmsgsm = left(_cmd,8)"- RC("xRC")"
      xmsglm = left(_cmd,8)"- "zerrlm
      call    $ispex "SETMSG MSG(XMSG001) "
   End

   /* LMFREE */
   xRC = $ispex("LMFREE DATAID("ID") ")
   If xRC \= 0 Then Do
      xmsgsm = left(_cmd,8)"- RC("xRC")"
      xmsglm = left(_cmd,8)"- "zerrlm
      call    $ispex "SETMSG MSG(XMSG001) "
   End

   call $ispex "FTINCL MASSCHG3 "

   xmsgsm  = left(_cmd,8)"- done"
   xmsglm  = left(_cmd,8)"- done"
   call    $ispex "SETMSG MSG(XMSG001) "

End

call $ispex "FTCLOSE"
if  disp = 1 then do
    call $ispex "VGET ZTEMPF"
    call $ispex "VIEW DATASET('"ZTEMPF"') "
end

xmsgsm  = left(_cmd,8)"- done"
xmsglm  = left(_cmd,8)"- done"
call    $ispex "SETMSG MSG(XMSG001) "

Exit

/* */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
$ispex:
   isp_0tr = trace("O")
   Address ISPEXEC arg(1)
   isp_0rc = rc
   trace value(isp_0tr)
   return isp_0rc

/* */
$isred:
   isr_0tr = trace("O")
   Address ISREDIT arg(1)
   isr_0rc = rc
   trace value(isr_0tr)
   return isr_0rc

/* */
$tsoex:
   tso_0tr = trace("O")
   Address TSO arg(1)
   tso_0rc = rc
   trace value(tso_0tr)
   return tso_0rc

Code: Select all

/* REXX */
Trace "O"

Parse Source _sys _how _cmd .

If Sysvar(SYSISPF) \= "ACTIVE" Then Do
   Say left(_cmd,8)"- Ispf is not active. Command not executed"
   Exit 4
End

/*
call $ispex "CONTROL ERRORS RETURN"
 */
chgs = 0; errs = 0
call $ispex "VPUT (CHGS,ERRS) SHARED"

if  $isred("MACRO (ZPARMS) NOPROCESS ") \= 0 then
    exit 8

if  $ispex("VGET (cmax,opts,exclSTR,inclSTR) SHARED" ) = 0 then do
    do  i  = 1 to cmax
        call $ispex "VGET (fromSTR"i" toSTR"i") SHARED"
    end

    if  strip(inclSTR) = "" then ,
        inclRC = 0
    else ,
        inclRC = $isred("FIND  &&inclSTR. FIRST")
    if  strip(exclSTR) = "" then ,
        exclRC = 4
    else ,
        exclRC = $isred("FIND  &&exclSTR. FIRST")

    if  inclRC = 0 & exclRC = 4 then do
        chgs = 0; errs = 0
        do  i = 1 to cmax
            fromSTR = VALUE("fromSTR"i)
            if  strip(fromSTR) = "" then ,
                iterate
            toSTR = VALUE("toSTR"i)
            xRC =  $isred("CHANGE &&fromSTR. &&toSTR. ALL")
            call $isred "(C,E) = CHANGE_COUNTS"
            chgs = chgs + c
            errs = errs + e
         end
         call $ispex "VPUT (CHGS,ERRS) SHARED"
         if  errs = 0 then do
             call $isred "END"
             exit 0
         end
     end
end
call $isred "CANCEL"
exit 1

/* */
$tsoex:
   tso_0tr = trace("O")
   Address TSO arg(1)
   tso_0rc = rc
   trace value(tso_0tr)
   return tso_0rc

/* */
$ispex:
   isp_0tr = trace("O")
   Address ISPEXEC arg(1)
   isp_0rc = rc
   trace value(isp_0tr)
   return isp_0rc

/* */
$isred:
   isr_0tr = trace("O")
   Address ISREDIT arg(1)
   isr_0rc = rc
   trace value(isr_0tr)
   return isr_0rc
the panel

Code: Select all

)ATTR DEFAULT(%+_)
 $ TYPE(INPUT) INTENS(LOW) PAD(' ')
 ! TYPE(INPUT) INTENS(LOW) CAPS(OFF) JUST(ASIS)
)BODY EXPAND(\\)
%-\-\- Mass Change -\-\-
%COMMAND ===>_ZCMD
+
+Dataset        ==>$dsnm                                            +
+: From                                 +: To
+:!fromSTR1                             +:!toSTR1
+:!fromSTR2                             +:!toSTR2
+:!fromSTR3                             +:!toSTR3
+:!fromSTR4                             +:!toSTR4
+:!fromSTR5                             +:!toSTR5
+:!fromSTR6                             +:!toSTR6
+-\-\-
+:From/To
+-\-\-
+:!fromSTR7
+:!toSTR7
+-\-\-
+:!fromSTR8
+:!toSTR8
+-\-\-
+ Options        ==>$opts                                            +
+ Mbr  Filter    ==>$filt                                            +
+ Excl Trigger   ==>$exclSTR                                         +
+ Incl Trigger   ==>$inclSTR                                         +
)INIT
)REINIT
)PROC
 &cmax = 8
 ver(&dsnm,nb,dsname)
 ver(&fromSTR1,nb)
 ver(&toSTR1,nb)
 IF (&fromSTR2 ^= ' ')
    VER(&toSTR2,NB)
 IF (&fromSTR3 ^= ' ')
    VER(&toSTR3,NB)
 IF (&fromSTR4 ^= ' ')
    VER(&toSTR4,NB)
 IF (&fromSTR5 ^= ' ')
    VER(&toSTR5,NB)
 IF (&fromSTR6 ^= ' ')
    VER(&toSTR6,NB)
 IF (&fromSTR7 ^= ' ')
    VER(&toSTR7,NB)
 IF (&fromSTR8 ^= ' ')
    VER(&toSTR8,NB)

*REXX(*,CMAX,XMSGSM,XMSGLM)
do i = 1 to cmax
   wstr = translate(strip(VALUE("fromSTR"i)))
   if wordpos(wstr,"NEXT    PREV    FIRST   LAST     ALL") > 0 then ,
       signal strerr
   if wordpos(wstr,"CHARS   PREFIX  SUFFIX  WORD") > 0 then ,
       signal strerr
   if wordpos(wstr,"X      NX") > 0 then ,
       signal strerr
   wstr = translate(strip(VALUE("toSTR"i)))
   if wordpos(wstr,"NEXT    PREV    FIRST   LAST     ALL") > 0 then ,
       signal strerr
   if wordpos(wstr,"CHARS   PREFIX  SUFFIX  WORD") > 0 then ,
       signal strerr
   if wordpos(wstr,"X      NX") > 0 then ,
       signal strerr
end
zrxrc = 0
return

strerr:
xmsgsm = "ERROR"
xmsglm = "From/To invalid string"
zrxmsg = "XMSG001"
zrxrc  = 8
return
*ENDREXX

)END
the skels

Code: Select all

)DEFAULT  )&?!<|>
)CM
)SETF XC = &LEFT(&CHGCMD,8)
Dataset : &dsnm
)BLANK
)IF &FILT ^= &Z THEN
Filter  : &filt
)IF &OPTS ^= &Z THEN
Options : &opts
)IF &exclSTR ^= &Z THEN
Exclude : &exclSTR
)IF &inclSTR ^= &Z THEN
Include : &inclSTR
)BLANK
)IF &fromSTR1 ^= &Z THEN )DO
From/To : &fromSTR1
        : &toSTR1
)ENDDO
)IF &fromSTR2 ^= &Z THEN )DO
From/To : &fromSTR2
        : &toSTR2
)ENDDO
)IF &fromSTR3 ^= &Z THEN )DO
From/To : &fromSTR3
        : &toSTR3
)ENDDO
)IF &fromSTR4 ^= &Z THEN )DO
From/To : &fromSTR4
        : &toSTR4
)ENDDO
)IF &fromSTR5 ^= &Z THEN )DO
From/To : &fromSTR5
        : &toSTR5
)ENDDO
)IF &fromSTR6 ^= &Z THEN )DO
From/To : &fromSTR6
        : &toSTR6
)ENDDO
)IF &fromSTR7 ^= &Z THEN )DO
From/To : &fromSTR7
        : &toSTR7
)ENDDO
)IF &fromSTR8 ^= &Z THEN )DO
From/To : &fromSTR8
        : &toSTR8
)ENDDO
)BLANK

Code: Select all

)DEFAULT  )&?!<|>
)CM
)SETF MB = &LEFT(&MEMB,8)
)SETF CC = &STRIP(&CHGS,L,0)
)SETF EC = &STRIP(&ERRS,L,0)
)IF &XEDRC = 0  THEN
Member  : &MB Chgs(&CC) Errs(&EC)                                         
)ELSE
Member  : &MB NOT CHANGED                                                 

Code: Select all

)DEFAULT  )&?!<|>
)CM
)BLANK
Process : &coun                                                           
)BLANK 2
the support panel

Code: Select all

)ATTR
   @ AREA(SCRL) EXTEND(ON)
   % TYPE(ET)
   _ TYPE(NEF) PAD(USER) CAPS(ON)
   + TYPE(NT)
)BODY EXPAND(\\)
%-\-\- T U T O R I A L  -\-\-
%OPTION  ===>_ZCMD                                                             +
@SAREA1                                                                        @
)AREA SAREA1
%
%
%      ******************************************************************
%      *                                                                *
%      *                                                                *
%      *                              SORRY                             *
%      *                                                                *
%      *                                                                *
%      *                There is no tutorial to be viewed.              *
%      *                                                                *
%      *                                                                *
%      *                       +Enter%END+to return.                    *
%      *                                                                *
%      *                                                                *
%      ******************************************************************
)PROC
)END
the support messages

Code: Select all

XMSG000  '&XMSGSM' .ALARM = &XALARM  .HELP = &XHELP NOKANA
'&XMSGLM'
XMSG001  '&XMSGSM' .ALARM = NO  .HELP = XNOHELP NOKANA
'&XMSGLM'
XMSG002  '&XMSGSM' .ALARM = NO  .HELP = XNOHELP NOKANA
'&XMSGLM'
there are still a couple of glitches,
but nothing so serious to make the thing unusable
enjoy

--)

Re: Using ISPF how to change one word in members of a PDS?

Posted: Thu Aug 11, 2016 8:53 pm
by utkarsh
Thanks a lot for the help, I'm working these aids. :)

Great help.