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

How to rename a word in all PS file names.


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

New User


Joined: 11 Jan 2010
Posts: 13
Location: india

PostPosted: Tue Sep 27, 2011 11:40 am
Reply with quote

Hi,

I have 15 files in which there will be a word as 'D2011'.
How can i rename all of them once.

just like the option C ALL, do we have any solution for this.?
I have just had a thought of it. Don't know, if there is a solution.

Kindly let me know, if there is any way to do this.

Please provide me your suggestions.
Back to top
View user's profile Send private message
Dsingh29

Active User


Joined: 16 Dec 2008
Posts: 132
Location: IBM

PostPosted: Tue Sep 27, 2011 12:02 pm
Reply with quote

Hi There,

You can you IDCAMS ALTER command:
Code:

 //STEP01   EXEC PGM=IDCAMS 
 //SYSPRINT  DD  SYSOUT=*
 //SYSUDUMP  DD  SYSOUT=*
 //SYSIN     DD  *
   ALTER  OLD.NAME -
         NEWNAME(NEW.NAME)


Write as many Alter statements as you need. All DS names would be changed at once.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Wed Oct 05, 2011 3:21 pm
Reply with quote

Dave - question is about changing the contents of a Data-set, it's not about changing (ALTER) the name of the DSN itself. That's why they say, terminology is important in IT.

sdaruna - I don't recall any of such command, which can be used on command line, after listing all those 15 DSNs in ISPF 3.4 . You might try with SORT FINDREP. To do that, concatnate all the DSNs to SORTIN and write as many output files as many you want.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Oct 05, 2011 3:43 pm
Reply with quote

Quote:
How to rename a word in all PS file names.


as usual around here bad wording reigns ,
a dataset rename was my first guess also
Back to top
View user's profile Send private message
sdaruna

New User


Joined: 11 Jan 2010
Posts: 13
Location: india

PostPosted: Wed Oct 05, 2011 3:58 pm
Reply with quote

Hi All,
Sorry for the confusion. I am sorry for my bad communication skills.

Let me explain this with examples. Say i have four files (irrespective of PS or PDS)

1 - ABC.SRIN.X1
2 - ABC.SRIN.X2
3 - DEF.SRIN.X3. AND So on.

how can i rename the word SRIN to SRINU at one go..

Actually convention renaming will be ok. but if we have files in 100s and we might need to rename the month names some times..

Is there any better way to do this.?
Let me know, if if there are any confusions in my question.
Back to top
View user's profile Send private message
sdaruna

New User


Joined: 11 Jan 2010
Posts: 13
Location: india

PostPosted: Wed Oct 05, 2011 4:04 pm
Reply with quote

I read my post again.. its pathetic.. my above reply will tell you, what exactly i am expecting..
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Oct 05, 2011 4:09 pm
Reply with quote

bad wording again ...
rename a word means just nothing

do You want to rename the datasetd or what ?
Back to top
View user's profile Send private message
sdaruna

New User


Joined: 11 Jan 2010
Posts: 13
Location: india

PostPosted: Wed Oct 05, 2011 4:16 pm
Reply with quote

Yes. I want to rename the datasets

intial

ABC.SRIN.X1
ABC.SRIN.X2
DEF.SRIN.X3

I want to rename them as

ABC.SRINU.X1
ABC.SRINU.X2
DEF.SRINU.X3
Back to top
View user's profile Send private message
Dsingh29

Active User


Joined: 16 Dec 2008
Posts: 132
Location: IBM

PostPosted: Wed Oct 05, 2011 4:16 pm
Reply with quote

Do you want to rename a file name, yes or no ?
Quote:
I read my post again.. its pathetic.. my above reply will tell you, what exactly i am expecting.



It still doesnt solve your dilemma icon_rolleyes.gif



did you tried above solution ?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Wed Oct 05, 2011 4:18 pm
Reply with quote

Unless I'm mistaken, TS has Data-sets which follow the naming-convention as:

ABC.SRIN.**

In all of them, at some position in their contents, there is "SRIN" and it should be changed to "SRINU" using some ISPF command.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Oct 05, 2011 4:22 pm
Reply with quote

Quote:
It still doesnt solve your dilemma

thanks &deity that' s his dilemma not ours

depending on the zOS level You might, repeat might, do it in one shot
otherwise You will have to write a <script> to do it ( REXX is the best option )
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Wed Oct 05, 2011 5:22 pm
Reply with quote

Best confusing thread of the Week! Grin!
Back to top
View user's profile Send private message
sdaruna

New User


Joined: 11 Jan 2010
Posts: 13
Location: india

PostPosted: Wed Oct 05, 2011 5:34 pm
Reply with quote

So, whats confusing in this now.?

I can give you one more example.

I have 100 files which will be ending with DEL90.

like,
A.B.DEL90
C.D.DEL90,
X.Y.Z.DEL90 etc.

As per the process, those files will not be available after 90 days(Say thats the sigificance of using DEL90).

I need those files for some more time. So i want to replace DEL90 with DEL120 in the names of the files. to make them alive for 120 days.

Assume that, DEL90 exists in the end of the file name only.
Back to top
View user's profile Send private message
sdaruna

New User


Joined: 11 Jan 2010
Posts: 13
Location: india

PostPosted: Wed Oct 05, 2011 5:45 pm
Reply with quote

"With all due respect to you genius"

Guys, i am a rookie. Please be kind, if i created any confusion.

Just think this problem in your own way. and provide me some details if you got this kind of situation any where any time.

let it be not related to my problem by some extent.. what ever the inputs you provide, that will be helpful for this young lad.. Please be kind towards my errors in this thread.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Oct 05, 2011 5:49 pm
Reply with quote

renaming a dataset just because the expiration date changed calls for...
immediate termination or better extermination of You storage support group

ok the need to rename a dataset,
the reason You have given for the rename lowers dramatically the benevolence factor
and the willingness to provide help

sometimes to keep <Your> mouth shut is better icon_biggrin.gif

again read my previous reply !
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Wed Oct 05, 2011 5:59 pm
Reply with quote

Quote:
It still doesnt solve your dilemma


But is this a dilemma, a predicament, a quandary, or a conundrum?

Isn't that what's really important?
Back to top
View user's profile Send private message
sdaruna

New User


Joined: 11 Jan 2010
Posts: 13
Location: india

PostPosted: Wed Oct 05, 2011 7:39 pm
Reply with quote

its learning purpose. the example on DEL90 is just for understanding purpose.

I was just thinking, why concentration shift towards these all.

Enrico, I understood what you mentioned

Can you provide me bit of clarification.?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Oct 05, 2011 8:34 pm
Reply with quote

Quote:
its learning purpose. the example on DEL90 is just for understanding purpose.


well the example was poorly chosen icon_evil.gif

to make the most out of the questions You ask and forecast the comments You might receive
it would be wise for You to read and meditate on
how to ask questions the smart way
here catb.org/~esr/faqs/smart-questions.html
or .. for a more PC language
here support.microsoft.com/kb/555375
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Wed Oct 05, 2011 11:43 pm
Reply with quote

Quote:

"With all due respect to you genius"

Guys, i am a rookie. Please be kind, if i created any confusion.

Just think this problem in your own way. and provide me some details if you got this kind of situation any where any time.

let it be not related to my problem by some extent.. what ever the inputs you provide, that will be helpful for this young lad.. Please be kind towards my errors in this thread.


Wondering why sdaruna isnt warned icon_biggrin.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Oct 05, 2011 11:51 pm
Reply with quote

I' ve seen much worser sins
not worth the click icon_wink.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Oct 06, 2011 11:48 pm
Reply with quote

Of course it all depends on the setup by the storage management team.

Renaming a dataset may or may not change the MGMTCLAS of the dataset, so spending all of this time finding out about something that may not work is a waste of everyones time.

Go talk to your storage management people and tell them what you want, and why you want it and see what they say.

If your storage people are any good they, like me, would liase with the security people to stop users from doing this another way. In cases where security would not help, I used to run anomolie reports and find out if people had been sneaky and just delete their datasets anyway icon_lol.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Oct 06, 2011 11:53 pm
Reply with quote

welcome back Expat !
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 FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top