The following is from the HP ARPA File Transfer Protocol User's Guide,
Using FTP Commands in UDCs and Programs. Since you are doing this from a
job stream, you cannot use the parm line. Instead, you must hardcode
node, user, and password into the jobstream. Hardcoding the password is
pretty poor security; you could make the ftpcmd file appendable but not
readable, or run it from a secured group (just reply if this is a
concern). Use RA!HPDate!HPMonthXX for the filename, unless you need the
leading zero for single digit days and months.
This is the closest thing I have found for a technique to pass variables
into a subsystem: echo the variables into a file, and RUN the subsystem
using the command file. I have for instance used this to list
yesterday's log, manipulating SHOWLOG and decrementing to get the
required number, ECHOing the commands to a command file, and then
passing the command file to DUI.DIAG.SYS, aka SYSDIAG.
--------
Transferring Multiple Files
You can create a command file to automatically copy a group of files
from
the remote system into your account as in the following example.
1. Create a file with the following contents:
_____________________________________________________
| |
| parm node, user, pass |
| continue |
| purge ftpcmds,temp |
| |
| echo exitonerror >> ftpcmds|
| echo open !node >> ftpcmds|
| echo user !user !pass >> ftpcmds|
| echo get file1 file1 >> ftpcmds|
| echo get file2 file2 >> ftpcmds|
| echo get file3 file3 >> ftpcmds|
| echo quit >> ftpcmds|
| |
| run ftp.arpa.sys; stdin=ftpcmds |
| |
| if !FTPLASTERR <> 0 then |
| showvar FTP@ |
| endif |
| |
| continue |
| purge ftpcmds,temp |
_____________________________________________________
2. From the CI, (:) enter the following to execute the command file
you created:
: yourfile remotehostname username password
EXITONERROR is enabled in the above example. If there is an
error while executing, the error will be printed on the terminal
display.
You can create a UDC using the same set of commands above, except
changing the word parm to a UDC name such as getfiles. The first
statement for this UDC is:
getfiles node, user, pass
Enter the contents of the file in your UDC file. To execute this UDC,
you would enter:
:getfiles remotehostname username password
>----------
>From: [log in to unmask][SMTP:[log in to unmask]]
>Sent: Saturday, November 02, 1996 7:07 AM
>To: [log in to unmask]
>Subject: File names and FTP
>
>I'm an inexperienced MPEix programmer who needs to FTP a file from an HP to a
>BACSBOX. The file name is not known until run time when it takes the form
>RAddmmXX where ddmm is the day and month. Everything is fine in the HP under
>MPE where the file is created correctly, can be referred to as !RAFILE and
>written to as required.
>However, once I run FTP in my job stream it cannot recognise the file as
>!RAFILE.
>
>How do I pass the name of the file to FTP at run time?
>
>Any suggestions would be gratefully received either posted to the newsgroup
>or
>by email to [log in to unmask] or at my compuserve address
>[log in to unmask]
>
>
>Thanks in advance.
>
>Michael Duignan
>
|