Job Log file extraction from UNIX / Admin
Moderators: chulett, rschirm, roy
Job Log file extraction from UNIX / Admin
Hi
Hi
I would like to extract log information for particular job. I am executing following command from Data stage Administration Command Line (Interface)
SELECT @ID,TYPE,WAVE.NO,TIMESTAMP,MSG.ARGS,MSG.TEXT,FULL.TEXT,SEVERITY FROM RT_LOG974
But I am not able to save this information. I tried via XMETA table also.
If any only help me how to get log information via file.
Thanks
Man
Hi
I would like to extract log information for particular job. I am executing following command from Data stage Administration Command Line (Interface)
SELECT @ID,TYPE,WAVE.NO,TIMESTAMP,MSG.ARGS,MSG.TEXT,FULL.TEXT,SEVERITY FROM RT_LOG974
But I am not able to save this information. I tried via XMETA table also.
If any only help me how to get log information via file.
Thanks
Man
Ok- you are making me dredge up ancient history from the old memory banks... but if I remember correctly, the easiest way to capture screen output from the command line shell is with the COMO (command output) command.
Syntax is
From the UNIX level, the output files are stored in a sub-directory called &COMO&. This will be either in your project directory or in the main $DSHOME directory depending on where the command is being executed. Since you are on UNIX, the "&" special character must be prefixed with a back-slash in pathnames: ie: cd \&COMO\&
Hope that helps!
Historical Note: the strangely named COMO command was taken from the 1970's PRIMOS operating system that hosted the Prime Information database - a precursor of the UniVerse database that became the DataStage shell. http://en.wikipedia.org/wiki/PRIMOS
Syntax is
- - Capture all output into a file: COMO ON filename
- Turn off Capture: COMO OFF
- List all output files: COMO LIST
- Delete existing output file: COMO DELETE filename
From the UNIX level, the output files are stored in a sub-directory called &COMO&. This will be either in your project directory or in the main $DSHOME directory depending on where the command is being executed. Since you are on UNIX, the "&" special character must be prefixed with a back-slash in pathnames: ie: cd \&COMO\&
Hope that helps!
Historical Note: the strangely named COMO command was taken from the 1970's PRIMOS operating system that hosted the Prime Information database - a precursor of the UniVerse database that became the DataStage shell. http://en.wikipedia.org/wiki/PRIMOS
Works fine from there. There are also posts here showing how to launch a dssh session from the command line, run a sql and redirect the output to a file that a search should turn up.asorrell wrote:I'm not certain if you can get it to work from the admin console, but you can try it.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Where are you trying to do this - interactively or in a server routine? There are some neat tricks in the latter case.
From the operating system command line you can use redirection operator.
From TCL you can use COMO or DIVERT.OUT commands to capture output.
From the operating system command line you can use redirection operator.
From TCL you can use COMO or DIVERT.OUT commands to capture output.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Re: Job Log file extraction from UNIX / Admin
#! /bin/Ksh
export DSHOME=`cat /.dshome`
export PATH=$PATH:$DSHOME/bin
proj_name=$1
job_name=$2
hash_num=null
#job_name=`echo $2 | tr "[:lower:]" "[:upper:]"`
echo Project_name: "$proj_name"
echo Job name: $job_name
if [ -f $DSHOME/dsenv ]
then
. $DSHOME/dsenv
else
echo "dsenv File doesn't exist"
fi
#cd `cat /.dshome`
cd "$DSHOME"
dssh "SELECT PATH FROM UV_SCHEMA WHERE SCHEMA_NAME='"$proj_name"'">/home/dsadm/hailun/temp_test
path=`sed -n '4p' /home/dsadm/hailun/temp_test|cut -f 2 -d " "`
echo Project_Path: $path
get_hash (){
a=$1
b=$2
c=$3
cd $a
dssh<<eof
LOGTO $b
SELECT JOBNO FROM DS_JOBS WHERE NAME = '$c';
quit
eof
}
write_job_log (){
a=$1
b=$2
c=$3
cd $a
dssh<<eof
LOGTO $b
SELECT * FROM RT_LOG$c ORDER BY TIMESTAMP,@ID;
quit
eof
}
get_hash $DSHOME $proj_name $job_name >/home/dsadm/hailun/a
#echo $hash_num
hash_num=`sed -n '9p' /home/dsadm/hailun/a`
echo hash_num: $hash_num
write_job_log $DSHOME $proj_name $hash_num >/home/dsadm/hailun/b
cat /home/dsadm/hailun/b | sed /^$/d|sed /'=SQL+'/d |sed /'JSeverity Full Text.......'/d|sed '1,7d' >/home/dsadm/hailun/`date "+%Y%m%d%H%#M"`_"$proj_name"_"$job_name".log
cd
cd hailun
rm -f temp_test
rm -f a
rm -f b
Run the shell sctript by following format:
shell $project_name $job_name
And you will get what you need,
FYI
Thanks
Man
export DSHOME=`cat /.dshome`
export PATH=$PATH:$DSHOME/bin
proj_name=$1
job_name=$2
hash_num=null
#job_name=`echo $2 | tr "[:lower:]" "[:upper:]"`
echo Project_name: "$proj_name"
echo Job name: $job_name
if [ -f $DSHOME/dsenv ]
then
. $DSHOME/dsenv
else
echo "dsenv File doesn't exist"
fi
#cd `cat /.dshome`
cd "$DSHOME"
dssh "SELECT PATH FROM UV_SCHEMA WHERE SCHEMA_NAME='"$proj_name"'">/home/dsadm/hailun/temp_test
path=`sed -n '4p' /home/dsadm/hailun/temp_test|cut -f 2 -d " "`
echo Project_Path: $path
get_hash (){
a=$1
b=$2
c=$3
cd $a
dssh<<eof
LOGTO $b
SELECT JOBNO FROM DS_JOBS WHERE NAME = '$c';
quit
eof
}
write_job_log (){
a=$1
b=$2
c=$3
cd $a
dssh<<eof
LOGTO $b
SELECT * FROM RT_LOG$c ORDER BY TIMESTAMP,@ID;
quit
eof
}
get_hash $DSHOME $proj_name $job_name >/home/dsadm/hailun/a
#echo $hash_num
hash_num=`sed -n '9p' /home/dsadm/hailun/a`
echo hash_num: $hash_num
write_job_log $DSHOME $proj_name $hash_num >/home/dsadm/hailun/b
cat /home/dsadm/hailun/b | sed /^$/d|sed /'=SQL+'/d |sed /'JSeverity Full Text.......'/d|sed '1,7d' >/home/dsadm/hailun/`date "+%Y%m%d%H%#M"`_"$proj_name"_"$job_name".log
cd
cd hailun
rm -f temp_test
rm -f a
rm -f b
Run the shell sctript by following format:
shell $project_name $job_name
And you will get what you need,
FYI
Thanks
Man
Last edited by hailun on Thu Oct 15, 2009 8:16 pm, edited 3 times in total.
Let's Progress Together....
How about using the dsjob command? From Unix:
We have a wrapper that we use to kick off all DS job and it ends by pulling the logs with the above command, reformatting a bit and outputing to a log file.
Brad.
Code: Select all
dsjob <your connection parms> -logdetail <proj> <job> -wave 0
Brad.
It is not that I am addicted to coffee, it's just that I need it to survive.