Author |
Message
|
$ureshWMB |
Posted: Tue Feb 17, 2015 10:34 pm Post subject: How to use FTP Commands SITE and QUOTE |
|
|
Apprentice
Joined: 06 Apr 2014 Posts: 36
|
Hi every one.
I need to execute two FTP commands with fields(SITE and QUOTE) every time when we place a file.
What is the syntax for this two commands.. I have tried in the same as other commands
SET OutputLocalEnvironment.Destination.File.Remote.Precommand[1].CD = '/XX/XX';
SET OutputLocalEnvironment.Destination.File.Remote.Precommand[2].SITE = 'NAMEFMT 1';
While debugging I am getting FTP protocol error at second command.
How to run these commands?
Thanks In Advance. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Feb 18, 2015 5:15 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
|
Back to top |
|
 |
$ureshWMB |
Posted: Sun Feb 22, 2015 9:31 pm Post subject: |
|
|
Apprentice
Joined: 06 Apr 2014 Posts: 36
|
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Feb 23, 2015 5:06 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
I thought the infocenter was pretty clear... What have you tried so far and to what effect?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
$ureshWMB |
Posted: Mon Feb 23, 2015 6:03 am Post subject: |
|
|
Apprentice
Joined: 06 Apr 2014 Posts: 36
|
fjb_saper wrote: |
I thought the infocenter was pretty clear... What have you tried so far and to what effect?  |
I have tried with below syntax and getting FTP protocol exception.
SET OutputLocalEnvironment.Destination.File.Remote.Precommand[2].SITE = 'NAMEFMT 1';
SET OutputLocalEnvironment.Destination.File.Remote.Precommand[3].QUOTE = 'TYPE C 850';
Sequence of nodes :
MQInput--->Compute node(ALL)--->Fileoutput node
Text:CHARACTER:FTP protocol exception
Insert
Type:INTEGER:5
Text:CHARACTER:FTP
Insert
Type:INTEGER:5
Text:CHARACTER:SITE
Insert
Type:INTEGER:5
Text:CHARACTER:FTP protocol error |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Feb 23, 2015 6:22 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
[quote="$ureshWMB"][quote="fjb_saper"]
$ureshWMB wrote: |
Thank you saper.
http://www-01.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/bc23790_.htm
I have tried with below syntax and getting FTP protocol exception.
SET OutputLocalEnvironment.Destination.File.Remote.Precommand[2].SITE = 'NAMEFMT 1';
SET OutputLocalEnvironment.Destination.File.Remote.Precommand[3].QUOTE = 'TYPE C 850';
Sequence of nodes :
MQInput--->Compute node(ALL)--->Fileoutput node
Text:CHARACTER:FTP protocol exception
Insert
Type:INTEGER:5
Text:CHARACTER:FTP
Insert
Type:INTEGER:5
Text:CHARACTER:SITE
Insert
Type:INTEGER:5
Text:CHARACTER:FTP protocol error |
Looks to me you need to review the first 2 links.
Just to give us the right information... if you do run the ftp manually what do your quote and site commands look like? Does it work in a non IIB environment? Are you connecting to a mainframe?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
$ureshWMB |
Posted: Mon Feb 23, 2015 8:35 am Post subject: |
|
|
Apprentice
Joined: 06 Apr 2014 Posts: 36
|
[quote="fjb_saper"][quote="$ureshWMB"]
fjb_saper wrote: |
$ureshWMB wrote: |
Thank you saper.
http://www-01.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/bc23790_.htm
I have tried with below syntax and getting FTP protocol exception.
SET OutputLocalEnvironment.Destination.File.Remote.Precommand[2].SITE = 'NAMEFMT 1';
SET OutputLocalEnvironment.Destination.File.Remote.Precommand[3].QUOTE = 'TYPE C 850';
Sequence of nodes :
MQInput--->Compute node(ALL)--->Fileoutput node
Text:CHARACTER:FTP protocol exception
Insert
Type:INTEGER:5
Text:CHARACTER:FTP
Insert
Type:INTEGER:5
Text:CHARACTER:SITE
Insert
Type:INTEGER:5
Text:CHARACTER:FTP protocol error |
Looks to me you need to review the first 2 links.
Just to give us the right information... if you do run the ftp manually what do your quote and site commands look like? Does it work in a non IIB environment? Are you connecting to a mainframe?  |
Thanks for your quick reply.
Yes. I am trying to place files in AS400 machine.
Yes.. This setup is running for atomsphere.
We are able to place the files but the target application is not picking up them.When we discuss with target machine owners they suggested us to run below commands
Commands used:
QUOTE site namefmt 1
-used first before any other FTP commands
SET PrePutCommand=TYPE C 850
-Used to force the CCSID to 850 (Extended ASCII).
When I goggled for above commands i found IIB info center link
Thank you..  |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Feb 23, 2015 12:59 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Which means you haven't tried them yet in a standard ftp. Get this one to work first, then you will know what to issue as quote and site commands before you use IIB.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
$ureshWMB |
Posted: Tue Feb 24, 2015 11:03 pm Post subject: |
|
|
Apprentice
Joined: 06 Apr 2014 Posts: 36
|
fjb_saper wrote: |
Which means you haven't tried them yet in a standard ftp. Get this one to work first, then you will know what to issue as quote and site commands before you use IIB.
Have fun  |
I am able to do this in JCN.
Thanks JAVA.
 |
|
Back to top |
|
 |
Vitor |
Posted: Wed Feb 25, 2015 5:37 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
$ureshWMB wrote: |
I am able to do this in JCN.
Thanks JAVA.
 |
If you're going to do everything in Java (and you can do everything in Java), save yourself some money - a WAS license is much cheaper than an IIB one......  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
zpat |
Posted: Wed Feb 25, 2015 6:01 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
What exact version of WMB or IIB are you using?
Also there are two alternative ways to select the IFS naming format using FTP.
1. If the first command issued is CD /targetdirectory, OS/400 automatically selects NAMEFMT 1. The key is that the target directory path must start with a forward slash, and it must be the first command.
- OR -
2 Issue the subcommand, QUOTE SITE NAMEFMT 1. Once this command is completed, the target IBM iSeries family of servers should be in NAMEFMT 1 mode, and the directory structure can be navigated using the CD command as with a PC or UNIX server.
Now it may be the case that the fileoutput node will do option 1 for you anyway. Especially if you code the full directory path.
Set up a WMB/IIB configurable service definition for this FTP. This allows more control and can be changed without re-coding anyway.
DON'T USE JAVA INSIDE THE BROKER TO CONNECT TO ANYTHING.
You're unlikely to be the first person to need to do this - and I would be surprised if it couldn't be done with the filenode given a little trial and error.
The second part looks unnecessary to me. Just set ASCII transfer mode on the FTP (in the CS). _________________ Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error. |
|
Back to top |
|
 |
$ureshWMB |
Posted: Wed Feb 25, 2015 10:43 pm Post subject: |
|
|
Apprentice
Joined: 06 Apr 2014 Posts: 36
|
Vitor wrote: |
$ureshWMB wrote: |
I am able to do this in JCN.
Thanks JAVA.
 |
If you're going to do everything in Java (and you can do everything in Java), save yourself some money - a WAS license is much cheaper than an IIB one......  |
.
This FTP session uses the SITE command to pass information for the target dataset. The Message Broker FileOutput node does not have this capability, so this article will show you how to implement it.
Please go through the below article.
http://www.ibm.com/developerworks/websphere/library/techarticles/1105_subrahmanyam/1105_subrahmanyam.html |
|
Back to top |
|
 |
zpat |
Posted: Wed Feb 25, 2015 11:05 pm Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
You're not reading my post.
He wants to use NAMEFMT 1 - which is the IFS - Unix style of filepath and filename addressing in i/OS. There is no dataset (this is not z/OS).
From my reading of the documentation, all he needs to do is specify the target directory fully with a leading slash and the rest is automatic.
How long would it take to try it? About 10 mins. _________________ Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error. |
|
Back to top |
|
 |
$ureshWMB |
Posted: Thu Feb 26, 2015 9:38 pm Post subject: |
|
|
Apprentice
Joined: 06 Apr 2014 Posts: 36
|
zpat wrote: |
You're not reading my post.
He wants to use NAMEFMT 1 - which is the IFS - Unix style of filepath and filename addressing in i/OS. There is no dataset (this is not z/OS).
From my reading of the documentation, all he needs to do is specify the target directory fully with a leading slash and the rest is automatic.
How long would it take to try it? About 10 mins. |
Thank you zpat.
I have tried with all other options giving commands oin ESQL and configuring additional parameters in ftpConfigurable services nothing was helpfull.
After all these i have choosen java for this.
set OutputLocalEnvironment.Destination.File.Remote.Precommand[1].CD = '/xx/xx/xx/xx';
SET OutputLocalEnvironment.Destination.File.Remote.Precommand[2].SITE = 'namefmt 1';
When i have used above two commands in esql the file is placing in the remote ftp but the target application is not picking up the file.
SET OutputLocalEnvironment.Destination.File.Remote.Precommand[3].QUOTE = 'TYPE C 850';
When i have tried to include this in ESQL I am getting FTP Protocol Error.
Target application pick ups the file when we send below parameters.
1)User name and password(we can setup this using mqsisetdbparms)
2)transformation mode (Passive)(using configurable services)
3)data transfer mode ASCII(on fileoutput node Transfer mode property)
4)namefmt 1(using CD as a first command in ESQL)
5)TYPE C 850(SET OutputLocalEnvironment.Destination.File.Remote.Precommand[3].QUOTE = 'TYPE C 850'
When I have used both namefmt 1 and type c 850 in ESQL I am getting FTP protocol error.
Can you please help me on this.
I don't want to use java in my flow
Below are the java statements used.
FTPClient f = new FTPClient();
f.login(ftpUser, ftpPass);
f.enterLocalPassiveMode();
boolean re = f.sendSiteCommand("namefmt 1");
System.out.println(""+re);
int res = f.sendCommand("TYPE C 850");
Thank you. |
|
Back to top |
|
 |
zpat |
Posted: Fri Feb 27, 2015 12:00 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Remove both the site and quote lines. You don't need them.
As I have tried to explain - you don't need to use the NAMEFMT - it is automatic when the destination starts with a / character.
You don't need to set the code page to 850 either.
Do NOT specify QUOTE, do NOT specify SITE. Ensure the target directory path starts with a leading slash.
Use a configurable service definition for the FTP and set transfer type to ASCII, although it's probably the default anyway. _________________ Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error. |
|
Back to top |
|
 |
|