[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FTP a save file from one iSeries to another



Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>


I have been trying to use FTP_GET() to pick up a save file from another
iSeries.  When the file is retrieved, it has the PF-DTA attributes instead
of the SAVF attributes.


So, I'm guessing (please confirm this or clarify) what you're doing is

          x = FTP_get(y: 'path on server'
                       : '/qsys.lib/mylib.lib/mysavf.savf')

At the time you run this, mysavf doesn't exist, and you want FTPAPI to create it as a save file. Is that correct?

Looking at the OpenFile() source (which is called by FTP_GET()) it calls
ParsePath() which returns *SAVF.  This is then passed to GetFileAtr() which
actually creates the file.  Unfortunately, the first thing GetFileAtr() does
is clobber the SAVF attribute with "eval      peAttrib = *blanks".

Yeah, that's obviously not what was intended. I think, originally, GetFileAtr() was only being called for files that already existed. Files that didn't exist didn't have an attribute, so used the defaults of PF or SAVF.


Somewhere along the way, it was changed to always call GetFileAtr() and have it create the files that didn't exist, which broke this behavior (but probably fixed something else)

OpnFile() started as a very simple subprocedure, and it's turned into an absolute mess! :) That whole thing needs to be broken into smaller pieces and made easier to cope with.


Do I need to modify the GetFileAtr() procedure or is there another way of retrieving save files from another iSeries?

I should really fix OpnFile(), but if you want a quick workaround, just create the SAVF ahead of time. Then the file will exist, and GetFileAtr() will return an attribute of SAVF (since it will actually be one!)


-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------