Article

How-To: Increase Your Command of Esend with Sequel

IBM i
Need help with Esend or Sequel?
Posted:
February 22, 2017

You use Esend as a tool for sending spooled files as emails. It still does this and does it exceptionally well, but there is more to Esend than just simply sending your spooled file reports to recipients via email.

Esend also has the capacity to embed the results in body of an email or use FTP (File Transfer Protocol) to move a file from one machine to another. With the use of an Esend FTP Server entry, you can use secure FTP for your data transfer.

You can also create an address book with Esend. The address book allows input of short names so you don’t need to enter the full email address every time you need to send an email. You can also create specific lists or groups of names, like managers for example. With groups or lists, your email request is simply entered as “managers”, and then the email will be sent to several different addresses.

Automatic Forwarding and Distribution

Forwarding allows you to identify IBM i output queue as Esend forwarding capable. Setting up a Forwarding Rule tells Esend what to look for. The rule can be as generic as every spooled file for an output queue, or can be as specific as one output queue, one report name, one format, or one user. The action can also be a Distribution Rule.

A Distribution Rule or Bursting Rule can be created to look at the data on the report and to take an action based on that data. A report with multiple pages can be “burst” into separate emails or files to be placed on the IFS by identifying a piece of data: salesman number or name, an account number, region number, division name, etc. Distribution Rules can also be referenced independently with the command EDISTRIB.

When you have a report and it hits the output queue, Esend takes over and automatically forwards and bursts the report so that each manager is sent just their information, and only their information. You can also use your address book entries, including lists with a forwarding rule to email reports to all of the managers on the list.

Now, if this spooled file is built as a Host Report with Sequel Data Access, you have even more control of the field placement and data to be included on the report. With a Sequel Report, the spooled file can be created exactly as you need for the forwarding and distributing features. You control the page breaks, the subtotals, and the content. In the view used as the basis of the report, you can join a file of email addresses. Then the report can display the email address of the recipient, or if the email addresses aren’t available in a file, the view can include a CASE statement to create the email address.

 

 

Not using Sequel yet? Try it today!

With the email address right on the report, your distribution rule can key in on the data and send the emails. And with a distribution rule, the rule can remove the email address from the PC file created (Search Text = *REMOVE).

The Sequel commands that are most often used in Sequel Scripts, CL Programs, and scheduled jobs all include a RECIPIENT parameter. This is where the tie into Esend comes into play. With Sequel and Esend, you don’t always have to create the spooled file for Esend to email. You can go directly from the view or report.

EXECUTE VIEW(SEQUELEX/CUSTLIST) PCFMT(*XLS) RECIPIENT(MANAGERS)

Or

REPORT REPORT(SEQUELEX/CUSTLISTR) PCFMT(*PDF) RECIPIENT(SUPPORT)

In Addition, BCHEXECUTE, BCHPRINT, BCHREPORT and PRINT can also use the RECIPIENT parameter. Reports can only be emailed as RTF, TXT, HTML or PDF file types. These commands can also place the PC file on the IFS by using the TOSMTF (to stream file) parameter.

With Sequel Viewpoint or Sequel Web Interface, users can choose to email results of views, script views, reports, or tables. A right click on the view, script view, report, or table gives the user several options including ‘Send Results To’ (‘Email Results’ in Sequel Web Interface).

Because these requests automatically invoke Esend, all of your address books are available. If you have an address book setup with a list of email addresses named “managers”, you would simply email the results to “managers”.

From Sequel Viewpoint, right click on a view or table.

 

 

Send to individuals or Esend lists. Choose from a variety of PC formats:

 

 

From Viewpoint you can schedule the sending of the email using Robot Schedule or the IBM Job Scheduler from Sequel Web Interface Explorer:

 

 

Don't have Robot Schedule? Give it a try!

Send to individuals or lists in Esend Address Book:

 

 

You can take advantage of this feature by adding *ATT in the message text to embed the results in the body of the email. By making the PC File type HTML, the recipient will see the data in the email body. This command can be placed into a script, which can then be run from Sequel Viewpoint, a shortcut, or a dashboard button.

EXECUTE VIEW(SEQUELEX/SALESINFO) PCFMT(*HTML) RECIPIENT(MANAGERS) EMLMSG(*ATT)

Sent with *ATT – table results embedded in body of email:

 

 

This is a great way to see the data if your recipient is using a mobile device to view their email.

Esend as a stand alone tool has many great features and functions for sending spooled files, but when used with Sequel, Sequel Viewpoint, or Sequel Web Interface you have even more options, features, and power available at your command.

 

Do More with Sequel

Get the answers to your questions and do more with your HelpSystems products. 

Not using Sequel yet?

Related Products

Related Solutions