- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- FTP command file issue
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2009 06:58 AM
07-13-2009 06:58 AM
What am I doing wrong?
Solved! Go to Solution.
- Tags:
- ftp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2009 07:10 AM
07-13-2009 07:10 AM
Solutionhttp://labs.hoffmanlabs.com/node/136
As for what's wrong with your particular DCL code here, you'll want to post that code, how you're invoking the code ("immediately logs out" can be indicative of a user-mode coding error in some contexts, or of an inner-mode and thus more serious error in others), along with some information on which IP stack and version and ECO level is in use here, and the OpenVMS version.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2009 07:10 AM
07-13-2009 07:10 AM
Re: FTP command file issue
please make a text file copy of the command procedure and post it as an attachment.
Without this information, we will be left guessing in the dark.
Duncan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2009 07:24 AM
07-13-2009 07:24 AM
Re: FTP command file issue
$ put test.ops "TEST.OPS"
$ ascii
$ quit
It gets as far as logging in then comes back with a '221 goodbye'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2009 07:25 AM
07-13-2009 07:25 AM
Re: FTP command file issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2009 07:28 AM
07-13-2009 07:28 AM
Re: FTP command file issue
$ COPY/FTP/ASCII/LOG TEST.OPS -
SERV"username password"::
Craig
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2009 07:31 AM
07-13-2009 07:31 AM
Re: FTP command file issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2009 07:33 AM
07-13-2009 07:33 AM
Re: FTP command file issue
If this is V6.2 or later, use this:
$ COPY /FTP /ASCII test.ops -
server"user pass"::TEST.OPTS
$
If this is older or if you want to use the hard way, then use this:
$ ftp serv /USERNAME="user" /PASSWORD="pass"
ascii
put test.ops TEST.OPS
quit
$
And the next thing you'll usually encounter with "the hard way" is that you can't do DCL symbol substitution in the commands, which means you need to use a custom-created file for the transfer and @ it.
http://labs.hoffmanlabs.com/node/1339
An example of building a data file from DCL:
http://labs.hoffmanlabs.com/node/163
If you're just getting going with DCL and DCL procedures, have a look at the User's Guide in the OpenVMS manual set, too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2009 07:37 AM
07-13-2009 07:37 AM
Re: FTP command file issue
I would doubt you entered ftp> $ put
In a DCL procedure, the $ is a flag that indicates "this is a DCL command". Bash doesn't have something similar here, if you're coming over from Unix. The $ differentiates between commands and data. Commands have symbol substitution and other such, and data does not. And the very first $ that an application reads is treated as an EOF for the application command input.
Unless you need to use a leading $ on your application input data, and then you use $ DECK and $ EOD commands. Which is described here:
http://labs.hoffmanlabs.com/node/1339
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2009 07:39 AM
07-13-2009 07:39 AM
Re: FTP command file issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2009 10:16 AM
07-13-2009 10:16 AM
Re: FTP command file issue
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2009 11:32 AM
07-13-2009 11:32 AM
Re: FTP command file issue
One method that I haven't seen mentioned yet in this thread, is the use of ftp host /input=vms_file_with_ftp_commands The input file can have the remote username and password as the first two lines of the input file, followed by ftp commands to execute (including quit), alternatively, the username and password can be passed on the DCL FTP command line with /username and /password. In this case the /input file should not have the username and password. In other words, if the username and password are not specified using the command line /username and /password, then FTP will be expecting the username and password as the first two lines of input.
The integration of FTP in DCL commands is nowhere as seemless as the integration of DECnet into DCL. For example there is no $ RENAME/FTP DCL command. Also, some things just won't work when initiating a tcp session for each command, for example something like "quote site umask" commands, which only remain in effect only for the duration of the ftp session.
Example code to copy from 'vms_name' to 'unix_name' while making the 'unix_name' appear to be 'atomically' created. This transfers to a temporary file nmae 'xfr_name' on the remote side, then uses ftp rename to rename the file on the remote side. Note: There is no VMS command RENAME/FTP
$ pid = f$getjpi("","PID")
$ temp = "sys$scratch:ftpinput.''pid';"
$ create 'temp'
$ temp = f$search(temp)
$ close/nolog ftpcmd
$ open/append ftpcmd 'temp'
$ write ftpcmd "''ftp_user'"
$ write ftpcmd "''ftp_usrp'"
$ write ftpcmd "ascii"
$ write ftpcmd "quote site umask 111" ! change default protection for created files to -rw-rw-rw-
$ write ftpcmd "put ''vms_name' ''xfr_name'"
$ write ftpcmd "rename ''xfr_name' ''unix_name'"
$ write ftpcmd "quit"
$ close/nolog ftpcmd
$ if .not. debug
$ then
$ define/user sys$output nla0:
$ else
$ type* 'temp'
$ endif
$ set noon ! so we can manually process ftp status
$ ftp 'ftp_srv' /input='temp'
$ ftp_copy_code := '$status'/'$severity'
$ ftp_copy_status = f$element(0,"/",ftp_copy_code)
$ ftp_copy_severity = f$element(1,"/",ftp_copy_code)
$ last_status = ftp_copy_status
$ if ftp_copy_severity .eq. 1
$ then
$ ! put code here to be executed if file was successfully copied
$ 'nodeb' delete* 'temp'
$ else
$ ! put code here to be executed if file copy failed
$ endif
The biggest disadvantage of this method is that you have very limited error handling, about all you know it that the whole sequence succeeded, or that some part of it failed, but which part is not easy to determine.
Jon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2009 12:16 AM
07-14-2009 12:16 AM
Re: FTP command file issue
The copy/ftp command worked nicely, but didn't put the file onto the UNIX box in uppercase, which the FTP command minus the $s did, so I'm going with that for the time being.
Thanks again everyone.
dave.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2009 01:27 AM
07-14-2009 01:27 AM
Re: FTP command file issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2009 04:43 AM
07-14-2009 04:43 AM
Re: FTP command file issue
I'll presume you're on OpenVMS I64 V8.2-1 or (more likely) OpenVMS I64 V8.3-1H1 here (AFAIK, there's no V8.3-1), and these versions also mean you can also alter your DCL-level command parsing settings as required. Specifically, this is the SET PROCESS /PARSE=EXTENDED command. This mechanism preserves file case (case-preserving, case-blind) and how application-level switches (foreign commands) and related are processed.
The extended parsing mechanism is often associated with making full use of ODS-5 disk structures, but is a separate process-level selection knob.