IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
Expand all | Collapse all

Qstn about put(email) command...........

  • 1.  Qstn about put(email) command...........

    Posted 11/19/07 12:24 PM

    Originally posted by: SystemAdmin


    I am working on a task in which I have two files file1 & file2.
    the common record in both files is the custno.
    i have to extract all records from file1 whose cust no is present in file2. I then have to send emails to all the extracted (common)records and the email address in present in file1.

    the extract part is working fine
    =f_map(EXTRACT(FileRec:ip,Cust_No Elements:.:ip= cust_No fields:.:ip1 ),ip1)

    iam trying to use the PUT function to send email as
    =PUT("email","-proto inet -server xyz.com -TO Cust_No_Email Elements:In1" ,mssg))

    My Q is can i use the field value in the -TO when sending email ?

    If N how can I send multiple emails to different email id's of common records present in file1.

    Thanks in Advance
    Regards
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 2.  Re: Qstn about put(email) command...........

    Posted 11/19/07 02:06 PM

    Originally posted by: jvanboga


    You should be able to. Depending on the version you are using you have command-line size limits. Sending to multiple recipients can eat them fast.

    If you are having a problem sending an email turn on the trace feature; -t. The default trace file name is m4email.mtr.

    "email","-t -proto inet -server xyz.com -TO Cust_No_Email Elements:In1" ,mssg

    also, you'll need to change your format a little....

    " -TO '" + Cust_No_Email Elements:In1 + "'"

    Message was edited by: jvanboga
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 3.  Re: Qstn about put(email) command...........

    Posted 11/19/07 02:07 PM

    Originally posted by: john.gibby


    To Q#1: Yes you can use the field value as the address in the PUT function:

    =PUT("email","-proto 'inet' -server 'xyz.com' -TO '" + Cust_No_Email Elements:In1 + "'" ,msg))

    To Q#2: Yes you can use multiple email addresses. However, they each have to be prefixed with "-TO ". I have a reference file with email addresses in the email address field. This is a single text field with the different addresses delimited by a semicolon. Then I do the following:

    =PUT("email","-proto 'inet' -server 'xyz.com' -TO '"
    + SUBSTITUTE(Cust_No_Email Elements:In1,";","' -TO '")
    + "'" ,msg))

    If your email field is a series object that can contain multiple email addresses, then you should use the TEXT function inside the SUBSTITUTE function as I did above.

    Hope this helps,
    John
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 4.  Re: Qstn about put(email) command...........

    Posted 11/19/07 02:16 PM

    Originally posted by: jvanboga


    John, we haven't required the extra semi-quotes

    "-proto 'inet' -server 'xyz.com'

    works just like

    "-proto inet -server xyz.com

    Any reason why you add them?
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 5.  Re: Qstn about put(email) command...........

    Posted 11/19/07 02:24 PM

    Originally posted by: john.gibby


    Just the way I was taught during Ascential Training, so I have continued to use them. I know some have said they don't use them, but I have never had a problem using them, so I have chosen to continue.

    John
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 6.  Re: Qstn about put(email) command...........

    Posted 11/19/07 04:03 PM

    Originally posted by: SystemAdmin


    Just throwing my 2 bits on the whole single quotes subject; if I'm building a rule in a put statment and using varibles from any means, and it doesn't work, one of the first items I'll try is putting the single quotes around the varibles. And this is not just with the PUT(EMAIL's, this is for mulitple applications. There have been times in the past where using the single quotes has fixed the issue.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 7.  Re: Qstn about put(email) command...........

    Posted 11/19/07 04:05 PM

    Originally posted by: SystemAdmin


    Also, you would have to use PACKAGE:

    =PUT("email","-proto inet -server xyz.com -TO Cust_No_Email Elements:In1" ,PACKAGE(In1))

    You may know that, but just in case someone refers to this thread for help.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 8.  Re: Qstn about put(email) command...........

    Posted 11/19/07 04:25 PM

    Originally posted by: jvanboga


    Depending on your need either package(in1) or seriestotext(in). At times package won't work.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 9.  Re: Qstn about put(email) command...........

    Posted 11/20/07 10:48 AM

    Originally posted by: SystemAdmin


    Thanks for all your responses.
    my file1 has cust no, email addr
    my file2 has cust no, messages.

    The multiple emails are now being sent. But there is still a minor glitch in the logic.My File 2 has got an unique message for each customer number. So this message shud be sent in the email for each corresponding cust number which match in file1 & file2.

    Currently it sends all the messages to each email.
    As per my first req my f_map shud extract only those records whose customer numbers match in both files.
    My f_map rule is:
    =f_map(extract(FileRec:ip,Cust_No Elements:.:ip=cust_No fields:.:ip1),ip1)

    the rule in the f_map o/p card for sending emails is
    =PUT("email","-proto 'inet' -server 'xyz.com' -from abc@abc.com -TO "Cust_Email Elements:In1"" ,package(adapter_command fields:.:In2))

    any suggestions on resolving this one....???

    Message was edited by: ASK

    Message was edited by: ASK
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 10.  Re: Qstn about put(email) command...........

    Posted 11/20/07 12:00 PM

    Originally posted by: jvanboga


    try changing

    =PUT("email","-proto 'inet' -server 'xyz.com' -from abc@abc.com -TO "Cust_Email Elements:In1"" ,package(adapter_command fields:.:In2))
    to

    =PUT("email","-proto 'inet' -server 'xyz.com' -from abc@abc.com -TO '"+Cust_Email Elements:In1+"'" ,package(adapter_command fields:.:In2))

    Message was edited by: jvanboga
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 11.  Re: Qstn about put(email) command...........

    Posted 11/20/07 02:34 PM

    Originally posted by: SystemAdmin


    I have already used +prefixing the email id...i just mentioned it incorrectly in my 2nd post.

    However if my file1 has a few invalid email id's at 2/3 position and a valid mail id at the fourth postion, it fails after the fist instance & dosent go to the fourth instance. The trace file created mentions closing connection after the first email is sent.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 12.  Re: Qstn about put(email) command...........

    Posted 11/20/07 02:54 PM

    Originally posted by: jvanboga


    Could you post your trace file? Also, what version & platform are u running?
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 13.  Re: Qstn about put(email) command...........

    Posted 11/20/07 03:06 PM
      |   view attached

    Originally posted by: SystemAdmin


    i also tried using restart/ reject for email field...

    iam posting my trace file for ur ref
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender

    Attachment(s)



  • 14.  Re: Qstn about put(email) command...........

    Posted 11/20/07 04:01 PM

    Originally posted by: SystemAdmin


    **Cleanup call from prior Rollback; re-initializing instance storage.**
    **Map return is 0.**
    **Wrote Header: Date: Tue, 20 Nov 2007 15:03:12 -0500 (EST)**
    **Wrote Header: X-Mailer: IBM WebSphere DataStage 1.0.6**
    **Warning! Line too long (over 80 characters): 'ASCput("FT...'. It may be wrapped in transit.**
    **Local host is 'anup'.**
    **Client host is 'miraclesoft.com'.**
    **WSASelect: One or more of the descriptor sets contains an invalid socket.**
    **WSASelect: One or more of the descriptor sets contains an invalid socket.**
    **WSASelect: One or more of the descriptor sets contains an invalid socket.**
    **WSACloseSocket: Invalid socket descriptor.**
    **WSATerm: Entering**
    **WSATerm: bWSStarted = 0, nWSClients = 0**
    **WSATerm: Exiting -**
    **WSASelect: One or more of the descriptor sets contains an invalid socket.**
    **Cannot deliver to any recipients.**
    **Attempt #1 failed, no more retries allowed.**
    **WSASelect: One or more of the descriptor sets contains an invalid socket.**
    **WSASelect: One or more of the descriptor sets contains an invalid socket.**
    **WSACloseSocket: Invalid socket descriptor.**
    **WSATerm: Entering**
    **WSATerm: bWSStarted = 0, nWSClients = 0**
    **WSATerm: Exiting -**
    **WSATerm: Entering**
    **WSATerm: bWSStarted = 0, nWSClients = 0**
    **WSATerm: Exiting -**
    **Data in C:\DOCUME~1\ANUPKA~1\LOCALS~1\Temp\A165.tmp deleted.**
    **Run Terminated at 15:03:12.906 on 11/20/07.**

    Cleanup call from prior Rollback; re-initializing instance storage.
    Map return is 0.
    Wrote Header: Date: Tue, 20 Nov 2007 15:03:12 -0500 (EST)
    Wrote Header: X-Mailer: IBM WebSphere DataStage 1.0.6
    Warning! Line too long (over 80 characters): 'ASCput("FT...'. It may be wrapped in transit.
    Local host is 'anup'.
    Client host is 'miraclesoft.com'.
    WSASelect: One or more of the descriptor sets contains an invalid socket.
    WSASelect: One or more of the descriptor sets contains an invalid socket.
    WSASelect: One or more of the descriptor sets contains an invalid socket.
    WSACloseSocket: Invalid socket descriptor.
    WSATerm: Entering
    WSATerm: bWSStarted = 0, nWSClients = 0
    WSATerm: Exiting -
    WSASelect: One or more of the descriptor sets contains an invalid socket.
    Cannot deliver to any recipients.
    Attempt #1 failed, no more retries allowed.
    WSASelect: One or more of the descriptor sets contains an invalid socket.
    WSASelect: One or more of the descriptor sets contains an invalid socket.
    WSACloseSocket: Invalid socket descriptor.
    WSATerm: Entering
    WSATerm: bWSStarted = 0, nWSClients = 0
    WSATerm: Exiting -
    WSATerm: Entering
    WSATerm: bWSStarted = 0, nWSClients = 0
    WSATerm: Exiting -
    Data in C:\DOCUME~1\ANUPKA~1\LOCALS~1\Temp\A166.tmp deleted.
    Run Terminated at 15:03:12.937 on 11/20/07.

    If we analyse the trace ,After sending the first successful email , when the put tries to send a second email for a incorrect email id, it throws a syntax error
    501 Syntax error in address crux123@gmail (F) (which can b seen in the trace file)
    Thereafter it says
    >221 Closing connection. Good bye. (S)
    Socket Closed.

    after that even if it encounters a correct mail id at the fourth position, it still says

    WSASelect: One or more of the descriptor sets contains an invalid socket.

    Any suggestions on resolving this ???
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 15.  Re: Qstn about put(email) command...........

    Posted 11/20/07 05:21 PM

    Originally posted by: john.gibby


    It sounds like you are going to have to send one email per address/message combination instead of trying to send to multiple addresses per message. Personally, I would use a separate map for sending the emails because I have found that if I use PUT to send an email and my map fails for any reason, the email does not get sent even though the command completed successfully. Then you can RUN the sendmail map for each address/message combo and if an email address fails, it won't affect the others.

    John
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 16.  Re: Qstn about put(email) command...........

    Posted 11/21/07 09:52 AM

    Originally posted by: jvanboga


    I agree though depending on needs you'd need to track failures.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender