1822146 Members
4214 Online
109640 Solutions
New Discussion юеВ

Connect direct

 
vaish
Frequent Advisor

Connect direct

I use a shell script for Connect direct to copy files.
abc.sh contains
ndmcli -x << EOJ
submit maxdelay=0:01:0 proc1 process snode=$node
step1 copy from (file=$srcname snode) to (file=$destname)
pend ;
EOJ

Is there any way for me to get the msgid and process it in the shell script ?

Can any please help me in this concern ?

4 REPLIES 4
vaish
Frequent Advisor

Re: Connect direct

I know if error exists or not using
ndmcli -x << EOJ
submit maxdelay=0:01:0 proc1 process snode=$node
step1 copy from (file=$srcname snode) to (file=$destname)
pend ;
EOJ

SAVE=$?
echo $SAVE
if [[ $SAVE > 0 ]]
then
echo "\n\n\nError: $SAVE"

in the script , But I need to get the message id. Please help me in this concern
Steve Lewis
Honored Contributor

Re: Connect direct

The first problem you have is that it should really be called connect indirect, because you just submit jobs and it handles the transfers in background.
That aside, the only two things that I can think of are these:
1. Look at the stdout and stderr of your job submission command. I think the msgid may be printed in there somewhere for you to grep.
2. If that doesn't work, then look at the latest CD/NDM log file for traces of your submission. You should be able to grep your pid, your task name, nodes, files etc and grep/cut out the msgid from that. Its dirty but possible.
Jose Ram├│n Rodr├нguez
Occasional Advisor

Re: Connect direct

I have a shell script like this (I have C:D 3.6.01 for HP-UX):

#-----------------------------------------#
$CDTOP/bin/direct -x -e 4 <>$MYLOGFILE 2>&1
submit maxdelay=unlimited
${PROCESS_NAME} process snode=$TARGET_NODE

paso01
copy from (file = $SOURCE_FILE $FORMAT_CD pnode)
ckpt=512K
compress extended
to (file = $TARGET_FILE disp=rpl snode)
pend;
quit;
FIN
RC=$?
if [ $RC -ne 0 ]
then
NUMPROCCD=`$GREP "Process Number =" ${MYLOGFILE} | awk -F"= " '{gsub(":","",$2);print $2}'`
$DIRECT << FIN2 >$STATFILE 2>&1
sel stat pnum=$NUMPROCCD pname=$PROCESS_NAME detail=yes ;
quit;
FIN2
$CAT $STATFILE | $AWK 'BEGIN{find=0;end=0;find2=0;} \
{ if ( $1 == "Completion" && $4 != 0 && find == 0 ) \
{ find=1;}; \
if ( find == 1 && $1 == "Message" && $2 == "Id" && end == 0 ) \
{ error=$4;end=1; }; \
if ( find == 1 && end == 1 && find2 == 0 && $1 == "Short" ) \
{ mensaje=$0; find2=1;}; \
}
END{print error, mensaje}' > $MSGERRORFILE 2>&1
fi
#-----------------------------------------#
The $MSGERRORFILE has the msgid and a short description of the error.

You can send it to IT Operation Console or another monitoring tools.
JR
vaish
Frequent Advisor

Re: Connect direct

Thanks