top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What are pre and post terms used in the session for the shell command?

0 votes
375 views
What are pre and post terms used in the session for the shell command?
posted Mar 19, 2015 by Amit Sharma

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

For a session task, command task is referred as either pre or post session in the shells for command. It can be run as pre, post success or post failure session command.

answer Mar 23, 2015 by Shweta Singh
Similar Questions
0 votes

am writing a post session shell script where i have to count the target which is a flat file row count and if the count is greater then 500 then send a mail notifying the same. But there are some errors in the script.

DIR="/data/research_dev/inbfiles"
cd /data/research_dev/inbfiles
if [ "$(wc -l ff_invoicepreviewqueue1.csv)" > 500 ]; then
echo "Hi," > InvoicePreview.dat
echo " The row count of InvoicePreviewQueue is:   " >> InvoicePreview.dat
#wc -l ff_invoicepreviewqueue1.csv >> InvoicePreview.dat
echo "                  " >> InvoicePreview.dat
echo "            " >> InvoicePreview.dat
echo "Thanks and Regards," >> InvoicePreview.dat
echo "BI Support team." >> InvoicePreview.dat
mailx -s "Alert!! Count is out of limits!! " "correia.blossom@rexelholdingsusa.com" < InvoicePreview.dat
rm -f InvoicePreview.dat.dat
#
+1 vote

I'm trying to get my Informatica workflow to fail a session if it selected 0 source records. I have come up with the following script to run as the Post-Session Success Command:

if [ $PM{Source Qualifier Name}@numAppliedRows == 0 ]
then
exit 2
else
exit 0
fi

where {Source Qualifier Name} is the name of my source qualifier. When I look at the session log it looks as I would expect where the $PM{Source Qualifier Name}@numAppliedRows is replaced by the number of rows my source qualifier selected but it is still causing the session to fail even when this number is != 0. The session log gives me the following error message:

sh: 0403-057 Syntax error at line 1 : 'if' is not matched.

Any help would be appreciated.

...