COMPILATION LISTING OF SEGMENT write_acct_bill Compiled by: Multics PL/I Compiler, Release 28d, of October 4, 1983 Compiled at: Honeywell Multics Op. - System M Compiled on: 09/18/84 1242.9 mst Tue Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 4* * * 5* * Copyright (c) 1972 by Massachusetts Institute of * 6* * Technology and Honeywell Information Systems, Inc. * 7* * * 8* *********************************************************** */ 9 10 11 write_acct_bill: proc; 12 13 /* This program writes a bill for each multics account. 14* It is a print pass over "reqfile", and is run after "charge_accts". 15* 16* inputs: 17* . "reqfile" per-account requisition info 18* 19* outputs: 20* . "bill" one page per account, showing project and account status 21* . "mailing_copy" same as bill, but with breaker page for mailing before each account 22* THVV 11/69 */ 23 /* Modified by C. Hornig June 1979 to center titles. */ 24 /* Modified Feb 1980 by M. B. Armstrong to remove invalid (and useless) call to get prices. */ 25 /* Modified 1984-08-01 BIM for some unaligned strings in the projfile. */ 26 27 dcl ec fixed bin (17), /* file-system error code */ 28 subacct_exit fixed bin, 29 (i, j, k) fixed bin (17), /* counters */ 30 oproj char (12) aligned, /* project names */ 31 (coxx, dpxx) char (4) aligned, /* junk args to "system_info_" */ 32 (cods, dpds) char (120) aligned, /* Comapny name & department name for header */ 33 dtemp char (8) aligned, /* ... */ 34 (rv, rb) char (15) aligned, /* ... */ 35 (yy (4), yz (4)) float bin (27), /* totals for summary page */ 36 open char (15) aligned internal static init (" open"), 37 month (12) char (12) aligned int static init 38 ("January", "February", "March", "April", "May", "June", "July", 39 "August", "September", "October", "November", "December"), 40 (mm, year) fixed bin (17), /* converted args */ 41 qp ptr, /* ptr to "reqfile" */ 42 bchr char (i) unal based (ap), /* pickup args */ 43 ap ptr, 44 dn char (168) aligned, 45 user_count fixed bin (17) init (0); /* number of users this proj */ 46 47 dcl (divide, length, null, rtrim) builtin; 48 49 dcl bill char (32) int static options (constant) aligned init ("bill"), /* Streamname on which bill is written */ 50 mc char (32) int static options (constant) init ("mailing_copy"); /* Streamname for mailing copy of bill */ 51 52 /* format statements */ 53 54 dcl l3 char (48) aligned int static options (constant) init 55 ("^-^-^-Multics ^a for the month of ^a, 19^d^/"), 56 xl1 char (72) int static options (constant) aligned init 57 ("^-^-^-The following charges have been billed to account no. ^a^/^/^/"), 58 xl2a char (90) aligned int static options (constant) init 59 ("^-^-^4xRequisition^8xCharge^10xRequisition^8xCharge^9xRequisition Termination"), 60 xl2b char (80) aligned int static options (constant) init 61 ("^-^14a or PO no.^8xthis month^6xAmount^13xthis req.^6xBalance^6xDate"), 62 xl3 char (60) aligned int static options (constant) init 63 ("^/^-^12a ^12a ^15a ^15a ^15a ^15a ^8a"), 64 dashx char (120) aligned int static options (constant) init 65 ("^/^------------- ------------^3x--------------^3x--------------^3x--------------^3x-------------- --------"); 66 67 /* procedures called by this program */ 68 69 dcl ioa_ entry options (variable), 70 ioa_$rsnnl entry options (variable), 71 get_wdir_ entry returns (char (168) aligned), 72 ioa_$ioa_stream entry options (variable), 73 system_info_$titles entry (char (*) aligned, char (*) aligned, char (*) aligned, char (*) aligned), 74 cu_$arg_ptr ext entry (fixed bin, ptr, fixed bin, fixed bin), 75 date_time_ ext entry (fixed bin (71), char (*) aligned), 76 cv_$mwvf ext entry (float bin (27)) returns (char (15) aligned), /* dollar converter */ 77 cv_dec_check_ entry (char (*) unal, fixed bin) returns (fixed bin), /* ASCII to binary */ 78 hcs_$initiate entry (char (*) aligned, char (*) aligned, char (*) aligned, 79 fixed bin (1), fixed bin (2), ptr, fixed bin), 80 hcs_$terminate_noname entry (ptr, fixed bin), 81 mailing_page_ entry (char (*), char (*), char (*)), 82 com_err_ entry options (variable); 83 1 1 /* Requisition file declaration */ 1 2 /* Modified BIM 1984-07-10 for unaligned strings */ 1 3 /* Modified BIM 1984-09-14 foor 3000 size-array */ 1 4 1 5 dcl 1 reqfile based (qp) aligned, /* MIT accounting data */ 1 6 2 nacts fixed, 1 7 2 version fixed bin, 1 8 2 pad (6) bit (36) aligned, 1 9 2 reqfiletab (3000), /* one entry per Multics account */ 1 10 /* same size as projfile */ 1 11 3 acctid char (12) unal, /* account id. usually same as Proj */ 1 12 3 mitacct char (12) unal, /* MIT account no. */ 1 13 3 reqno char (12) unal, /* requisition or PO no. */ 1 14 3 qflag char (8), /* class & activity */ 1 15 3 procssd fixed bin, /* temp for usage report */ 1 16 3 qdn fixed bin (71), /* date on for account */ 1 17 3 qdf fixed bin (71), /* date off */ 1 18 3 billing_name char (32) unal, /* where to send bill */ 1 19 3 billing_addr char (32) unal, 1 20 3 chg_mo float bin (63), /* charges this month */ 1 21 3 chg_tr float bin (63), /* charges this req */ 1 22 3 req_amt float bin (63), /* req face value */ 1 23 3 cutoff fixed bin (71); /* term date for req */ 1 24 1 25 dcl loqh int static fixed bin (17) init (8), /* length of reqfile head */ 1 26 loqe int static fixed bin (17) init (40); /* lth of reqfile entry */ 1 27 1 28 declare REQFILE_VERSION fixed bin init (2) int static options (constant); 1 29 1 30 /* End include file reqfile.incl.pl1 */ 84 85 86 /* ====================================================================================================== */ 87 88 call system_info_$titles (coxx, dpxx, cods, dpds); /* Get installation ID */ 89 90 call cu_$arg_ptr (1, ap, i, ec); /* get date */ 91 if ec ^= 0 then do; 92 aer: call com_err_ (0, "write_acct_bill", "argument error. mm yy"); 93 return; 94 end; 95 mm = cv_dec_check_ (bchr, ec); /* Convert month to binary. */ 96 if ec ^= 0 then go to aer; 97 if mm > 12 then go to aer; /* Check for legality. */ 98 call cu_$arg_ptr (2, ap, i, ec); /* Get second argument. */ 99 if ec ^= 0 then go to aer; 100 year = cv_dec_check_ (bchr, ec); /* Convert year to binary */ 101 if ec ^= 0 then go to aer; 102 if year < 69 then go to aer; /* Check. */ 103 104 call hcs_$initiate ((get_wdir_ ()), "reqfile", "", 0, 1, qp, ec); 105 if qp = null then do; 106 err: call com_err_ (ec, "write_acct_bill", "reqfile"); 107 return; 108 end; 109 110 oproj = ""; /* force subtotal */ 111 k = 0; 112 do i = 1 to reqfile.nacts; /* loop through reqfile */ 113 if qdf (i) ^= 0 then if chg_mo (i) = 0.0e0 then go to skipa; 114 if mitacct (i) = "nonbill" then go to skipa; 115 if acctid (i) = "" then go to skipa; /* ... */ 116 if oproj ^= mitacct (i) then do; /* If account changed, subtotal & head. */ 117 if oproj ^= "" then if k > 1 then do; 118 subacct_exit = 1; 119 go to subacct; 120 end; 121 subacct_ret1: yz (1), yz (2), yz (3), yz (4) = 0.0e0; /* Zero account totals. */ 122 call mailing_page_ (mc, billing_name (i), billing_addr (i)); 123 call ioa_$ioa_stream (bill, "^|^vx^a^/", 68 - divide (length (rtrim (cods)), 2, 17), cods); /* write headers */ 124 call ioa_$ioa_stream (bill, "^vx^a^/", 68 - divide (length (rtrim (dpds)), 2, 17), dpds); /* write headers */ 125 call ioa_$ioa_stream (bill, l3, "billing", month (mm), year); 126 call ioa_$ioa_stream (bill, "^-^-^-To: ^a; ^a^/", billing_name (i), billing_addr (i)); 127 call ioa_$ioa_stream (bill, xl1, mitacct (i)); 128 call ioa_$ioa_stream (bill, xl2a); 129 call ioa_$ioa_stream (bill, xl2b, "Project ID"); 130 call ioa_$ioa_stream (bill, dashx); 131 k = 0; /* count of reqs on acct */ 132 oproj = mitacct (i); 133 end; 134 k = k + 1; /* Count requisition. */ 135 yy (1) = chg_mo (i); /* Get charges this month. (just added this up) */ 136 yy (2) = req_amt (i); /* Get face amount of req. */ 137 yy (3) = chg_tr (i) + yy (1); /* Get charges this req. */ 138 yy (4) = yy (2) - yy (3); /* Compute balance. */ 139 if yy (2) = 0.0e0 then do; /* Check for OPEN balance. */ 140 yy (4) = 0.0e0; /* Yes. */ 141 rv, rb = open; 142 end; 143 else do; /* No. */ 144 rv = cv_$mwvf (yy (2)); 145 rb = cv_$mwvf (yy (4)); 146 end; 147 call date_time_ (cutoff (i), dtemp); 148 do j = 1 to 4; /* Add up account total. */ 149 yz (j) = yz (j) + yy (j); 150 end; 151 call ioa_$ioa_stream (bill, xl3, acctid (i), reqno (i), /* Write requisition line. */ 152 cv_$mwvf (yy (1)), rv, cv_$mwvf (yy (3)), rb, dtemp); 153 skipa: end; 154 subacct_exit = 2; 155 if k > 1 then go to subacct; /* last subtotal if necessary */ 156 subacct_ret2: 157 call ioa_ ("End of bill."); 158 159 call hcs_$terminate_noname (qp, ec); /* Terminate reqfile. */ 160 return; /* FINAL EXIT */ 161 162 /* - - - - - - - */ 163 164 /* This internal procedure does a subtotal for bills */ 165 166 subacct: call ioa_$ioa_stream (bill, dashx); /* Write dashes. */ 167 if yz (2) = 0.0e0 then rv, rb = open; /* Check for OPEN */ 168 else do; 169 rv = cv_$mwvf (yz (2)); 170 rb = cv_$mwvf (yz (4)); 171 end; 172 call ioa_$rsnnl ("^d projects", dn, j, k); 173 call ioa_$ioa_stream (bill, xl3, dn, "", cv_$mwvf (yz (1)), rv, 174 cv_$mwvf (yz (3)), rb, ""); 175 if subacct_exit = 1 then go to subacct_ret1; 176 else go to subacct_ret2; 177 end write_acct_bill; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 09/18/84 0802.8 write_acct_bill.pl1 >special_ldd>online>09/18/84>write_acct_bill.pl1 84 1 09/18/84 1000.6 reqfile.incl.pl1 >special_ldd>online>09/18/84>reqfile.incl.pl1 NAMES DECLARED IN THIS COMPILATION. IDENTIFIER OFFSET LOC STORAGE CLASS DATA TYPE ATTRIBUTES AND REFERENCES (* indicates a set context) NAMES DECLARED BY DECLARE STATEMENT. acctid 10 based char(12) array level 3 packed unaligned dcl 1-5 set ref 115 151* ap 000234 automatic pointer dcl 27 set ref 90* 95 98* 100 bchr based char unaligned dcl 27 set ref 95* 100* bill 000176 constant char(32) initial dcl 49 set ref 123* 124* 125* 126* 127* 128* 129* 130* 151* 166* 173* billing_addr 40 based char(32) array level 3 packed unaligned dcl 1-5 set ref 122* 126* billing_name 30 based char(32) array level 3 packed unaligned dcl 1-5 set ref 122* 126* chg_mo 50 based float bin(63) array level 3 dcl 1-5 ref 113 135 chg_tr 52 based float bin(63) array level 3 dcl 1-5 ref 137 cods 000112 automatic char(120) dcl 27 set ref 88* 123 123* com_err_ 000104 constant entry external dcl 69 ref 92 106 coxx 000110 automatic char(4) dcl 27 set ref 88* cu_$arg_ptr 000066 constant entry external dcl 69 ref 90 98 cutoff 56 based fixed bin(71,0) array level 3 dcl 1-5 set ref 147* cv_$mwvf 000072 constant entry external dcl 69 ref 144 145 151 151 151 151 169 170 173 173 173 173 cv_dec_check_ 000074 constant entry external dcl 69 ref 95 100 dashx 000000 constant char(120) initial dcl 54 set ref 130* 166* date_time_ 000070 constant entry external dcl 69 ref 147 divide builtin function dcl 47 ref 123 124 dn 000236 automatic char(168) dcl 27 set ref 172* 173* dpds 000150 automatic char(120) dcl 27 set ref 88* 124 124* dpxx 000111 automatic char(4) dcl 27 set ref 88* dtemp 000206 automatic char(8) dcl 27 set ref 147* 151* ec 000100 automatic fixed bin(17,0) dcl 27 set ref 90* 91 95* 96 98* 99 100* 101 104* 106* 159* get_wdir_ 000060 constant entry external dcl 69 ref 104 hcs_$initiate 000076 constant entry external dcl 69 ref 104 hcs_$terminate_noname 000100 constant entry external dcl 69 ref 159 i 000102 automatic fixed bin(17,0) dcl 27 set ref 90* 95 95 98* 100 100 112* 113 113 114 115 116 122 122 126 126 127 132 135 136 137 147 151 151* ioa_ 000054 constant entry external dcl 69 ref 156 ioa_$ioa_stream 000062 constant entry external dcl 69 ref 123 124 125 126 127 128 129 130 151 166 173 ioa_$rsnnl 000056 constant entry external dcl 69 ref 172 j 000103 automatic fixed bin(17,0) dcl 27 set ref 148* 149 149 149* 172* k 000104 automatic fixed bin(17,0) dcl 27 set ref 111* 117 131* 134* 134 155 172* l3 000152 constant char(48) initial dcl 54 set ref 125* length builtin function dcl 47 ref 123 124 mailing_page_ 000102 constant entry external dcl 69 ref 122 mc 000166 constant char(32) initial unaligned dcl 49 set ref 122* mitacct 13 based char(12) array level 3 packed unaligned dcl 1-5 set ref 114 116 127* 132 mm 000230 automatic fixed bin(17,0) dcl 27 set ref 95* 97 125 month 000010 internal static char(12) initial array dcl 27 set ref 125* nacts based fixed bin(17,0) level 2 dcl 1-5 ref 112 null builtin function dcl 47 ref 105 open 000206 constant char(15) initial dcl 27 ref 141 167 oproj 000105 automatic char(12) dcl 27 set ref 110* 116 117 132* qdf 26 based fixed bin(71,0) array level 3 dcl 1-5 ref 113 qp 000232 automatic pointer dcl 27 set ref 104* 105 112 113 113 114 115 116 122 122 126 126 127 132 135 136 137 147 151 151 159* rb 000214 automatic char(15) dcl 27 set ref 141* 145* 151* 167* 170* 173* req_amt 54 based float bin(63) array level 3 dcl 1-5 ref 136 reqfile based structure level 1 dcl 1-5 reqfiletab 10 based structure array level 2 dcl 1-5 reqno 16 based char(12) array level 3 packed unaligned dcl 1-5 set ref 151* rtrim builtin function dcl 47 ref 123 124 rv 000210 automatic char(15) dcl 27 set ref 141* 144* 151* 167* 169* 173* subacct_exit 000101 automatic fixed bin(17,0) dcl 27 set ref 118* 154* 175 system_info_$titles 000064 constant entry external dcl 69 ref 88 user_count 000310 automatic fixed bin(17,0) initial dcl 27 set ref 27* xl1 000130 constant char(72) initial dcl 54 set ref 127* xl2a 000101 constant char(90) initial dcl 54 set ref 128* xl2b 000055 constant char(80) initial dcl 54 set ref 129* xl3 000036 constant char(60) initial dcl 54 set ref 151* 173* year 000231 automatic fixed bin(17,0) dcl 27 set ref 100* 102 125* yy 000220 automatic float bin(27) array dcl 27 set ref 135* 136* 137* 137 138* 138 138 139 140* 144* 145* 149 151* 151* 151* 151* yz 000224 automatic float bin(27) array dcl 27 set ref 121* 121* 121* 121* 149* 149 167 169* 170* 173* 173* 173* 173* NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. REQFILE_VERSION internal static fixed bin(17,0) initial dcl 1-28 loqe internal static fixed bin(17,0) initial dcl 1-25 loqh internal static fixed bin(17,0) initial dcl 1-25 NAMES DECLARED BY EXPLICIT CONTEXT. aer 000370 constant label dcl 92 ref 96 97 99 101 102 err 000607 constant label dcl 106 skipa 001475 constant label dcl 153 ref 113 114 115 subacct 001534 constant label dcl 166 ref 119 155 subacct_ret1 000714 constant label dcl 121 ref 175 subacct_ret2 001504 constant label dcl 156 ref 176 write_acct_bill 000317 constant entry external dcl 11 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 2110 2216 1735 2120 Length 2440 1735 106 206 152 44 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME write_acct_bill 318 external procedure is an external procedure. STORAGE FOR INTERNAL STATIC VARIABLES. LOC IDENTIFIER BLOCK NAME 000010 month write_acct_bill STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME write_acct_bill 000100 ec write_acct_bill 000101 subacct_exit write_acct_bill 000102 i write_acct_bill 000103 j write_acct_bill 000104 k write_acct_bill 000105 oproj write_acct_bill 000110 coxx write_acct_bill 000111 dpxx write_acct_bill 000112 cods write_acct_bill 000150 dpds write_acct_bill 000206 dtemp write_acct_bill 000210 rv write_acct_bill 000214 rb write_acct_bill 000220 yy write_acct_bill 000224 yz write_acct_bill 000230 mm write_acct_bill 000231 year write_acct_bill 000232 qp write_acct_bill 000234 ap write_acct_bill 000236 dn write_acct_bill 000310 user_count write_acct_bill THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc call_ext_out return ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. com_err_ cu_$arg_ptr cv_$mwvf cv_dec_check_ date_time_ get_wdir_ hcs_$initiate hcs_$terminate_noname ioa_ ioa_$ioa_stream ioa_$rsnnl mailing_page_ system_info_$titles NO EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 11 000316 27 000324 88 000325 90 000347 91 000366 92 000370 93 000424 95 000425 96 000450 97 000452 98 000455 99 000474 100 000476 101 000521 102 000523 104 000526 105 000603 106 000607 107 000636 110 000637 111 000642 112 000643 113 000653 114 000663 115 000671 116 000676 117 000702 118 000711 119 000713 121 000714 122 000721 123 000744 124 001014 125 001061 126 001116 127 001152 128 001175 129 001212 130 001237 131 001254 132 001255 134 001265 135 001266 136 001273 137 001275 138 001300 139 001303 140 001306 141 001310 142 001324 144 001325 145 001336 147 001347 148 001366 149 001373 150 001377 151 001401 153 001475 154 001477 155 001501 156 001504 159 001522 160 001533 166 001534 167 001551 169 001570 170 001601 172 001612 173 001642 175 001731 176 001734 ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved