Command Line Arguments to Wrapped Custom Stage

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
banactp
Participant
Posts: 52
Joined: Tue Feb 22, 2005 2:55 pm

Command Line Arguments to Wrapped Custom Stage

Post by banactp »

I'm trying to pass some command line arguments to a UNIX command through a Wrapped stage.

I'm having difficulty passing a variable String value that normally would be enclosed in double quotes if it were typed in at the command line. Think of a string with whitespace and/or special characters.

When I enter the parameter as is on the stage properties within my job, the command fails - DataStage doesn't add double quotes for you but instead merely passes the text verbatim to the command. When I try adding double quotes myself, DataStage ignores them and passes only the text inside the quotes. Single quotes do not work, either. I've also tried escaping the quotes (\") with no success.

Has anyone encountered this issue before and if so, how can I get around it?

TIA

tpb
banactp
Participant
Posts: 52
Joined: Tue Feb 22, 2005 2:55 pm

Post by banactp »

Ascential support has provided a workaround for this issue.

The solution is to enclose command line arguments passed by the wrapper as "Value Only" in a set of double and single quotes when specifying the wrapped stage properties. For example, "'arg1'". Parameters passed by the wrapper as "-Name Value" should be enclosed in a set of single quotes.

It gets more complicated if you want to use wildcards '*' or '?' but you can pass arguments containing them if you think a little about where the quotes should go.

tpb
Post Reply