Passing ampersand (&) in a property value

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
dtsexplorer
Participant
Posts: 3
Joined: Mon Nov 22, 2004 10:19 am

Passing ampersand (&) in a property value

Post by dtsexplorer »

I am using a wrapped stage, which I have created for invoking wget command on Unix. I want to download a comma separated file from an http link. This http link contains a special character "&". I am using an escape character to run it properly on unix.

When I check the OSH for the job it displays two escape characters "\\"
OSH entry :
wget -o 'logfilepath/logfilename' 'http://server:port/dir/.../file.xml\\report=REPORTNAME'

On execution, the job fails with fatal error. It invokes the command and the log generated (logfilename) says it was trying to connect to ''http://server:port/dir/.../file.xml". Which is not correct as "&report=REPORTNAME" part of link is missing.
I have tried putting the link in single quotes, double quotes but it does not work.

Can someone provide some help.

Thanks.
T42
Participant
Posts: 499
Joined: Thu Nov 11, 2004 6:45 pm

Post by T42 »

I don't understand the problem.

I built a wrapped stage and I see this:

#!/bin/sh
# Generated on 11/29/2004 at 11:39:55 PM

...

command = \"wget -o 'logfilepath/logfilename' 'http://server:port/dir/.../file.xml&report=REPORTNAME'\",
status = {default_good}

...

I'm doing this on 7.0.1, and do not see why this can not work for you.
dtsexplorer
Participant
Posts: 3
Joined: Mon Nov 22, 2004 10:19 am

Post by dtsexplorer »

Are you passing the httplink argument through a property or are you specifying it in command itself?

When I specify it in the command box it works. But if I pass it as a property it only passes the part of the httplink which is till the "&" character and leaves out the rest of the string.
Post Reply