View previous topic :: View next topic
|
Author |
Message |
higherbriars
New User
Joined: 24 Jan 2007 Posts: 13 Location: SLC
|
|
|
|
Can I split an FTP sub-command line into 2 lines with a continuation character? How? IE. Can I take the destination of the PUT command and separate it into Path and File-Name? If so, what character and position do I use? Thank you...Cheers.
/THE/DEST/SERVER/LOCATION/FILENAME.TXT (change this line)
/THE/DEST/SERVER/LOCATION/ (to these 2 lines?)
FILENAME.TXT |
|
Back to top |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 631 Location: Wisconsin
|
|
|
|
Why not change the lines to
CD /THE/DEST/SERVER/LOCATION
PUT FILENAME.txt |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
4.9 Submitting FTP requests in batch.
Quote: |
If a command is too long to insert on a line, type a plus sign (+) in
place of the next command option and then enter the remaining options
on the next line. For example:
put local_file +
remote_file
Use a blank followed by a plus sign (+) at the end of an FTP
subcommand line as a continuation indicator for all FTP subcommands
except for the QUOTE subcommand. When the continuation indicator is
encountered at the end of an FTP subcommand line, the next line is
appended to the subcommand. For example, the following command is
interpreted as PUT SOURCE.DS.NAME DEST.DS.NAME:
PUT SOURCE.DS.NAME +
DEST.DS.NAME
|
|
|
Back to top |
|
|
higherbriars
New User
Joined: 24 Jan 2007 Posts: 13 Location: SLC
|
|
|
|
Thanks for the feedback. I do currently split the command line into 2 sub-command lines as you suggested. However, I'm wondering if I can break the file name of the DEST.DS.NAME into 2 separate lines.
DEST.DS.NAME
DEST.DS
.NAME
I have tried using "+" with no success. I need to isolate the file name from the path and then string them back together with a continuation. Is this feasible?
Thanks again for your feedback. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
From what I know, the continuation has to occur on a space in the string. May I ask why this should be necessary? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I need to isolate the file name from the path and then string them back together with a continuation. Is this feasible |
Is there some reason to not change into the proper directory and then issue the PUT? |
|
Back to top |
|
|
higherbriars
New User
Joined: 24 Jan 2007 Posts: 13 Location: SLC
|
|
|
|
We have approximately 2000 batch jobs which currently use NDM (Connect Direct) for file transfers. NDM lends itself to the use of Procs where Global changes can easily be made. We are switching from NDM to FTP. I am considering the possibility of concatenating files of the FTP commands normally used as in-stream data. I envision the need for future changes occurring mostly to the Path Name of the receiving file. If the Path Name is kept in a unique PDS which is concatenated as part of the FTP commands, then future changes to the Path can be done at a Global level versus having to change 2000 individual jobs. Since the "Report Name" (last 2 nodes of receiving file) are unique to each job, I want to isolate it from the Path Name which is more or less static. Hope this helps explain my reasoning for wanting to split the Destination File Name of the FTP into 2 pieces (those pieces being Path Name and Report Name). From what I'm seeing, FTP does not accommodate Global changes to the Path of the Destination File. If anyone has ideas on how to design the FTP from a batch point of view so that future changes to just the Destination Path part of the destination file name is possible, I'd like to hear your thoughts.
Cheers! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
If i understand your requirement, you want to concatenate several "pieces" into one FTP command sequence.
Would it not work to use 2 pds entries for the path and file name? In the first, a cd to the proper reomte path would be issued. In the second, would be the "put filename.txt".
I believe this meets your requirement to push the "file" into the correct destination directory. The only difference is that it takes 2 commands (cd & put) rather than just one.
If i've misunderstood, please clarify and we'll look for something else. |
|
Back to top |
|
|
higherbriars
New User
Joined: 24 Jan 2007 Posts: 13 Location: SLC
|
|
|
|
Thanks for the input regarding FTP CD. Sounds like it will work! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
You're welcome
We're here if there are new "opportunities". |
|
Back to top |
|
|
higherbriars
New User
Joined: 24 Jan 2007 Posts: 13 Location: SLC
|
|
|
|
It worked!!! BUT...I have another question. I'm trying to use symbolics in the FTP command line. It's not resolving them. It leaves them alone and interprets them as literals. An example of what I've tried thus far, is as follows:
&FTPUSER &FTPPASS
CD '/opt/wbi/data/XMPL/Inbound/SortBulk/&FTPSITE
PUT
'&FTPDSN1' +
'&FTPDSN2
quit
/*
//*
Is this possible or am I pushing my luck? Thank you. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Good to hear this
Quote: |
Is this possible or am I pushing my luck |
I believe you are in "puching my luck" territory. The ftp command info should already be resolved. It is not jcl and won't know how to resolve symbolics.
What you might do is create the ftp command info however it is being built now and then "edit" it yourself (in jcl), creating a dataset or member that has all of the values resolved. This new info would be what actually is processed by ftp. |
|
Back to top |
|
|
|