Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Can FTP sub-command lines be split ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
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    Post subject: Can FTP sub-command lines be split ?
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    Post subject:
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

Moderator Team Head


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

PostPosted: Wed Oct 17, 2007 9:31 am    Post subject: Reply to: Can FTP sub-command lines be split ?
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    Post subject: Reply to: Can FTP sub-command lines be split ?
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

Moderator Team Head


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

PostPosted: Wed Oct 17, 2007 7:55 pm    Post subject: Reply to: Can FTP sub-command lines be split ?
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

Site Director


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

PostPosted: Wed Oct 17, 2007 7:56 pm    Post subject:
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    Post subject: Reply to: Can FTP sub-command lines be split ?
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

Site Director


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

PostPosted: Wed Oct 17, 2007 9:02 pm    Post subject:
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    Post subject: Reply to: Can FTP sub-command lines be split ?
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

Site Director


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

PostPosted: Wed Oct 17, 2007 11:53 pm    Post subject:
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    Post subject: Reply to: Can FTP sub-command lines be split ?
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

Site Director


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

PostPosted: Thu Oct 18, 2007 5:36 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts MQ command in option 6 of ISPF! Vignesh Sid All Other Mainframe Topics 3 Tue Sep 26, 2017 6:01 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts How to change a string containing the... chong.zhou TSO/ISPF 6 Tue Aug 29, 2017 4:54 pm
No new posts Mainframe dataset split purushottam DFSORT/ICETOOL 13 Tue Aug 29, 2017 12:28 pm
No new posts Failure after DIR command Hank Watson All Other Mainframe Topics 2 Tue Aug 29, 2017 3:14 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us