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

Re: ftp_get local file question



Sender: "alan shore" <SHOREA@xxxxxxxx>

Okay - let me take a shot at this.
Lets see if I understand your predicament
This file is coming from an IBM mainframe and the file is known as a G.D.G. (Generation data group - I think). The suffix (0) means the latest, while (+1) will mean the next and (-1) will mean the prior (-2) will mean the one prior to that.
If I understand your predicament, specifying the file file.name(+0) now will result in the file file.name.g0023v01, but the next time you specify the file, this COULD result in file.name.g0029v02. In other words - no set series of how the file name will result.
Could you not try something like 
DSPOBJD OBJD(library/file.name.g*) OBJTYPE(*FILE) OUTPUT(*OUTFILE) OUTFILE(QTEMP/name)
As the file.name.g????v?? will always increase in value for the latest generation, the last record in this outfile will contain the name of the latest file ftp'ed.
Hopefully, this will give you what you are looking for.
Good luck
Good hunting
Let me know how this works out

>>> "Richard B Baird" <rbaird@xxxxxxxxxxxxxxxxxxxxx> 11/05/02 08:18AM >>>
Sender: "Richard B Baird" <rbaird@xxxxxxxxxxxxxxxxxxxxx>


Scott,

I've got a situation where I'm doing a get to a banks ftp server, and I
don't know what the file name is.  here's the situation:

the directions given by the bank says to enter the command
'get file.name(+0)'
and it will give you the latest incarnation of the file you wish - for
instance, file.name.g0023v01    - they must use some sort of pre-processing
program with the get command to achieve this result.

so, i don't know what the file name will be, until after i retrieve it.
looking at ftp_get code, as i understand it, if I don't specify a local
file name, ftp_get will assume the remote file name, in this case
'file.name(+0)'
- an invalid file name.

if I do specify a local file name, I would have to rename it due to having
and needing multiple versions of the file already on my server, but at this
point, I don't know the file name I actually retrieved, but I do want to
retain the bank's file name.

you see my dilema?  If I use the ibm ftp client, everything is peachy, and
i get the file name as it was intended (because I didn't supply a local
file name)

I would like for the remote server to name the file for me.  do you have
any ideas on how to handle this situation using ftp_get? or maybe, is this
a job for ftp_getraw?

thanks,

rick

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

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