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

Replacing characters in all PDS members


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
giraffe

New User


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

PostPosted: Fri Dec 17, 2010 9:04 am
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

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Fri Dec 17, 2010 10:03 am
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: 27
Location: SHENZHEN CHINA

PostPosted: Fri Dec 17, 2010 10:09 am
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: 1702
Location: Australia

PostPosted: Fri Dec 17, 2010 1:59 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Fri Dec 17, 2010 2:03 pm
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
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: 8796
Location: Welsh Wales

PostPosted: Fri Dec 17, 2010 2:03 pm
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

Global Moderator


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

PostPosted: Fri Dec 17, 2010 4:33 pm
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: 2481
Location: Netherlands, Amstelveen

PostPosted: Fri Dec 17, 2010 4:40 pm
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: 27
Location: SHENZHEN CHINA

PostPosted: Fri Dec 17, 2010 6:20 pm
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

Global Moderator


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

PostPosted: Fri Dec 17, 2010 10:38 pm
Reply with quote

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

www.ibmmainframes.com/viewtopic.php?t=50857
www.ibmmainframes.com/viewtopic.php?t=45130
www.ibmmainframes.com/viewtopic.php?t=36204
www.ibmmainframes.com/viewtopic.php?t=15892
www.ibmmainframes.com/viewtopic.php?t=29596
www.ibmmainframes.com/viewtopic.php?t=46649
www.ibmmainframes.com/viewtopic.php?t=50032
www.ibmmainframes.com/viewtopic.php?t=43241
www.ibmmainframes.com/viewtopic.php?t=13275
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: 1702
Location: Australia

PostPosted: Sat Dec 18, 2010 4:20 am
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
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: 8796
Location: Welsh Wales

PostPosted: Tue Dec 28, 2010 7:09 pm
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
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 Member


Joined: 31 Dec 2009
Posts: 590
Location: London

PostPosted: Fri Dec 31, 2010 7:30 pm
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

Senior Member


Joined: 07 Feb 2009
Posts: 1314
Location: Vilnius, Lithuania

PostPosted: Fri Dec 31, 2010 8:59 pm
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
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.

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

Senior Member


Joined: 07 Feb 2009
Posts: 1314
Location: Vilnius, Lithuania

PostPosted: Tue Jan 11, 2011 4:52 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replacing FILLER with FILLER<SeqNu... DFSORT/ICETOOL 2
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
No new posts Duplicate several members of/in one l... JCL & VSAM 7
Search our Forums:

Back to Top