|
Gary, I didn't mainly because the agency that I am sending the file to changed the JCL to include the user name. I would like to try it though in case the need arises in the future. Chad Cornelius, IIS (720) 921-7835 -----Original Message----- From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Gary L Peskin Sent: Thursday, December 15, 2005 10:03 AM To: 'Java Programming on and around the iSeries / AS400' Subject: RE: Java FTP Chad -- Did you ever get a chance to give this a try? Gary > -----Original Message----- > From: java400-l-bounces@xxxxxxxxxxxx > [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of cornelius, chad > Sent: Monday, December 12, 2005 10:36 AM > To: Java Programming on and around the iSeries / AS400 > Subject: RE: Java FTP > > Thanks Gary... I'll give it a whirl. > Chad Cornelius, IIS > (720) 921-7835 > > > -----Original Message----- > From: java400-l-bounces@xxxxxxxxxxxx > [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Gary L Peskin > Sent: Monday, December 12, 2005 11:03 AM > To: 'Java Programming on and around the iSeries / AS400' > Subject: RE: Java FTP > > Try using this for your ftp.put call: > > ftp.put(fileStream, "'BC.CPC.PAY'", true); > > Note how the second argument (ie the remote file name) > encloses the file name in apostrophes. Do NOT change the > > String file = "BC.CPC.PAY"; > > up at the top. This is the local file name and apostrophes > will not work on Windows (or the 400). > > Gary > > > -----Original Message----- > > From: java400-l-bounces@xxxxxxxxxxxx > > [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of cornelius, chad > > Sent: Monday, December 12, 2005 9:48 AM > > To: Java Programming on and around the iSeries / AS400 > > Subject: RE: Java FTP > > > > Gary, > > > > Below is how I am sending the file. Unfortunately I do not have > > access to the logs. I have not enclosed the file name in > apostrophes > > here because it will not work. When I try to FTP this > file, it will > > concatenate the user name to dataset. > > So instead of just "BC.CPC.PAY", it will go as "username.BC.CPC.PAY" > > > > try { > > String fileDir = "C:\\eclipse\\workspace\\cac\\COFERS\\"; > > String file = "BC.CPC.PAY"; > > FileInputStream fileStream = new > > FileInputStream(fileDir + file); > > > > > > > > // Connect > > // long startTime = System.currentTimeMillis(); > > FTPProgressMonitor progressMonitor = null; > > > > FTPClient ftp = new FTPClient(); > > ftp.setRemoteHost("hostname"); > > > > FTPMessageCollector listener = new FTPMessageCollector(); > > ftp.setMessageListener(listener); > > FTPReply reply = null; > > > > // Connect > > ftp.connect(); > > > > // Login > > ftp.login("username", "password"); > > ftp.setConnectMode(FTPConnectMode.PASV); > > > > // monitor transfer progress > > ftp.setProgressMonitor(progressMonitor); > > ftp.setType(FTPTransferType.ASCII); > > > > String message = listener.getLog(); > > log.debug("message = " + message); > > System.out.println("message = " + message); > > > > try { > > ftp.put(fileStream, "BC.CPC.PAY", true); > > > > reply = ftp.getLastValidReply(); > > ftp.quit(); > > } catch (InterruptedIOException iioe) { > > ftp.quit(); > > throw iioe; > > } > > } catch (Exception e) { > > e.printStackTrace(); > > } > > > > Chad Cornelius, IIS > > (720) 921-7835 > > > > > > -----Original Message----- > > From: java400-l-bounces@xxxxxxxxxxxx > > [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Gary L Peskin > > Sent: Monday, December 12, 2005 9:50 AM > > To: 'Java Programming on and around the iSeries / AS400' > > Subject: RE: Java FTP > > > > Can you include the relevant parts of your code and an > explanation of > > what happens when you try to execute it and why it doesn't > work? Are > > you seeing anything in the mainframe FTP logs? Have you > tried looking > > at a comm trace? > > > > Gary > > > > > -----Original Message----- > > > From: java400-l-bounces@xxxxxxxxxxxx > > > [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of > cornelius, chad > > > Sent: Monday, December 12, 2005 8:26 AM > > > To: Java Programming on and around the iSeries / AS400 > > > Subject: Java FTP > > > > > > A while back I inquired if anyone has FTP'd a dataset to a > > Mainframe > > > using Java. There were suggestions to enclose the file within > > > apostrophes (single ticks). I have yet to get this to > work. I am > > > using the EdtFTP API. Has anyone successfully accomplished > > this? If > > > so, would you mind sharing an example? Keep in mind I > know nothing > > > about Mainframes. > > > > > > > > > > > > Thanks, > > > > > > Chad Cornelius, IIS > > > > > > (720) 921-7835
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.