IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Can FTP sub-command lines be split ?


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
higherbriars

New User


Joined: 24 Jan 2007
Posts: 13
Location: SLC

PostPosted: Wed Oct 17, 2007 8:05 am
Reply with quote

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
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Wed Oct 17, 2007 8:57 am
Reply with quote

Why not change the lines to

CD /THE/DEST/SERVER/LOCATION
PUT FILENAME.txt
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Oct 17, 2007 9:31 am
Reply with quote

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
View user's profile Send private message
higherbriars

New User


Joined: 24 Jan 2007
Posts: 13
Location: SLC

PostPosted: Wed Oct 17, 2007 7:47 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Oct 17, 2007 7:55 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Oct 17, 2007 7:56 pm
Reply with quote

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
View user's profile Send private message
higherbriars

New User


Joined: 24 Jan 2007
Posts: 13
Location: SLC

PostPosted: Wed Oct 17, 2007 8:35 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Oct 17, 2007 9:02 pm
Reply with quote

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
View user's profile Send private message
higherbriars

New User


Joined: 24 Jan 2007
Posts: 13
Location: SLC

PostPosted: Wed Oct 17, 2007 10:04 pm
Reply with quote

Thanks for the input regarding FTP CD. Sounds like it will work!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Oct 17, 2007 11:53 pm
Reply with quote

You're welcome icon_smile.gif

We're here if there are new "opportunities".
Back to top
View user's profile Send private message
higherbriars

New User


Joined: 24 Jan 2007
Posts: 13
Location: SLC

PostPosted: Thu Oct 18, 2007 3:47 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Oct 18, 2007 5:36 am
Reply with quote

Hello,

Quote:
It worked!!!
Good to hear this icon_smile.gif

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Routing command Address SDSF to other... TSO/ISPF 2
No new posts DTL - how to define key with stacked ... TSO/ISPF 3
No new posts LTJ command CA Products 4
Search our Forums:

Back to Top