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.