ACT Defining the Complex-Level Ext. File Input Routine
The complex-level external file input routine contains the SAS code used to read the external data source. The routine is stored in the member ACTUfffI in sharedprefix.MICS.SOURCE, where "fff" is the last three characters of the external file name defined in the Complex-Level Ext. File Specifications Worksheet. It is invoked when external file charging is performed.
micsrm140cd
Coding Considerations
- The routine must be a valid SAS routine with no embedded DATA or PROC statements.
- The routine must either set YEAR, MONTH, ACTYEAR, and ACTMONTH or set ENDTS. If the routine does not set the YEAR, MONTH, ACTYEAR, and ACTMONTH variables, they will be derived from the ENDTS. This prevents inconsistencies between YEAR and MONTH compared to ACTYEAR and ACTMONTH which can cause problems with external file aging.
- The routine must set the variables SYSID and SUBSYSID if you are using system or subsystem algorithm qualification.
- The quantities to be used for charging must be read from the input file.
- The COSTCTR variables must be assigned. This can be done in your external file input routine or in sharedprefix.MICS.PARMS(COSTRTE). If you place the code in COSTRTE:
- All cost center assignments can be done by a centralized routine.
- You must test the variable ROUTINE for the value fffINPUT, where "fff" is the last three characters of the external file name. Code the following SAS statement in your input routine:%INCLUDE SHRPARMS(COSTRTE);
The following subsections contain a worksheet and example to help you write the complex-level external file input routine:
Complex-Level Ext. File Input Routine Worksheet
+----------------------------------------------------------------------------------------------------------+ | | |Date: ____/____/____ Administrator: ____________________________________________ | +----------------------------------------------------------------------------------------------------------+ COMPLEX-LEVEL EXTERNAL FILE INPUT ROUTINE WORKSHEET SAS Statements: ____________________________________________________________________________________________________________ ____________________________________________________________________________________________________________ ____________________________________________________________________________________________________________ ____________________________________________________________________________________________________________ ____________________________________________________________________________________________________________ ____________________________________________________________________________________________________________ ____________________________________________________________________________________________________________ ____________________________________________________________________________________________________________ ____________________________________________________________________________________________________________ ____________________________________________________________________________________________________________ ____________________________________________________________________________________________________________ ____________________________________________________________________________________________________________ _____________________________________________________________________________________________________________
Complex-Level Ext. File Input Routine Example
In the following Complex-Level External File Input Routine Example, 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);___________________ ___________________________________________________________ ___________________________________________________________ ___________________________________________________________ _____________________________________________________________