Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

DCL SCRIPT TO RENAME SUB DIRECTORIES

SOLVED
Go to solution
vmsserbo
Super Advisor

DCL SCRIPT TO RENAME SUB DIRECTORIES

I need to rename the COUNTRYWIDE sub-dir to COUNTRYWIDE_DELETE and the TDI sub-dir to TDI_DELETE on all of our systems.

Each site has the same dir structure
Enclose as an attachment are all the Nodes with their directory structure.

Can someone wrie a simple script to do the renames?

Thanks!
5 REPLIES
Hein van den Heuvel
Honored Contributor
Solution

Re: DCL SCRIPT TO RENAME SUB DIRECTORIES

Miles,

The thing you might want to know is that you can rename the directory files itself, if you are allowed to deleted them.
Doing so all files in the directory will 'move' with the directory (they will not move, they are just found through other names now).

So either grab some sysprv or (shudder..) bypass, or SET FILE/PROT...D... TALP1:[USER]COUNTRYWIDE.DIR

Now $RENAME/LOG TALP1:[USER]COUNTRYWIDE.DIR
TALP1:[USER]COUNTRYWIDE_DELETE.DIR

and

$RENAME/LOG TALP1:[USER]TDI.DIR TALP1:[USER]TDI_DELETE.DIR


btw... may I recommend a plain .TXT file for plain text attachement net time?

Cheers,
Hein.

Volker Halle
Honored Contributor

Re: DCL SCRIPT TO RENAME SUB DIRECTORIES

Miles,

maybe - just maybe - you should consider to contract someone to help you with your OpenVMS system management on a daily basis or just if there are certain tasks to be done.

Also please - when adding attachments - consider to use non-proprietary file formats and especially prevent those documents, which may possibly contain viruses. While almost anybody will probably use anti-virus software, preventing the possibility of spreading viruses in the first place may be a good idea.

The contents of the information you're trying to provide, will most likely not suffer, if presented in a plain .TXT file.

Thanks,

Volker.
Robert Gezelter
Honored Contributor

Re: DCL SCRIPT TO RENAME SUB DIRECTORIES

Miles,

The script that you need contains TWO RENAME commands.

For execution, you have a variety of options including batch, DECnet, and the SYSMAN DO command.

As to writing the entire procedure, I can recommend that you take a fairly quick read through the documentation kit (it is available at http://www.hp.com/go/openvms ).

- Bob Gezelter, http://www.rlgsc.com
Allan Bowman
Respected Contributor

Re: DCL SCRIPT TO RENAME SUB DIRECTORIES

Miles,

In the past, I have needed to make similar changes on a wide area network with about 30 VMS systems. I found it easiest to just use SYSMAN. You need to SET the ENVIRONMENT to include all of the nodes, and then use the DO command to execute each command on the remote nodes. You will need to use the full file spec for the directory names.

If this is something that gets done frequently, you might be better off writing a command file to make the changes and copy the file to each node. You could still use SYSMAN to execute the command file remotely.

You may want to check out HELP for the RENAME command as well as the SYSMAN internal HELP.

Allan in Atlanta
Karl Rohwedder
Honored Contributor

Re: DCL SCRIPT TO RENAME SUB DIRECTORIES

A slight addition to Allan's comment:
You may define group of nodes using logical names in a special SYSMAN$NODE_TABLE to ease the definition of an environment. See the System Managers document.

regards Kalle