Page 1 of 1

Problems using File Pattern option with DataStage in Windows

Posted: Tue Jul 05, 2011 9:57 am
by MarbinPR
Hello all.

I got this situation in where I want to read two files with the same structure.

Test1.txt
Test2.txt

I'm using Job Parameters to define the fullpath.

In the Sequential File Stage in the File Pattern field I define the following:
#PathToFile#\Test*.txt

When I run the Parallel Job alone I got this errors.
CSV_PCP_IPA_MemberMonths_Read: Invalid filename specified: Invalid hostname: <hidden>.


If I change the Read Method of the Sequential File Stage to Specific File then define in the File box the following:
#PathToFile#\Test1.txt

Runs perfectly.

Any suggestion?

Re: Problems using File Pattern option with DataStage in Win

Posted: Tue Jul 05, 2011 5:32 pm
by SURA
The problem is with the test file you created might be the reason is my guess . Try it again with another file having multiple columns.

Set proper delimiter
Use File pattern


DS User

Posted: Tue Jul 05, 2011 8:03 pm
by chulett
From what I think I recall, you should separate the two portions of the file when using a pattern, so for the filename just put the path parameter there and then in the file pattern just the "pattern" itself - Test*.txt.

Posted: Thu Jul 07, 2011 7:09 am
by MarbinPR
Chulett - There is no separate field for Path and other Pattern. Everything goes to the same place.

SURA - If I change the Read Method to Sequential File and define any of the files the job process it successfully. Meaning that there is no problem with the file structure.

Posted: Thu Jul 07, 2011 7:23 am
by chulett
Bummer, guess I was thinking it had a structure like the Folder stage. :(

Posted: Thu Jul 07, 2011 8:07 am
by MarkB
Just for fun, try specifying the file path instead of a parameter and see what happens.

I've tried it using #PARAMNAME#test*.txt, where the PARAMNAME parameter is set as type pathname, and as a regular path, like D:\MyPath\ - works both ways.

Is it possible you've defined your #PATHTOFILE# parameter as string instead of as pathname, and that is causing your issue? Just a thought.

Posted: Fri Jul 08, 2011 6:49 am
by MarbinPR
Yeah that was one of my previous test of specifying the whole path without using parameters. I also tried forward and back slashes (\, /) without success.

Posted: Fri Jul 08, 2011 9:25 am
by FranklinE
I don't have a sample that comes close to your situation, but I do have a question for our gurus: If the OS is Windows, does that mean that the DS runtime environment is running on a Windows server, or is it still on a Unix server?

That said, the times I've run into this sort of problem I've looked to the differences between Unix and DOS. Usually it's around the permitted characters. DOS allows spaces in directory and file names, Unix does not.

Good luck.

Posted: Fri Jul 08, 2011 10:06 am
by chulett
FranklinE wrote:I don't have a sample that comes close to your situation, but I do have a question for our gurus: If the OS is Windows, does that mean that the DS runtime environment is running on a Windows server, or is it still on a Unix server?
If you are talking about the choice of OS you have when creating a new post then yes, if you say "Windows" it's supposed to mean you have the DataStage "engine" installed on a Windows server rather than a UNIX server.

Posted: Fri Jul 08, 2011 10:14 am
by FranklinE
Thanks, Craig. That means any advice I may offer here could be inaccurate. MarbinPR, please take note. :)