Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

ftp command procedure

 
SOLVED
Go to solution

ftp command procedure

I think this has been discussed before but here goes.
Compaq TCP/IP Services for OpenVMS VAX Version V5.3
VMS 7.3
The command procedure is below.
$ date = f$extract(0,10,f$cvtime())
$ mo = f$extract(5,2,date)
$ da = f$extract(8,2,date)
$ yr = f$extract(2,2,date)
$ fil = "dbt_"'mo''da''yr' + ".dat"
$ set def dka200:[jnc]
$ ftp/user=chambjx/pass=xxxxxxx upenn2 -
get pg_disk:[chambjx.jesse.sytools.sydata]'fil' dka200:[jnc]'fil'

When this is executed I receive the following error.

%DCL-W-NUMBER, invalid numeric value - supply an integer
\GET\

Any help would be appreciated.

11 REPLIES
Marc Van den Broeck
Trusted Contributor

Re: ftp command procedure

Jesse,

remove the minus sign at the end of the ftp line.

Rgds
Marc
Ian Miller.
Honored Contributor

Re: ftp command procedure

You may also wish to consider using the COPY/FTP syntax. See HELP.
____________________
Purely Personal Opinion

Re: ftp command procedure

The - at the end is a line continuator for the procedure.

Below is a very similiar procedure using Multinet.

$ date = f$extract(0,10,f$cvtime())
$ mo = f$extract(5,2,date)
$ da = f$extract(8,2,date)
$ yr = f$extract(2,2,date)
$ fil = "dbt_"'mo''da''yr' + ".dat"
$ ftp/user=system/pass=xxxxxx cm1 -
get dka200:[jnc]'fil' cachesys:'fil'
$!

This procedure works great.

I must admit, I had the procedure list working and managed to delete it! I am now trying to re-create it on TCPIP.
Antoniov.
Honored Contributor

Re: ftp command procedure

Jesse,
I'm with Marc, remove hyphen.

In vms, every line with end hyphen means continue with next line.
Without hyphen, your command procedure open ftp and then execute get command.

Antonio Vigliotti
Antonio Maria Vigliotti

Re: ftp command procedure

The problem with that is I am passing in a symbol and ftp will not see the file name.
Willem Grooters
Honored Contributor
Solution

Re: ftp command procedure

Multinet <> TCPIP....

This is how we do it, sending all files from a previously prepared directory:

$ ftp
/user= /passw=
prompt
asci
send bps$exp:*.*;*
bye
$

ftp + addrtess + user + password on one line, rest on a line by themselves.

So no "-" in your FTP-line...

In other occasions, a commandprocedure as above is created in that procedure, executed and deleted:

$ open/write FTPFILE ftp.com
$ write FTPFILE "ftp
/user= /passw="
$ write FTPFILE "prompt"
$ write FTPFILE "asci"
$ write FTPFILE "send bps$exp:*.*;*"
$ write FTPFILE "bye"
$ close FTPFILE
$ @ftp.com
$ delete/nolog ftp.com;*

Not very elegant, but who cares. It works...
Be sure though to redefine SYS$INPUT to TT: (as we have in ou command procedure)
Willem Grooters
OpenVMS Developer & System Manager
Jan van den Ende
Honored Contributor

Re: ftp command procedure

Jesse,

we essentially use Willem's solution.
Clumsy, but works great.

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Ian Miller.
Honored Contributor

Re: ftp command procedure

$ COPY/FTP/ASCII upenn2"chambjx xxxxxx"::pg_disk:[chambjx.jesse.systools.sydata]'fil' dka200:[jnc]'fil'

(all one line)
____________________
Purely Personal Opinion
Bojan Nemec
Honored Contributor

Re: ftp command procedure

Jesse,

I will go for the COPY/FTP solution as mentioned by Ian:

$ COPY/FTP upenn2"chambjx xxxxxxx":: pg_disk:[chambjx.jesse.sytools.sydata]'fil' dka200:[jnc]'fil'


With TCP/IP Services you can not do the command in one line so you must remove the minus sign at the end of yours command. So you get the same thing as if you type the command:

$ ftp/user=chambjx/pass=xxxxxxx upenn2

get the FTP> prompt and type

FTP> get pg_disk:[chambjx.jesse.sytools.sydata]'fil' dka200:[jnc]'fil'

But now you get problems with symbol replacement. The symbols are not replaced.

If you want to replace this symbols you can use the pipe command:

$ PIPE WRITE SYS$OUTPUT -
"get pg_disk:[dir]''fil' dka200:[jnc]''fil'" -
| ftp/user=chambjx/pass=xxxxxxx upenn2


There is another solution which works with put, but not with get:

$ date = f$extract(0,10,f$cvtime())
$ mo = f$extract(5,2,date)
$ da = f$extract(8,2,date)
$ yr = f$extract(2,2,date)
$ define file "dbt_''mo'''da'''yr'.dat"
$ ftp/user=chambjx/pass=xxxxxxx upenn2
put file


Bojan

Re: ftp command procedure

Modified to the "kludgey" method and it works great. See below.

$ date = f$extract(0,10,f$cvtime())
$ mo = f$extract(5,2,date)
$ da = f$extract(8,2,date)
$ yr = f$extract(2,2,date)
$ fil = "dbt_"'mo''da''yr' + ".dat"
$ set def dka200:[jnc]
$ open/write FTPFILE ftp.com
$ write FTPFILE "ftp/user=chambjx /pass=xxxxxx "
$ write FTPFILE "ascii"
$ write FTPFILE "get pg_disk:[chambjx.jesse.sytools.sydata]''fil' dka200:[jnc]''fil'"
$ write FTPFILE "exit"
$ close FTPFILE
$ @ftp.com
$ delete/nolog ftp.com;*

Thanks for everyones help!!

Re: ftp command procedure

See last response for the fix.