Upload
trankhue
View
219
Download
0
Embed Size (px)
Citation preview
SpoolFlex Advanced Utilities Tutorial
Overview ............................................................................................................................................. 1
Understanding Features within SpoolFlex Advanced Utilities ........................................................... 1 Create Sample Spooled Files .............................................................................................................. 2 Exercise 1 – Review a Spooled Data Map .......................................................................................... 3
Spooled Data Map (SDM) for spooled file containing Statements ................................................ 3 Exercise 2 – Move a Spooled File using the SFAMOVE API ........................................................... 8
Spooled File Selection Definition (SFS)......................................................................................... 9 Move a Spooled File using the Move tool .................................................................................... 12
Exercise 3 – Delete a Spooled File using the SFADELETE API ..................................................... 13
Spooled File Selection Definition (SFS)....................................................................................... 13 Delete a Spooled File using the Delete Tool ................................................................................ 14
Exercise 4 – Sort a Spooled File using the SFASORT API ............................................................. 15 Create Sample Spooled Files ........................................................................................................ 15
Spooled File Selection Definition (SFS)....................................................................................... 16 Sort Definition .............................................................................................................................. 16
Output Definition .......................................................................................................................... 19 Sort a Spooled File ........................................................................................................................ 23
Exercise 5 – Split a Spooled File using Report Splitter Tool (SFASPLIT)...................................... 24 Create Sample Spooled files ......................................................................................................... 24 Spooled File Selection Definition (SFS)....................................................................................... 25
Output Definition (used in the Report Splitter) ............................................................................ 25 Report Splitter Definition ............................................................................................................. 28
Split a Spooled File using the Report Splitter tool (SFASPLIT) .................................................. 31 Exercise 6 – Report Distribution ....................................................................................................... 33
Verify e-Mail is setup and working .............................................................................................. 33
Create Sample Spooled files ......................................................................................................... 34
Report Distribution Setup ............................................................................................................. 35 Exercise 7 – Automate Report distribution using the Spool Sentry ................................................. 46
Create Sample Spooled Files ........................................................................................................ 46
Setup a Spool Sentry ..................................................................................................................... 47 Start a Spool Sentry ...................................................................................................................... 51
End a Spool Sentry........................................................................................................................ 52
Last Edition (October 2017)
11585 Jones Bridge Rd Suite 420-210 Alpharetta, GA 30022
Phone: 678.417.1521 E-Mail: [email protected] Web: www.drvtech.com Copyright DRV Technologies Inc. 2010. All Rights Reserved
Overview
IMPORTANT! Before proceeding with this tutorial you should have:
Installed the SpoolFlex software onto your AS/400 or iSeries
Activated the software and completed a phone demonstration of SpoolFlex with a Sales
Consultant at DRV Technologies. To schedule a 20 minute phone demonstration call
678-417-1521
Completed the SpoolFlex Quick Start Guide
Completed the SpoolFlex e-Delivery Tutorial
This document is one of the tutorials designed as training guides to introduce you to the SpoolFlex Suite of
tools. After using this tutorial you will have a better understanding of what can be accomplished using the
SpoolFlex Advanced Utilities.
Understanding Features within SpoolFlex Advanced Utilities
In this tutorial you will:
Review Spool Data Map
Learn more about Spool File Selection
Learn some SpoolFlex API’s (commands)
Learn about Address Book
Learn about Report Distribution
Learn about Spool Sentry
*NOTE*: Output Definition was defined and discussed in more detail in the e-Delivery Tutorial.
Most tools in the SpoolFlex Suites will take an existing spooled file and transform the spooled file into
another spooled file or to an e-Format file such as PDF, Excel, etc. All of the SpoolFlex tools exist as an
AS/400 command that can be executed from a SpoolFlex Menu, from a command line, from your CL
programs, from a SpoolFlex Spool Sentry, or from the SpoolFlex Manage Spooled File Menu option.
SpoolFlex Advanced Utilities Tutorial
2
Create Sample Spooled Files
During the exercises in this manual, you will be using two output queues (SFOUTQ and SFOUTQ2) and
sample spooled files that are easily re-created. To ensure the two output queues contain the correct files, you
will delete and re-create the sample files using the instructions below.
Clear output queues SFOUTQ and SFOUTQ2.
Create sample spooled files:
Go to Manage Spooled Files menu. Enter SFOUTQ in the Output Queue field
and *LIBL in the Library field and press <enter>. Press F6 to create sample spooled files.
You should see eight sample files in the screen below.
Press F12 to return to the SpoolFlex Main menu.
*NOTE*: These spooled files can be used with any of the exercises in the manual or if you are
just playing with the software and need sample spooled files for testing purposes.
SpoolFlex Advanced Utilities Tutorial
3
Exercise 1 – Review a Spooled Data Map
In this exercise you will:
Review a Spooled Data Map for the spooled file containing Statements
Spooled Data Map (SDM) for spooled file containing Statements
Spool Data Map identifies where specific Spooled Data Fields, such as Invoice# or Customer#, are located on
a spooled page. Once a Spooled Data Map has been created, Spooled Data Fields may be used for: Sorting a
Spooled File, Splitting a Report, or naming a document.
From the SpoolFlex Main Menu, select option 2. Work with Definitions and press <enter>.
SpoolFlex Advanced Utilities Tutorial
4
From the Work with Definitions screen, select Spooled Data Map and press <enter>.
A list of existing Spool Data Maps will display.
Put 2 next to SAMPLE STATEMENTS and press <enter> to edit this map.
SpoolFlex Advanced Utilities Tutorial
5
A list of existing Spool Data Fields is displayed. You can see that Spool Data Fields are defined within the
spooled file by using a Line number, Position, Length and Repetitions. In this example, the Customer Name
is located on Line 10, Position 49 and has a Length of 30. Once this information is stored, it can be used by
many of the SpoolFlex Tools such as sorting, report splitting, output definitions, plus others. Page Down to
get to the STATEMENT NUMBER entry.
Put 2 next to the STATEMENT NUMBER entry and press <enter>.
SpoolFlex Advanced Utilities Tutorial
6
Press F10 to view your spooled file and see location and values of the SDF, STATEMENT NUMBER.
Find the spooled file in SFOUTQ outque with a Form Type = *STMT.
Put V (view) next to it and press <enter>.
SpoolFlex Advanced Utilities Tutorial
7
Page down until you see a highlighted text. This is your STATEMENT NUMBER.
Now you can see the SDF’s location in the file and one of its values. If you keep paging down, you will find
the next value. When ready, press <enter> to come out of the spooled file.
Press <enter> twice to come out of this data map.
Press F12 until you return to the SpoolFlex Main Menu.
You have now reviewed the SAMPLE STATEMENTS Spooled Data Map.
*NOTE*: To get more information on the Spooled Data Map, check out the e-Dilevery Tutorial.
SpoolFlex Advanced Utilities Tutorial
8
Exercise 2 – Move a Spooled File using the SFAMOVE API
In this exercise you will:
Verify the existence of a test spooled file containing 5 pages of statements
Review the Spooled File Selection Definition
Use the SFAMOVE tool to move this spooled file from the
SFOUTQ output queue to the SFOUTQ2 output queue
Verify that the sample spooled files exist in the SFOUTQ output queue:
From the main menu, select option 1. Manage Spooled Files and press <enter>.
You should see a screen similar to the one below. If you don’t see some of the sample files,
press F6 to create them.
Check if you have a spooled file with Form Type, *STMT.
Press F12 to return to the SpoolFlex Main Menu.
SpoolFlex Advanced Utilities Tutorial
9
Spooled File Selection Definition (SFS)
Some of the SpoolFlex tools require a Spooled File Selection Definition that defines criteria
for selecting spooled files for processing.
From the SpoolFlex Main Menu, select option 2. Work with Definitions and press <enter>.
Select Spool File Selection and press <enter>.
SpoolFlex Advanced Utilities Tutorial
10
Put 2 next to SAMPLE STATEMENTS and press <enter>.
Put 2 next to Sequence 10 and press <enter>.
SpoolFlex Advanced Utilities Tutorial
11
This Spooled File Selection definition selects files by looking for Printer File Name, PRT0002, and Form
Type, *STMT. Make sure the values on your screen match the screen below and press <enter>.
The second screen is mainly used to check for specific data values located on the First or the Last page
of the spooled file. If there is a match, then the spooled file will be selected.
The last line on this screen lets you search for reports using file attributes, such as User Data or User ID.
Press <enter> twice and then F3 until you return to the SpoolFlex Main menu.
SpoolFlex Advanced Utilities Tutorial
12
Move a Spooled File using the Move tool From the SpoolFlex Main Menu do the following:
Type SFAMOVE on the Command Line and press F4 to prompt
Once the SFAMOVE screen comes up, enter the following values:
Select From Output Queue SFOUTQ
Spooled File Selection Name SAMPLE STATEMENTS
Move to Output Queue SFOUTQ2
Press <enter> to run this command.
You should get a message on the bottom that 1 spooled file got processed.
Now check the original outque by running the following command:
WRKOUTQ SFOUTQ
You should see that the spooled file with Form Type *STMT is no longer there.
Now check the new outque by running the following command:
WRKOUTQ SFOUTQ2
You should see the spooled file with Form Type *STMT is in this output queue.
You have now successfully used SpoolFlex Tool (SFAMOVE) to select a spooled file from one Output
Queue and move it to another Output Queue.
SpoolFlex Advanced Utilities Tutorial
13
Exercise 3 – Delete a Spooled File using the SFADELETE API
In this exercise you will:
Verify the existence of a test spooled file containing 5 pages of statements
Review the Spooled File Selection Definition
Use the SFADELETE tool to delete this file from the SFOUTQ2 output queue
Verify that the sample spooled file still exists in SFOUTQ2 output queue:
WRKOUTQ SFOUTQ2
You should see the spooled file with Form Type *STMT is in this output queue.
If you do not see the spooled file with Form Type *STMT, go back and complete Exercise 2.
Press F12 to return to the SpoolFlex Main Menu.
Spooled File Selection Definition (SFS)
We are going to use the same SFS definition, SAMPLE STATEMENTS, as we used in the previous
exercise.
This SFS is defined to select spooled files by looking for Printer File Name, PRT0002,
and Form Type, *STMT
SpoolFlex Advanced Utilities Tutorial
14
Delete a Spooled File using the Delete Tool
From the SpoolFlex Main Menu do the following:
Type SFADELETE on the Command Line and press F4 to prompt
Enter the following values in the screen:
Select From Output Queue SFOUTQ2
Spooled File Selection Name SAMPLE STATEMENTS
Press <enter> to run this command.
You should get a message on the bottom that 1 spooled file got processed.
Now check your outque by running the following command:
WRKOUTQ SFOUTQ2
The spooled file with Form Type *STMT should not be there anymore.
Press F12 to return to the SpoolFlex Main Menu.
You have now successfully used SpoolFlex Tool (SFADELETE) to select a spooled file from an
Output Queue and Delete it.
SpoolFlex Advanced Utilities Tutorial
15
Exercise 4 – Sort a Spooled File using the SFASORT API
In this exercise you will:
Re-create sample spooled files in SFOUTQ
Review the Spooled File Selection Definition – to determine what spooled file to select
Review the Sort Definition – to determine how to sort the spooled file
Review the Output Definition - to determine what output format the new file will have
Execute the SFASORT tool to sort the selected spooled file
Create Sample Spooled Files
During this exercise you will be using two output queues (SFOUTQ and SFOUTQ2) and one sample
spooled file. To ensure the two output queues contain the correct files, delete and re-create the sample
spooled files using the instructions below.
Clear output queues SFOUTQ and SFOUTQ2.
Create sample spooled files:
Go to Manage Spooled Files menu and press F6 to create sample spooled files.
You should see the following files in the SFOUTQ outque.
Press F12 to return to the SpoolFlex Main menu.
SpoolFlex Advanced Utilities Tutorial
16
Spooled File Selection Definition (SFS) We are going to use the same SFS, SAMPLE STATEMENTS, as we used in the Exercise 2.
This SFS is defined to select spooled files by looking for Printer File Name, PRT0002,
and Form Type, *STMT.
Sort Definition The SpoolFlex Sort tool (SFASORT) is used to sort pages within a spooled file
or sort spooled files within an outque. The Sort Definition is where this information is stored.
Pages within a spooled file can be sorted:
Using up to five different Spool Data Fields in ascending or descending sequence
By groups, based on a value like statement total greater than $10,000
Spooled files within an outque can be sorted:
By User Data (&SPLUSD)
By User Id (&SPLUSR)
By User Defined Data (&SPLUDD1 through &SPLUDD6)
Let’s look at the Sort Definition that sorts pages within a spooled file.
From the SpoolFlex Main Menu select option 2. Work with Definitions and press <enter>.
SpoolFlex Advanced Utilities Tutorial
17
Select Sort Definition and press <enter>.
Put 2 next to SAMPLE STMT SORT and press <enter>.
SpoolFlex Advanced Utilities Tutorial
18
This Sort Definition is defined to use the Spooled Data Map, SAMPLE STATEMENTS, which we re-
viewed earlier in this tutorial. Here we sort first by the CUSTOMER NAME and then by the
STATEMENT NUMBER in ascending (*ASCEND) sequence.
You can put your cursor in any of the five Sort SDF Name fields and press F4 to see a list of SDFs
that exist in the SAMPLE STATEMENTS data map. Any of these SDFs could be used to sort a spooled
file. Press Page Down to see the next screen.
This Sort Definition is defined to group together all the statements that have a Total greater than $10,000
(these pages will show up in the beginning of the sorted file).
By default the statements that are not greater than $10,000 will fall into their own group.
Press <enter> to return to the list of existing Sort Definitions.
Press F3 to return to Work with Definitions menu.
SpoolFlex Advanced Utilities Tutorial
19
Output Definition Many SpoolFlex tools require an Output Definition. An Output Definition defines the type of output to be
generated and the attributes of the output. Some of the Output types are: *PRTF, *PDF, *RTF, *TXT,
*XLSX, *CSV or *HTML, etc.
Select Output Definition and press <enter>.
Page Down until you get to the SAMPLE STMTS SORTED definition. Type 2 and press <enter>.
SpoolFlex Advanced Utilities Tutorial
20
This Output Definition is defined to output a spooled file (*PRTF type). Press <enter> to continue.
On the screen below, we define attributes for the new spooled file that will be generated:
Printer file name - PRT0201; Output Queue name – SFOUTQ2; Form type – STMTSORTED;
Copies – 2. Press <enter> to continue.
SpoolFlex Advanced Utilities Tutorial
21
You can see there are many attributes that can be defined for the new Printer File output. Any field left blank
will use the value from the original spooled file. Press <enter> to continue.
On this screen you can store values in the User Data and User Defined Data file attributes.
Press <enter> to continue.
SpoolFlex Advanced Utilities Tutorial
22
This screen is used to add an AFP Overlay to the Printer File. Press <enter> to continue.
*NOTE*: The AFP Overlay must already exist.
This screen allows you to exclude characters from your spooled file.
Press F3 until you return to the SpoolFlex Main Menu.
You have now reviewed the Output Definition you will use when sorting the statement spooled file.
SpoolFlex Advanced Utilities Tutorial
23
Sort a Spooled File From the SpoolFlex Main Menu do the following:
Type SFASORT on the command line and then press F4 to prompt
When the SFASORT screen comes up, enter the values that you see on the screen below.
*NOTE*: Use F4 to see a list of valid definitions in the Spool File Selection Name, Sort Name,
and Output Definition Name fields.
Press <enter> to run this command.
You should get a message on the bottom that 1 spooled file got processed.
Now check your outque by running the following command:
WRKOUTQ SFOUTQ2
Check for the file with File name: PRT0201, Form Type: STMTSORTED, and copies: 2.
Press F12 until you return to the SpoolFlex Main Menu.
You have now successfully copied and sorted a spooled file.
SpoolFlex Advanced Utilities Tutorial
24
Exercise 5 – Split a Spooled File using Report Splitter Tool (SFASPLIT)
*NOTE*: The Report Distribution tool (covered later in this tutorial) can also be used
to split reports in most cases.
In this exercise you will:
Re-create sample spooled files in SFOUTQ
Review the Spooled File Selection Definition – to determine what spooled file to select
Review the Report Splitter Definition – to determine how to split the spooled file
Review the Output Definition - to determine what output format the new split file will have
Execute the SpoolFlex Report Splitter tool (SFASPLIT) to split the selected spooled file into
multiple files.
The sample spooled file contains 5 pages that make up 4 statements (one statement has 2 pages). The
SFASPLIT tool will split the spooled file into 4 individual spooled files (one for each statement).
Create Sample Spooled files
During this exercise you will be using two output queues (SFOUTQ and SFOUTQ2) and one sample
spooled file. To ensure the two output queues contain the correct files, delete and re-create the sample spooled
files using the instructions below.
Clear output queues SFOUTQ and SFOUTQ2.
Re-create sample spooled files:
From the SpoolFlex Main Menu go to Manage Spooled Files menu. Select SFOUTQ output queue
and then press F6 to create sample spooled files. Press F5 to check that you have a file with Form Type,
*STMT, in the SFOUTQ outque.
Press F12 to return to the SpoolFlex Main menu.
SpoolFlex Advanced Utilities Tutorial
25
Spooled File Selection Definition (SFS) We are going to use the same SFS, SAMPLE STATEMENTS, as we used in the Exercise 2.
This SFS is defined to select spooled files by looking for Printer File Name, PRT0002,
and Form Type, *STMT.
Output Definition (used in the Report Splitter)
From the Spoolflex Main menu, select 2. Work with Definitions.
Then select Output Definition. Put 2 next to SAMPLE STMTS SPLIT and press <enter>.
The Output type is *PRTF (this will create a new spooled file). Press <enter> to continue.
SpoolFlex Advanced Utilities Tutorial
26
The Spool Data Map is SAMPLE STATEMENTS.
This screen shows the attributes for the new spooled file that will be generated:
(Output Queue name = SFOUTQ2; Form type = STMT01; Hold =*YES; Save = *YES)
Change any values that are different than those shown and press <enter> to continue.
Press <enter> to continue.
SpoolFlex Advanced Utilities Tutorial
27
User Data is specified to contain the constant string STMT followed by the actual STATEMENT
NUMBER from the spooled file. This is done on a page by page basis, so all the spooled files generated
from this tool will have their unique statement number in the User Data file attribute.
User Def Data (&SPLUDD) is specified to have a constant string CUST followed by the actual
CUSTOMER NAME from the spooled file.
Press <enter> to continue.
Press <enter> twice to come out from this output definition.
Press F12 to return to the Work with Definitions menu.
You have now reviewed the Output Definition we will use for splitting the Statement spooled file.
SpoolFlex Advanced Utilities Tutorial
28
Report Splitter Definition
The SpoolFlex Report Splitter tool (SFASPLIT) needs to know how to split the spooled file. This
information is stored in the Report Splitter Definition. Spooled pages can be split based on the value of data
changing in up to three different spool data fields (SDF).
From the Work with Definitions menu, select Report Splitter Definition and press <enter>.
Put 2 next to SAMPLE STMT SPLIT and press <enter>.
SpoolFlex Advanced Utilities Tutorial
29
Here we select the report to work with for splitting. SAMPLE STMTS SPLIT output definition tells the
program where to place the split files. Press <enter> to continue.
This screen shows that whenever STATEMENT NUMBER changes on the page, the split occurs.
Press <enter> to continue.
SpoolFlex Advanced Utilities Tutorial
30
On this screen you can exclude the last page, or any other page based on certain criteria, but we will not be
using these options in this exercise. Press <enter> to return to the list of existing definitions.
Press F12 until you return to the SpoolFlex Main menu.
You have now reviewed a Report Splitter Definition that splits apart a report into individual spooled files
based on the Statement Number.
SpoolFlex Advanced Utilities Tutorial
31
Split a Spooled File using the Report Splitter tool (SFASPLIT)
From the SpoolFlex Main Menu do the following:
Enter SFASPLIT on the Command Line and press F4 to prompt
Enter the following values into the Report Splitter API screen:
Report Splitter Name – SAMPLE STMT SPLIT
Combine selected spool files - *NO
Press <enter> to run this SFASPLIT command.
SpoolFlex Advanced Utilities Tutorial
32
Go to the Manage Spooled Files menu. Put SFOUTQ2 into the Output Queue field and press <enter>.
Notice the four new spooled files with Form Type = STMT01.
Notice that User Data attribute contains the statement number from the spooled file.
Press F11 twice to see the User Defined Data values.
Notice that User Defined Data 1 attribute contains the customer name from the spooled file.
Press F12 to return to the SpoolFlex Main menu.
You have now successfully split a spooled file and created individual files for each statement.
SpoolFlex Advanced Utilities Tutorial
33
Exercise 6 – Report Distribution
In this exercise you will:
Verify that Email is setup and working on your iSeries or AS/400
Re-create a sample Consolidated Balance report
Setup an Address Book Entry with your Email address
Email this report to your Email address as an Excel attachment
through a Report Distribution definition
Verify e-Mail is setup and working From the SpoolFlex Main Menu, select option 20 – Setup/Maintenance Menu.
Select option 2. Configure e-Mail and press <enter>.
Select option 3. Send Test eMail (Internal) and press <enter>.
*NOTE*: Make sure that To eMail Address, From eMail Address and From Name fields
have your email information filled in. Press <enter> to send an email.
If the test email is delivered to your email inbox, then everything is configured and is working properly. You
can now proceed with this exercise.
However, if you didn’t get your test email or you receive any errors, please call DRV Technical Support for
assistance at (678) 417-1521.
*NOTE*: If you don’t see your email in the Inbox, then check for it in the Junk E-mail folder.
*NOTE2*: For various reasons, sometimes the email may not appear in your inbox instantly.
Please allow a few minutes for your email to arrive before calling Technical Support.
SpoolFlex Advanced Utilities Tutorial
34
Create Sample Spooled files
During this exercise you will be using two output queues (SFOUTQ and SFOUTQ2) and one sample
spooled file. To ensure the two output queues contain the correct files, delete and re-create the sample spooled
files using the instructions below.
1) Clear output queues SFOUTQ and SFOUTQ2.
2) Re-create the sample spooled files by doing the following:
Go to the Manage Spooled Files menu and select SFOUTQ outque.
Press F6 to create the sample spooled files.
Check that you have a file with Form Type, CONBALANCE, in the SFOUTQ outque.
Press F12 to return to the SpoolFlex Main Menu.
SpoolFlex Advanced Utilities Tutorial
35
Report Distribution Setup
Setting up a Report Distribution may involve the following:
Define Address Book entries
Define Output Queue where the original spooled file will be located
Define Selection criteria for selecting the specific spooled file(s) to be distributed
Define Output definition that you might use for the file conversion
Define Report Distribution
If you have already added yourself and your email address to an Address Book, you may skip the
next section (Adding eMail address to Address Book).
Adding eMail address to an Address Book From SpoolFlex Main menu, select 6. Address Books and press <enter>.
SpoolFlex Advanced Utilities Tutorial
36
Put 2 next to *USERS and press <enter>.
If your AS/400 User Profile does not appear in this list, then press F6 to add it.
Otherwise put 2 to edit it, so you could verify your email address.
SpoolFlex Advanced Utilities Tutorial
37
If you are adding a new entry:
Enter your AS/400 User Profile in the Address Book Entry field, your name in the
Name field, and your email address in the eMail Address field. Press <enter> to save.
Your entry should now appear in the list.
Press F12 until you return to the SpoolFlex Main Menu.
SpoolFlex Advanced Utilities Tutorial
38
From the SpoolFlex Main Menu, select option 7. Report Distributions and press <enter>.
If SAMPLE CONBALANCE appears in the list, put 2 to edit it or press F6 to create it.
*NOTE*: If you used F6 to create, enter SAMPLE CONBALANCE into the
Report Distribution Name field and press <enter>.
SpoolFlex Advanced Utilities Tutorial
39
The Report Distribution definition needs to know what file(s) to pick up for processing. In this exercise we
are using the Consolidated Balance report in the SFOUTQ outque with the form type CONBALANCE.
Make sure the data in your screen looks the same as in the screen below.
*NOTE*: If your spooled file cannot be uniquely identified by the Form Type, Printer File Name
and/or User Data values, then you can create a Spooled File Selection definition
and use it in the Spooled File Selection Name field instead.
If your file’s type is SCS, then put *YES in the Standard Spooled File (SCS) field.
Otherwise, put *YES in the Contains Form overlay (ASCII, AFP, PCL) field.
Press <enter> to continue.
SpoolFlex Advanced Utilities Tutorial
40
In the After processing section, we need to specify what to do with the files after they get distributed.
Move Selected SPLFs to OUTQ Name field has several options:
NAME - will move the file(s) to the <name> outque
*SAME - will leave the file(s) in the original outque
*DELETE - will delete file(s) from the original outque
*NOTE*: While testing, you might want to use the *SAME option.
Spool Data Map Name field is optional unless you are going to split your report and/or use SDFs
in the report distribution screens.
Press <enter> to continue.
If this screen is blank, then press F6 to create a new entry.
Otherwise, put 2 next to the sequence 10 and press <enter> to continue.
SpoolFlex Advanced Utilities Tutorial
41
In this exercise we are going to email a complete Consolidated Balance report.
Set Distribute Complete Report field to *YES and Distribution Method field to *EML
Press <enter> to continue.
We will use an email address from an address book, so set the SpoolFlex Address Book field to*YES
Press <enter> to continue.
SpoolFlex Advanced Utilities Tutorial
42
In the Address Book field put *USERS and in the Constant Value field put an entry that has your email
address. Press <enter> to continue.
*NOTE*: You can do F4 to prompt for values in both fields.
The Output Definition field defaults to *DFTPDF (default PDF). You can enter your own output
definition instead. Put *DELETE into the Path Name field, so the program will not put a copy of the
document into any other folder (the last two fields are used by the Audit Trail module).
Press <enter> to continue
*NOTE*: You can Password Protect your PDF if you have the Advanced Security module.
SpoolFlex Advanced Utilities Tutorial
43
Press <enter> to continue.
Exception Handling screen is used if the address book doesn’t have the email address to distribute your
report.
Exception Output Queue Name NAME – create an exception outque for all your email exceptions
*SAME – keeps exception files in the original outque
*NONE – exception files are ignored and not saved
Exception SPLF Form Type new Form Type of all the exception files
SpoolFlex Advanced Utilities Tutorial
44
If you are distributing reports via Email, the email screen will come up at the end.
Email Subject - *FILNM is a default and its value is the document name from the output definition
you are using to convert your report with.
Email Message - this field is optional
Address Book Name - *USRDFT (by default information comes from the User Defaults menu)
Entry Value - *JOBUSR (by default value comes from either the User defaults or an address book)
Press <enter> to come out from the report distribution.
SpoolFlex Advanced Utilities Tutorial
45
To distribute your report from Work with Report Distribution screen, put D next to the
SAMPLE CONBALANCE and press <enter>.
All the parameter values for the Report Distribution default to *RDSDEF. This means the program will
retrieve these values from the Report Distribution Definition. Any of these values can be changed at the time
of execution by entering a valid value in place of the *RDSDEF. Press <enter> and the Consolidated
Balance Report will be converted to PDF and emailed to your email address.
Press F12 to return to the SpoolFlex Main Menu.
SpoolFlex Advanced Utilities Tutorial
46
Exercise 7 – Automate Report distribution using the Spool Sentry
In this exercise you will:
Re-create sample spooled files in SFOUTQ outque
Setup Spool Sentry – schedule jobs on certain days / times
automate Report Distribution (SFARDST)
Start Spool Sentry
Create Sample Spooled Files
During this exercise you will be using two output queues (SFOUTQ and SFOUTQ2) and one sample
spooled file. To ensure the two output queues contain the correct files, delete and re-create the sample
spooled files using the instructions below.
Clear output queues SFOUTQ and SFOUTQ2.
Go to Manage Spooled Files menu and press F6 to create sample reports.
You should see the following files in the SFOUTQ outq.
Press F12 to return to the SpoolFlex Main menu.
SpoolFlex Advanced Utilities Tutorial
47
Setup a Spool Sentry A Spool Sentry allows you to schedule your tasks. A task can be any AS/400 command or
a SpoolFlex command that can be stored in the Spool Sentry definition.
From the SpoolFlex Main menu select option 5. Spool Sentry and press <enter>.
*NOTE*: If the Subsystem Status is flashing NOT ACTIVE in red, then do F14 to start SFLEX subsystem.
This action should change the Subsystem Status to ACTIVE
and now your sentries are ready to run.
SpoolFlex Advanced Utilities Tutorial
48
Find the SAMPLE CONBAL sentry; enter 2 next to it and press <enter>.
This Spool Sentry is setup to run every Monday morning at 6am with the job name CONBAL. *NOTE*: SpoolFlex automatically appends “SF_” to the beginning of the job name,
so you will see SF_CONBAL in the list of active jobs.
Press <enter> to see the next screen.
SpoolFlex Advanced Utilities Tutorial
49
This spool sentry is setup to execute the Report Distribution command, SFARDST.
Put 2 next to sequence 10 and then press <enter> to continue.
Sequence 10 shows you that we are using the SFARDST command to run the SAMPLE CONBALANCE
report distribution.
*NOTE*: Press F4 in the “Command/API to execute” field to see a list of the Command/APIs
most often used in our software (we picked SFARDST for this example).
Next press F4 in the “Command/API parameters” field.
SpoolFlex Advanced Utilities Tutorial
50
“Report Distribution Name” parameter is blank when you first prompt the SFARDST command
and you need to enter a valid report distribution name in there.
The rest of the parameter values default to *RDSDEF. This means the program will retrieve these values
from your report distribution definition. Any of these values can be changed at the time of execution by
entering a valid value in place of the *RDSDEF.
Press <enter> a few times to save this Command/API in your sentry and go back out to the sentry menu.
SpoolFlex Advanced Utilities Tutorial
51
Start a Spool Sentry You can run a Spool Sentry two ways: Immediate or As Scheduled.
For Example: As Scheduled option could be used to run sentries at the end of the month
(if you choose this option, the sentry status will become SUBMITTED).
*NOTE*: You can start a sentry from the command line by executing the SFASTRSS command.
*NOTE2*: Make sure that Subsystem Status says ACTIVE (top left corner). If it is not, then do F14
(spool sentries cannot run without the SFLEX subsystem in the Active status)
The Spool Sentry needs to be in the READY status before you can start it.
If the SAMPLE CONBAL sentry is on HOLD,
then enter R next to it and press <enter> to Release it.
To start your sentry, enter S next to the SAMPLE CONBAL sentry and press <enter>.
SpoolFlex Advanced Utilities Tutorial
52
A screen will come up with a few options.
Immediate is the default option.
Press <enter> to start running your sentry.
If you press F5 to refresh, you may see the status change to ACTIVE,
and then to SUBMITTED when it’s done.
You should be getting an email from the report distribution shortly.
End a Spool Sentry You can end a Spool Sentry in one of the following ways:
Put E next to the Spool Sentry and press <enter>
Run SFAENDSS command directly from the command line
Specify a Stop Time in the Spool Sentry Definition
You have now successfully reviewed and executed the SpoolFlex Spool Sentry tool.
You have now completed the Spoolflex Advanced Utilities Tutorial.
If you have any questions, please contact Technical Support at [email protected]
You can call us at (678) 417-1521 and someone would be happy to assist you.