Issue on running sqlldr while using rsh

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
agathaeleanor
Participant
Posts: 76
Joined: Mon Mar 05, 2007 9:26 pm
Location: Malaysia

Issue on running sqlldr while using rsh

Post by agathaeleanor »

Hi There,

Appreciate if anyone can help.
I am running a dsjob using remote shell. Where the source file is placed in different host and the dsjob will do rsh to do sqlldr. However, I encountered the below error that

Func_Sqlldr[27]: sqlldr: not found

and the log file wasn't there also.

Here i posted my sqlload function for reference:

Func_Sqlldr() {

CONNECTION_STRING="${USER_ID}/${PASSWORD}@${DATA_SOURCE_NAME}"
DATA_PATH=${1}
CTL_FILE=${2}

cd ${DATA_PATH}

for PROCESS_FILE in `ls -1 *`
do
DATA_FILE="${DATA_PATH}${PROCESS_FILE}"
SQLLDR_LOG_FILE="${LOG_PATH}/${PROCESS_FILE}_trn.log"
SQLLDR_BAD_FILE="${LOG_PATH}/${PROCESS_FILE}.bad"
SQLLDR_ERROR_FILE="${LOG_PATH}/${PROCESS_FILE}_trn.error"


Func_Log_Writer "----------------------------------------------------------"
Func_Log_Writer "Start sqlldr ${PROCESS_FILE}"
Func_Log_Writer "Connection string=${CONNECTION_STRING}"
Func_Log_Writer "Data file=${DATA_FILE}"
Func_Log_Writer "Control file=${CTL_FILE}"
Func_Log_Writer "Log file=${SQLLDR_LOG_FILE}"
Func_Log_Writer "Bad file=${SQLLDR_BAD_FILE}"

sqlldr\
userid=${CONNECTION_STRING}\
control="${CTL_FILE}"\
data="${DATA_FILE}"\
log="${SQLLDR_LOG_FILE}"\
bad="${SQLLDR_BAD_FILE}"\
errors=${REC_ERROR_ALLOW}\
rows=${ROWS}\
bindsize=${BINDSIZE}\
direct="${DIRECT}"\
silent="${SILENT}" 2> "${SQLLDR_ERROR_FILE}"

SQLLDR_RETURN_CODE=$?
Func_Log_Writer "Sqlldr return code ${SQLLDR_RETURN_CODE}"


#*** Removing Source file ***
if [[ ${RETURN_CODE} != "1" ]]; then

Func_Remove_File "${DATA_FILE}"

fi

done

cd ${CONTROLLER_PATH}
}


Thanks.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Welcome. :D

sqlldr isn't in your path on the remote system, hence it cannot be found. And there's no log file because you never launched sqlldr... unless you mean whatever Func_Log_Writer is supposed to do. If so, don't see how anyone can comment on that with no source.

So it seems you'll need to ensure your environment is correct over there, either in the remote user's .profile or better yet explicitly in your script. At the very least that would mean establishing the full pathname to sqlldr over there.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You might also like to check (or ensure) that your script has all relevant environment variables, such as ORACLE_HOME, set.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
agathaeleanor
Participant
Posts: 76
Joined: Mon Mar 05, 2007 9:26 pm
Location: Malaysia

Post by agathaeleanor »

Thanks very much.
It works now with the ORACLE_HOME path defined.
agathaeleanor
Participant
Posts: 76
Joined: Mon Mar 05, 2007 9:26 pm
Location: Malaysia

Post by agathaeleanor »

Thanks very much.
It works now with the ORACLE_HOME path defined.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Time to mark the thread as Resolved, then.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply