This function can be used, if pages in a spooled file should be rearranged and sorted by one or more key values found inside.
The function can e.g. be used prior to an overlay merge.
Enter Menu point 5. Sort Definitions on the menu With 5. Work Auto Forms Control. The following screen will appear:
Work with Sort Definitions SOR300D
Start with . . . . . __________
Type option, Press Enter. 2=Change 3=Copy 4=Delete 5=Display
Opt Name Description (No Sort definitions - F6 to create)
End F3=Exit F5=Refresh F6=Add F12=Cancel
|
Press F6 to create a new sorter definition.
One sorter definition is specific for one type of print job, and can be referred to by any number of queues defined in AutoFormsControl.
Update Sort Definition SOR310D
Definition name . . . . : PETER
Description . . . . . . . Sort IF400DEMO
Insert separator page before start of new group . . . . *YES *NO, *YES
Insert separator page if break in sort field no . . 1 1-6
F3=Exit F12=Cancel
|
Definition name
This name will be referred to by the AFC function D=Sort Spooled File (hidden).
Insert Pages before start of new group
Stating *YES will produce an extra page in the sorted spool entry with the text SEPARATOR PAGE inserted between each sorted group within the resulting spool entry. The page will include the character string which met the sort criteria.
Insert separator page if break in sort field no.
This option defines the detail level for insertion of the separator page, e.g. stating 3 will insert a separator page if one or more characters changes within any of the intervals defined in sort field number 1 to 3. The separator page will additionally list the contents of each sort field.
Pressing Enter will bring up the following screen:
Work with Sort Definition Details SOR320D
Definition name . . . . : PETER
Start with . . . . . ____
Type option, Press Enter. 2=Change 3=Copy 4=Delete 5=Display
Opt Seqnbr. Description (No sort definition details - F6 to create)
End F3=Exit F5=Refresh F6=Add F12=Cancel
|
Press F6 to create a new definition.
More definitions can be created but is only relevant if the Page Selection criteria is used.
Create Sort Definition Details SOR330D
Definition name . . . . : DEMO
Sequence number . . . . . __1 Description . . . . . . . Sort_by_Customer_ID__________
Page selection criteria
Print line Position Oper Compare value ___ ___ - ___ ____ _______________________________ ___ ___ - ___ ____ _______________________________ ___ ___ - ___ ____ _______________________________
Find sort fields in the following positions Sort field no. Print line Position Ascending/Descending 1 ___ ___ - ___ _ (A D) 2 ___ ___ - ___ _ (A D) 3 ___ ___ - ___ _ (A D) 4 ___ ___ - ___ _ (A D) 5 ___ ___ - ___ _ (A D) 6 ___ ___ - ___ _ (A D) F3=Exit F12=Cancel F13=Select spooled file F18=DSPSPLF
|
The functionality of F13 and F18 is described for the split defintion.
The page selection criteria should only be used if the same spooled file contains more than one page layout.
This could be the case if a spool entry contains invoices and credit notes, and the customer ID, intended for use as sort field, is placed in different line/column positions on the invoices than on the credit notes. In this case you should create two Sort Definition Details, where one compare with the text INVOICE and the other with CREDIT NOTE, and each has its own specification for the customer ID sort field.
If some of the invoices consisted of several pages of which only the first page indicate INVOICE, the successive pages will automatically follow the first page of the invoice. That means pages which are not recognized by any Page Selection criteria will in the final sort automatically succeed the last recognized page.
Print Line
The print line in the spool entry to search.
Position
The column interval to search
Oper
The operator relating to the compare value.
The operators used are standard operators known from e.g. Query/400:
EQ |
Equal to compare value |
NE |
Not equal to compare value |
LT |
Less than compare value |
LE |
Less than or equal to compare value |
GT |
Greater than compare value |
GE |
Greater than or equal to compare value |
Compare value
The character string or numeric value which the operator should compare with. No delimiters are used. The comparison is in reality done on hexadecimal values. This means that e.g. the figure 1 which has EBCDIC value F1h is greater than the character Z which has EBCDIC value E9h.
Find sort fields in the following positions
The Sort fields indicate the detail level of the sort process. Pages will be sorted in the same order as the sort fields. Sort field no.1 is the most significant for the sort.
Print Line
The print line in the spool entry to search.
Position
The column interval to search.
Ascending/decending
Select the way you want to order this sorting field. If you leave it blank, it will default to ascending.
The following makes use of the demo spool entry delivered with InterForm400®. You can print this from the menu 12. Service Functions.
On all pages the Customer ID is always four digits found in line 13 position 57 - 60:
Display Spooled File File . . . . . : QPRINT Page/Line 1/3 Control . . . . . Columns 1 - 78 Find . . . . . . *...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+... 1 Herring Marine Research Seaweed Street 14 9000 Battleaxe DK-Denmark --------------------- Att: Martin Merman 1004/PDC.20-02-2008 Re. Your new InterForm400 modules. ---------------------------------- Congratulations with your new InterForm400 module(s). You are now able to fully exploit the benifits of combining InterForm400 with one or more of the powerful modules to impress your customers and ease the workflow in your organisation. The following license code(s) will be needed to activate the module(s) permanently to your System(s): More... F3=Exit F12=Cancel F19=Left F20=Right F24=More keys
|
The distinction between Document Management and Modules letters is the text “Document” or “modules.” which can be located on each page in line 15 position 34 - 41.
Note that we must compare the same number of characters, which is the reason why we check for “modules.” (Including the “.”) in order to match the length of the word “Document”.
Display Spooled File File . . . . . : QPRINT Page/Line 3/15 Control . . . . . +1 Columns 1 - 78 Find . . . . . . *...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+... Re. Your new InterForm400 Document Management System. ----------------------------------------------------- Congratulations with your new InterForm400 software. InterForm400 will enable you to print Electronic Forms and perform advanced data remapping and copy management of your existing SCS print data. InterForm 400 exploits the advanced features of standard HP-PCL printers and is the chosen document management solution for over 2000 installations. The following license code(s) will be needed to activate InterForm400 permanently to your system(s): Product Model i-Group Serial No. License Code ---------------------------------------------------------------- InterForm400 515 i050 4449079 F2 E7 20 AA InterForm400 810 i100 44B2031 AA BB 01 23 InterForm400 890 i600 44D3971 1A BC DE 44 InterForm400 520 i100 44A1460 79 10 22 F1 More... F3=Exit F12=Cancel F19=Left F20=Right F24=More keys
|
Example 1. Sort by Type, “Document" letters first:
A sort definition could monitor the field with the text “Document” or “modules.”. The spool entry would then be sorted with all the Document letters first followed by the modules letters. Document letters will appear before modules letters in the resulting printout, as the sort is done alphabetically on the contents of the sort fields - with ascending (A) sort sequence..
Find sort fields in the following positions
Sort field no. Print line Position Ascending/Descending
1 _15 _34 - _41 A
2 ___ ___ - ___ _
Example 2. Sort by Type, “modules.” letters first:
To reverse the sequence of the letters compared to above we can just state the sequence to be Descending:
Find sort fields in the following positions
Sort field no. Print line Position Ascending/Descending
1 _15 _34 - _41 D
2 ___ ___ - ___ _
Example 3. Sort by Type and Customer ID:
To increase the detail level of the search we could have the groups of Document and modules letters sorted according to Customer ID. This would also be necessary if some of the letters consisted of more than 1 page, where page 2 and succeeding pages only indicate the customer ID, but not “Document” or “modules.”.
We add an extra sort definition, where we search for the customer ID:
Find sort fields in the following positions
Sort field no. Print line Position Ascending/Descending
1 _15 _34 - _41 A
2 _13 _57 - _60 A
Example 4. Sort by Customer ID and type:
Another approach could be to sort by customer ID’s first and then by the type being “Document” or “modules.”. This is achieved by reversing the order of the sort fields from the previous example:
Find sort fields in the following positions
Sort field no. Print line Position Ascending/Descending
1 _13 _57 - _60 A
2 _15 _34 - _41 A
In an AFC definition we can activate the sort definition SORTDEMO, by using function B:
Update AFC-functions attached to output queues AFC305D
Queue: AFC_INPUT2 Library: APF3812
Seqnbr F. Formtyp Save Jobname Filename Device file Program UserData
(No functions defined)
Seqnbr Function 1,0 D Sort Spooled File
Sort definition name . . . . . . SORTDEMO Outque for sorted print . . . . *INPUT Library . . . . . . . . . . . __________ Form type . . . . . . . . . . . SORTDONE
F3=Exit F12=Cancel
|
This will cause the demo spool entry to have pages sorted into another SCS spool entry with form type SORTDONE is created and placed after the original spool entry in the same queue.
We can now merge the new spool entry with an overlay conditioned by the Form Type SORTDONE or by using an Overlay Selector:
Update AFC-functions attached to output queues AFC305D
Queue: AFC_INPUT2 Library: APF3812
Seqnbr F. Formtyp Save Jobname Filename Device file Program UserData 0001 D DEMO Sort, def: SORTDEMO outq *DEFAULT &form type: SORTDONE
Seqnbr Function Attributtes of input file for which to execute the function 2,0 1 Form type . . . . . . . . . . . . . . SORTDONE Save attribute . . . . . . . . . . . . _ Jobname . . . . . . . . . . . . . . . __________ Spooled file name . . . . . . . . . . __________ Device file . . . . . . . . . . . . . __________ Library . . . . . . . . . . . . . . __________ Program that opened file . . . . . . . __________ Library . . . . . . . . . . . . . . __________ User-specified data . . . . . . . . . __________ F3=Exit F13=Fold/Unfold F12=Cancel
|
Update AFC-functions attached to output queues AFC305D
Queue: AFC_INPUT2 Library: APF3812
Seqnbr F. Formtyp Save Jobname Filename Device file Program UserData 0001 D DEMO Sort, def: SORTDEMO outq *DEFAULT &form type: SORTDONE
Seqnbr Function 2,0 1 Merge with overlay
Output queue for merged print . *DEFAULT Library . . . . . . . . . . . __________ Printer type . . . . . . . . . . __________ Unicode output . . . . . . . . . *INPUT *INPUT, *YES Merge overprint lines . . . . . *NO *NO, *YES Find overlay in form type table _ (Y N)
F3=Exit F13=Fold/Unfold F12=Cancel
|
The Sorted spool entry from example 4, including a definition of insertion of a separator page if break in sort field number 2 would look like this:
DISPLAY SPOOL FILE File . . . . . : QPRINT Page/Line 1/1 Function . . . . Columns 1 - 78 Search for . . . *...+....1....+....2....+....3....+....4....+....5....+....6....+....7... ** SEPERATOR PAGE ** 1001 modules. Florence Flowers Tulip Road 16 4000 Marigold DK-Denmark --------------------- Att: Susan Sunflower 1001/PDC.20-02-2008 Re. Your new InterForm400 modules. ---------------------------------- Congratulations with your new InterForm400 module(s). You are now able to fully exploit the benifits of combining InterForm400 with one or more of the powerful modules to impress your customers and ease the workflow in your organisation. F3=Exit F12=Cancel F19=Left F20=Right F24=More keys
|
TIP: You can use the sort selection criteria that is included on the separator page (in this example 1001 or InterForm400®) to have an overlay selector pick an overlay that prints the separator page to be with a special overlay or from another drawer, e.g. with coloured paper.