View previous topic :: View next topic
|
Author |
Message |
kovur
New User
Joined: 15 Nov 2007 Posts: 36 Location: India
|
|
|
|
Hi,
Is it possible to change contents of members of a pds using sort. I have the below requirement. I have a parm library in which I have some ftp parms. I would like to change the contents of the parms without going to each and every parm.
I have parms in the library with the below format:
Code: |
SERVER.OLD
USERNAME1
PASSWORD1
cd /PATH1/OLD
|
I would like to use SORT utility to check the members of the library and if it finds the parm containing this data, it should change the data as below:
Code: |
SERVER.NEW
USERNAME2
PASSWORD2
cd /PATH2/NEW
|
Also I have some parms with tha below data:
Code: |
REXEC -l username1 -p
password1 server.old +
/path1/old/script/ascrip.sh
/path1/old/abc/afile
|
I would like to change the data as below:
Code: |
REXEC -l username2 -p password2
server.new +
/path2/new/script/ascrip.sh
/path2/new/def/afile
|
Please let me know if this can be done thru SORT. If not please suggest any method of doing it.
Thanks,
Manoj |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Be careful doing batch updates to a PDS. If you have more than one job updating the PDS at the same time, you have the potential to screw up the PDS. "More than one job" can include a TSO session. I'd suggest DISP=OLD for your PDS, and remember that if the jobs all sit there in the input queue, someone has the file in TSO. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hello,
You could try the below job to perform find and replace in all members of a PDS.
Code: |
//UPDAT1 EXEC PGM=IPOUPDTE,
// PARM='UPDATE'
//*PARM='CHECK'
//@LIB1 DD DISP=SHR,DSN=YOUR.PDS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
FROM-STRING<TO-STRING<
// |
Note: For this program to work, the destination PDS has to have a empty member named $$$COIBM.
Hope it helps. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Please let me know if this can be done thru SORT. |
DFSORT is NOT really the tool of choice for updating PDS members en masse.
DFSORT can only deal with one member at a time. So you would need a separate step (or ICETOOL operator) to change each member. |
|
Back to top |
|
|
giraffe
New User
Joined: 09 Nov 2010 Posts: 27 Location: SHENZHEN CHINA
|
|
|
|
There's a solution I worked out, but it's a little compicated.
Firstly, using IKJEFT01 to exec LISTDS command, then use ICETOOL SUBSET to eliminate the header and trailer information in order to obtain the member list.
Secondly, generate a job from the member list with SORT FINDREP steps.
Finally, exec IKJEFT01 SUBMIT command to submit the generated job, the mission's done.
However, if there're two many members in your pds, you will have to generate several jobs to complete this. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
giraffe
You have done about ten times more work than is required.
You can list the members and not have to sort the output to get a workable list.
Why perform a sort step for every single member when an ISPF edit macro will do exactly the same.
Submit gazillions of jobs when one will suffice.
Methinks that you may be talking out of the wrong end on this topic |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Adding to Expat's view,
Also, DFSORT copy does not copy the member statistics like created,changed,version details of a pds member. which might be handy information at times. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi Frank,
Quote: |
DFSORT is NOT really the tool of choice for updating PDS members en masse.
|
This could be your next challenge.
Gerry |
|
Back to top |
|
|
kovur
New User
Joined: 15 Nov 2007 Posts: 36 Location: India
|
|
|
|
Hi,
I tried to do this by using IPOUPDTE. But it is not identifying the strings that I gave in the sysin dd * statement. In the spool it is showing that there are no updates.
Please check the job, Member and spool output that I have got and suggest what needs to be corrected.
Job:
Code: |
//STEP01 EXEC PGM=IPOUPDTE,PARM='UPDATE'
//@LIB1 DD DSN=MY.TEST.PDS1,DISP=SHR
//SYSIN DD *
server.old<server.new<
username1<username2<
password1<password2<
/path1/old</path2/new<
/*
//SYSPRINT DD SYSOUT=*
//
|
Member in the PDS, MY.TEST.PDS1
Code: |
VIEW MY.TEST.PDS1(TESTPARM) - 01.04
Columns 00001 00072
Command ===>
Scroll ===> CSR
000001 server.old
000002 username1
000003 password1
000004 cd /path1/old
|
Spool output:
Code: |
BATCH JCL TAILORING AID
UPDATE CONTROL STATEMENTS
SYSIN SERVER.OLD<SERVER.NEW<
SYSIN USERNAME1<USERNAME2<
SYSIN PASSWORD1<PASSWORD2<
SYSIN /PATH1/OLD</PATH2/NEW<
MESSAGE IPO005
END OF INPUT CONTROL STATEMENTS
BATCH JCL TAILORING AID
VOL=TSO006 DSNAME=MY.TEST.PDS1
MESSAGE IPO010 FILE @LIB1 HAD NO UPDATES
MESSAGE IPO011 IPOUPDTE ENDED. CODE=04
|
Thanks,
Manoj |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
gcicchet wrote: |
Hi Frank,
Quote: |
DFSORT is NOT really the tool of choice for updating PDS members en masse.
|
This could be your next challenge.
Gerry |
It looks once in thousand kind of request..
Very less often datafiles are stored in PDS.. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Very less often datafiles are stored in PDS.. |
True - not so much data as in this example, but often global jcl and/or control statement changes. . .
While there are multiple ways to do this, a "sort" way could be quite handy as well (imho) |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Manoj IPOUPDTE works with JCL and CONTROL types of data. As such, it won't recognize anything defined as lower-case. |
|
Back to top |
|
|
giraffe
New User
Joined: 09 Nov 2010 Posts: 27 Location: SHENZHEN CHINA
|
|
|
|
expat wrote: |
giraffe
You have done about ten times more work than is required.
You can list the members and not have to sort the output to get a workable list.
Why perform a sort step for every single member when an ISPF edit macro will do exactly the same.
Submit gazillions of jobs when one will suffice.
Methinks that you may be talking out of the wrong end on this topic |
ICETOOL SUBSET will do 'copy' instead of 'sort', the purpose of this step is to eliminate the header(7?) and trailer(4?) information.
There's a limitation for a job's step number, so, if there're two many members, we need to generate several aufgereiht jobs to accomplish this, since one pds(for update) can not be specified in ICETOOL DD more than once, ICETOOL with generated SORT AND CNTL statements do not work here.
This is just a solution with DFSORT, REXX is a more effecient tool here. |
|
Back to top |
|
|
kovur
New User
Joined: 15 Nov 2007 Posts: 36 Location: India
|
|
|
|
Kevin,
Thanks for your reply. I just changed the contents of the member to upper case and tried. It worked fine.
The spool output :
Code: |
BATCH JCL TAILORING AID
UPDATE CONTROL STATEMENTS
SYSIN SERVER.OLD<SERVER.NEW<
SYSIN USERNAME1<USERNAME2<
SYSIN PASSWORD1<PASSWORD2<
SYSIN /PATH1/OLD</PATH2/NEW<
MESSAGE IPO005
END OF INPUT CONTROL STATEMENTS
BATCH JCL TAILORING AID
VOL=TSO006 DSNAME=MY.TEST.PDS1
TESTPARM REPLACED SERVER.OLD
REPLACEMENT SERVER.NEW
TESTPARM REPLACED USERNAME1
REPLACEMENT USERNAME2
TESTPARM REPLACED PASSWORD1
REPLACEMENT PASSWORD2
TESTPARM REPLACED CD /PATH1/OLD
REPLACEMENT CD /PATH2/NEW
MESSAGE IPO011 IPOUPDTE ENDED. CODE=00
|
But all the strings that I need to change are in lower case only. Please suggest a way to achieve this.
Thanks,
Manoj |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
But all the strings that I need to change are in lower case only. Please suggest a way to achieve this. |
Quote: |
Manojm IPOUPDTE works with JCL and CONTROL types of data. As such, it won't recognize anything defined as lower-case. |
Use something other than IPOUPDTE . . . As has been suggested REXX would work well. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Manoj, everything I've read here so far seems to be bordering on excessive overkill. Don't you have tools you can easily use or readily adapt to handle this (FileAid, File Manager, etc.) without having to write code? Are there a lot of members to be updated, or is it a relatively small set that a few repetitive job submissions could've handled? IPOUPDTE would've been the perfect option but you have the issue with the lower-case text.
As a somewhat simple process, couldn't you just:
1. Use IEBPTPCH to "PUNCH" the selected members of the PDS into a sequential dataset.
2. Use SORT to reformat the IEBPTPCH output into a standard IEBUPDTE-ready format.
3. Edit the data to enable your changes.
4. Use IEBUPDTE to create a PDS from the edited dataset.
All of which has been described here many times before, as has IPOUPDTE, as has writing REXX execs to do this, as has writing and using ISPF Edit Macros, and writing COBOL programs to do this. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
superk wrote: |
Don't you have tools you can easily use or readily adapt to handle this without having to write code? |
Yes; giraffe, vasanthz, probably a couple of others. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
kovur wrote: |
Hi Giraffe,
Thanks for the code. I will try this and let you know my experience with it.
Regards,
Manoj |
Remembering to do the change to lower case, in at least four places! |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Quote: |
Yes; giraffe, vasanthz, probably a couple of others. |
Well, I suggested IPOUPDTE which is'nt much work & we don't have file-aid or file manager or insync..
writing a new rexx or dfsort is too much overkill & i never voted for it.. |
|
Back to top |
|
|
|