Discussion:
using variables - multinet FTP / VMS
(too old to reply)
CORA VANDENDRIESSCHE
2007-03-13 19:25:06 UTC
Permalink
Good 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
We 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
n***@metso.com
2007-03-13 20:44:12 UTC
Permalink
Post by CORA VANDENDRIESSCHE
Good 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 VANDENDRIESSCHE
We 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
You either want to use $COPY/FTP/USER=xxx/pass=yyy/nostru/verbose -
/binary (or /ascii) source_path target_path

or use a take command
$ FTP ccftp /USER=xxx /PASS=yyy /VERBOSE TAKE file.CMD
where file.CMD has FTP commands, like
cd rossuer
put sfile1
dir sfile1.*
bye
exit

or you can write a procedure file, so you can use DCL symbol
substitution and then run it:

OPEN OUTFILE file.com
WO:=WRITE OUTFILE
WO "$COPY/FTP/etc 'source_path' 'destination_path"
WO "$EXIT"
CLOSE OFILE
@FILE.COM

You get the ideas.
Michael J. Loeffler
2007-03-13 20:47:23 UTC
Permalink
You can do something like this:

$ open/write fileout temp.txt

$ write fileout "login cambrian\FTPUser"

$ write fileout "password (the-password)"

$ write fileout f$fao("cd !AS",user_dir)

$ write fileout f$fao("mput !AS",filename2)

$ write fileout "quit"

$ close fileout

$ ftp ccftp/take=temp.txt





_____

From: CORA VANDENDRIESSCHE [mailto:***@cambrianc.on.ca]
Sent: Tuesday, March 13, 2007 3:25 PM
To: info-***@process.com
Subject: using variables - multinet FTP / VMS



Good 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


We 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,TDAT E)
$ 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 ROSS USER
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
Ken Connelly
2007-03-13 20:53:53 UTC
Permalink
Two methods, both essentially the same:

1. Use your command procedure to construct (open, write, write,
write, close) a "take" file, then call that file as the last line
of your command procedure: $ mu ftp ccftp
/username=xxx/password=yyy/take_file=zzz
2. Use your command procedure to construct (open, write, write,
write, close) a second command procedure which contains the lines
from the bottom of your example, beginning with "$mu ftp".
Execute the second command procedure as the last line of the first
command procedure: $ @zzz

- ken
Post by CORA VANDENDRIESSCHE
Good 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
We 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
--
- Ken
=================================================================
Ken Connelly Associate Director, Security and Systems
ITS Network Services University of Northern Iowa
email: ***@uni.edu p: (319) 273-5850 f: (319) 273-7373
M***@instinet.com
2007-03-13 20:53:20 UTC
Permalink
COPY/FTP might or might not be available on Cora's systems, depending on
which version of OpenVMS you are running. VMS 5.5-2H4 does not have
COPY/FTP; VMS 7.2-1 does have the /FTP option.


Michael Goetz
Crossing Development
Instinet New York





***@metso.com
03/13/2007 04:44 PM
Please respond to
Info-***@process.com


To
info-***@process.com
cc

Subject
Re: using variables - multinet FTP / VMS
Post by CORA VANDENDRIESSCHE
Good 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 VANDENDRIESSCHE
We 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
You either want to use $COPY/FTP/USER=xxx/pass=yyy/nostru/verbose -
/binary (or /ascii) source_path target_path

or use a take command
$ FTP ccftp /USER=xxx /PASS=yyy /VERBOSE TAKE file.CMD
where file.CMD has FTP commands, like
cd rossuer
put sfile1
dir sfile1.*
bye
exit

or you can write a procedure file, so you can use DCL symbol
substitution and then run it:

OPEN OUTFILE file.com
WO:=WRITE OUTFILE
WO "$COPY/FTP/etc 'source_path' 'destination_path"
WO "$EXIT"
CLOSE OFILE
@FILE.COM

You get the ideas.



*****************************************************************
<<<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.

*****************************************************************
Ken Connelly
2007-03-13 21:06:47 UTC
Permalink
wow... four relevant responses inside a half-hour. kind of brings back
TGV days! :-)

plus fulfilling the hope that the "mailing list is still active"
--
- Ken
=================================================================
Ken Connelly Associate Director, Security and Systems
ITS Network Services University of Northern Iowa
email: ***@uni.edu p: (319) 273-5850 f: (319) 273-7373
Brown, Dwight
2007-03-14 12:44:26 UTC
Permalink
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 VANDENDRIESSCHE
Good 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 VANDENDRIESSCHE
We 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
M***@instinet.com
2007-03-14 13:13:26 UTC
Permalink
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 VANDENDRIESSCHE
Good 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 VANDENDRIESSCHE
We 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.

*****************************************************************
Paul Sture
2007-03-14 14:30:06 UTC
Permalink
In article
<OFCB44ED87.82277C0C-ON8525729E.00474B69-***@isn.instinet.
com>,
Post by M***@instinet.com
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.)
$ open/write tmp take.txt
$ 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.
Another method for uniqueness is to use the process id as part of the
filename. It's somewhat meaningless, and harder to type when it comes to
looking at the files though.

I find a date and time combination more useful for file transfers, as it
aids problem diagnosis and determining which jobs require resubmitting
after a link failure.
--
Paul Sture
Ken Connelly
2007-03-14 13:19:08 UTC
Permalink
I tend to use the PID, f$getjpi("","pid"), when I'm worried about
collisions.

- ken
Post by M***@instinet.com
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.)
$ open/write tmp take.txt
$ 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
03/14/2007 08:44 AM
Please respond to
To
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 VANDENDRIESSCHE
Good 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 VANDENDRIESSCHE
We 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.
*****************************************************************
--
- Ken
=================================================================
Ken Connelly Associate Director, Security and Systems
ITS Network Services University of Northern Iowa
email: ***@uni.edu p: (319) 273-5850 f: (319) 273-7373
Belviso, Scott J. (GRC-VCE0)[RSIS]
2007-03-14 13:30:42 UTC
Permalink
There is always the f$unique() lexical also...

Scott
-----Original Message-----
Sent: Wednesday, March 14, 2007 9:19 AM
Subject: Re: using variables - multinet FTP / VMS
I tend to use the PID, f$getjpi("","pid"), when I'm worried
about collisions.
- ken
Post by M***@instinet.com
Yes, that would work. One thing to watch out for, however. If it's
possible that this procedure could run more than once
simultaneously,
Post by M***@instinet.com
in the same directory, the processes could be writing
different copies
Post by M***@instinet.com
of 'take.txt' at the same time. It's possible that one of
them would
Post by M***@instinet.com
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
Post by M***@instinet.com
be sufficient if there are multiple processes or
subprocesses running
Post by M***@instinet.com
from the same terminal. In that case, a different unique ID would
need to be used. For my purposes, terminal name surfices.)
$ open/write tmp take.txt
$ 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
Post by M***@instinet.com
guarantee that only one copy will run at a time,
disambiguation of the
Post by M***@instinet.com
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
03/14/2007 08:44 AM
Please respond to
To
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 VANDENDRIESSCHE
Good afternoon - I hope this public mailing list is still
active - I
Post by M***@instinet.com
Post by CORA VANDENDRIESSCHE
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 VANDENDRIESSCHE
We 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
Post by CORA VANDENDRIESSCHE
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.
*****************************************************************
--
- Ken
=================================================================
Ken Connelly Associate Director, Security and Systems
ITS Network Services University of Northern Iowa
M***@instinet.com
2007-03-14 17:47:30 UTC
Permalink
Not always. I'm not sure what version of VMS introduced f$unique, but
it's a more recent version than what I'm running on any of my VAXen or
Alphas. Maybe f$unique was introduced with VMS 8.0?


Michael Goetz
Crossing Development
Instinet New York





"Belviso, Scott J. (GRC-VCE0)[RSIS]" <***@nasa.gov>
03/14/2007 09:30 AM
Please respond to
Info-***@process.com


To
info-***@process.com
cc

Subject
RE: using variables - multinet FTP / VMS






There is always the f$unique() lexical also...

Scott
*****************************************************************
<<<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.

*****************************************************************
Ken Connelly
2007-03-14 17:56:26 UTC
Permalink
it is in alpha 7.3-2, but not in vax 7.3

-ken
Post by M***@instinet.com
Not always. I'm not sure what version of VMS introduced f$unique, but
it's a more recent version than what I'm running on any of my VAXen or
Alphas. Maybe f$unique was introduced with VMS 8.0?
Michael Goetz
Crossing Development
Instinet New York
03/14/2007 09:30 AM
Please respond to
To
cc
Subject
RE: using variables - multinet FTP / VMS
There is always the f$unique() lexical also...
Scott
*****************************************************************
<<<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.
*****************************************************************
--
- Ken
=================================================================
Ken Connelly Associate Director, Security and Systems
ITS Network Services University of Northern Iowa
email: ***@uni.edu p: (319) 273-5850 f: (319) 273-7373
n***@metso.com
2007-03-14 21:13:27 UTC
Permalink
I wonder, did the list answer your questions, Cora?
Post by CORA VANDENDRIESSCHE
Good afternoon - I hope this public mailing list is still active - I
could really use the help
[snip]
Thank you to anyone with suggestions
Cora
David J Dachtera
2007-03-15 01:30:19 UTC
Permalink
Hello, Cora,

Netscape failed to quote your message - probably due to HTML and/or MIME. This
is a text-only newsgroup.

Here's an approach that should work on most VMS versions V7.2 and later:

$ fdat = f$cvtime() - "-" - "-" - " " - ":" - ":" - "."

This technique is called "string reduction" - "subtracting" unwanted characters
from a string. This will result in, for example, "2007031419262286" so files
will be sorted by year/month/day instead of day/month(alpha)/year/...

$ fnam := onestop_'fdat'.JRNL ! Try to avoid dashes in filenames.
$ usrn := 'f$getjpi( 0, username" )' ! Trailing spaces get dropped
$ say := write sys$output
$ pipe -
(say "cd ROSSUSER" ; -
say "cd ", usrn ; -
say "mput ", fnam ) | - ! No wildcards on MPUT???!!!
ftp ccftp/user="cambrian\FTPUser"
$ exit

If no /PASSWORD, then omit the qualifier because a value is required. Also,
because the username is mixed case and contains "invalid" characters ("\"), put
it inside quotes.

"FTP" should be enough. "MULTINET " should be optional. If you just use "FTP",
the procedure will work for Multinet, TCPware or UCX instead of just Multinet.

Hope this helps.
--
David J Dachtera
dba DJE Systems
http://www.djesys.com/

Unofficial OpenVMS Marketing Home Page
http://www.djesys.com/vms/market/

Unofficial Affordable OpenVMS Home Page:
http://www.djesys.com/vms/soho/

Unofficial OpenVMS-IA32 Home Page:
http://www.djesys.com/vms/ia32/

Unofficial OpenVMS Hobbyist Support Page:
http://www.djesys.com/vms/support/
David J Dachtera
2007-03-16 02:41:56 UTC
Permalink
Post by David J Dachtera
Hello, Cora,
Netscape failed to quote your message - probably due to HTML and/or MIME. This
is a text-only newsgroup.
$ fdat = f$cvtime() - "-" - "-" - " " - ":" - ":" - "."
This technique is called "string reduction" - "subtracting" unwanted characters
from a string. This will result in, for example, "2007031419262286" so files
will be sorted by year/month/day instead of day/month(alpha)/year/...
$ fnam := onestop_'fdat'.JRNL ! Try to avoid dashes in filenames.
$ usrn := 'f$getjpi( 0, username" )' ! Trailing spaces get dropped
Slight correction:
$ usrn := 'f$getjpi( 0, "username" )' ! Trailing spaces get dropped

I missed a double-quote.
Post by David J Dachtera
$ say := write sys$output
$ pipe -
(say "cd ROSSUSER" ; -
say "cd ", usrn ; -
say "mput ", fnam ) | - ! No wildcards on MPUT???!!!
ftp ccftp/user="cambrian\FTPUser"
$ exit
If no /PASSWORD, then omit the qualifier because a value is required. Also,
because the username is mixed case and contains "invalid" characters ("\"), put
it inside quotes.
"FTP" should be enough. "MULTINET " should be optional. If you just use "FTP",
the procedure will work for Multinet, TCPware or UCX instead of just Multinet.
Hope this helps.
--
David J Dachtera
dba DJE Systems
http://www.djesys.com/

Unofficial OpenVMS Marketing Home Page
http://www.djesys.com/vms/market/

Unofficial Affordable OpenVMS Home Page:
http://www.djesys.com/vms/soho/

Unofficial OpenVMS-IA32 Home Page:
http://www.djesys.com/vms/ia32/

Unofficial OpenVMS Hobbyist Support Page:
http://www.djesys.com/vms/support/
Loading...