Please let me know how can i send AS400 data using a query to user email in form of excel?
Announcement
Collapse
No announcement yet.
Send AS400 data using a query to user email
Collapse
X
-
By "query" do you mean SQL or the actual Query product?
What release level is the system ?
Is PHP (fro example) installed?
Does this function have to integrate nto an existing application?
IBM i (AS400 is a very old name) has as many ways of doing this as most any other computer system. So the easiest way may be to do whatever you are already familiar with.
-
V5R4? Seriously? Wow - that has been out of service for about 10 years.
Simplest choice probably to create a Savefile of the objects you want to move. Then FTP the savefile from one box to the other and restore the objects from the savefile.
You could also create a DDM link between the two boxes and move files that way. Or set up to connect the boxes via SQL.
I don't know what you know so only you can tell me which might work. If your knowledge is limited thn savefile approach is probably the easiest and there are lots of examples of how to do it on the web.
Comment
-
The easiest way is via csv.
Use CPYTOIMPF into your IFS and send this file (if you have some external mailprog on your iseries)
Edit: http://www-01.ibm.com/support/docvie...d=nas8N1017620Last edited by Chris Brunner; December 4, 2018, 01:15 AM.
Comment
-
How I do this is to output the query to a database table
Copy the table to the IFS as a .csv
Use SNDSMTPEMM to e-mail the file from the iSeries to the user
I'm not sure if SNDSMTPEMM is supported in v5r4 though.
Also if you want meaningful headings you're better off creating another database file, inserting the headings there, copying to the IFS first
Then when you copy the data out to the IFS, use *ADD and it will add the rows beneath the headings.
This also assumes your iSeries is setup to allow sending of e-mails.
Comment
Comment