Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

(MVS) Change all members of PDS

420 views
Skip to first unread message

David Nasser

unread,
May 21, 1997, 3:00:00 AM5/21/97
to

Re: (MVS) Change all members of PDS

Good Souls,

I need a Rexx exec that will implement >=1 global editor changes in
all members of a specified MVS PDS.

The initial specifications in the exec might look something like:
lib='userid.source.lib'
oldstr='old musty/dusty piece of code'
newstr='new and shiny piece of code'
The exec would then proceed to:
1.) Get a member list for userid.source.lib.
2.) Loop for the number of members.
3.) Change oldstr to newstr in each member and save the changes.

I dunno the best way to do 1.). I can probably handle 3.) with
ISPF utilities.

Questions:
a.) Has this wheel been previously invented? Anybody got a
sharable exec that does this kind of thing?
b.) If not, would welcome suggestions for writing such an exec.
I'm not an experienced Rexx pgmr, so detail would be
appreciated.

Salut and Thanks,
David


**********************************************************************
** David Nasser ** nas...@umslvma.umsl.edu **
** Univ. Mo. St. Louis (sometimes) ** **
**********************************************************************;

DMcRitchie

unread,
May 21, 1997, 3:00:00 AM5/21/97
to

Dave, check out IBM published code at

http://booksrv2.raleigh.ibm.com/ispf/allmem.htm

This edit macro will run another edit macro against some or all of the
members of a PDS or ISPF library. To use it, edit a member of the library.
Type ALLMEM
macro or ALLMEM macro prefix on the command line and press Enter. See the
header below for details.

You might want to also check out @DIR in
http://members.aol.com/dmcritchie/nclist.htm look at documentation
first.

David McRitchie
DMcRi...@aol.com

Kevin McGrath

unread,
May 21, 1997, 3:00:00 AM5/21/97
to

>>> David Nasser <NASSER=40UMSLVMA.UMSL.EDU> 1997/05/21 - 08:14 >>>
<snip>
>I need a Rexx exec that will implement >=3D1 global editor changes in

>all members of a specified MVS PDS.

FileAID or equivalant utilities are usually the best alternative, IF =
available.
They may not be ideal if the changes become complex, but for what you
specify in the =27spec=27, they would do the trick.
=20


>The initial specifications in the exec might look something like:

> lib=3D=27userid.source.lib=27
> oldstr=3D=27old musty/dusty piece of code=27
> newstr=3D=27new and shiny piece of code=27


>The exec would then proceed to:
> 1.) Get a member list for userid.source.lib.
> 2.) Loop for the number of members.
> 3.) Change oldstr to newstr in each member and save the changes.

>I dunno the best way to do 1.).
>I can probably handle 3.) with ISPF utilities.

1.) and 2.) can be handled with ISPF LMMLIST.
3.) can be handled by an ISPF EDIT MACRO.
(See example, attached.)

>Questions:
> a.) Has this wheel been previously invented?=20

Yeah...well, kind of. IBM included the original idea for this in the=20
examples in =22ISPF Edit & Edit Macros=22. It was called ALLMBRS,=20
and this code is very similiar. It doesn=27t accept =27from=27 and =
=27to=27
strings, but could be readily modified to do so.

> Anybody got a
> sharable exec that does this kind of thing?

...below. This code was tested, but does not have any real error-
handling. Gussy up to suite.

Kevin McGrath
Boole & Babbage
=22PMS + dyslexia =3D SMP=22

1) Main REXX exec, =27EDITALL=27. Call from ISPF command line option 6:
/* REXX */ =20
trace ?i =20
Arg DSN MAC PATTERN . =20
If DSN =3D =27=27 then exit 12 =20
If MAC =3D =27=27 then exit 12 =20
If PATTERN *=3D =27=27 then PATTERN =3D =27PATTERN(=27PATTERN=27)=27 =
=20
Address ISPEXEC =27LMINIT DATAID(DSID) DATASET(=27DSN=27) ENQ(EXCLU)=27 =
=20
Address ISPEXEC =27LMOPEN DATAID(=27DSID=27) OPTION(INPUT)=27 =
=20
Do while RC =3D 0 =20
Address ISPEXEC =27LMMLIST DATAID(=27DSID=27) OPTION(LIST)=27, =
=20
=27MEMBER(MEMNAME) STATS(NO)=27 PATTERN =20
If RC =3D 0 then =20
Do =20
Say =27Processing member=27 MEMNAME=27....=27 =
=20
Address ISPEXEC =27EDIT DATAID(=27DSID=27) MEMBER(=27MEMNAME=27)=27=
, =20
=27MACRO(=27MAC=27)=27 =
=20
END =20
END =20
Address ISPEXEC =27LMMLIST DATAID(=27DSID=27) OPTION(FREE)=27 =
=20
Address ISPEXEC =27LMCLOSE DATAID(=27DSID=27)=27 =
=20
Address ISPEXEC =27LMFREE DATAID(=27DSID=27)=27 =
=20

2). REXX Edit macro =27NEWTEXT=27:=20
/* REXX */ =20
trace ?i =20
Address ISREDIT /* Default environment. */
=27MACRO=27 /* Must identify as EDIT MACRO */
=27C TEST PROD ALL=27 /* Desired change(s) */
=27(CHG,ERR) =3D CHANGE_COUNTS=27 /* What was the result? */
CHG =3D ABS(CHG) /* Get rid of leading zeros */
ERR =3D ABS(ERR) =20
Say =27 Changes:=27 CHG /* Say the results */
Say =27 Errors: =27 ERR /* Say the results */
=27SAVE=27 /* Explicit incase AUTOSAVE =3D OFF */
=27END=27 /* Must END edit if initial macro must return */

3). To execute:
editall sample.pds newtext ma*
- Execute EDITALL=20
- data set is =27<my-pref>.SAMPLE.PDS=27
- execute edit macro NEWTEXT against each member
- (optional) select member matching name mask MA*

Steven Hughes

unread,
May 21, 1997, 3:00:00 AM5/21/97
to

On Wed, 21 May 1997 10:14:14 CDT, David Nasser
<NAS...@UMSLVMA.UMSL.EDU> wrote:

>Re: (MVS) Change all members of PDS
>
>Good Souls,
>

>I need a Rexx exec that will implement >=1 global editor changes in


>all members of a specified MVS PDS.
>

>The initial specifications in the exec might look something like:

> lib='userid.source.lib'
> oldstr='old musty/dusty piece of code'
> newstr='new and shiny piece of code'

>The exec would then proceed to:
> 1.) Get a member list for userid.source.lib.
> 2.) Loop for the number of members.
> 3.) Change oldstr to newstr in each member and save the changes.
>
>I dunno the best way to do 1.). I can probably handle 3.) with
>ISPF utilities.
>

>Questions:
> a.) Has this wheel been previously invented? Anybody got a


> sharable exec that does this kind of thing?

> b.) If not, would welcome suggestions for writing such an exec.
> I'm not an experienced Rexx pgmr, so detail would be
> appreciated.
>
> Salut and Thanks,
> David
>
>
>**********************************************************************
>** David Nasser ** nas...@umslvma.umsl.edu **
>** Univ. Mo. St. Louis (sometimes) ** **
>**********************************************************************;

Hi,
Yes, I have done this several times. I can give you caode if
needed but to pseudo-code a solution, proceed as follows:

OutTrap(STEM.)

TSO LISTDS partitioned dataset MEMBERS

For each row in STEM variable from 7 onwards
Parse member . (fullstop very important)
Ispexec Edit dataset(member) Macro(rexx macro)
End

And there really not much more to it than that. I actually had one
go to production which used Library Management services, in that the
for loop had lminit before and lmfree after, with lmopen and lmclose
before and after the edit respectively, but that was 'cos ops wanted
it like that.

Your edit macro has the change 'old' 'new' strings.

If you have File-Aid version 8, you can use tyhe compare/replace
option to do exactly that.

HTH,
Steven.

mary sticken

unread,
May 25, 1997, 3:00:00 AM5/25/97
to

IBM already has an assembler utility that does global pds member changes...
called ipoupdte. Ask one of your system programmers.

David Nasser <NAS...@UMSLVMA.UMSL.EDU> wrote in article
<REXXLIST%9705211...@UGA.CC.UGA.EDU>...


> Re: (MVS) Change all members of PDS
>
> Good Souls,
>
> I need a Rexx exec that will implement >=1 global editor changes in
> all members of a specified MVS PDS.

... snip ....

DMcRitchie

unread,
May 26, 1997, 3:00:00 AM5/26/97
to

I believe ipoupdte is licensed only for IPO type installations of IBM
distributions. Is probably limited to working with 80 byte records.

I think you would be a lot better of using other suggestions posted
involving using macros invoked as an IMACRO() or from a REXX execute such
as ALLMEM [http://booksrv2.raleigh.ibm.com/ispf/allmem.htm] so you can
control how you want changes made in your own macro.


kirk sticken

unread,
May 28, 1997, 3:00:00 AM5/28/97
to

DMcRitchie wrote:
> I believe ipoupdte is licensed only for IPO type installations of IBM
> distributions. Is probably limited to working with 80 byte records.
I have yet to see an mvs system without ipoupdte, and although it does
have an 80 byte lrecl limit... most pds's are just that. In any event I
was responding more to the "...wheel invented yet..." question.

0 new messages