File Pattern When File Name Contains Quotes

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
gsbrown
Premium Member
Premium Member
Posts: 148
Joined: Mon Sep 23, 2002 1:00 pm
Location: USA

File Pattern When File Name Contains Quotes

Post 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:
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post 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.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post 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.
Choose a job you love, and you will never have to work a day in your life. - Confucius
UCDI
Premium Member
Premium Member
Posts: 383
Joined: Mon Mar 21, 2016 2:00 pm

Post 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.
Post Reply