Hello,
We are trying to create a file from a routine and need to write double quotes to it. Does anyone know how to specify quote characters within the DataStage Basic language?
Thanks in advance,
Heather
writing quote (") to a file in a routine
Moderators: chulett, rschirm, roy
writing quote (") to a file in a routine
what a man is contributes much more to his happiness than what he has, or how he is regarded by others.
Heather, in DataStage Basic you can use ", ', or / as a quote character interchangeably. So you can assign a double-quote via '"' or /"/ .
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Thanks for the quick response...however....
I have the following piece of code, using DOS to pipe a line to a file:
CALL DSExecute('DOS','echo SignonMake ' : '"' : ModelSignon : '"' : ' PromptForPassword False UserId ' : '"' : DBSignonUId : '"' : ' Password ' : '"' : DBSignonPwd : '"': ' >':SignonMDLFile,sResult,sReturnCode)
I get quotes around the first parameter, but none after that. If anyone has any ideas, they would be greatly appreciated.
cheers,
Heather
I have the following piece of code, using DOS to pipe a line to a file:
CALL DSExecute('DOS','echo SignonMake ' : '"' : ModelSignon : '"' : ' PromptForPassword False UserId ' : '"' : DBSignonUId : '"' : ' Password ' : '"' : DBSignonPwd : '"': ' >':SignonMDLFile,sResult,sReturnCode)
I get quotes around the first parameter, but none after that. If anyone has any ideas, they would be greatly appreciated.
cheers,
Heather
what a man is contributes much more to his happiness than what he has, or how he is regarded by others.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Try using a function such as Quote or DQuote.
Beware (search the forum) that passing quoted strings to another shell can cause one level of quotes to be stripped off. If you don't need to capture the result, you may be better off using the PERFORM statement with the DOS verb.
Code: Select all
CALL DSExecute('DOS', 'echo SignonMake ' : Quote(ModelSignon) : ' PromptForPassword False UserId ' : Quote(DBSignonUId) : ' Password ' : Quote(DBSignonPwd) : ' >' : SignonMDLFile, sResult, sReturnCode)
Code: Select all
Command = 'echo SignonMake ' : Quote(ModelSignon) : ' PromptForPassword False UserId ' : Quote(DBSignonUId) : ' Password ' : Quote(DBSignonPwd) : ' >' : SignonMDLFile
PERFORM "DOS /C " : Command
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 23
- Joined: Mon Jul 04, 2005 6:25 am
Hi
I tried all three of the above suggestions and am still not getting the quotes after the first parameter. Actually, the PERFORM command doesn't do anything.
And we've just discovered that if the parameter value has a space in it, the quotes work, otherwise they're ignored.
So I guess my question is, is there any way to force quotes to a file. I run the same command on the dos prompt, and everything is fine.
Again, thanks for your help.
Heather
I tried all three of the above suggestions and am still not getting the quotes after the first parameter. Actually, the PERFORM command doesn't do anything.
And we've just discovered that if the parameter value has a space in it, the quotes work, otherwise they're ignored.
So I guess my question is, is there any way to force quotes to a file. I run the same command on the dos prompt, and everything is fine.
Again, thanks for your help.
Heather
what a man is contributes much more to his happiness than what he has, or how he is regarded by others.
Hi everyone, me again.
I ended up using the OpenSeq command and writing to the file that way. Since this is supposed to be dynamic, I'll simply use the DOS command to pipe to and create an empty file.
Thanks again for your input.
cheers,
Heather
I ended up using the OpenSeq command and writing to the file that way. Since this is supposed to be dynamic, I'll simply use the DOS command to pipe to and create an empty file.
Thanks again for your input.
cheers,
Heather
what a man is contributes much more to his happiness than what he has, or how he is regarded by others.