HP OpenVMS Systems

ask the wizard
Content starts here

DCL Programming, File name manipulation?

» close window

The Question is:

I receive a file every day called ABCDEF.DAT. I would like to a command to a
 command procedure file that copies this file to another with the day's date in
 its name. ie. MMDDYY.DAT so that I have a unique file for each day. Since the
 file I get is always
named ABCDEF.DAT I want to be able to copy it and keep an archive by date of
 all the received files. Is there some way to do this in a command procedure?
 (ie. a .COM file?)

The Answer is :

  Please acquire access to and then read one of the available books or
  manuals on DCL programming -- this operation is simple, using one of
  the many available DCL lexical functions such as f$cvtime and DCL
  symbol substitution.  For example:
  $ date = f$cvtime(,"COMPARISON","DATE")
  $ rename abcdef.dat 'date'

answer written or last revised on ( 25-APR-2001 )

» close window