This document shows you how to use three Sequel commands in two scripts to repetitively burst a Client Report (CRO) and send separate report sections to different email addresses. This example sends a specific report to each manager of a region.

This approach is easily accomplished using two scripts. One script creates a client report for each region, and sends it to the appropriate manager. The second script repetitively runs the first script as many times as there are managers listed in a manager file.


  1. Create Scipt One:
    This script only needs to contain the following command: (commands below are shown ‘justified’ for clarity)
           SETVAR((_&&regon ''_&&regon'') (_&&email ''_&&emailadd''))') 
           SQL('select regon, emailadd from sequelex/regmgrlst')
    This script repetitively runs the second script once for each record in the REGMGRLST file. Also, there are no variables to define in this script—the variable values for region and email address are dynamically passed from the REGMGRLST file.
  2. Create Script Two.
    This script uses the two commands below: (commands below are shown on multiple lines for clarity)
    RUNRMTCMD CMD('"\program files\sequel viewpoint\viewpnt.exe" 
              /V:YourSystem/YourLib/YourCRO /SETVAR((regon ''&&regon'')) 
              /D:\\YourSystem\tmp\Region&&regon.pdf /F:*pdf') 
              RMTLOCNAME(YourVPServer *IP)
    ESNDMAIL RECIPIENT('&&email') 
             SUBJECT('PDF file from CRO for Region &&regon') 
             ATTLIST((* *DFT '/tmp/Region&&regon.pdf' *N * *LAST *ONLY))
    This script issues the Run Remote Command (RUNRMTCMD) against a configured ViewPoint server. The client report is run for a single region and a PDF file is created on the IFS. This file is then sent to the appropriate manager using the ESEND Mail command (ESNDMAIL).

    Note: The variable definitions used in the RUNRMTCMD should be an EXPR type with the appropriate length
  3. After you have saved both scripts, run Script One to burst and email your report.



Still have questions? We can help. Submit a case to Technical Support.

Last Modified On: August 10, 2020