For the particular case of "delete a file if one with the same name exists in a different directory", there is my delete_if_exists.com, and delete_if_identical.com in
Thanks for your suggestion. But can i have an easier and non-complicated way to perform the loop? How can i use the For loop to perform my work in VMS?
Can i work similarly to the way i used in UNIX?
foreach file (`ls <dir1>`) del <dir2>/$file end
On the other hand, how do i truncate the version number of a file when i output the directory listing of a directory? For example: abc.log;1 | V abc.log
For better understanding, i'm trying to perform the following which i did successfully in UNIX.
I'm trying to capture the list of files in a particular directory and delete them in a connected machine.
For example in UNIX, i performed the following:
foreach file (`ls <dir1>`) mem del $file end
However, UNIX do not consist of any version number at the end of a filename. Hence, i would need to truncate the version number off the filename when i dir the files.
Since DCL has no loop construct like foreach, the mentioned each.com comes nearest. But of course You can write a much simples procedure to perform the particular task: To delete a file You HAVE to specify it's version number (or use a wildcard ";*" version to delete all. The DCL loop would be something like that:
Hi Joseph! I've got it! You've been a great help! Thanks a million!
As for the DCL loop, how do i delete the same files from the f$search in a different directory when the f$search results include the full path of the files? E.g. f$search dir: sys$sysdevice:[user.andrew.ABC] Delete in dir: sys$sysdevice:[user.andrew.CBA]
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE