Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
danjm
Participant
Posts: 34
Joined: Tue Sep 09, 2003 8:44 am
Location: Canada
Contact:

Final Disposition

Post 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.
Dan Marshall
Alberta Education
Edmonton, AB
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply