login about faq

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.

asked Nov 17 '15 at 09:18

tschoenmaker's gravatar image


edited Dec 02 '15 at 07:43

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.


answered Nov 18 '15 at 08:50

chilkat's gravatar image

chilkat ♦♦

Thank you for the tip. It does help me to see the activity. However, it doesn't answer why GetFileName works intermitently.

(Nov 27 '15 at 14:41) tschoenmaker

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.


answered Nov 25 '15 at 11:24

cdlvj130's gravatar image


Yes, that's what I noticed, but sometimes the method DOES actualy return the expected full gdg name, at other times it does not. I'm monitoring this via a daily SSIS package to see if rhyme-or-reason can be determined..

(Nov 27 '15 at 14:44) tschoenmaker

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.


answered Dec 01 '15 at 16:42

cdlvj130's gravatar image



The function does not work with Generation data sets?

Will this be fixed?


answered Feb 01 '17 at 15:11

cdlvj130's gravatar image


Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Nov 17 '15 at 09:18

Seen: 1,381 times

Last updated: Feb 01 '17 at 15:11

powered by OSQA