Computing.Net > Forums > Unix > To check a column of table

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

To check a column of table

Reply to Message Icon

Name: Nanda.R
Date: September 17, 2003 at 00:04:46 Pacific
OS: Win 2k
CPU/Ram: P IV & 64kb
Comment:

Hi,
Below script has some errors can any one help

#!/bin/ksh
#cdstat1.sh
for file in send*.log
do
if [ -f ${file} ]
then
echo "`grep /ripsapps/ripsu/data/out "${file}"`" | cut -d "/" -f7 >> temp
grep "Process Number" "${file}"| cut -d "=" -f2 >> temp
pnum=`grep "Process Number" "${file}"| cut -d "=" -f2`
echo "$pnum"
set -v
ndmcli << EOJ > table
select statistics pnumber=$pnum;
EOJ
for CCOD in `cat table | awk '{print $7}'`
do
if [ $CCOD="0" ]||[ $CCOD="2" ]||[ $CCOD="4A" ]
then
echo "Success" >>temp
if [ $CCOD="8" ]
then
echo "Failure" >>temp
fi
fi
done
else
exit
fi
done
----------------
This one of log Files in which I have to grep filename “nonramp.d20030716”&Process Number “16235” inside a file-

."send_rpsrv_attlabs.log" 26 lines, 893 characters

******************************************************
* *
* CONNECT:Direct for UNIX *
* *

* Copyright (c) 1983, 1997 Sterling Commerce, Inc. *
* Version 3.1.00 GA *
******************************************************

Direct> Enter a ';' at the end of a command to submit it. Type 'quit;' to exit CLI.

submit RPATTRV process snode=RELAYAL
step2 copy from (file=/ripsapps/ripsu/data/out/rpsrv/nonramp.d20030716
pnode)
ckpt=no
to (file=nonramp.d20030716
snode)
if (step2 = 0) then
run job snode sysopts="bin/relay ninguai nonramp.d20030716"
eif
pend;

Process Submitted, Process Number = 16235
Direct>
CONNECT:Direct CLI Terminated...
--------------------
Below should be the output of the script “
set -v
ndmcli << EOJ > table
select statistics pnumber=$pnum;
EOJ”
Then ,this output has to be copied to another file to extract a column “CCOD”
To check the status of the file.

Direct> select statistics pnumber=16235;
===============================================================================
SELECT STATISTICS
===============================================================================
P RECID LOG TIME PNAME PNUMBER STEPNAME CCOD FDBK MSGID
E RECID LOG TIME MESSAGE TEXT
---------------------
E RNCF 07/18/2003 11:06:10 Attempt to connect to remote node RELAYAL failed.
E RNCF 07/18/2003 11:43:15 Attempt to connect to remote node RELAYAL failed.
E SSTR 07/18/2003 11:43:45 Session started, SNODE:relayal
P PSTR 07/18/2003 11:43:45 RPATTRV 16235 0 XSMG200I
P XSMG 07/18/2003 11:43:45 RPATTRV 16235 8 XSMG242I
E PSAV 07/18/2003 11:43:45 Process returned to tcq.
E SEND 07/18/2003 11:43:45 Session ended, Session Manager shutting down SNODE:
relayal
===============================================================================
Select Statistics Completed Successfully.

Check my script tell me any error & adjustments to be made
David Perry asked me to send my data file
Thank u
Anu



Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: September 17, 2003 at 04:47:09 Pacific
Reply:

How's this?

#!/bin/sh
function NDMCLI {
# $pnum = $1
ndmcli << EOJ > table
select statistics pnumber=$1;
EOJ¦
}

for file in `grep -l /ripsapps/ripsu/data/out *` ; do
pnum=`awk -F"=" '/Process Number/ { print $2 }' $file`
NDMCLI $pnum
case `awk '/P XSMG/ { print $7 }' table` in
0 | 2 | 4A )
echo "Success for Process Number $pnum" >> temp
;;
8 )
echo "Failure for Process Number $pnum" >> temp
;;
esac
done


0

Response Number 2
Name: Nanda.R
Date: September 24, 2003 at 22:40:38 Pacific
Reply:

hi,
David your function can't be called .Moreover u have changed my script
below script shouldn't be cahanged.
"set -v
ndmcli << EOJ > table
select statistics pnumber=$pnum summary=no;
EOJ"
try to give some idea.

thank u
thank u

nanda


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


logging to UNIX by UDP po... To run the bat file



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: To check a column of table

script to check a dynamic ip www.computing.net/answers/unix/script-to-check-a-dynamic-ip/6456.html

how to check amount of video memory www.computing.net/answers/unix/how-to-check-amount-of-video-memory/7432.html

To save repeated data of a column only once www.computing.net/answers/unix/to-save-repeated-data-of-a-column-only-once/8406.html