Execute SQL command to send .XLS file to certain email ID

Tags:
AS/400
SQL
XLS
I am using EXECUTE SQL command to send a .XLS file to certain email ID. Now when I use TOSTMF in the statement, the XLS file is getting copied in the root directory also, which is not needed. Requirement is that only email should be sent. But if I remove the TOSTMF from the statement, the XLS file is created with a generic name. Is there any work around possible?


Software/Hardware used:
os400
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 6  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • ToddN2000
    Post you code and let us take a look.
    133,645 pointsBadges:
    report
  • CharlieBrowne
    If you do not want it, why not delete it after the email is sent?
    62,385 pointsBadges:
    report
  • Supriyoas400
    xcmdStr_ =                                                     
        'EXECUTE SQL(' + '''' + %trim(#sqlscript)  + '''' + ') ' + 
        'PCFMT(*xls) '                                        + 
        'TOSTMF('      + '''' + %trim(#tostmf)    + '''' + ') '  + 
        'REPLACE(*YES) '                                         + 
        'RECIPIENT('   + '''' + %trim(#emails)     + '''' + ') ' + 
        'EMLMSG('      + '''' + %trim(#emailmsg)   + '''' + ') ' + 
        'TEXT('        + '''' + %trim(#outtext)    + '''' + ')'  ; 
                            
    250 pointsBadges:
    report
  • TheRealRaven
    Hard to say. What "EXECUTE SQL" command are you referring to?
    35,620 pointsBadges:
    report
  • TheRealRaven
    Where did you get the command? Who wrote it? If you need answers about how it works, you'll probably need to ask the author. It's apparently not an IBM-supplied command. It's not even clear what language you're using, so the code snippet isn't very helpful. And without the content of the variables, it's not likely that anyone can be sure of what's happening.

    35,620 pointsBadges:
    report
  • ToddN2000
    That does not look like SQL code from IBM. Better to contact the vendor who wrote it. Are you true SQL in the parameter #SQLSCRIPT?
    133,645 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: