Previous Topic: CAKRINVC JCL

Next Topic: Invoice Example 1: Detail by ORD/Element/Qualifier/Modifier (Paged by Group)


Sample CAJREARL (CAKRINV1) Member for Invoice Example 1

This example uses CAJREARL member CAKRINV1 to generate a detail invoice using only data from the CCCTAB.

!
!     INVOICE EXAMPLE #1
!
!  THIS JOB ILLUSTRATES THE USE OF Earl TO PRINT RECORDS FROM
!  THE CHARGEBACK CCCTAB, DATABASE TO CREATE
!  INVOICES USING THE CAKRERL2 GET ROUTINE.
!
!  THIS IS A DETAIL INVOICE, SHOWING COUNT, UNITS, RATE AND CHARGE
!  FOR EACH ORDID/ELEMENT/QUALIFIER/MODIFIER, FOR EACH STRUCT3.
!
!  SORT ORDER IS VERSION, PERIOD, STRUCT1-STRUCT3, ORDID,
!  ELEMENT, QUALIFIER, MODIFIER.
!
!  PAGE BREAK IS BY STRUCT3, LINE BREAK IS BY ORD AND ELEMENT,
!  AND EACH LINE IS AN ORDID/ELEMENT/QUALIFIER/MODIFIER COMBINATION.
!
USER 'CA PMA Chargeback INVOICE EXAMPLE 1'
!
OPTION PRINTER = 132     NODUMP
!
 CBREC:    FILE CAKRERL2 RECORD=2000
 COPY CBDEF2
!
COPY CBGSA
!
COPY CBSET
!
REPORT 'DETAIL BY ORD/ELEMENT/QUALIFER/MODIFIER, PAGE BY GROUP'
TITLE 'VERSION='   PVERSION
TITLE 'PERIOD='    PPERIOD
TITLE 'DIVISION='   PSTRUCT1
TITLE 'DEPARTMENT='   PSTRUCT2
TITLE 'GROUP='   PSTRUCT3
NOTE
NOTE    SELECT ONLY TYPE 1 RECORDS AS THIS REPORT DOES NOT
NOTE    LIST BUDGETS OR DEBITS/CREDITS
NOTE
SELECT PTYPE = 1
CONTROL SKIP
        (PVERSION)
        (PPERIOD)
        (PSTRUCT1 )
        (PSTRUCT2 )
        (PSTRUCT3 ) SKIP
        (PORDID)
        (PELEMENT ) BREAK
         PQUAL
         PMODIFIER
         PRATE
         PFLAGS
         PTYPE
SET(D) PCNT= TCNT
SET(D) PUNITS=TUNITS
SET(D) PCHARGE = TCHARGE
NOTE
NOTE   SUPPRESS PRINTING CNT AND UNITS TOTALS ABOVE ELEMENT
NOTE   LEVEL AS THEY WOULD BE MEANINGLESS
NOTE
IF(T) &CTRLBREAK. = 1
   SET(T) PCNT = TCNT
   SET(T) PUNITS = TUNITS
ELSE
   SET(T) PCNT = 0
   SET(T) PUNITS = 0
   ENDIF
NOTE
NOTE   SUPPRESS PRINTING TOTALS ABOVE PAGE LEVEL
NOTE
IF(T) &CTRLBREAK. <= 3 THEN SET(T) PCHARGE = TCHARGE
ELSE SET(T) PCHARGE = 0 ENDIF
!
PRINT                 PORDID
                      PELEMENT
                      PQUAL
                      PMODIFIER
                     (PCNT)
                     (PUNITS)
                      PRATE
                     (PCHARGE)
END

All invoices have similar headings as described below.

A. CA PMA Chargeback INVOICE EXAMPLE 1 22/01/91 DETAIL BY ORD/ELEMENT/QUALIFER/MODIFIER, PAGE BY GROUP PAGE 1 B. C. VERSION= TESTCHAR D. } PERIOD= 1 E. } DIVISION= C MICRO } DEPARTMENT= F.E ORDERING G. GROUP= A DALLAS ----------------------------------------------------------------------------------------------------------------------------------

A.

Displays the invoice name.

B.

Displays the date the invoice was printed.

C.

Displays the invoice title.

D.

Displays the page number.

E.

Tells you the CA PMA Chargeback version used to generate the invoice.

F.

Tells you the period that the invoice covers.

G.

Displays the accounting structure and entity within the structure to which the invoice applies. In this case, it is for the A Dallas Group within the E Ordering Department, that is part of the C Micro Division. Accounting structure information is defined using CA PMA Chargeback's online Cbdefs facility. The structure and entity names are derived from the Accounting Structure, Accounting Sources and Accounting Sources Lookup tables.

Note: Information for each entity within the structure prints on a separate page.