script works when called in AIX - but not from DataStage

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
madog
Charter Member
Charter Member
Posts: 16
Joined: Tue Jul 11, 2006 10:50 pm
Location: Melbourne

script works when called in AIX - but not from DataStage

Post by madog »

Hi. I got a shell script in AIX which uses mailx. Within the body of the email, i use "\r" and "\n" to create a new line.

When i call the script from AIX - the email generated is correctly formatted.
When the script is run from DataStage - all i get is a bunch of literal "\r" or "\n" strings within the body of the email, and no new lines or carriage returns.

the datastage user on the AIX machine has default ksh as its shell. I've checked this in the /etc/passwd (as suggested in another thread).

The script is also setup to uses ksh93 as the shell - if that's any help.

I'm using the execSH stage (which is supposed to default to ksh) to run the script.

please help if you can. thanks in advance.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I don't think the stage defaults to any particular shell, I assume it would be the default shell of the user the job runs under.

Would you be willing to post the script, perhaps that will allow us to see the issue.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The execute command SH calls up "/bin/sh"
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Still not sure if the "execSH stage" means the before/after job routine or the "Execute Command" stage. For whatever reason, I was assuming they meant the latter. Shouldn't really matter if the first line of the script calls out the shell needed as asserted.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I'm not sure that the OP is doing that - calling the preferred shell from whatever shell DataStage opens.
madog
Charter Member
Charter Member
Posts: 16
Joined: Tue Jul 11, 2006 10:50 pm
Location: Melbourne

Post by madog »

Thanks for all the help guys - I've figured it out.

the ksh93 was screwing things up. I've gotten it to use ksh - and all seems fine now.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I just realized that the shell used by DataStage is determined by the uvconfig file setting of SHDISPATCH. Just a fyi.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

SHDISPATCH? Really... don't recall ever seeing that one, I guess I need to check again. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply