i need to change all the occurence of a particular occurence string in a DS. i.e; i need not open all the members individually and change the occurece with a new value. i need to change all the occurence with one stroke.
i know the command SRCHFOR 'string' to look for string in all members of a DS. i want the command to replace.
Joined: 01 Mar 2006 Posts: 290 Location: Basel, Switzerland
1. make a simple edit-macro with that CHANGE command you need
2. create a memberlist with LMMLIST
3. if you have more than one dataset, you can first create a datasetlist with LMDLIST
4. if you are sure that there is no redundant naming for those members,
you can allocate a dd with all the datasets, then you create a memberlist
upon that dd
5. invoke repetitive EDIT DATASET('dsname(membername)') MACRO(yourmacro) PARM(your occurrence string)
6. don't forget in your edit-macro the END command, for the flow will
continue and the member is saved
Joined: 01 Mar 2006 Posts: 290 Location: Basel, Switzerland
do you have any utility on your mainframe like qwickref ...?
this is an ISPF service...
LMMLIST - List a Library's Members
The LMMLIST service, when used with the LIST or SAVE option, creates a
list of the first occurrence of all the members in an ISPF library, a
concatenated set of ISPF libraries, or an MVS partitioned data set
associated with the given data ID.
When you invoke LMMLIST for the first time with the LIST option, the
MEMBER variable determines the starting position within the member list.
To position at the beginning, set the MEMBER variable to blanks. If the
requested member is not found, the next member in the member list is
returned. The member list is sorted by member name. Repeated innvocation
of LMMLIST provides access to each member name in the member list.
Use LMMLIST with the SAVE option to write a list of member names to a data
set. If a MEMBER variable is nonblank, the member name you specify will be
the first member in the list.
You must complete the LMINIT and LMOPEN services before using LMMLIST. Use
the LMMLIST FREE option to release the list storage space when it is not
Note: Member lists generated by LMMLIST cannot be displayed by LMMDISP,
and member lists generated by LMMDISP cannot be used with LMMLIST.
Member lists should be freed when switching between LMMLIST and
LMMDISP with the same data ID.
Command Invocation Format
Call Invocation Format
The data ID associated with the ISPF library, concatenated group of
ISPF libraries, or MVS partitioned data set for which the member list
is to be created. The data ID has been generated by the LMINIT
service. The maximum length of this parameter is 8 characters.
These options determine the action performed by the LMMLIST service.
LIST The first time that you invoke the LMMLIST service with the
LIST option (the default value), it creates a member list
for use by a dialog.
If member-var is initialized to blanks, the first name in
the member list is returned. If member-var is set to a
member name for a starting position within the member list,
that member name is returned in member-var. If the member is
not found, the next member in the member list is returned.
If you request statistics information for the member, the
statistics are returned.
Later invocations of LMMLIST with the LIST option return
succeeding member names and their statistics, if requested,
until the end of the list is reached, as indicated by return
code. At this point, the dialog should invoke LMMLIST with
the FREE option.
FREE The FREE option specifies that the storage acquired to
create the member list is to be freed. Each creation of a
member list should be matched by an invocation of LMMLIST
with the FREE option.
SAVE The SAVE option writes all member names in a list specified
by the data ID to a data set. The name of the data set is
determined by the presence and value of the GROUP parameter.
The name of the variable into which the name of the member used for
positioning in the member list is specified, or the name of the next
member in the list is to be stored. The maximum length of this
parameter is 8 characters.
When you invoke LMMLIST for the first time, member-var is used for
selecting a starting position within the member list. If the member is
found, that member name is returned in member-var. If the requested
member is not found, the next member in the member list is returned.
To start at the beginning of the list, set member-var to blanks.
The member-var parameter serves the same purpose for the SAVE option
as it does for the LIST option. When LMMLIST is used with OPTION
(SAVE), a list of member names is written to a data set. If member-var
is nonblank, the member name you specify is the first member in the
The STATS parameter can only be used with the LIST and SAVE options.
The default is STATS(NO). If you specify STATS(YES) the LMMLIST
service provides member statistics with the member names. This
parameter is fully described under "LMMFIND - Find a Library Member"
in item LMMFIND.
This 8-character value specifies the group name of the data set that
the LMMLIST service writes the member names list with the SAVE option.
The entire data set name is <prefix>.<group>.MEMBERS. If you do not
specify a group name the LMMLIST service writes to the ISPF LIST data
Note: LMMLIST service allocates the output data set with a DISP=OLD
for the SAVE option.
The character string that is used to specify which members are to be
returned. See the section on naming ISPF libraries and data sets in
the ISPF User's Guide Volume I for a more complete description of
patterns and pattern matching.
When SAVE is selected to save the member list to a dataset, LONG
formats all dates in yyyy/mm/dd format for the member. Additionally,
for PDS datasets not containing load libraries, the untranslated
member name is written after the member name.
A fullword fixed binary integer containing the length of the buffer
A buffer containing the name of the service and its parameters in the
same form as they would appear in an ISPEXEC invocation for a command
The following return codes are possible:
0 One of the following:
o LIST option - Normal completion. The member list is
available and the next member in the list is returned in the
o FREE option - Normal completion. The member list is freed
o SAVE option - Normal completion. The member list is
successfully written to a data set.
4 Empty member list.
8 One of the following:
o LIST option - End of member list.
o FREE option - Member list does not exist.
o SAVE option - For a data ID, the LMMLIST service has been
invoked with the SAVE option after being invoked with LIST
option, but before being invoked with the FREE option.
10 No data set is associated with the given data ID; that is,
LMINIT has not been completed.
12 One of the following:
o The data set is not open or is not partitioned.
o A parameter value is invalid.
o Member list was created using LMMDISP.
16 A truncation or translation error occurred in accessing dialog
20 Severe error; unable to continue.
This example invokes the LMMLIST service with the LIST option to create a
member list of the data set associated with the data ID in variable DDVAR
and to return the first member namein the list in variable MEMVAR.
//STEP0001 EXEC PGM=FILEAID
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//DD01 DD DSN=(PDSName),DISP=SHR within which you want to //* replace all the occurance of a string with another string
//SYSIN DD *
$$DD01 UPDATE RA=(1,0,C'str1', C'str2')