aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes Problem with FTPing file to Mainframe dataset using apache commons net Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Problem with FTPing file to Mainframe dataset using apache commons net" Watch "Problem with FTPing file to Mainframe dataset using apache commons net" New topic
Author

Problem with FTPing file to Mainframe dataset using apache commons net

Damodara Reddy Gosula
Greenhorn

Joined: Dec 25, 2011
Posts: 5
Hi,

I'm ftping a file to Mainframe dataset. But the problem is, only first 256 characters of the file are being received on mainframe dataset and rest of it is truncated. I was advised to execute/run the ftp command "locsite lrecl=320 recfm=fb blocksize=6080" so that the record length would be set to 320 characters and file will not be truncated. I tried running this command using both sendSiteCommand(String) and sendCommand(String) of apache commons FTPClient class.Though return status of sendCommand is '500' and sendSiteCommand is 'true', the data being stored is only 256 characters on the mainframe dataset. I have tried by sendCommand("rec=-320,,f,ascii"), but not of any use.

Can someone please help me by advising how to overcome this scenario?

Many Thanks in advance.

Regards,
Damodara Reddy
Muralidhar Madugundu
Greenhorn

Joined: Jan 30, 2012
Posts: 2
Hi Damodar,

I am also experiencing the same problem. Is this problem still there for you or have you resolved it? If resolved, can you please post back the solution.

Thanks in Advance.

Muralidhar Madugundu
Greenhorn

Joined: Jan 30, 2012
Posts: 2
Used below lines of code, now working fine.

fin = new FileInputStream(file);
client.sendCommand("site lrecl=345 recfm=FB ");
client.allocate((int)file.length(), 345);
client.storeFile("'" + mainFrameFileName + "'", fin);

Hope this might help you.

Thanks,
Murali
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with FTPing file to Mainframe dataset using apache commons net
 
Similar Threads
problem with outputText in datatable
what is the limitation of getString(column name)?
commons net 1.4.1 - sendSiteCommand
Size for Prepared Statement setString()
need to send ftp explicit command using Apache Commons Net classes