Operating System - OpenVMS
1748213 Members
3124 Online
108759 Solutions
New Discussion юеВ

Re: Using FTP from a detached process.

 
SOLVED
Go to solution
The Brit
Honored Contributor

Using FTP from a detached process.

Hi Guys,
I know that one of you is going to jump on this and make me feel even dumber than normal, however, here goes.

I have short FTP script which is fairly self explanatory, i.e.

$ ftp ftp..com
cd out
dir
mget *.*
dir
bye
$!
$ Exit

This script runs fine interactively, and it runs fine in Batch, however when I try to run it from a detached process I get,

$ @FTP_Script
$ ftp ftp.rrd.com
%DCL-W-NUMBER, invalid numeric value - supply an integer
\\
cd out
%DCL-W-IVVERB, unrecognized command verb - check validity and spelling
\CD\

(obviously I am providing the correct Username and Password above.)

Can anyone through any light on this (without humiliating me too much)

thanks

Dave.
15 REPLIES 15
labadie_1
Honored Contributor

Re: Using FTP from a detached process.

As it runs fine in batch, what is the plus of running as a detached process ?

Jim_McKinney
Honored Contributor

Re: Using FTP from a detached process.

How are you creating this detached process? Unless you execute LOGINOUT you won't have the DCL CLI, PPFs, etc... so you won't have the FTP verb. You need to execute some variation of the following (add additional command qualifiers as desired/needed).

$ RUN/DETACH/INPUT=FTP_SCRIPT.COM SY$SYSTEM:LOGINOUT
The Brit
Honored Contributor

Re: Using FTP from a detached process.

The creation command is

$ run sys$system:loginout.exe
/input=parent.com/out=parent.log

The ftp_script runs from within "parent.com"

All DCL commands upto the FTP script execution work correctly, and after the script fails, the remaining DCL commands work correctly.

the problem just seems to be that the detached process will not let me specify the username and password on the command line.

by the by, I am running this on an ES45, OVMS 7.3-2, TcpWare 5.7. (Although I got the same error on a node running TCPIP Services V5.4).

Thanks

Dave
Jim_McKinney
Honored Contributor

Re: Using FTP from a detached process.

Guess that I should have realized that the CLI was mapped - you did show the DCL error message in the initial post...

Is FTP invoked using a verb from the command tables or as a foreign command? Is there a logical name defined for the FTP image or a symbol for the verb that is present during batch or interactive use but not defined for detached jobs (either by SYS$SYLOGIN or the LGICMD)?
The Brit
Honored Contributor

Re: Using FTP from a detached process.

No symbols, No Logicals, Not Foreign!

D
Walter Miller_1
Valued Contributor

Re: Using FTP from a detached process.

Maybe try the DCL style of /USERNAME=username /PASSWORD=password in your command prodecure.
Steven Schweda
Honored Contributor

Re: Using FTP from a detached process.

> Can anyone through any light on this
> (without humiliating me too much)

Could be hard, one way or the other.

Around here, with that syntax, I _always_ get
an error:

alp $ tcpip show version

HP TCP/IP Services for OpenVMS Alpha Version V5.4 - ECO 6
on a COMPAQ Professional Workstation XP1000 running OpenVMS V7.3-2

alp $ ftp alp sms not_my_password
%DCL-W-NUMBER, invalid numeric value - supply an integer
\SMS\

Most likely because, as the HELP says:

UNIX Format

ftp [ host [ port ] ]

and most user names don't qualify as valid
port numbers.

Personally, if I wished to do a quick
wildcard FTP fetch, I'd probably use wget:

wget "ftp://user:pass@host/path/*.*"

although if you need ASCII mode, it could get
messy.
John Gillings
Honored Contributor

Re: Using FTP from a detached process.

Dave,
For the VMS style FTP command use qualifiers /USERNAME=username /PASSWORD=password

The FTP command is trying to interpret your username parameter as a port number (see HELP FTP)

I'd also strongly recommend you delimit your commands with $DECK and $EOD


$ ftp ftp..com /USERNAME= /PASSWORD=
$ DECK
cd out
dir
mget *.*
dir
bye
$ EOD
$!
$ EXIT

$DECK protects you from nasty side effects if your command doesn't consume all the input (as in your case - imagine if your first FTP command had been DELETE rather than CD!)

Also check out COPY/FTP. It would look something like:

$ COPY/FTP ftp..com"username password"::"/out/*.*" []

A crucible of informative mistakes
The Brit
Honored Contributor

Re: Using FTP from a detached process.

To Walter,
TCPWARE doesn't recognise the "/username=... /password=..." syntax.

To Steven,
As a reminder, I am running TCPWARE 5.7, not TCPIP Services (sad to say!).

I think a point is being missed here, and that is that the FTP syntax I am using works fine either INTERACTIVELY or in BATCH, it only fails (and gives the above error) when it is running from a detached process.

This is what has me tearing my hair out. (and at my age there aint much left to begin with).

To John,
Thanks for the reminder about the Deck command, I will incorporate it, (really don't use it as much as I probably should).

Dave.