Page 1 of 1

Wild card character not working

Posted: Mon May 02, 2016 8:33 pm
by mallikharjuna
hi,

Our datastage server is on windows. we are receiving 2 files, data file SRS_YYYYMMDD.csv(YYYYMMDD is year month and date) and control file SRS_YYYYMMDD_Control.csv.

I have to read both files in same job and check count match. the problem hear is wild character(?) is not working when i tried to read the file like SRS_????????.csv then it is not working, and if i am trying to use other wildcard character(*), reading both files in single source stage, could you please help how to read these 2 files separately in same job.

Thanks

Posted: Mon May 02, 2016 9:16 pm
by ray.wurlod
That pattern does not match the Control file.

Any reason you can't use the asterisk?

I presume you have changed the Read Mode property of the Sequential File stage to "File Pattern".

Re: Wild card character not working

Posted: Mon May 02, 2016 9:39 pm
by maypandh
Hi,

Read files with file name as SRS_*.csv and read method type as file pattern.

Posted: Mon May 02, 2016 10:29 pm
by mallikharjuna
i have given pattern for both data file and control file pattern like control file SRS_????????_Control.csv .but it is not working . if i use '*" both files are reading in same source. I have give SRS_*.csv then both files are reading in same source.

Posted: Mon May 02, 2016 10:57 pm
by chulett
Can you be more specific about what "not working" means here? If you are getting an error, please post it. Both of those are perfectly valid DOS/Windows wildcard patterns that work just fine from a command line so not really sure why they wouldn't as a File Pattern.

SRS_????????.csv
SRS_????????_Control.csv

I've seen some old posts about wildcard pattern issues on a Windows server so you might want to involve your official support provider if you haven't done so yet.

Posted: Mon May 02, 2016 11:03 pm
by mallikharjuna
hi,

I am not getting any error, job just hanging and not reading the files.

Posted: Mon May 02, 2016 11:14 pm
by chulett
Involve support.

Posted: Mon May 02, 2016 11:30 pm
by ray.wurlod
Can you read the files if you are explicitly naming them (that is, not using wildcards of any kind)? We also need to understand exactly what you are trying to achieve here - I'm presuming there are two Sequential File stages (possibly in two jobs) looking for files matching the given pattern.
Does the job abort after a minute or five, or hang for longer than that?
Is the file open by any other process? Are you using a controlling sequence with a Wait For File activity?

Posted: Mon May 02, 2016 11:57 pm
by mallikharjuna
Hi,

i will receive monthly files , file names are not static. yyyymmdd change based on date of extract. and control file contains record count of source file, i am reading source file and aggregating for record count and checking with control file record count. if both counts are not matching then abort the process.we have created datastage job for this requirement.

Posted: Tue May 03, 2016 7:34 am
by qt_ky
The multiple ? wildcard in file patterns works fine for me. My server is on AIX.

Contact Support.

Posted: Tue May 03, 2016 7:47 am
by chulett
Seems to be an issue specific to Windows from what I could find.