4. CUSTOMIZATION › 4.4 Accounting for Complex-Level External Files › 4.4.2 Defining the Complex-Level Ext. File Input Routine › 4.4.2.2 Complex-Level Ext. File Input Routine Example
4.4.2.2 Complex-Level Ext. File Input Routine Example
In the example in Figure 4-38, the values of COSTCTR1
(Department) and COSTCTR2 (Project) are set from the OWNER
input field. COSTCTR3 is always blank. The tape creation
date is read into the variable CDATE, from which YEAR and
MONTH are computed. The tape expiration date is read into
the variable EXPDT. The number of tapes to be charged is in
the variable UTPTAPE. The first three characters of any
element in the quantity field must start with the file
identifier UTP. The ENDTS variable is built from the MONTH
and YEAR to provide the time stamp for the Special Accounting
Dates feature.
_____________________________________________________________
+-----------------------------------------------------------+
| Date: __/__/__ Administrator: _________ |
+-----------------------------------------------------------+
___INFILE INPUTACT;________________________________________
___INPUT @10 OWNER $CHAR6._________________________________
_________@20 VOLSER $CHAR6.________________________________
_________@30 CDATE PIB4.__________________________________
_________@40 EXPDT PIB4.__________________________________
_________@50 UTPTAPE 8.;___________________________________
___COSTCTR1 = SUBSTR(OWNER,1,1);___________________________
___COSTCTR2 = SUBSTR(OWNER,4,3);___________________________
___COSTCTR3 = ' ';_________________________________________
___CDATE = PUT(CDATE,$DATE.);______________________________
___YEAR = YEAR(CDATE)-1900;________________________________
___MONTH = MONTH(CDATE);___________________________________
__/* If you are using the Special Accounting Dates: */____
__/* Optionally assign a value to the ENDTS variable.*/____
__/* Otherwise the default system date will be used. */____
___________________________________________________________
__ENDTS = DHMS(MDY(MONTH,1,YEAR),0,0,0);___________________
___________________________________________________________
___________________________________________________________
___________________________________________________________
_____________________________________________________________
Figure 4-38. Complex-Level External File Input Routine Example