ACT Defining the User Invoice Format Exit
The standard invoice format routine presents a logical invoice page for each unique cost center and offers three summarization levels and several line-item formats. If none of these standard formats meet your requirements, you may develop your own invoice format routine and have it invoked automatically for the appropriate cost centers (or as the default).
rm
User format invoices will be printed after any invoices using the standard format facilities. A Grand Total page will be printed for each set of invoices using the same user format.
Your invoice format routine(s) must reside in a member named sharedprefix.MICS.SOURCE(USRnnnnn), where nnnnn are any characters.
You can use Cost Center Attributes Invoice Options to associate the format name with particular invoice level cost centers. Or you can specify the format name as the default format on the Invoice Format Options panel.
If your format closely resembles one of the standard formats, follow the instructions below under Modifying the Standard Format Routine. Otherwise, follow the instructions under Creating a New Format Routine. In either case, complete the checklist under Steps to Define the User Invoice Format Exit.
Modifying the Standard Format Routine
Copy the standard format routine from SOURCE(MNACTRPT) to your USR routine. Make the necessary modifications, but do not change any of the SET statements which input the INVOICE work files. Make as few modifications to the standard routine as possible.
Specify the name of any defined invoice format in the "Name of model invoice format" field on the Format Options for User Invoices panel. This will cause the standard work file routines to be invoked to perform the necessary summarization. The format options associated with the model format will be used to print your user invoice.
Creating a New Format Routine
Create your USR routine as an independent SAS data step. It should input the SAS data set named WORK.USRDATA and print the records in the desired format.
The records in the WORK.USRDATA data set contain the Financial Recap File data elements plus Year-to-Date Financial Recap File data elements (resulting from a SAS merge). The records also contain invoicing cost centers, named INVCTRn, which indicate the cost center to which this record should be invoiced (as indicated in the Cost Center Attributes). The data set is sorted in cost center (COSTCTR1...COSTCTRn) order only.
The format routine does not have to perform any subsetting of the input data set. This data set will contain only the records for the cost centers for which this invoice format was specified in the Cost Center Attributes file (or for all cost centers for which another invoice format was NOT specified in the event this format was defined as the default). However, the input data set may contain data for multiple cost centers and the format routine will have to identify and correctly process cost center changes. Using the variables FIRST. and LAST. will likely help.
Steps to Define the User Invoice Format Exit
Follow the steps in this checklist to define the user invoice format exit. The Financial Recap File is the basis for the input to the format routine.
- Use MWF;4;2;3;2;5 to display the Invoice Format Options Panel. Use the R line command to repeat the USER format and display the Format Options for User Invoices panel. Specify the Format name and description, and the name of the user-written format routine. The format routine name must begin with USR.If you are modeling the invoice after an existing standard invoice format, fill in the format name, COMPCODE, INVCCAT, or COSTCTR, in the "Name of model invoice format" field. If you are not modeling the invoice after an existing standard invoice format, leave the "Name of model invoice format" field blank.If this user format will be used to print all or most of your invoices, enter its name in the "Default format" field at the top of the Invoice Format Options panel. Otherwise, follow step 2 below to specify the cost centers whose invoices are to be printed with this user format.END back to the Parameter Specification and Generation Menu and submit the ACTXOPTS job when requested.
- Access the Invoice Options Cost Center Selection panel (MWF;4;2;1;1;2). For each cost center to which the special format applies, enter the appropriate format name in the format column.
- Code the invoice format exit routine in sharedprefix.MICS.SOURCE(USRnnnnn) and test it thoroughly.
- Create a copy of the new invoice format routine in IEBUPDTE format and save it in the sharedprefix.MICS.LOCALMOD.CNTL library as an audit trail.