Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
Good afternoon. I have an issue where some of our reports that get emailed via SNDDST are no longer working. The files are first copied to QDLS/TMP using CPYTOIMPF and then the SNDDST command emails the file as a *DOC. I hate using QDLS, but is there any other way to do it if I'm copying the file to the IFS as a *PCASCII file? I was under the impression that *DOC types always have to be copied to the QDLS directory.
I'm hoping there's something new in V7R1 that might help me to eliminate the need to use this directory. Any suggestions would be appreciated. Here's the code, if you would like to look at it. Thanks!
RTVSYSVAL SYSVAL(QTIME) RTNVAR(&SYSTIME)
CHGVAR VAR(&DOCNM) VALUE('GL' *TCAT &SYSTIME *TCAT '.CSV')
CHGVAR VAR(&TOSTMF) VALUE('/qdls/tmp/' *TCAT &DOCNM)
CPYTOIMPF FROMFILE(QTEMP/CSC117P) TOSTMF(&TOSTMF) STMFCCSID(*PCASCII) +
MBROPT(*REPLACE) RCDDLM(*CRLF) STRDLM(*NONE) RMVBLANK(*BOTH) +
ADDCOLNAM(*SQL)
CHGDOCD DOC(&DOCNM) FLR(TMP) DOCD('SODA Sales G/L Posting Report')
CHGVAR VAR(&MSG) VALUE('The SODA Sales G/L Posting Report that you +
requested is attached.')
SNDDST TYPE(*DOC) TOINTNET((&EMAIL1) (&EMAIL2) (&EMAIL3) (&EMAIL4) +
(&EMAIL5)) DSTD('SODA Sales G/L Posting Report') MSG(&MSG) +
DOC(&DOCNM) FLR(TMP)
I would use SQL Query File and SENDMAIL instead.
RUNSQLF SQL('select * from CSC117P') OUTPUT(*CSV) SENDMAIL TO(&EMAIL1 &EMAIL2 &EMAIL3) SUBJECT(&SUBJECT) ATTACH('/home/cozzi/csc117p.csv')
http://www.rpgpgm.com/2014/07/formatting-email-body-in-sndsmtpemm.html
Hi Bob
I don't seem to have either of those commands. Where can I find those? It looks MUCH cleaner too!
Thanks!
Chris
Those are SQL Query File commands
2COZ-QF2
the SNDSMTPEMM command is a fun alternative to SNDDST but just as annoying
Hi Bob
I just Googled the number and it appears it a product of yours, correct?
Yep it is. And that's good to know (the google thing).
www.sqlQueryFile.com