Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to apply a TSO command for all the PDS members

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
SCARCEBOYZ

New User


Joined: 16 May 2005
Posts: 32
Location: Millenium Business Park, Mumbai

PostPosted: Thu Nov 15, 2007 11:57 am    Post subject: How to apply a TSO command for all the PDS members
Reply with quote

Hello All,

Could anybody explain me how can I apply ReNUM;Unnum TSO command for all the PDS members in one go rather tha changing it one by one.

Thanks,
Vivek Tripathi
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Thu Nov 15, 2007 12:39 pm    Post subject:
Reply with quote

RENUM and UNNUM are not TSO commands; they are ISPF Edit Command.

You can write a REXX to loop through all members in a PDS, then execute and ISPF Edit Macro against each member.

Search the forum for planty of examples.

O.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10254
Location: italy

PostPosted: Thu Nov 15, 2007 1:37 pm    Post subject: Reply to: How to apply a TSO command for all the PDS members
Reply with quote

here is a working sample

Code:

/* 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
Back to top
View user's profile Send private message
SCARCEBOYZ

New User


Joined: 16 May 2005
Posts: 32
Location: Millenium Business Park, Mumbai

PostPosted: Thu Nov 15, 2007 2:02 pm    Post subject:
Reply with quote

Thanks a lot e.s.

This is what I was looking for. Could you please tell me how to install this Rexx and use it for changes as I hav'nt used any Rexx tool before.

Thanks in advance
Vivek
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10254
Location: italy

PostPosted: Thu Nov 15, 2007 2:09 pm    Post subject: Reply to: How to apply a TSO command for all the PDS members
Reply with quote

in a library in Your sysproc concatenation create the 4 members
test them on a copy of Your real data
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Copying Panvalet members to PDS LOGESHWARAN K CA Products 4 Mon Mar 06, 2017 10:45 am
No new posts Customizing the ISPF HILITE Command Pedro TSO/ISPF 3 Fri Mar 03, 2017 11:49 pm
No new posts Fail to change physical VSAM filename... jacobdng CICS 7 Fri Jan 20, 2017 12:36 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us