Yes, that would work. One thing to watch out for, however. If it's
possible that this procedure could run more than once simultaneously, in
the same directory, the processes could be writing different copies of
'take.txt' at the same time. It's possible that one of them would end up
executing the other's file.
To avoid this, I usually embed the terminal name of the executing process
in the filename of temporary files. (Note that this would not be
sufficient if there are multiple processes or subprocesses running from
the same terminal. In that case, a different unique ID would need to be
used. For my purposes, terminal name surfices.)
For example, instead of:
$ open/write tmp take.txt
I would use something like:
$ termn := 'f$extract(0,f$locate(":",f$process()),f$process())
$ takefile := take_'termn'.txt
$ open/write tmp 'takefile'
This will result in creating a file called, for example,
"TAKE__NTY2595.TXT". There's no possibility of conflicting with another
process also creating a take file.
Of course, if there's no possibility of multiple instances of this process
running concurrently, you can skip all this. But if you can't guarantee
that only one copy will run at a time, disambiguation of the temporary
file name can prevent some difficult to diagnose problems down the road.
Michael Goetz
Crossing Development
Instinet New York
Direct Line: (212) 310-4169
Cell: (914) 320-7795
"Brown, Dwight" <***@mail.etsu.edu>
03/14/2007 08:44 AM
Please respond to
Info-***@process.com
To
info-***@process.com
cc
Subject
Re: using variables - multinet FTP / VMS
So it would look something like this with <username> replaced by the
username for FTP use and <password> replaced by the appropriate password
$ !
$ ! Get date/time to append to file name
$ tdate = -
f$edit(-
f$extract(0,15,f$time() - "-" - "-" - " " - ":" - ":" -
"."),"collapse")
$ filename = "onestop-" + tdate + ".JRNL"
$ !
$ ! Get the userid to know which directory to move the file to
$ !
$ user_dir = f$edit(f$getjpi("","username"),"collapse")
$ !
$ ! Create the temporary take file
$ open/write tmp take.txt
$ write tmp -
"CD ROSSUSER"
$ write tmp -
"CD ''user_dir'"
$ write tmp -
"MPUT ''filename'"
$ write tmp -
"EXIT"
$ close tmp
$ !
$ ! Execute FTP using the take file
$ multinet ftp ccftp /username=<username> /password=<password>
/take_file=take.txt
$ !
$ ! Cleanup
$ delete take.txt;*
$ exit
Dwight Brown
East Tennessee State University
Post by CORA VANDENDRIESSCHEGood afternoon - I hope this public mailing list is still active - I
could really use the help
I need to create a command file that needs to pass variables to a
multinet ftp process
the variables will be the subfolder name and the name of the file
being
sent
Post by CORA VANDENDRIESSCHEWe are in a VMS environment
Sample command file
!$ GET DATE/TIME TO ABEND TO FILE NAME $ TDATE=F$TIME() $
FDAY=F$EXTRACT(0,2,TDATE) $ FMONTH=F$EXTRACT(3,3,TDATE) $
FYEAR=F$EXTRACT(7,4,TDATE) $ FDAY=F$EDIT(FDAY, "COLLAPSE") $
FHR=F$EXTRACT(12,2,TDATE) $ FMIN=F$EXTRACT(15,2,TDATE) $
FSEC=F$EXTRACT(18,2,TDATE) $
FILENAME="ONESTOP-"+FDAY+FMONTH+FYEAR+FHR+FMIN+FSEC
$ FILENAME2='FILENAME' + '.JRNL'
$!
$! GET THE USER-ID TO KNOW WHICH DIRECTORY TO MOVE THE FILE TO $!
$ USER_DIR1 = F$GETJIP("","USERNAME")
$ USER_DIR = F$EDIT(USER_DIR1,"COLLAPSE") $!
$multinet ftp ccftp /username=cambrian\FTPUser /password= CD >ROSSUSER
CD %USER_DIR THIS IS WHERE I'D LIKE TO HAVE SYNTAX
THAT ALLOWS THE VARIABLES TO BE USED
MPUT %FILENAME2
EXIT
Thank you to anyone with suggestions
Cora
*****************************************************************
<<<Disclaimer>>>
In compliance with applicable rules and regulations, Instinet
reviews and archives incoming and outgoing email communications,
copies of which may be produced at the request of regulators.
This message is intended only for the personal and confidential
use of the recipients named above. If the reader of this email
is not the intended recipient, you have received this email in
error and any review, dissemination, distribution or copying is
strictly prohibited. If you have received this email in error,
please notify the sender immediately by return email and
permanently delete the copy you received.
Instinet accepts no liability for any content contained in the
email, or any errors or omissions arising as a result of email
transmission. Any opinions contained in this email constitute
the sender's best judgment at this time and are subject to change
without notice. Instinet does not make recommendations of a
particular security and the information contained in this email
should not be considered as a recommendation, an offer or a
solicitation of an offer to buy and sell securities.
*****************************************************************