Linux Shell Session Setup For DataStage Command Line
Linux Shell Session Setup For DataStage Command Line
#!/bin/sh
#DataStage4You
echo "creating DSHOME file...."
if [ `ps -ef | grep -c dsrpcd` -eq 2 ] ; then
ps -ef | grep dsrpcd | grep -v grep | awk '{print $NF}' | sed -n
's/bin\/dsrpcd//p' > /.dshome
echo '.dshome file has been created under / (root dir)'
else
echo 'Please check whether datastage server is up or not, If not, please
start'
fi
b) Now create .profile and .kshrc or .bashrc (update as your shell support) in your HOME dir
by copying below content to respective file
i- .profile file
# Simply copy the below content in your $HOME/.profile
export VISUAL=vi
export EDITOR=/usr/bin/vi
ENV=$HOME/.kshrc
export ENV
umask 000
stty erase ^?
export HOST=`hostname`
export PS1='$HOST:$PWD> '
export PS2="$HOST:`pwd`>> "
export PS3="$HOST:`pwd`== "
unalias ls
set -o vi
echo setting up DataStage environment
export DSHOME=`\cat /.dshome`
# execute dsenv
if [[ -x $DSHOME/dsenv ]]; then
. $DSHOME/dsenv
else
echo "The DataStage dsenv file ($DSHOME/dsenv) not found or is not
executable!"
fi
If you have done with all above steps correctly, please logout from current session and login
again to get run above settings for your user profile. Now, you can use DataStage command line
in your Linux Shell session.
Happy Coding .....!!!