Hi,
I'm trying to work out a way of generically renaming objects (files in specific) on an iseries.
I have a large number of files which have names that begin with a letter which needs to be changed and end in a number which also needs to be changed, for example :-
Axxxxx01
Ayyyyy01
Azzzz01
The middle part of the name needs to stay the same, but the A and the 01 all need to be changed to B and 02. The length of the name is not consistent, some names are longer than others.
Is there a quick way of acheiving this, or do I have to write something for it? It would also be nice if I could change the member name at the same time (member name is same as file name in this case) and the text on the member and file to all be the same.
If I have to write something, suggestions on how best to do this will also be welcome.
Thanks in advance,
Martin Gilbert.
Software/Hardware used:
ASKED:
July 15, 2008 1:02 PM
UPDATED:
July 17, 2008 9:27 AM
You could even do it all in CL using DSPOBJD and RCVF
Kevin – Affiliated
Hi Guys,
Thanks for the pointers. Was hoping there’d be a quick cheat for this using QSHELL or something, but I couldn’t get it to do what I wanted. Problem with most of the commands with generic names is the generic part is always the end of the name, not the start (PDM lets you use generic names with the start and end of the name).
I’ve put something quick and dirty together to let me do this. Uses DSPOBJD to a file in QTEMP, fills a subfile with the DSPOBJD info, lets you use subsets to select what you want to change and then uses QCMDEXC to do a RNMOBJ, RNMM, CHGPF, etc.
Didn’t take too long – skipped lunch….
Eventually I’ll get round to writing my own replacement for PDM…..
Cheers,
Martin.