We have a need to be able to email AS/400 query source code to another location to be viewed in a PC text editor. Does anyone know what is the most efficient way to do this?
We have a need to be able to email AS/400 query source code to another location to be viewed in a PC text editor. Does anyone know what is the most efficient way to do this?
Are you dealing with SQL or Query/400 ?
Jennifer, You can copy the source to a document using CPYTOPCD. This is the PDM option I use: CPYTOPCD FROMFILE(&L/&F) TOFLR('&L/&F') FROMMBR(&N) TODOC('&N.&S') REPLACE(*YES) You can then set the name of the sent attachemnt with: CHGDOCD DOC('&N.&S') FLR('&L/&F') DOCD('&N.&S') Then use the SNDDST command to send the file. The command will look like: SNDDST TYPE(*DOC) ?TOINTNET((user@domain.com)) DOC(&N.&S)FLR('&L/&F') The first step will place the source file with a name like srcmbr.qry in a folder with a name like library/qqrysrc. The second step will cause the e-mail to use the file name as the attachment name. The TOINTNET parameter became available on V4R1 or V4R2 and requires the following system directory entry: ADDDIRE USRID(INTERNET USERS) SYSNAME(TCPIP) USRD('Context switching entry') USER(*NONE) MSFSRVLVL(*USRIDX) PREFADR(NETUSRID *IBM ATCONTXT) David Morris
I am trying to do something similar, but I can't get the Document name to be included in the MIME header for the attachment ... Do you know if there is something to set up for that ? (the document description DOCD is sent as the subject of the e-mail)