update_int_log: update_interrupt_log: uil: proc; /* error report file beast */ /* ************************************************************************************** */ /* Initially coded by Hannigan, Berglund, Adleman during initial installation phase of AFDSC Multics system. This is now and always has been an installation maintained program. 12/02/74 -- modified minutely by DRM (D. R. Mengel) to allow for both a CRN (crash no. entry) and an ERF (error report form number entry). 06/13/75 -- modified by Warren Johnson to remove calls to obsolete procedures, generally clean up the code, to insert \006 between entries for different days, and to print last valid ERF. 79-05-21 Modified by DRM to reflect interrupt_log status rather than crash file status. Put into service at the University of Calgary, using the following path names: >udd>SysMaint>lib>changes>info>int_log.info >udd>SysMaint>lib>s>update_interrupt_log.pl1 (addname uil.pl1) >udd>SysMaint>lib>update_interrupt_log (addname uil) 80-03-14 Modified by B. P. Heidrick (U of C) to make data entry more convenient . Modified 'desc' from 70 to 120 chars but, desc will always be trimmed to 70 chars or less. Added 'extra_desc' it contains the overflow words that exceed the 70 char limit of 'desc'. The 'extra_desc' is added to the beginning of the next line of 'desc". 80-05-08 Modified by B. P. Heidrick (U of C) to change the formatting of the entries when requested to verify the contents of the entry. 80-07-04 Modified by B. P. Heidrick (U of C) to show last interrupt information before asking if updating required. 80-07-04 Modified by B. P. Heidrick (U of C) to create a new int_log.info segment when it is designated as full. The full int_log.info segment will have its' name changed to int_log.yymmdd.info and a new int_log.info segment will be created. The new int_log.info segment will have the same header information as the full int_log.info segment had. The interrupt log legend will also be added to the segment upon creation. 80-07-09 Modified by B. P. Heidrick (U of C) to have the program automatically terminate the int_log.info every quarter. Termination will be made upon the first entry of an interrupt on the following months: Jan, Apr, Jul, Oct. 81-02-11 Modified by B. P. Heidrick (U of C) Several modifications made to the original int_log program: 1. Replaced 'ask' with 'request','request$prompt','request$word_trim'. 2. Add create_log,unlock entry points. The create_log creates an initial segment with pr#000, current date, header information, and the legend. 3. Added locking process, where only one person may use the int_log.info segment at once. It can be forceable unlocked with the 'unlock' entry. 4. Changed 'down time' entry to request the date/time of when the system was returned for user service. The down time is then calculated from the crash time and the returned time. 5. Dates converted from mm/dd/yy to yy-mm-dd. 6. Interrupts may now be edited in any order. Once a new interrupt number is selected the whole scratch file is copied to the int_log.info. The file is then fully updated before going to the next interrupt numbers' processing. 82-02-19 Modified by D. A. Fudge (U of C) to delete request, request$word_, trim, and request$prompt. Using create_log with quarter_term to create a new int_log.info segment quarterly, acls are copied to the new int_log.info. Use of format_document_$string for trimming the input. Clean_up conditions installed. The edit section now allows more than one line of input to the desc and anal. Check of system down time, if down more than 4 hours all input is entered. Info segment int_log.info changed to int_log.yy-mm-dd.info on quarterly termination. */ %include whotab; dcl opr char (8); /* operator initials */ dcl more_desc char (5); /* header for continued description line */ dcl more_anal char (5); /* header for analysis lines */ dcl datex char (10); /* date of crash */ dcl timex char (7); /* time of report input from user */ dcl lost_time char (5); dcl hrs_lost pic "z9"; dcl min_lost pic "99"; dcl type char (15); /* type of report; set internally */ dcl erf char (5); /* erf no. associated with crash */ dcl last_erf char (5) init ("-----"); /* last meaningful ERF in File */ dcl desc char (120) init (""); /* description of crash */ dcl desc_out char (120) init (""); dcl extra_desc char (50) init (""); /* overflow of max 70 char crash description */ dcl desc_lines fixed bin init (1);/* number of lines of description */ dcl desc_line (100) char (70) init ((100) ("")); /* actual description lines */ dcl system_returned fixed bin (71) init (0); /* when system returned */ dcl crash_time fixed bin (71) init (0); /* crash time */ dcl return_date char (8) init ("00-00-00"); /* return date in chars */ dcl return_time char (5) init ("00:00"); /* return time */ dcl lost char (5); dcl (lost_hrs, lost_minutes) fixed bin; dcl len fixed bin (17); /* length of line */ dcl line char (158); /* line put together by ioa_ */ dcl edit_cmd char (120); /* edit command */ dcl flag fixed binary (17); /* indicates entry point */ dcl err_flag fixed bin; /* error code for request */ dcl crash_num pic "999"; /* error report numbers */ dcl crash_temp pic "zzz9"; /* temp crash number */ dcl whoptr ptr init (null); /* pointer to whotable */ dcl sptr ptr init (null); /* scratch pointer */ dcl erptr ptr init (null); /* error file pointer */ dcl er_num char (3) based; dcl tempchr char (12); /* temp area for cv_bin_$dec */ dcl xtempchr char (24); dcl move_ char (1048576) based; /* template */ dcl escape_six char (1); /* octal 006 character */ dcl temp_chr char (4); /* temp holder */ dcl dir char (168) internal static init (">am>info"); /* SITE DEPENDENT DIR CONTAINING "int_log.info" SEG */ dcl count fixed bin (17); /* file size in characters */ dcl (i, ie, is, istemp, ietemp) fixed bin (17) init (0); /* index */ dcl (j, k) fixed bin; dcl bc fixed bin (24); /* bit count */ dcl month fixed bin; /* current month */ dcl command_list char (240) init (""); /* edit command list */ dcl command fixed bin init (0);/* command index */ dcl code fixed bin (35); /* error code */ dcl clock_ entry returns (fixed bin (71)); dcl convert_date_to_binary_ entry (char (*), fixed bin (71), fixed bin (35)); /* convert dates to Binary */ dcl date_time_ entry (fixed bin (71), char (*)); /* routine to get todays date given clock */ dcl cv_dec_ entry (char (*)) returns (fixed bin (35)); /* converts ascii to binary */ dcl cv_dec_check_ entry (char (*), fixed bin (35)) returns (fixed bin (35)); dcl com_err_ entry options (variable); /* standard error routine */ dcl ioa_ entry options (variable); /* routine for formatting and printing */ dcl ioa_$rs entry options (variable); /* routine for formatting a string */ dcl ioa_$rsnnl entry options (variable); /* routine for formatting a string without newline */ dcl hcs_$delentry_seg entry (ptr, fixed bin (35)); /* routine to delete scratch segment */ dcl hcs_$initiate_count entry (char (*), char (*), char (*), fixed bin (24), fixed bin (2), ptr, fixed bin (35)); /* file hooker to-er */ dcl hcs_$make_seg entry (char (*), char (*), char (*), fixed bin (5), ptr, fixed bin (35)); /* dir file maker */ dcl hcs_$chname_file entry (char (*), char (*), char (*), char (*), fixed bin (35)); /* change segment names */ dcl hcs_$set_bc entry (char (*), char (*), fixed bin (24), fixed bin (35)); /* sets bit count of updated file */ dcl hcs_$set_bc_seg entry (ptr, fixed bin (24), fixed bin (35)); dcl hcs_$terminate_noname entry (ptr, fixed bin (35)); /* file unhooker */ dcl hcs_$list_acl entry (char (*), char (*), ptr, ptr, ptr, fixed bin, fixed bin (35)); dcl hcs_$replace_acl entry (char (*), char (*), ptr, fixed bin, bit (1), fixed bin (35)); dcl ask_ entry options (variable); /* tools routine to get input from user */ dcl ask_$ask_clr entry; /* clears buffer */ dcl ask_$ask_line entry options (variable); /* gets a line from user */ dcl (char, null, divide, index, mod, substr, unspec) builtin; /* useful builtin functions */ /* The Following is Used to Create the initial int_log.info */ /* and the quarterly log after termination. */ dcl NL char (1) static init (" "); /* newline character */ dcl HEADER char (68) init ("INTN OPR DATE TIME TYPE DOWN ERF BRIEF DESCRIPTION "); dcl 1 LEGEND aligned internal static options (constant), 2 BLOCK1 char (254) unaligned init (" Legend:  The following is a list of possible entries that may appear in the TYPE column: BTEM Emergency Maint HARD Hardware BTHM Scheduled Hardware Maint PROC Procedural"), 2 BLOCK2 char (254) unaligned init (" BTSM Scheduled System Maint SOFT Software Fault CONT Contracted Booked Time SHUT Scheduled Shutdown ENVI Environmental UNKN Unknown FIRM Firmware Problem ???? Crash not Analyzed GROW Growyh of System"), 2 BLOCK3 char (254) unaligned init (" The following character abbreviations may appear in the ERF column: ca CPU A ic Initializer Console cb CPU B ma MPX A, FNP A cc CPU C mb MPX B, NODE1 da DISK MPC A mc MPX C, NODE2"), 2 BLOCK4 char (130) unaligned init (" db DISK MPC B oc OPERATORS CONSOLE dc DISK MPC C sa SCU A ia IOM A sb SCU B ib IOM B sc SCU C"); dcl 1 info_file aligned based (erptr), 2 int_no char (4), 2 date char (8), 2 lock char (7) unaligned, 2 nline char (1) unaligned, 2 header char (68), 2 legend char (900); dcl 1 last_int unaligned based (erptr), 2 pad char (89), 2 int_num char (4), 2 pad1 char (1), 2 opr_who char (4), 2 pad2 char (2), 2 int_date char (9), 2 pad3 char (2), 2 int_time char (5), 2 pad4 char (2), 2 crash_type char (4), 2 pad5 char (3), 2 down_time char (5), 2 pad6 char (3), 2 int_erf char (3), 2 first_line char (250); dcl dt char (28) init (""); dcl date char (28) init (""); dcl constant fixed bin (71) init (0); dcl down_time fixed bin (71) init (0); dcl crash_date char (10) init (""); dcl areap ptr aligned; dcl aclp ptr aligned; dcl acl_count fixed bin (17); dcl dummy based (aclp); dcl get_system_free_area_ entry returns (ptr); dcl get_temp_segment_ entry (char (*), ptr, fixed bin (35)); dcl release_temp_segment_ entry (char (*), ptr, fixed bin (35)); dcl cleanup condition; dcl finish condition; /* conditions */ /* ENTRY FOR UPDATING BY OPERATORS */ flag = 1; /* indicate operator initial entry point */ unspec (escape_six) = "000000110"b; /* initialize octal 006 */ goto COMMON; /* goto main line */ /* ENTRY FOR UPDATING BY SYSTEMS PERSONNEL */ edit: entry; /* update entry for SAs */ flag = 2; /* set to SA entry type */ goto COMMON; /* do common processing */ /* force an unlock of the segment */ unlock: entry; call hcs_$initiate_count (dir, "int_log.info", "", bc, 00b, erptr, code); if erptr = null then do; call com_err_ (code, "int_log", "int_log.info"); return; end; if info_file.lock = "locked" then info_file.lock = "unlock"; else call ioa_ ("int_log.info isn't locked!"); call hcs_$terminate_noname (erptr, code); return; COMMON: /* main line */ on condition (cleanup) call clean_up; on condition (finish) call clean_up; call date_time_ (clock_ (), dt); date = substr (dt, 7, 2) || "-" || substr (dt, 1, 2) || "-" || substr (dt, 4, 2); call ioa_ ("int_log.info is from ^a", dir); /* get int_log report (int_log.info) */ call hcs_$initiate_count (dir, "int_log.info", "", bc, 00b, erptr, code); if erptr = null then do; /* check for good initiate */ call com_err_ (code, "int_log", "int_log.info"); return; /* we have nothing initiated, so bomb out */ end; if info_file.lock = "locked" then do; call ioa_ ("int_log.info is currently locked, try again later."); call hcs_$terminate_noname (erptr, code); return; end; info_file.lock = "locked"; /* int_log is now locked */ month = bin (substr (dt, 1, 2)); if ((month = 1) | (month = 4) | (month = 7) | (month = 10)) & /* check for quarter terminate */ (bin (substr (erptr -> move_, 8, 2)) ^= month) then do; call ioa_ ("Quarterly termination of int_log.info segment in progress."); goto quarter_term; end; if substr (erptr -> move_, 90, 1) ^= "" & substr (erptr -> move_, 90, 1) ^= "L" then do; call ioa_ ("^/Last interrupt information entered as:"); /* show last info entered */ call ioa_ ("Int# ^a entered by ^a for interrupt at ^a on ^a.", last_int.int_num, last_int.opr_who, last_int.int_time, last_int.int_date); call ioa_ ("Down time ^a, ERF# ^a, crash type ^a", last_int.down_time, last_int.int_erf, last_int.crash_type); i = (index (substr (last_int.first_line, 1, 250), NL) + 138); /* new line of first int line */ /* searching for end of the first line of the first interrupt comments section */ call ioa_ ("Line 1 of interrupt:^/^a^/", substr (last_int.first_line, 4, i - 141)); count = divide (bc, 9, 17, 0); /* find out how many chars long file is */ end; else do; call ioa_ ("No interrupts have been entered.^/"); /* new int_log.info segment */ count = 1135; /* 1135 characters in the header and legend initially */ end; if count > 1048576 then do; call ioa_ ("^a>int_log.info is full.", dir); quarter_term: flag = 3; call hcs_$terminate_noname (erptr, code); aclp = null; /* store acl's to be copied to new int_log.info */ areap = get_system_free_area_ (); call hcs_$list_acl (dir, "int_log.info", areap, aclp, null, acl_count, code); call hcs_$chname_file (dir, "int_log.info", "int_log.info", "int_log." || substr (date, 1, 8) || ".info", code); /* old log is now int_log.yy-mm-dd.info */ call ioa_ ("Full int_log.info is now named int_log.^a.info.", date); create_log: entry; call hcs_$make_seg (dir, "int_log.info", "", 1010b, erptr, code); if code ^= 0 then do; call com_err_ (code, "int_log", "creating int_log.info"); call hcs_$terminate_noname (erptr, code); return; end; call date_time_ (clock_ (), dt); info_file.int_no = "000 "; info_file.date = substr (dt, 7, 2) || "-" || substr (dt, 1, 2) || "-" || substr (dt, 4, 2); info_file.lock = " unlock"; info_file.nline = NL; info_file.header = HEADER; info_file.legend = LEGEND.BLOCK1 || LEGEND.BLOCK2 || LEGEND.BLOCK3 || LEGEND.BLOCK4; call ioa_ ("Created int_log.info in ^a", dir); call hcs_$set_bc_seg (erptr, 1135 * 9, code); count = 1135; /* the length of header and legend characters */ if flag = 3 then do; call hcs_$replace_acl (dir, "int_log.info", aclp, acl_count, "1"b, code); if aclp ^= null then free aclp -> dummy; end; /* add acl's to the new int_log.info if quarterly term */ flag = 1; end; crash_num = cv_dec_ (erptr -> er_num); /* first three chars of file are max_crash number */ if flag = 1 then do; /* operator making new entry in file */ call hcs_$initiate_count (">sc1", "whotab", "", bc, 00b, whoptr, code); /* initiate whotab */ if whoptr = null then do; call com_err_ (code, "crash", "whotab"); call clean_up; return; end; lost_minutes = (whoptr -> timeup - whoptr -> lastsd) / 6.0e7; /* get downtime in minutes */ lost_hrs = divide (lost_minutes, 60, 17, 0); /* get hours part */ lost_minutes = mod (lost_minutes, 60); /* and remainder in minutes */ call ioa_$rsnnl ("^2d:^2d", lost_time, len, lost_hrs, lost_minutes); if substr (lost_time, 4, 1) = " " then substr (lost_time, 1, 4) = "0"; /* put back suppressed zero */ call date_time_ (whoptr -> lastsd, xtempchr); /* get time of last crash or shutdown */ datex = substr (xtempchr, 7, 2) || "-" || substr (xtempchr, 1, 2) || "-" || substr (xtempchr, 4, 2); timex = substr (xtempchr, 11, 2) || ":" || substr (xtempchr, 13, 2); /* and time (in correct format) */ lost = whoptr -> whotab.erfno; /* get last erf number */ call hcs_$terminate_noname (whoptr, code); /* unhook from the who table */ whoptr = null; query: call ask_$ask_clr; /* reset buffer */ if lost ^= "" then do; if lost = "crash" then erf, lost = "---"; else erf, last_erf = lost; end; call ask_ ("Is an update needed? ", temp_chr, err_flag); if substr (temp_chr, 1, 1) ^= "y" then goto quit; end; call get_temp_segment_ ("", sptr, code); /* make us a scratch file */ if code ^= 0 then do; call com_err_ (code, "crash", "temp file"); call clean_up; return; end; call ioa_$rsnnl ("^-^-^-^-^-", more_desc, len); /* generate header string for continued description */ call ioa_$rsnnl ("^-^-^-^-^-", more_anal, len); /* and header string for analysis lines */ i = (index (substr (erptr -> move_, 50, count), NL)) + 49; /* find the newline char at end of head line */ substr (sptr -> move_, 1, i) = substr (erptr -> move_, 1, i); /* move first 2 lines to buffer */ is, ie = i + 1; /* set pointer to next char in each file string */ count = count - i; /* decrement the number of chars remaining in input file */ if flag = 1 then do; crash_num = crash_num + 1; /* up to next crash number */ substr (sptr -> move_, 1, 3) = crash_num; /* shove right three digits into scratch file */ /* make new error report */ call convert_date_to_binary_ (dt, down_time, code); /* check down time for more than 4 hours */ call convert_date_to_binary_ (xtempchr || " +4hours", constant, code); if down_time > constant then goto retry; if lost = "" then goto retry; /* if no crash in whotab, make operator put in all the data */ xxx_retry: istemp = is; /* initialize istemp */ call ioa_ ("Int#: ^a, occurred at ^a on (^a) ^a^/down time: ^a, ERF#: ^a", crash_num, timex, substr (xtempchr, 22, 3), datex, lost_time, lost); call ask_ ("Is this correct? ", tempchr, err_flag); if substr (tempchr, 1, 1) = "y" then goto get_desc; if substr (tempchr, 1, 1) ^= "n" then goto xxx_retry; retry: istemp = is; /* set temp pointer */ desc_lines = 1; /* set number for description lines */ call ask_ ("Enter interrupt time (hh:mm): ", timex, err_flag); if timex = "quit" then go to quit; if substr (timex, 3, 1) ^= ":" then do; /* make sure the time is reasonable format */ call ioa_ ("Incorrect time (hh:mm) format"); goto retry; end; date_retry: call ask_ ("Enter date (yy-mm-dd) or (*) for today's date: ", datex, err_flag); /* get the date */ if datex = "quit" then go to quit; if datex = "*" then datex = date; /* if he supplied the date check its format */ else if substr (datex, 3, 1) ^= "-" | substr (datex, 6, 1) ^= "-" then do; call ioa_ ("Incorrect date (yy-mm-dd) specification."); goto date_retry; end; retry_date: call ask_ ("Enter system return date (yy-mm-dd) or (*): ", return_date, err_flag); if return_date = "*" then return_date = date; else if substr (return_date, 3, 1) ^= "-" | substr (return_date, 6, 1) ^= "-" then do; call ioa_ ("Incorrect date (yy-mm-dd) specification."); goto retry_date; end; retry_lost: call ask_ ("Enter return time (hh:mm): ", return_time, err_flag); if substr (return_time, 3, 1) ^= ":" then do; call ioa_ ("Incorrect time (hh:mm) specification."); goto retry_lost; end; call convert_date_to_binary_ (rtrim (return_date) || "_" || rtrim (return_time), system_returned, code); if code ^= 0 then do; call com_err_ (code, "uil", "Converting return date or time"); goto retry_date; end; call convert_date_to_binary_ (rtrim (datex) || "_" || rtrim (timex), crash_time, code); if code ^= 0 then do; call com_err_ (code, "uil", "Converting down date or time"); goto retry; end; lost_minutes = divide (system_returned - crash_time, 60000000, 71); lost_hrs = divide (lost_minutes, 60, 17, 0); lost_minutes = mod (lost_minutes, 60); hrs_lost = lost_hrs; min_lost = lost_minutes; lost_time = hrs_lost || ":" || min_lost; get_ERF: if last_erf ^= "-----" then goto get_new_ERF; /* no need to do this more than once */ j = is; ERF_loop: i = index (substr (erptr -> move_, j, count - j + is), NL); if i = 0 then do; /* we're at end of file and haven't found last ERF no. */ last_erf = "0"; goto get_new_ERF; end; if i < 50 then goto try_again; /* don't even look at this line */ temp_chr = substr (erptr -> move_, j, 3); k = cv_dec_check_ (temp_chr, code); /* see if this is first line of an entry */ if code = 0 then do; /* yes, we are looking at first line */ temp_chr = substr (erptr -> move_, j + 44, 3); if temp_chr ^= "--- " then do; /* see if the ERF number is really a number */ k = cv_dec_check_ (temp_chr, code); if code = 0 then do; last_erf = temp_chr; go to get_new_ERF; end; end; end; try_again: j = j + i; goto ERF_loop; get_new_ERF: /* time to ask for new ERF for this entry */ call ioa_ ("Last dump erf taken was ^3a", last_erf); call ask_$ask_clr; call ask_ ("Enter erf or --- if no dump taken ", erf); get_desc: type = "????"; /* default is ???? */ get_opr: call ask_$ask_clr; call ask_$ask_line ("Your initials: ", opr); call ask_$ask_clr; /* clean the buffer */ call ask_$ask_line ("description:^/-> ", desc); /* get description of problem */ if desc = "quit" then go to quit; if length (rtrim (desc)) > 70 then call truncate; /* check for extra words violating 70 char max */ else extra_desc = ""; desc_line (desc_lines) = desc; call ioa_$rs ("^3a ^7a^10a^7a^7a^5a ^6a^a", line, len, crash_num, opr, datex, timex, type, lost_time, erf, desc); next: desc_lines = desc_lines + 1; substr (sptr -> move_, istemp, len) = substr (line, 1, len); /* move input to scratch file with temp pointer */ istemp = istemp + len; /* step temp pointer */ if extra_desc = "" then call ask_$ask_line ("-> ", desc); /* desc is less than 70 char maximum */ else call ask_$ask_line ("-> " || (rtrim (extra_desc)) || " ", desc); /* inform the Operator of what words were trimmed from the */ /* last line and added to this line */ if extra_desc ^= "" then desc = rtrim (extra_desc) || " " || rtrim (desc); /* add extra words to beginning of next description line */ if length (rtrim (desc)) > 70 then call truncate; /* do word trimming */ else extra_desc = ""; trimmed_extra: if desc = "quit" then go to quit; if desc = "." then go to ok; /* has he finished input? */ call ioa_$rs ("^a^a", line, len, more_desc, desc); /* format continue line */ desc_line (desc_lines) = desc; goto next; /* go put it into the buffer */ ok: call ioa_ ("INT# ^a^2xERF# ^a^2xEntered by: ^a", crash_num, erf, opr); call ioa_ ("Interrupt occurred: ^a at ^a. Down time: ^a", datex, timex, lost_time); call ioa_ ("Description:"); do i = 1 to desc_lines; call ioa_ ("^a", desc_line (i)); end; call ask_ ("correct? ", desc); if desc = "quit" then go to quit; if substr (desc, 1, 1) = "y" then is = istemp; /* set permanent pointer to temp pointer */ else if substr (desc, 1, 1) ^= "n" then go to ok; else go to retry; /* retry on no; ask again on all else */ substr (sptr -> move_, is, 2) = escape_six || NL; /* stuff an 006 newline in scratch file */ is = is + 2; /* bump pointer */ end; /* end of type one processing */ /* */ if flag = 2 then do; /* SAs type update */ command_list = /* list of edit type commands */ "description lost erf time date type " || "quit done next print help analysis ? "; SA_ask: call ioa_ ("Highest INT# is ^a.", crash_num); /* tell them where we are */ SA_next: call ask_ ("INT#: ", crash_temp, err_flag); /* get INTERRUPT NUMBER */ if substr (crash_temp, 1, 1) = "q" then goto quit; i = cv_dec_check_ (char (crash_temp), code); if code ^= 0 then do; call ioa_ ("Crash INT# must be numeric."); goto SA_next; end; search_int: i = index (substr (erptr -> move_, 1, count), NL || crash_temp); /* note we start with nl char of preceeding line */ if i = 0 then do; call ioa_ ("^a not found", crash_temp); goto SA_ask; end; substr (sptr -> move_, is, count) = substr (erptr -> move_, ie, count); /* move the rest of the int_log to scratch file */ substr (erptr -> move_, 1, (is + count)) = substr (sptr -> move_, 1, (is + count)); /* move the whole scratch file to the int_log */ is, ie = 1; /* back to the top the file */ i = index (substr (erptr -> move_, 1, count), NL || crash_temp); /* re-locate int's location */ substr (sptr -> move_, 1, i - 1) = substr (erptr -> move_, 1, i - 1); /* move INTNs ahead of this one over to scratch */ is = is + i; /* step scratch counter */ ie = ie + i; /* and step input position */ i = index (substr (erptr -> move_, ie, count), NL); /* find new line char at end of this line */ if i = 0 then do; garbage: call ioa_ ("^a>int_log.info garbled.^/HELP!!", dir); call ioa_ ("Probably someone forgot the tab characters before the^/description or analysis portion entered."); goto quit; end; ck_more_desc: if (substr (erptr -> move_, ie + i, 5) = more_desc) & (substr (erptr -> move_, ie + i + 5, 5) ^= "ANLY:") then do; /* see if next line is more description */ j = index (substr (erptr -> move_, ie + i, count - i), NL); /* find next newline */ if j = 0 then goto garbage; i = i + j; goto ck_more_desc; end; k = 0; /* set counter to no chars of anal */ ck_more_anal: if substr (erptr -> move_, ie + i + k, 5) = more_anal then do; /* see if line is analysis format line */ j = index (substr (erptr -> move_, ie + i + k, count - (i + k)), NL); /* find end of line */ if j = 0 then goto garbage; /* just in case we dont find newline char */ k = k + j; /* up counter of chars in anal lines */ goto ck_more_anal; /* see if another line */ end; substr (sptr -> move_, is, i) = substr (erptr -> move_, ie, i); /* move to scratch file to work on */ ie = ie + i; /* move input pointer index */ /* don't move output pointer till finished updating */ SA_more: call ask_$ask_line ("edit: ", edit_cmd, err_flag); /* get type mod to be made */ command = (11 + index (command_list, rtrim (before (edit_cmd, "-")))) / 12; /* which command is this */ if command = 0 then /* unable to find command... illegal command */ do; call ioa_ ("Unknown command '^a', type help or ? for command list", edit_cmd); goto SA_more; end; else goto process (command); /* process edit command */ process (1): if after (edit_cmd, " ") = "" then edit_cmd = rtrim (edit_cmd) || " -n"; /* new is default */ if after (edit_cmd, " ") = "-a" then is = is + i; /* append lines to already existing description */ else is = is + 50; /* step passed first 50 cols of information */ call ask_$ask_line ("Description: --> ", desc); more_desc_tst: if length (rtrim (desc)) > 70 then call truncate; else extra_desc = ""; if after (edit_cmd, " ") = "-a" then call ioa_$rs ("^a^a", line, len, more_desc, desc); else call ioa_$rs ("^a", line, len, desc); substr (sptr -> move_, is, len) = substr (line, 1, len); /* get new line */ is = is + len; /* adjust for chars entered */ if extra_desc = "" then call ask_$ask_line ("-->", desc); else call ask_$ask_line ("-->" || (rtrim (extra_desc)) || " ", desc); if extra_desc ^= "" then desc = rtrim (extra_desc) || " " || rtrim (desc); if desc ^= "." then do; substr (edit_cmd, 6, 2) = "-a"; goto more_desc_tst; end; goto search_int; process (2): call ask_ ("down time: ", lost, err_flag); if substr (lost, 3, 1) ^= ":" then do; call ioa_ ("Time format must be hh:mm"); goto process (2); end; if substr (lost, 1, 1) = "0" then substr (lost, 1, 1) = " "; substr (sptr -> move_, is + 36, 5) = lost; goto SA_more; process (3): call ask_ ("ERF#: ", erf, err_flag); substr (sptr -> move_, is + 44, 5) = erf; goto SA_more; process (4): call ask_ ("Crash time: ", timex, err_flag); substr (sptr -> move_, is + 22, 5) = timex; goto SA_more; process (5): call ask_ ("Crash date: ", datex, err_flag); if (substr (datex, 3, 1) ^= "-") | (substr (datex, 6, 1) ^= "-") then goto process (5); substr (sptr -> move_, is + 12, 10) = datex; goto SA_more; process (6): call ask_ ("Crash type: ", type, err_flag); substr (sptr -> move_, is + 29, 6) = type; goto SA_more; process (7): call ioa_ ("QUIT.....INT# ^a may not be updated!!!!!!", crash_temp); call clean_up; return; process (8): is = is + i; /* set output counter */ goto SA_done; process (9): is = is + i; goto SA_next; process (10): call ioa_ ("^a^a", substr (sptr -> move_, is, i), substr (erptr -> move_, ie, k)); goto SA_more; process (11): /* help -- 11, ? -- 13 */ process (13): call crash_help; /* get internal help file printed */ goto SA_more; process (12): extra_desc = ""; /* blank it out just in case */ if after (edit_cmd, " ") = "" then edit_cmd = rtrim (edit_cmd) || " -n"; /* default is new */ if after (edit_cmd, " ") = "-n" then ie = ie + k; /* step over old analysis in input file */ else do; /* step over analysis already present */ is = is + k; ie = ie + k; end; is = is + i; /* set passed information entered already */ new_anal: call ask_$ask_line ("Analysis: -->", desc); more_anal_tst: if length (rtrim (desc)) > 65 then call truncate; else extra_desc = ""; if (after (edit_cmd, " ")) = "-n" then call ioa_$rs ("^5aANLY: ^a", line, len, more_anal, desc); /* format first anal line */ else call ioa_$rs ("^a^a", line, len, more_anal, desc); /* format continuation of anal */ substr (sptr -> move_, is, len) = substr (line, 1, len); is = is + len; if extra_desc = "" then call ask_$ask_line ("-->", desc); else call ask_$ask_line ("-->" || (rtrim (extra_desc)) || " ", desc); if extra_desc ^= "" then desc = rtrim (extra_desc) || " " || rtrim (desc); if desc ^= "." then do; substr (edit_cmd, 1, 7) = "repeats"; go to more_anal_tst; end; else goto search_int; end; SA_done: /* now move rest of file */ substr (sptr -> move_, is, count) = substr (erptr -> move_, ie, count); /* move rest of file */ is = is + count; /* increment pointer to end of scratch file */ /* move scratch to crash file doing update */ substr (erptr -> move_, 1, is - 1) = substr (sptr -> move_, 1, is - 1); /* move scratch to crash file */ call hcs_$set_bc (dir, "int_log.info", ((is - 1) * 9), code); /* set new bit count */ if flag = 1 then /* only for Operator update sequence */ call ioa_ ("Int # ^d entered by ^a for ^a at ^a / down time is ^a", crash_num, opr, datex, timex, lost_time); call ioa_ ("int_log has been updated"); call clean_up; return; quit: do; /* quit out routine */ call ioa_ ("QUIT...file was not updated!!"); call clean_up; return; end; return; /* exits with out update */ truncate: proc; /* using format_document to trim input */ dcl format_document_$string entry (char (*), char (*), fixed bin (21), pointer, fixed bin (35)); dcl outlen fixed bin (21); dcl next_nl fixed bin (21); %include format_document_options; allocate format_document_options; format_document_options.version_number = format_document_version_1; if substr (edit_cmd, 1, 7) = "anal -n" then format_document_options.line_length = 65; else format_document_options.line_length = 70; format_document_options.literal_sw = "1"b; call format_document_$string (desc, desc_out, outlen, format_document_options_ptr, code); outlen = outlen - 4; desc = substr (desc_out, 4, outlen); next_nl = search (substr (desc, 1), NL); extra_desc = substr (desc, next_nl + 1); desc = substr (desc, 1, next_nl - 1); free format_document_options; return; end; crash_help: proc; call ioa_ ("*** Valid edit directives for the analysis portion ***"); call ioa_ ("date...change date time...change time"); call ioa_ ("lost...change lost time type...change type"); call ioa_ ("erf....change erf number desc {-a/-n}...change description "); call ioa_ ("next...end current Int processing done...finished updating"); call ioa_ ("anal {-a/-n}...change or add analysis print..print entry"); call ioa_ ("quit...abort with no current updates processed"); call ioa_ ("'-a' -- add/append --- '-n' -- new"); call ioa_ ("^/The following 'types' are defined:"); call ioa_ ("BTEM Emergency Maint HARD Hardware"); call ioa_ ("ENVI Environmental GROW Growth of System"); call ioa_ ("UNKN Unknown Soft Software Fault"); call ioa_ ("PROC Procedural ???? Crash not yet analyzed"); call ioa_ ("Firm Firmware Problem CONT Contracted Booked Time"); call ioa_ ("BTHM Scheduled Hardware Maint BTSM Scheduled System Maint"); call ioa_ ("SHUT Scheduled Shutdown"); call ioa_ ("^/"); end; clean_up: proc; /* clean up handler, terminate open files */ info_file.lock = " unlock"; if sptr ^= null then call release_temp_segment_ ("", sptr, code); if whoptr ^= null then call hcs_$terminate_noname (whoptr, code); if erptr ^= null then call hcs_$terminate_noname (erptr, code); return; end; end uil; */ ----------------------------------------------------------- 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 */