Archived Forum Post

Index of archived forum posts

Question:

GetFilename not always working (FPT2 connection to mainframe)

Feb 01 '17 at 15:11

After setting the ListPattern to the latest GDG reference, 'filename(0)', I was able to return the file name getting the FULL file name a 'filename.G0001V00'. That was yesterday.

Today is a different story. I get "Nothing" returned from the GetFilename(0) call.

I really want to know the actual generation number, but now I can't find a stable, consistent way to do this!

Has anyone experience sporadic success with GetFilename?

To clarify ----- The problem is very intermittent. For several days in a row, a mainframe GDG exists with the latest generation at "G0004V00". I have a job scheduled to run several times each day to pull the latest GDG (generation zero).

The defined number of generations for this file is 3, so these files are on the mainframe: 'my.mainframe.file.G0002V00' 'my.mainframe.file.G0003V00' 'my.mainframe.file.G0004V00'

Here's the code snippet: RemoteFileName = "'my.mainframe.file(0)'" loFTP.ListPattern = RemoteFileName ActualRemoteFileName = loFTP.GetFilename(0)

What happens in GetFilename(0)? Sometimes (often the first execution of the day but not always), the variable "ActualRemoteFileName" contains "Nothing" (it is empty!), however in most of the executions on the same day this same variable will contain "'my.mainframe.file.G0004V00'".

Purely intermittent! The code has not changed for many days.

Plus, I've not seen "only the file node" returned. It's always been empty or the actual full GDG name.


Answer

Set the ftp.KeepSessionLog property = true/1/YES and then examine the contents of the ftp.SessionLog property after the the call to GetFilename(0). The session log should contain all of the requests/responses up to that point. See what filenames are contained in the directory listing.


Answer

You are totally correct, the GetFileName is not working.

I have PEX.FR01.DB.G0001V00 PEX.FR01.DB.G0002V00 PEX.FR01.DB.G0003V00 PEX.FR01.DB.G0004V00

The GetFileName returns PEX.FR01.DB The node is not returned.


Answer

Looks like if the file node is unique and one, then it is ok. But if you have multiple GDG's, only the file node to GDG is returned once.


Answer

Chilkat,

The function does not work with Generation data sets?

Will this be fixed?