Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OLE Automation of Attachmate in Visual Foxpro 9 2

Status
Not open for further replies.

ppoole

Programmer
Sep 9, 2011
9
US
I am trying to use Attachmate from VFP9 but am having trouble with the syntax. The old MS FTP command I used was "get 'sys4.planning.S9vx.xrefchld(0)' c:\temp\Xrefchild.txt" to download the latest generation of the file, but the following code cannot find the file

#DEFINE rcASCII 0
#DEFINE rcSkip 8
LOCAL oFTP as Reflection.FTPoFtp = CreateObject("Reflection.FTP")

oFtp.Open("PLP403.sys.eds.com")

oFtp.SetCurrentDirectory("sys4.planning.S9vx.xrefchld")

oFtp.ReceiveFile("c:\temp\Xrefchild.txt", "sys4.planning.S9vx.xrefchld(0)", rcASCII, rcSkip)

oFtp.Close
oFtp = null

Any help would be greatly appreciated.ThanksPaul
 
What does the Attachmate documentation say? We do Foxpro here, and other products only by coincidence. :)

Note: Attachmate has multiple file transfer products. It *MIGHT* (emphasis on might) help you if you say which one you're using.
 
I have never used Attachmate so I'd recommend using an alternative such as is referenced in this forum's FAQ's
[/B]How do I transfer files using FTP?
faq184-3234[/B]

Good Luck,
JRB-Bldr
 
Sorry about that.

Attachmate Extra! X-treme 9.1 is our current version. There documentation has C# and VBA examples but for transferring files from file to file but no examples from TSO Mainframe.

Just wondering if anyone has used it before.

Thanks
Paul
 
Thanks jrbbldr,

Attachmate is the only approved application now for secure FTP at our company. I have been getting in trouble with the computer police using MS FTP so far.

Paul
 
I understand, but if Attachmate isn't working for you, then I'd seriously lobby to get some alternatives approved which you CAN get to work in a timely manner.

Another 3rd party tool that I have used is Chilkat's FTP ActiveX.
Its FREE - Or for SFTP (unfortunately not Free)

One nice thing that I have found using Chilkat ActiveX utilities is that they have VFP examples
and their support has been pretty good when I needed it.

Good Luck,
JRB-Bldr
 
Source/target shouldn't make any difference. If you have VBA examples, they should translate fairly easily.

(See the weasel words "should" and "fairly"?)

Why not post that example and we'll have a go at it?
 
One other thought. If you have a VBA example, does it work in a Word or Excel macro?

If it does, then you're 90% there. If it doesn't, it's time to involve Attachmate support.
 
Thanks everyone. I played with attachmate scripting and figured out some parenthesis issues.
 
This is actually quite easy with Attachmate's Reflection product which the poster is using. I'm using it very successfully with TSO. Two comments:

1. I SetCurrentDirectory only for retrieval of members from PDSes. It should not be needed for a fully-qualified filename such as the one shown by the poster.
2. The mainframe file name must be enclosed in single quotes within the quoted string, e.g. "'filename'".

Regards,

Glenn
 
Thanks Glenn,

I was able to get that example working. The problem I have now is uploading a new generation. I have no problem with:

oFtp.SendFile("c:\temp\upload.txt", "'pi262.ms9ma.mv70v220.part'",0,2)

to append to a file without a generation. But when I try:

oFtp.SendFile("c:\temp\UPLOAD.TXT", "PI262.MS9GM.PCI.SCRPMISC(+1)",0)

it appears to create the generation ( cannot see it since it kicks off a job on receipt of the file ) because the job is kicked off but it abends for an empty dataset.

Any ideas?

Thanks
Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top