An Auto Forms Control (AFC) template can be explained as a common list of AFC functions, that should be considered for multiple output queues. This means, that if you have multiple printers (or output queues), that should react in the same manner, then you should consider to use one or more AFC templates.You can compare an AFC template with a suboverlay for overlays: Use this to reuse definitions for multiple output queues.
Things to notice for the AFC templates:
1.Only one level of templates is allowed i.e. one template cannot include another template.
2.You can define multiple templates.
3.The monitor job for a template does not need to run, so the auto start option should normally be 'N'.
4.In order to select a dynamic printer for the merge you should select *DEFAULT as the target output queue in the template.
5.If you use AFC functions e.g. finish definitions, that should be handled on the same output queue, then you need to specify *INPUT as the new output queue, for the output queue - just be sure, that you are not creating a loop, where the processed spooled files are triggering the same AFC function again.
6.The header settings for the template output queue is not used for any output queue, that is referring to the template.
7.If you add, change or delete AFC functions for the AFC template, then you need to stop and start the AFC jobs referring to the template before the changes become active.
8.It is possible to combine special exceptions for an output queue, that can override the common definitions in the referred template as the specific output queue are executed prior to the definitions in the template.
This video explains how to use AFC templates:
You are not totally locked, if you use AFC templates as this video explains:
Before you can add an AFC template you need to create an output queue with the same name. One suggestion is to simply name it: TEMPLATE.
You can create the output queue with the command:
CRTOUTQ QUSRSYS/TEMPLATE
- to create it in library, QUSRSYS.
Now go into Auto Forms Control with options:
5. Work with Auto Forms Control
1. Functions attached to Output Queues
- and press F6=Create to add a new output queue:
Add Auto Forms Control Definition AFC302D
Output queue . . . . . . : TEMPLATE Library . . . . . . . : QUSRSYS
Type choices and then press Enter. Press F3 or F12 to exit. Description . . . . . . . . General AFC functions for most printers Autostart job . . . . . . . N (Y N) Code page . . . . . . . . . *SYSVAL Number, *SYSVAL F4=List When to use code page . . *SPLFATR *SPLFATR, *ALWAYS Default output output queue and printer type Output queue . . . . . . . . TEMPLATE Name, *WINPRINT Library . . . . . . . . . QUSRSYS Printer type . . . . . . . . HP4500
Optional template AFC-definition to be executed after this definition Template AFC-definition: Output queue . . . . . . . . Library . . . . . . . . . Signature pad used by jobs in this output queue. Sign pad . . . . . . . . . . F4=List F3=Exit F4=Prompt F10=Additional parameters F12=Cancel
|
Normally the template should not be used for anything (even though it can if you want to), and if that is the case, then you can use these values:
Autostart job: N
Output queue and printer type are irrelevant, but you can refer to the current output queue to point out, that this outq is special.
The template option in the bottom must be left blank.
When you add functions to the template you need to remember to refer to generic output queues (unless you really want them to be fixed) like below:
For function 1 = Merge with overlay you should refer to *DEFAULT for the target output queue and printer type like below:
Update AFC-functions attached to output queues AFC305D
Queue: TEMPLATE Library: QUSRSYS
Seqnbr F. Form type Save Jobname Filename Dev.file Program UserData 0001 D Demo Sort, def: SORT outq *INPUT &form type: Sort 0002 1 Sort Merge, Overlay: IF400DEMO Fileset: SAMPLE 0003 N PDF Name Def.: PDF Overlay: IF400DEMO Fileset: SAMPLE 0004 1 DEMO Merge, Overlay: IF400DEMO Fileset: SAMPLE + Seqnbr Function 4,0 1 Merge with overlay
Output queue for merged print . *DEFAULT Name, *DEFAULT, *USER Library . . . . . . . . . . . Printer type . . . . . . . . . . Unicode output . . . . . . . . . *INPUT *INPUT, *YES Merge overprint lines . . . . . *NO *NO, *YES Find overlay in form type table N (Y N)
F3=Exit F13=Fold/Unfold F11=Delete F12=Cancel
|
For finish definitions, sort and split you should consider *INPUT as the target output queue - remember to verify, that you are not creating a loop.
It is very simple to refer to an existing AFC template for each printer, you just refer to the template in the bottom of the definition:
Update Auto Forms Control Definition AFC302D
Output queue . . . . . . : PRT01_IN Library . . . . . . . : QUSRSYS
Type choices and then press Enter. Press F3 or F12 to exit. Description . . . . . . . . Sales Department Autostart job . . . . . . . Y (Y N) Code page . . . . . . . . . 1141 Number, *SYSVAL F4=List When to use code page . . *SPLFATR *SPLFATR, *ALWAYS Default output output queue and printer type Output queue . . . . . . . . PRT01 Name, *WINPRINT Library . . . . . . . . . QUSRSYS Printer type . . . . . . . . HP4D
Optional template AFC-definition to be executed after this definition Template AFC-definition: Output queue . . . . . . . . TEMPLATE Library . . . . . . . . . QUSRSYS Signature pad used by jobs in this output queue. Sign pad . . . . . . . . . . F4=List F3=Exit F4=Prompt F10=Additional parameters F12=Cancel
|
- and the list of functions can normally be empty:
Update AFC-functions attached to output queues AFC305D
Queue: PRT01_IN Library: QUSRSYS
Seqnbr F. Form type Save Jobname Filename Dev.file Program UserData
(No functions defined)
Seqnbr Function Suspend
F3=Exit F5=Service F13=Fold/Unfold F15=Subset F17=Subset by Spooled File
|
It is possible to override definitions in the template on specific output queues. The trick is, that any functions, that are added to the specific output queue in Auto Forms Control will be executed before the AFC template definitions, so you simply add them in the normal list of functions:
Update AFC-functions attached to output queues AFC305D
Queue: PRT02_IN Library: QUSRSYS
Seqnbr F. Form type Save Jobname Filename Dev.file Program UserData 0001 1 Demo Merge, Overlay: IF400DEMO2 Fileset: SAMPLE 0002 6 Demo Hold Spooled File 0003 9 Demo Exit
Seqnbr Function Suspend
F3=Exit F5=Service F13=Fold/Unfold F15=Subset F17=Subset by Spooled File
|
In the example above we want to merge with the overlay, IF400DEMO2 instead of the normal overlay that is defined in the AFC template used for the same output queue.
After the merge we hold the original spooled file and end with the function 9=Exit to ignore any definitions in the template for the spooled files with the form type Demo.