Skip to main content

Hello,

I am trying to use OpenSession method as described in Automating tasks with OLE Automation scripts section of the help document. I have create a simple session with this code to download a file from Mainframe with ASCII transfer type

Set myFtpApp = CreateObject("FTPSFtp.Application")
myFtpApp.DefaultSessionFolder = "C:\\FTPSession\\"
myFtpApp.TransferType = "ASCII"
Set myFtpSession = myFtpApp.NewSession
myFtpSession.Hostname = "Mainframe"
myFtpSession.UserName = "Mainframe Username"
myFtpSession.Password = "Mainframe Password"
myFtpSession.TransferType = "ASCII"

rc = myFtpSession.SaveSessionFileAs("testSession.sft")

myFtpApp.CloseAllSessions
myFtpApp.Quit

When I try to use this newly created session file, all works except the file is downloaded with binary transfer type. In the session file that gets  created by the code above I can see that the Transfer Type is set to ASCII 

Here is the code I use to get file from Mainframe using session file 

Set myFtpApp = CreateObject("FTPSFtp.Application")

myFtpApp.DefaultSessionFolder = "C:\\FTPSession\\"

Set myFtpSession = myFtpApp.OpenSession("testSession.sft")

rc = myFtpSession.ReceiveFile("'Path to file(FileName)'", "C:\\FTP\\")

myFtpApp.CloseAllSessions
myFtpApp.Quit

What am I missing here? 

 

Pawel


#question
#Rumba

Hello,

I am trying to use OpenSession method as described in Automating tasks with OLE Automation scripts section of the help document. I have create a simple session with this code to download a file from Mainframe with ASCII transfer type

Set myFtpApp = CreateObject("FTPSFtp.Application")
myFtpApp.DefaultSessionFolder = "C:\\FTPSession\\"
myFtpApp.TransferType = "ASCII"
Set myFtpSession = myFtpApp.NewSession
myFtpSession.Hostname = "Mainframe"
myFtpSession.UserName = "Mainframe Username"
myFtpSession.Password = "Mainframe Password"
myFtpSession.TransferType = "ASCII"

rc = myFtpSession.SaveSessionFileAs("testSession.sft")

myFtpApp.CloseAllSessions
myFtpApp.Quit

When I try to use this newly created session file, all works except the file is downloaded with binary transfer type. In the session file that gets  created by the code above I can see that the Transfer Type is set to ASCII 

Here is the code I use to get file from Mainframe using session file 

Set myFtpApp = CreateObject("FTPSFtp.Application")

myFtpApp.DefaultSessionFolder = "C:\\FTPSession\\"

Set myFtpSession = myFtpApp.OpenSession("testSession.sft")

rc = myFtpSession.ReceiveFile("'Path to file(FileName)'", "C:\\FTP\\")

myFtpApp.CloseAllSessions
myFtpApp.Quit

What am I missing here? 

 

Pawel


#question
#Rumba
Hi Pawel,
did you test to first download the Mainframe file with the Rumba FTP Application ? What is your result?
Did you set the correct Server type in the Advanced options for your environment ( MVS ,IBM VSE ...?)
The ftp Client support initial commands to be executed on the remote host immediately after the connection is established. For example, entering ‘SITE SBDATACONN=(IBM-273,ISO8859-1)’ causes the MVS host to correctly translate German characters in the document when downloading it as ASCII transfer type.
Can you test with an unix or Windows FTP server?