[Info-vax] DCL: Restrictions to READ loop process?

ken kenrbnsn at gmail.com
Wed Sep 16 12:51:11 EDT 2009


On Sep 16, 12:38 pm, Robb <rob... at gmail.com> wrote:
> On Sep 16, 12:31 am, CY <christ... at gmail.com> wrote:
>
>
>
>
>
> > On 15 Sep, 21:14, Robb <rob... at gmail.com> wrote:
>
> > > Hi,
>
> > > I'm trying to put a conditional IF-THEN statement in a READ loop that
> > > triggers a COPY.
>
> > > It only seems to work the first time through the loop.
>
> > > Is there something about the READ loop that prevents this?
>
> > > Thanks,
>
> > > Robb
>
> > Trying to copy the file you are reading? might be locked? what do I
> > know, Im blonde...
> > //CY
>
> Wow, thanks for the great, quick responses everyone!  Nice to find a
> newsgroup that isn’t dead.

Welcome to the wonderful world of VMS...

>
> Well CY, seems you were right sort of.
>
> Adding SET VERIFY like JF Mezei recommended, I see that the process
> errors out if the file I'm asking it to copy doesn't exist.
>
> Now to figure out what to add to my copy command so it ignores errors
> and continues looping… if the file doesn’t exist then I don’t care if
> it isn’t copied.

Adding

$ set noon

at the start of your command procedure will keep it going when it hits
an error.

Alternatively, you can check if the file exists before doing the copy:

$ if f$search("your_filename.here") .nes. "" then copy
your_filename.here your_newfilename.here

Ken



More information about the Info-vax mailing list