To setup Linux Shell for Datastage command line is very important if you are a DataStage Developer and want to work hassle free on DataStage Command Line.
Follow below steps to setup your profile ---
a) First, we will create .dshome file which is containing the path of DS Engine. If you know what it is, good, create a file in root dir with DS Engine path
otherwise execute below scripts to do it by itself
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
ii- .kshrc file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simply copy this content to your .kshrc or .bashrc file | |
# .kshrc | |
# Source global definitions | |
if [ -f /etc/kshrc ]; then | |
. /etc/kshrc | |
fi | |
# User specific aliases and functions | |
export PS1='`hostname`:$PWD > ' | |
#DS ENV | |
if [ -f /is/is/Server/DSEngine/dsenv ];then | |
. /is/is/Server/DSEngine/dsenv | |
fi | |
#ORACLE_HOME= | |
#ORACLE_SID= | |
# User specific aliases and functions | |
alias dsr="ps -ef | grep 'DSD.RUN' | grep -v 'grep'" #alias for listing down all current running ds jobs | |
alias ll='ls -lrt' #alias for ls -lrt | |
alias llt='ls -lrt|tail' | |
alias rds='orchadmin rm' #alias for removing dataset use like - rds <datasetname> | |
alias dds='orchadmin dump' #alias for view/dump dataset use like - dds <datasetname> |
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 .....!!!
Like the Facebook Page & join Group
https://www.facebook.com/DataStage4you
https://www.facebook.com/groups/DataStage4you
https://twitter.com/datastage4you
https://groups.google.com/d/forum/datastage4you
For WHATSAPP group , drop a msg to 91-88-00-906098
No comments :
Post a Comment