Page 1 of 1

File Pattern When File Name Contains Quotes

Posted: Wed Apr 18, 2018 11:47 am
by gsbrown
I'm using a *.* file pattern in my input sequential stage to read in multiple files, but it errors if the file contains a quote like Mother'sDay2018.txt. The job aborts with this error...

Code: Select all

Sequential_File_11,1: Unable to open /Mother'sDay2018.txt
/Mother'sDay2018.txt: No such file or directory.
Is there a workaround to make this work?
Renaming the files is not an option :wink:

Posted: Wed Apr 18, 2018 12:32 pm
by FranklinE
Single quote is a valid character in the file name, but it has a meaning and usage in DataStage. You can't work around that, so you have to change the file name.

I suggest a script which lists the names of the files you intend to read, parses the names for characters that cause you problems, copy those files to change their names, and use the copied files.

I require external sources of my data to conform with a naming standard that avoids this problem. I don't take "no" for an answer from them. You might not have that luxury, but renaming the files is the best choice.

Posted: Wed Apr 18, 2018 2:06 pm
by qt_ky
I would recommend contacting Support to request a patch. If there's not already a patch available for that, then there should be.

Posted: Thu Apr 19, 2018 7:45 am
by UCDI
what about:

run command:
copy offendingfilename to newfilename
proceed.
end of job: run command delete newfilename

The run command thing does not really care. It will gladly attempt to invoke the OS command with whatever rubbish you send it. I think it will work. If you have write permissions.

for slightly more effort, if the files are HUGE (gigs?) you may be able to make a link/shortcut type interface with a usable name.