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

changing all the occurences of particular string.


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

Active User


Joined: 02 Dec 2005
Posts: 109

PostPosted: Fri Feb 24, 2006 5:55 pm
Reply with quote

hi all,

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.


kind regards,

gowtham
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Fri Feb 24, 2006 8:07 pm
Reply with quote

If you would like to run a REXX Script... This link may help you.....

http://ibmmainframes.com/viewtopic.php?t=2652

Regards,

Priyesh.
Back to top
View user's profile Send private message
gowtham_1982
Warnings : 1

Active User


Joined: 02 Dec 2005
Posts: 109

PostPosted: Wed Mar 01, 2006 9:05 am
Reply with quote

priyesh.agrawal wrote:
If you would like to run a REXX Script... This link may help you.....

http://ibmmainframes.com/viewtopic.php?t=2652

Regards,

Priyesh.



Thanks for the response Priyesh. Let me look into it. In the mean time, are you aware of any particular command for it?

suggestions welcomed...

gowtham
Back to top
View user's profile Send private message
martin9

Active User


Joined: 01 Mar 2006
Posts: 290
Location: Basel, Switzerland

PostPosted: Fri Mar 10, 2006 6:48 pm
Reply with quote

hy gowtham_1982,

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

you can run this in online or batch, no problem.

martin9
Back to top
View user's profile Send private message
gowtham_1982
Warnings : 1

Active User


Joined: 02 Dec 2005
Posts: 109

PostPosted: Thu Mar 16, 2006 9:11 am
Reply with quote

hi martin9,

sorry to say that i'm unclear with your explanation. how to create a member list or LMMLIST command? can you please provide me more info in this?


that will be very very great.

kind regards,

gowtham
Back to top
View user's profile Send private message
martin9

Active User


Joined: 01 Mar 2006
Posts: 290
Location: Basel, Switzerland

PostPosted: Thu Mar 16, 2006 6:36 pm
Reply with quote

hy gowtham,

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
needed.

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.

Subtopics
Command Invocation Format
Call Invocation Format
Parameters
Return Codes
Example


Command Invocation Format:

ISPEXEC LMMLIST DATAID(data-id)
?OPTION(LIST!FREE!SAVE)|

?MEMBER(member-var)|

?STATS(YES!NO)|

?GROUP(group)|

?PATTERN(member-pattern)|

?LONG
|


Call Invocation Format:

CALL ISPLINK ('LMMLIST ',data-id
,?'LIST '!'FREE '!'SAVE '|

,?member-var|

,?'YES '!'NO '|

,?group|

,?member-pattern|

,?'LONG '
|);

OR

CALL ISPEXEC (buf-len, buffer);


Parameters:

data-id
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.

LIST!FREE!SAVE
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.

member-var
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
list.

YES!NO
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.

group
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
set.

Note: LMMLIST service allocates the output data set with a DISP=OLD
for the SAVE option.

member-pattern
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.

LONG
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.

buf-len
A fullword fixed binary integer containing the length of the buffer
parameter.

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
invocation.


Return Codes:

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
member-var parameter.

o FREE option - Normal completion. The member list is freed
successfully.

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
variables.

20 Severe error; unable to continue.


Example:

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.

Subtopics
Command Invocation
Call Invocation
Command Invocation
Call Invocation


Command Invocation:

In this example, the LMMLIST service LIST option creates a member list of
the data set associated with the data ID in variable DDVAR and returns the
first member name in the list to variable MEMVAR.

SET &MEMVAR =
ISPEXEC LMMLIST DATAID(&DDVAR) OPTION(LIST) +
MEMBER(MEMVAR)


Call Invocation:

MEMVAR = ' ';
CALL ISPLINK ('LMMLIST ',DDVAR,'LIST ','MEMVAR ' );
OR

Set the program variable BUFFER to contain:

MEMVAR= ' ';
BUFFER = 'LMMLIST DATAID(&DDVAR) OPTION(LIST)
MEMBER(MEMVAR)';

Set the program variable BUFLEN to the length of the variable BUFFER.
Issue the following:

CALL ISPEXEC (BUFLEN, BUFFER);

In this example, the LMMLIST service SAVE option creates a member list,
writes it to the ISPF LIST data set, using the data ID stored in IDVAR.


Command Invocation:

ISPEXEC LMMLIST DATAID(&IDVAR) STATS(YES) OPTION(SAVE)


Call Invocation:

CALL ISPLINK ('LMMLIST ',IDVAR,'SAVE ',' ','YES ');
OR

Set the program variable BUFFER to contain:

BUFFER = 'LMMLIST DATAID(&IDVAR) STATS(YES) OPTION(SAVE)';

Set the program variable BUFLEN to the length of the variable BUFFER.
Issue the following:

CALL ISPEXEC (BUFLEN, BUFFER);

martin9
Back to top
View user's profile Send private message
Virgon
Warnings : 1

New User


Joined: 17 Jun 2005
Posts: 14
Location: Chennai

PostPosted: Fri Mar 17, 2006 2:04 am
Reply with quote

Hi Gowtham,

You can very well use the File Aid utility, if you have one in your shop.

Go to file aid
choose utilities
choose option 6

This should work.

Thanks.
Virgon
Back to top
View user's profile Send private message
gowtham_1982
Warnings : 1

Active User


Joined: 02 Dec 2005
Posts: 109

PostPosted: Fri Mar 17, 2006 9:00 am
Reply with quote

hi

thanks all for all your suggestions.


thanks

gowtham
Back to top
View user's profile Send private message
Srinivas N.T

New User


Joined: 26 Sep 2007
Posts: 1
Location: Mysore

PostPosted: Thu Jun 05, 2008 2:53 pm
Reply with quote

HI,

Try out this comand.it may help you.


C ALL STR1 STR2

STR1 - ORIGINAL STRING TO BE REPLACED

STR2- REPLACE STRING

GIVE IT IN THE COMMAND LINE.


Regards
Srinivas N.T
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Jun 05, 2008 8:45 pm
Reply with quote

Hi,
Srinivas N.T wrote:
Try out this comand...
Do you think solution provided would work for the original request ?
Back to top
View user's profile Send private message
samuel_Inba

New User


Joined: 03 Jan 2008
Posts: 53
Location: Chennai

PostPosted: Mon Jun 09, 2008 12:25 pm
Reply with quote

Try This,

//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')
/*

Str1 - is the string which u want to replace.




Thanks,
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts changing defaults in db2 admin - Unlo... DB2 0
No new posts file manager is doing string conversion IBM Tools 3
Search our Forums:

Back to Top