Page 1 of 1

Posted: Fri Sep 23, 2005 5:14 pm
by ray.wurlod
You can read about this subroutine in the DataStage BASIC manual or by typing HELP BASIC !GET.PATHNAME at a TCL prompt.

The fourth argument (Code in your example) reports whether the subroutine has been called successfully; that is (for example) whether the directory part is a valid pathname. Check, too, that you have the arguments in the right order - I don't have access to DataStage at the moment (in airport lounge).

Final Disposition

Posted: Fri Oct 07, 2005 10:56 am
by danjm
I finally found time to complete this 'task'. I wanted to thank Ray again for providing me with a running start. I had to do a bit of sleuthing and testing to troubleshoot a problem I was having with !Get.Pathname but I learned a great deal doing that so it was well worth the effort.
It 'appears' that the routine does not handle MSWindows UNC naming convention ("\\path\) well, returning a blank path and the entire string minus the first '\' as the filename.
I modified the routine to check for the '\\' and, if found, remove the first one BEFORE calling GetPathname. The rest seems to work well and DSExecute substitutes the forward slashes (in the path returned from GetPathname) correctly when the shell parameter identifies "NT".
I also injected some debug code to assist with troubleshooting and analysis now and if anyone has difficulty in future.

Thanks so much again for the assist on this. I can't make a strong enough point about how great the DSX exchange forum is because of contributions that Ray and his fellow experts make so charitably.
Hope everyone has a great day. It's Thanksgiving here in Canada on Monday, so I'm going to be enjoying a nice long weekend after work today.

Posted: Fri Oct 07, 2005 4:48 pm
by ray.wurlod
!GET.PATHNAME and !MAKE.PATHNAME were written in the mid-1980s, before UNC pathnames had ever been heard of! I'm not surprised that they are not properly handled; it was a major surprise at VMARK when drive letters had to be accommodated! Indeed, you will see heavy reliance on the fact that Windows NT (and its children) is tolerant of "/" rather than "\" in pathnames other than of executables.

$INCLUDE UNIVERSE.INCLUDE FILENAMES.H gives you access to lots of system file pathnames already resolved for platforms, as well as to a variable called UV.FSEP containing the correct pathname separator character for the platform on which you're running.