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
 

 

Replacing characters in all PDS members

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
giraffe

New User


Joined: 09 Nov 2010
Posts: 28
Location: SHENZHEN CHINA

PostPosted: Fri Dec 17, 2010 9:04 am    Post subject: Replacing characters in all PDS members
Reply with quote

HI ALL, I'VE ENCOUNTERED A PROBLEM, SINCE I WANNA REPLACE A SPECIFIC CHARACTER STRING IN ALL MY PDS MEMBERS TO ANOTHER STRING.

E.G.
PDS GIRAFFE.JCL
THERE'RE LARGE AMOUNTS OF MEMBERS IN IT LIKE THIS:
TEST001J, TEST002J,TEST003J,TEST004J...
THESE MEMBERS MAY CONTAIN CHARACTERS 'AA' WHICH I WANNA REPLACE INTO 'BB'.

CAN DFSORT RESOLVE THIS?
THANKS A LOT.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Dec 17, 2010 10:03 am    Post subject: Reply to: REPLACE CHARACTERS IN ALL PDS MEMBERS
Reply with quote

please do not post in all CAPS it is considered shouting and rude!
Back to top
View user's profile Send private message
giraffe

New User


Joined: 09 Nov 2010
Posts: 28
Location: SHENZHEN CHINA

PostPosted: Fri Dec 17, 2010 10:09 am    Post subject:
Reply with quote

Hi, dear enrico-sorichetti
, I apologize for my ignorance, since i'm being busy with my work with CAPS on.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Dec 17, 2010 1:59 pm    Post subject:
Reply with quote

Hi,

as far as I know DFSORT can only work with one member at a time.

You would have to specify each member in a separate step.


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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Dec 17, 2010 2:03 pm    Post subject: Reply to: REPLACE CHARACTERS IN ALL PDS MEMBERS
Reply with quote

furthermore You would not be able to do it in place ( might not an issue )
for mass changes it is always safe to do it on a copy of the original data!

for a way of doing it in rexx see
http://ibmmainframes.com/viewtopic.php?t=25947&highlight=

You would have to rite a very simple INNER macro to carry on the change.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Dec 17, 2010 2:03 pm    Post subject:
Reply with quote

I would suggest an ISPF edit macro, of which there are numerous good examples on the forum.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Fri Dec 17, 2010 4:33 pm    Post subject: Reply to: REPLACE CHARACTERS IN ALL PDS MEMBERS
Reply with quote

I'd use IPOUPDTE.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Fri Dec 17, 2010 4:40 pm    Post subject:
Reply with quote

Kevin,

that would be my choice too. But didnt that tool not require a member $$$COIBM in the pds to process?
Back to top
View user's profile Send private message
giraffe

New User


Joined: 09 Nov 2010
Posts: 28
Location: SHENZHEN CHINA

PostPosted: Fri Dec 17, 2010 6:20 pm    Post subject:
Reply with quote

Hi, enrico-sorichetti, i'm unfamiliar with rexx.
Just now I conceived a solution, I will try it next monday at my working place, if it works, I will post the code, thanks to all who did me a favour.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Fri Dec 17, 2010 10:38 pm    Post subject: Reply to: REPLACE CHARACTERS IN ALL PDS MEMBERS
Reply with quote

By the way, here's a list of some similar topics:

http://www.ibmmainframes.com/viewtopic.php?t=50857
http://www.ibmmainframes.com/viewtopic.php?t=45130
http://www.ibmmainframes.com/viewtopic.php?t=36204
http://www.ibmmainframes.com/viewtopic.php?t=15892
http://www.ibmmainframes.com/viewtopic.php?t=29596
http://www.ibmmainframes.com/viewtopic.php?t=46649
http://www.ibmmainframes.com/viewtopic.php?t=50032
http://www.ibmmainframes.com/viewtopic.php?t=43241
http://www.ibmmainframes.com/viewtopic.php?t=13275
http://www.ibmmainframes.com/viewtopic.php?t=24609
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Sat Dec 18, 2010 4:20 am    Post subject:
Reply with quote

Hi,

FILEAID is quite useful if you have it.


Gerry
Back to top
View user's profile Send private message
Jeffrey Ranney

New User


Joined: 23 Dec 2010
Posts: 20
Location: USA

PostPosted: Tue Dec 28, 2010 6:24 pm    Post subject:
Reply with quote

The PDS utility(the best damned utility on the planet) which is FREE from the CBT tapes does this in a jiffy !!! I have found this utility is loaded on most all mainframes. Type in "TSO PDS" on the command line to test if it is on your box.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Dec 28, 2010 7:09 pm    Post subject:
Reply with quote

However some sites do restrict the loading of freeware products.
Back to top
View user's profile Send private message
Jeffrey Ranney

New User


Joined: 23 Dec 2010
Posts: 20
Location: USA

PostPosted: Tue Dec 28, 2010 7:21 pm    Post subject:
Reply with quote

This is very true EXPAT... On some sites, I downloaded it to my own TSOID files so I could use it.

On the other hand, this dilemna can also be cured with either :
FileAid
File Manager

Then again, a simple REXX program(or CLIST) can solve this issue.
Back to top
View user's profile Send private message
Pete Wilson

Active User


Joined: 31 Dec 2009
Posts: 437
Location: London

PostPosted: Fri Dec 31, 2010 7:30 pm    Post subject:
Reply with quote

The PDSM18 program (PDSMAN product) would do this very simply in a few seconds. Ask your Storage people if the product is installed on your site.

e.g.

This changes the string TGTGDS(ACTIVE) - to TGTGDS(ACTIVE) DELETE PURGE -

You can do more than one string at a time and apply conditional checking as well.

//STEP1 EXEC PGM=PDSM18
//PDSMPDS DD DSN=pds.name,
// DISP=SHR
//PDSMRPT DD SYSOUT=0
//PDSMSEL DD *
COPY*.ALL
/*
//SYSIN DD *
OPTION TRANSLATE=Y TRANSNEW=Y MISSMSG=N
REPLACE TARGET='TGTGDS(ACTIVE) -'
NEW='TGTGDS(ACTIVE) DELETE PURGE -'
/*
Back to top
View user's profile Send private message
prino

Active Member


Joined: 07 Feb 2009
Posts: 984
Location: Oostende, Belgium

PostPosted: Fri Dec 31, 2010 8:59 pm    Post subject:
Reply with quote

PeterHolland wrote:
that would be my choice too. But didnt that tool not require a member $$$COIBM in the pds to process?


PDSUPDTE does not have this limitation. icon_smile.gif
Back to top
View user's profile Send private message
Jeffrey Ranney

New User


Joined: 23 Dec 2010
Posts: 20
Location: USA

PostPosted: Tue Jan 04, 2011 8:02 pm    Post subject:
Reply with quote

I ran across this post in GOOGLE which is a REXX program to offload a PDS library to a sequential file in IEBUPDTE format with the "./ ADD" cards imbedded for each member.

http://groups.google.com/group/bit.listserv.ispf-l/browse_thread/thread/e0a5b32089a1475/3133728f10f50722?hl=en&q=create+iebupdte#

Then run a SUPERCE scan/replace on the sequential file.

Then run IEBUPDTE to offload the sequential file to a PDS library.

It works just slick !!



/*********************************************************************/
/* REXX */
/*********************************************************************/
/* Purpose: Unload PDS members to a readable sequential file */
/*-------------------------------------------------------------------*/
/* Syntax: PDS2SEQ match */
/*-------------------------------------------------------------------*/
/* Parms: match - membername pattern (simple, only trailing *) */
/* optional, will default to all members */
/* */
/* Notes: Input PDS is expected in DD INPDS */
/* Output Sequential file will be allocated to OUTSEQ */
/* Put IEBUPDTE cards between members */
/* Update variables BEFORE and AFTER if not IEBUPDTE cards */
/* */
/* If used in batch include DDNAMEs INPDS and OUTSEQ */
/* */
/* //PDS2SEQ EXEC PGM=IKJEFT01,PARM='PDS2SEQ' */
/* //SYSEXEC DD DSN=your.exec.pds,DISP=SHR */
/* //SYSTSPRT DD SYSOUT=* */
/* //INPDS DD DSN=INPUT.PDS,DISP=SHR */
/* //OUTSEQ DD DSN=OUTPUT.SEQ,DISP=(,CATLG),DSORG=PS, */
/* // LIKE=INPUT.PDS */
/* //SYSTSIN DD DUMMY */
/* */
/*********************************************************************/
/* Change Log */
/* */
/* Author Date Reason */
/* -------- --------- ----------------------------------------- */
/* R. Zenuk Dec 1993 Initial Creation */
/* */
/*********************************************************************/
/* Accept simple match pattern */
/*********************************************************************/
arg match
if match = '' then match = '*'
pattern = match
if right(match,1) = '*' then match = left(match,length(match)-1)
/*********************************************************************/
/* Put out a heading */
/*********************************************************************/
parse upper source execenv . execname . execdsn .
say execname 'started' date() time()
say
/*********************************************************************/
/* Is INPDS allocated? */
/*********************************************************************/
EXITRC = listdsi("INPDS" "FILE")
if EXITRC <> 0 then
do
say 'INPDS is missing RC='EXITRC sysmsglvl2
signal shutdown
end
dsn = sysdsname
say 'Unloading PDS' dsn
/*********************************************************************/
/* Is OUTSEQ allocated? */
/*********************************************************************/
EXITRC = listdsi("OUTSEQ" "FILE")
if EXITRC <> 0 then
do
/*********************************************************************/
/* Allocate OUTSEQ as sysdsname.SEQ */
/*********************************************************************/
"ALLOC F(OUTSEQ) DA('"sysdsname".SEQ') UNIT("sysunit")" sysunits,
"LRECL("syslrecl") BLKSIZE("sysblksize") DSORG(PS)",
"SPACE("sysprimary sysseconds")"
EXITRC = RC
if EXITRC <> 0 then
do
say 'OUTSEQ allocation error on' sysdsname'.SEQ RC='EXITRC
signal shutdown
end
end
say 'Loading sequential file' sysdsname
/*********************************************************************/
/* Open the output sequential file */
/*********************************************************************/
"EXECIO * DISKW OUTSEQ (OPEN"
EXITRC = RC
if EXITRC <> 0 then
do
say 'OPEN of OUTSEQ failed on' sysdsname'.SEQ RC='EXITRC
signal shutdown
end
/*********************************************************************/
/* Get the member list */
/*********************************************************************/
x = outtrap(mem.)
"LISTDS '"dsn"' MEMBERS"
EXITRC = RC
if EXITRC <> 0 then
do
say 'LISTDS error RC='EXITRC
signal shutdown
end
x = outtrap('off')
say
say mem.0-6 'members in' dsn
say
count = 0
/*********************************************************************/
/* Process the members */
/*********************************************************************/
do i=7 to mem.0
if abbrev(strip(mem.i),match) = 1 then
do
member = strip(mem.i)
count = count + 1
end
else
iterate
/*********************************************************************/
/* Before separator */
/*********************************************************************/
before = './ ADD NAME='member',LIST=ALL'
/*********************************************************************/
/* Allocate each member */
/*********************************************************************/
"ALLOC F("member") DA('"dsn"("member")') SHR"
EXITRC = RC
if EXITRC <> 0 then
do
say 'ALLOC error on member' member', RC='EXITRC
signal shutdown
end
/*********************************************************************/
/* Read each member into a stem */
/*********************************************************************/
"EXECIO * DISKR" member "(STEM LINES. FINIS"
EXITRC = RC
if EXITRC <> 0 then
do
say 'EXECIO read error on member' member', RC='EXITRC
signal shutdown
end
/*********************************************************************/
/* Put the "before" separator in the output file */
/*********************************************************************/
queue before
"EXECIO 1 DISKW OUTSEQ"
EXITRC = RC
if EXITRC <> 0 then
do
say 'EXECIO before separator write error on' member', RC='EXITRC
signal shutdown
end
/*********************************************************************/
/* Write each member to the sequential file */
/*********************************************************************/
"EXECIO * DISKW OUTSEQ (STEM LINES."
EXITRC = RC
if EXITRC <> 0 then
do
say 'EXECIO write error on member' member', RC='EXITRC
signal shutdown
end
/*********************************************************************/
/* FREE the member */
/*********************************************************************/
"FREE F("member")"
EXITRC = RC
if EXITRC <> 0 then
do
say 'FREE error on member' member', RC='EXITRC
signal shutdown
end
/*********************************************************************/
/* Drop the stem variable */
/*********************************************************************/
drop lines.
/*********************************************************************/
/* An audit trail */
/*********************************************************************/
say member 'was successfully unloaded' lines.0 'lines'
end
/*********************************************************************/
/* After separator */
/*********************************************************************/
after = './ ENDUP'
/*********************************************************************/
/* Put the "after" separator in the output file */
/*********************************************************************/
queue after
"EXECIO 1 DISKW OUTSEQ"
EXITRC = RC
if EXITRC <> 0 then
do
say 'EXECIO after separator write error on' member', RC='EXITRC
signal shutdown
end
/*********************************************************************/
/* Close OUTSEQ */
/*********************************************************************/
"EXECIO * DISKW OUTSEQ (FINIS"
EXITRC = RC
if EXITRC <> 0 then
do
say 'EXECIO close error on' sysdsname', RC='EXITRC
end
/*********************************************************************/
/* Shutdown */
/*********************************************************************/
shutdown: "FREE F(INPDS)"
"FREE F(OUTSEQ)"
say
say count 'members processed using pattern:' pattern
say
say execname 'ended' date() time()
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Jan 04, 2011 8:45 pm    Post subject:
Reply with quote

you may want to look at this editmacro from an old version of the ISPF Edit Macros manual: ISRMBRS

essentially, it provides a basis for invoking an edit session with each member of the pds with an imacro.

which is what you want to do.
Back to top
View user's profile Send private message
jmreddymca
Warnings : 1

New User


Joined: 14 Oct 2007
Posts: 29
Location: Bangalore

PostPosted: Tue Jan 11, 2011 3:42 pm    Post subject: using ezyedit you can do
Reply with quote

From ISPF panel enter into ezyedit screen. There you will get the ezyedit selection panel, in that ;
Function ===>
DSN/Variable # ===> 1
Member Name ===>
Volume Serial ===>

1 DSN= 'Enter pds name which you want to edit' press enter
you will get all the members list. Type REPL on the cmd line press enter
then it will ask start col & end col details then press enter next screen
Target string ===> give existing string

Also Contains ===>
Doesn't Contain ===>

Replacement ===> replacement string press enter
it will change all the members in the PDS.

Thanks
JMR
Back to top
View user's profile Send private message
prino

Active Member


Joined: 07 Feb 2009
Posts: 984
Location: Oostende, Belgium

PostPosted: Tue Jan 11, 2011 4:52 pm    Post subject: Re: using ezyedit you can do
Reply with quote

jmreddymca wrote:
From ISPF panel enter into ezyedit screen.


And what leads you to believe that the TS has access to ezyedit?
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Remove Special Characters from Mainfr... Rodger Zhang All Other Mainframe Topics 6 Wed Jul 06, 2016 1:12 am
No new posts Single step utility for compare and u... ramprakashn JCL & VSAM 5 Fri Apr 29, 2016 3:43 pm
No new posts Replacing Start Transid with LINK pkmurali CICS 12 Tue Apr 19, 2016 8:22 pm
No new posts Differences between copying members b... E.LAI TSO/ISPF 8 Wed Mar 30, 2016 12:35 pm
No new posts Trasnmitting a file with french chara... spoorni IBM Tools 1 Wed Feb 24, 2016 8:13 pm


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