View previous topic :: View next topic
|
Author |
Message |
giraffe
New User
Joined: 09 Nov 2010 Posts: 27 Location: SHENZHEN CHINA
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
please do not post in all CAPS it is considered shouting and rude! |
|
Back to top |
|
|
giraffe
New User
Joined: 09 Nov 2010 Posts: 27 Location: SHENZHEN CHINA
|
|
|
|
Hi, dear enrico-sorichetti
, I apologize for my ignorance, since i'm being busy with my work with CAPS on. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
I would suggest an ISPF edit macro, of which there are numerous good examples on the forum. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I'd use IPOUPDTE. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Kevin,
that would be my choice too. But didnt that tool not require a member $$$COIBM in the pds to process? |
|
Back to top |
|
|
giraffe
New User
Joined: 09 Nov 2010 Posts: 27 Location: SHENZHEN CHINA
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
FILEAID is quite useful if you have it.
Gerry |
|
Back to top |
|
|
Jeffrey Ranney
New User
Joined: 23 Dec 2010 Posts: 20 Location: USA
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
However some sites do restrict the loading of freeware products. |
|
Back to top |
|
|
Jeffrey Ranney
New User
Joined: 23 Dec 2010 Posts: 20 Location: USA
|
|
|
|
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 |
|
|
Pete Wilson
Active Member
Joined: 31 Dec 2009 Posts: 592 Location: London
|
|
|
|
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 |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1315 Location: Vilnius, Lithuania
|
|
|
|
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. |
|
Back to top |
|
|
Jeffrey Ranney
New User
Joined: 23 Dec 2010 Posts: 20 Location: USA
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
jmreddymca Warnings : 1 New User
Joined: 14 Oct 2007 Posts: 29 Location: Bangalore
|
|
|
|
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 |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1315 Location: Vilnius, Lithuania
|
|
|
|
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 |
|
|
|