top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

sending a mail using informatica workflow

0 votes
1,161 views

I have an informatica mapping-a simple one which has Sq->t(x)->tgt

Here I am populating the target (which is a flat file) only if a certain condition is satisfied, which is included in the transformations.

Now my requirement is that if the target (a txt file) is populated even with even one record it should send out an email to two people.

I am using the mailx Unix command but I am not sure how to check whether there are any records in the target file using Unix script. This is what I have tried:
if [ "/data/informatica/Services/myfolder/TgtFiles/filename.csv" = "1" ]//here i am trying to check if there are any records in the target
then

    mailx -s "Target is populated" "reciepent1@abc.com reciepent2@abc.com "<<ed
    Validation completed
    ed
else
    exit
    eod
fi
posted Sep 24, 2014 by Sachin

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

1 Answer

0 votes

It's not clear what shell informatica is calling, but this should work with about any bourne derivative (not csh).

if [ `wc -l < "/data/informatica/Services/myfolder/TgtFiles/filename.csv"` -gt 0 ]
   # //here i am trying to check if there are any records in the target
then
    mailx -s "Target is populated" "reciepent1@abc.com reciepent2@abc.com "<<ed
    Validation completed
    ed
else
    exit
    eod
fi

I can't easily test the mailx part and don't know what eod means for informatica. If I replace the then body with echo yep and the else body with echo nope, it works as expected.

If you can use newer command-substitution , replace the first line with
if [ $(wc -l < "/data/informatica/Services/myfolder/TgtFiles/filename.csv") -gt 0 ]

answer Sep 26, 2014 by Shweta Singh
Similar Questions
0 votes

I have a table say X with the below structure

COLUMN1    COLUMN2
1            T
2            F
3            T
4            T
5            F

I want to send an E-MAIL to a specific mail-id saying 'PASS' if there is no 'F' in COLUMN2 and an E-MAIL saying 'ALERT' if there is even a single 'F' in column2.

0 votes

In a mapping we use delimited flat file having 3 columns.The column separated through comma. But i have a requirement that in between the column there is a column having 2 comma.So how should I process the column in the mapping?

0 votes

we have two informatica jobs that run parallel . one starts at 11.40 cet and it has around 300 informatica workflows in it out of which one is fact_sales. the other job runs at 3.40 cet and it has around 115 workflows in it many of which are dependent on fact_sales in term of data consistency. the problem is fact_sales should finish before certain workflows in process 2 starts for data to be accurate. but this doesnt happen generally. what we are trying to do is to split the process 2 in such a way that fact_sales dependent workflows run only after the fact_sales has finished . can you provide me a way to go about writing a unix shell script that check the status of this fact_sales and if it successfull then kicks off other dependent workflows and if not then it should send a failure mail.

Thanks

0 votes

I am working in Informatica project, and we use to trigger the workflow from Autosys and if workflow fails we get the mail. After that we used to check the session log and find out the error message. Generally the error message is a Network error like failed to connect to Database. My Question is there any way to extract only the error message from the session log like "Failed to Connect to database" and send this in mail.

...