PARM what="?", level=0, entry=main # This script tries to provide meaningful information about the various # files, groups, accounts, directories, and database on this system. Read # the HELP text in the "do_help" routine for a general idea of what this # script does. Disc space usage is reported in KB only, KB and MB, or # MB only, depending on the size of the total. Currently, only leaf node # files count towards the disk usage total -- the space consumed by the # actual account, group, and directory entries is ignored. # Programmer note: disk space is internally accumulated in units of pages, with # 2^12=4096 bytes per page. This allows up to 8 TB to be counted for a single # group, account or directory via a signed 32 bit CI integer variable. # # There is an companion program, defined below by the _sw_db_pgm variable, # which, depending on its parm value, reads the Image "TC" file for DBE # names, or supplies Allbase DBE files for a specific DB-Con file. # # There are many combinations of output that can be reported, all controlled # by the "level" parm. The default level is to see basic system info; # however, greater details are provided by higher level values. The help # text, below, explains this. # # Errors, warnings, and progress are reported in a permanent file named # SIULOG. Each error/warning is displayed to $stdlist inline with the # grand total displayed at the end of the report, and in the error log file. # Each error/warning is numbered 1,2,...N in the order it is detected. # Since the file is permanent others can view it while this script is running # and taking so long! # # Note: POSIX directory names must begin with a "/", that is only absolute # pathnames are accepted. "@", "/" and " /@" are treated the same. # # Note: Directory names are only reported up to 4 levels deep. File space below # the 4th level is accumulated up to the 4th level. For example, if the file # "/a/b/c/d/e/file" is processed, its disk space accumulates to the 4th level # directory "d". # # Original authors: script : Jeff Vance, HP-CSY, Dec. 2001 # DB pgm : Tien-You Chen, HP-CSY, Dec. 2001 # # Version history at the end of this file. if "!entry" = "main" then # ** ** # ** main outer block entry ** # ** ** # make sure we are on a high enough rev of MPE/iX (6.0 PP1 or greater) if not bound(HPHHMMSSMMM) then echo echo The SIU tool requires the executing system to be on MPE/iX 6.0 PP1 echo or later. This system is on MPE/iX !hprelversion. Please contact HP & via echo Jazz at jazz.external.hp.com if assistance is required. SIU is not echo supported by the HP RC. echo escape endif # script version string setvar _sw_vers "B.06" echo echo H P 3 0 0 0 S y s t e m I n v e n t o r y U t i l i t y & vers !_sw_vers echo # some variables need to be set before help text is displayed, ie. the # names of certain files, level format names, etc. # name of this script, to save many references to HPFILE setvar _sw_me hpfile # name of the error log file, in the current working directory (CWD) setvar _sw_logf fqualify("SIULOG") # Name of the Known Vendor Accounts mapping file. This file maps MPE # account names to a vendor / company name. The account name can be # wildcarded, thus more specific entries should come before more generic # entries in this file. Absence of this file means that vendor info cannot # be gathered on this system. Default is in the current location of the # SIU script. if lft(_sw_me,1) = "/" then # HFS name for script -- why???, just use local CWD setvar _sw_me_ga "" else # MPE name for script setvar _sw_me_ga "." + xword(_sw_me,".") endif setvar _sw_kva_file "SIUVEND"+_sw_me_ga # Name of program that reads the Image "TC" file to map DBEs. This # privileged program reads the Image "TC" file until eof. The "TC" file # contains DBE names for Image/SQL databases. There can be more than one # DBE per Image/SQL database. Absence of this program means that specific # DBE names cannot be displayed. Default is in the current location of the # SIU script. setvar _sw_db_pgm "SIUDBP"+_sw_me_ga # Hard-coded format strings of equal field lengths, which must correlate # to the bit number in the in the numeric level mask. Each "field" in the # format string can be up to 9 chars long with one space as a delimiter. # 1 2 3 4 5 # 123456789012345678901234567890123456789012345678901 setvar _sw_fmts "SUMMARY ACCT DB VENDOR FILECODE & GROUP FILE IO " # Now we have defined enough of the environment to satisfy a help request if "!what" = "?" then xeq !_sw_me "!what" "!level" entry=do_help escape endif # set some vars for progress reporting and CPU/time statistics setvar _sw_start_cpu hpcpusecs setvar _sw_prev_cpu _sw_start_cpu setvar _sw_start_time lft(hphhmmssmmm,6) # create the permanent log file # Programmer note: this script only accesses the log file for a very short # duration while output is redirected to the file. The script is not able # to open the file once, keep it open, and close it before terminating. # Thus, another instance of this script could purge the logfile and re-build # it without any CI errors. if finfo(_sw_logf,'exists') then if finfo(_sw_logf,'accessors') > 0 then # logfile is being accessed, could be a transient write from this # script, or another process viewing it, etc. echo *** ERROR: Logfile "!_sw_logf" is being accessed, see below: listfile !_sw_logf,9 echo When there are no accessors re-run this script... escape endif if finfo(_sw_me,'accessors') > 1 then # Another instance of this script is executing. Remember the write # access to the logfile is very transient, and not likely detected # above. echo *** WARN: "!_sw_me" is already executing, see below: listfile !_sw_me,8 echo Your logfile "!_sw_logf" could be overwritten, depending on where echo the other instance(s) of this script are being executed. echo setvar _sw_rec "y" if hpinteractive then setvar _sw_rec dwns(lft(ltrim(input("...Continue script? ")),1)) echo endif if _sw_rec = "n" then escape endif endif # now purge the old logfile # let the script fail if the purge or build below fails... purge !_sw_logf endif # now build the permanent log/progress file build !_sw_logf;rec=-256,,v,ascii;disc=20000 # the log file writer has exclusive access, but others can read file !_sw_logf,old;ear # write the first entry to log file echo HP 3000 SIU (vers !_sw_vers) started on !hpdatef at !hptimef>*!_sw_logf echo Command parms: "!what" level="!level" >>*!_sw_logf setvar _sw_rec " Run by: #!hpjobtype!hpjobnum !hpjobname,!hpuser.!hpaccount" if hpspoolid <> "" then setvar _sw_rec _sw_rec+" SPID: !hpspoolid.OUT.HPSPOOL" endif echo !_sw_rec >>*!_sw_logf # initialize many counters and misc setvar _sw_save_mfence hpmsgfence setvar _sw_err_cnt 0 setvar _sw_warn_cnt 0 setvar _sw_kva_cnt 0 setvar _sw_tot_files 0 setvar _sw_tot_accts 0 setvar _sw_tot_grps 0 setvar _sw_tot_vs_grps 0 setvar _sw_tot_emp_grps 0 setvar _sw_tot_dirs 0 setvar _sw_tot_alldb 0 setvar _sw_tot_imgdb 0 setvar _sw_tot_jumbo 0 setvar _sw_tot_idx 0 setvar _sw_tot_imgTC 0 setvar _sw_acct_num_vs_grps 0 setvar _sw_acct_num_grps 0 setvar _sw_acct_num_dirs 0 setvar _sw_acct_big_file 0 setvar _sw_acct_big_grp 0 setvar _sw_acct_big_imgdb 0 setvar _sw_acct_emp_grps 0 setvar _sw_acct_g_most_files 0 setvar _sw_acct_num_imgdb 0 setvar _sw_acct_num_jumbo 0 setvar _sw_acct_num_idx 0 setvar _sw_acct_num_imgTC 0 setvar _sw_grp_num_dirs 0 setvar _sw_grp_num_imgdb 0 setvar _sw_sys_big_file 0 setvar _sw_sys_big_dir 0 setvar _sw_sys_big_grp 0 setvar _sw_sys_big_acct 0 setvar _sw_sys_big_imgdb 0 setvar _sw_sys_d_most_files 0 setvar _sw_sys_g_most_files 0 setvar _sw_sys_a_most_files 0 setvar _sw_sys_big_fname "" setvar _sw_sys_big_gname "" setvar _sw_sys_big_dname "" setvar _sw_sys_big_aname "" setvar _sw_sys_big_imgdb_name "" setvar _sw_acct_big_fname "" setvar _sw_acct_big_gname "" setvar _sw_acct_big_imgdb_name "" setvar _sw_sys_dname_most_files "" setvar _sw_sys_gname_most_files "" setvar _sw_sys_aname_most_files "" # These two vars contain the current and prior directory traversal depth setvar _sw_cur_depth 0 setvar _sw_prev_depth 0 # There are 3 four tiered arrays that keep track of: num_files, size(pages) # and directory type (acct, grp, dir) for a given account or root dir. # All levels deeper than 4 are collapsed to the 4th level. These arrays # are indexed by the _sw_arry_ndx and _sw_cur_depth vars. NOTE: the zeroth # elements for the num_files and size arrays is special in that it is not # cumulative. These 0 elements hold only the number of files and size of # these files directly under root (/). Elements 2..4 will accumulate up. # That is, elements 4 will be added to elements 3, and elements 3 will be # added to elements 2, etc. setvar _sw_num_files_0 0 setvar _sw_num_files_1 0 setvar _sw_num_files_2 0 setvar _sw_num_files_3 0 setvar _sw_num_files_4 0 setvar _sw_size_0 0 setvar _sw_size_1 0 setvar _sw_size_2 0 setvar _sw_size_3 0 setvar _sw_size_4 0 # The 3 directory type codes are: "A"=account, "G"=group, "D"=dir setvar _sw_dir_ty_1 "" setvar _sw_dir_ty_2 "" setvar _sw_dir_ty_3 "" setvar _sw_dir_ty_4 "" # are we in an account, a group, a directory? setvar _sw_in_acct false setvar _sw_in_grp false setvar _sw_in_dir false # delete the file code counter array deletevar _sw_fc_@ >$null # ** Programming Note: do NOT create any variables starting with '_sw_fc_' # ** unless they are filecode mnemonic variables. Variables staring with # ** this prefix are read for filecode formatting and deleted before the # ** script ends. # initialize the IMAGE root file info array # The format for this string array is: # byte 1 byte 2 byte 3 byte 4+ # ----------------------------------------------------------------- # | Jumbo-char | Indexed-char | DBE char | HFS DB pathname string # ----------------------------------------------------------------- # There is one array entry per Image database found on the system. # The number of elements is defined by _sw_IMGDB_0. setvar _sw_IMGDB_0 0 # ** Programming Note: there is a secondary array named _sw_IMGDBSZ that # ** holds the # of pages for each Image database on the system. The same # ** _sw_IMGDB_0 index value applies to this array too. # init a similar, but simplier, ALLBASE array setvar _sw_ALLDB_0 0 # deal with the "level" parm xeq !_sw_me "!what" "!level" entry=parse_level # returns _sw_int_lev, the bit-mask integer version of "level" # bits for various levels of detail. See help text above! setvar _sw_lev_acct odd(_sw_int_lev) setvar _sw_lev_db odd(_sw_int_lev lsr 1) setvar _sw_lev_vend odd(_sw_int_lev lsr 2) setvar _sw_lev_fc odd(_sw_int_lev lsr 3) setvar _sw_lev_group odd(_sw_int_lev lsr 4) setvar _sw_lev_file odd(_sw_int_lev lsr 5) setvar _sw_lev_io odd(_sw_int_lev lsr 6) # write the utility banner # echo ![rpt("-",34-len(hpsysname)/2-1)]!hpsysname& ![rpt("-",34-len(hpsysname)/2-1)] echo Detail Level is: ![decimal(_sw_int_lev)] (![octal(_sw_int_lev)], & ![hex(_sw_int_lev)]). Max level is 127 (%177, $7f) echo Displaying: system info, directory totals if _sw_lev_acct then echo Account summary info endif if _sw_lev_db then echo Database info endif if _sw_lev_vend then echo 3rd party vendor info endif if _sw_lev_fc then echo Special filecodes counts endif if _sw_lev_group then echo Group summary info endif if _sw_lev_file then echo Individual files shown based on file code or type endif if _sw_lev_io then echo I/O configuration info endif # load the Known Vendor Accounts file, if present, into a variable array. if _sw_lev_vend and finfo(_sw_kva_file,'exists') then xeq !_sw_me _sw_kva_ entry=read_kva >*!_sw_logf echo Account file "!_sw_kva_file" can't be found. >>*!_sw_logf setvar _sw_lev_vend false endif # verify the "TC" DBE mapping program file exists if _sw_lev_db and not setvar(_sw_dbpgm_ok,finfo(_sw_db_pgm,'exists')) then echo echo *** WARN ![setvar(_sw_warn_cnt,_sw_warn_cnt+1)]: & You requested database detailed info, but the program that echo provides some of this data ("!_sw_db_pgm") is missing. echo DBEs for Image/SQL and ALLBASE databases cannot be reported. echo # write to the error log file too echo *** WARN !_sw_warn_cnt: You requested database detailed info, but & the program that >>*!_sw_logf echo provides some of this data (!_sw_db_pgm) is missing. & >>*!_sw_logf endif ##################################################################### ## Start the reporting with 6 major steps here in the main entry ## ##################################################################### # 1. **** System Info **** xeq !_sw_me entry=sys_info # 2. **** I/O Info **** if _sw_lev_io then xeq !_sw_me entry=io_info endif # 3. **** Directory Info **** # Parse the "what" parm and collect all of the file info. # note: "directory info" needs to be collected to get file and filecode info xeq !_sw_me "!what" entry=dir_info # the above subroutine consumes by far the most time. # Report the summary results of processing the "what" parm. echo echo Directory Summary: echo - - - - - - - - - - echo # of accounts : !_sw_tot_accts if _sw_lev_vend then echo # of Vendor Accts : !_sw_kva_cnt endif if _sw_tot_emp_grps > 0 then echo # of groups : !_sw_tot_grps (!_sw_tot_emp_grps empty) else echo # of groups : !_sw_tot_grps endif echo # of grps user vols: !_sw_tot_vs_grps echo # of directories : !_sw_tot_dirs echo # of files : !_sw_tot_files if _sw_num_files_0 > 0 then setvar _sw_rec " # of files under / : !_sw_num_files_0 (" if _sw_size_0 > $800000 then setvar _sw_rec _sw_rec+"![_sw_size_0/256] MB)" elseif _sw_size_0 < $800 then setvar _sw_rec _sw_rec+"![_sw_size_0*4] KB)" else setvar _sw_rec _sw_rec+"![_sw_size_0*4] KB, ![_sw_size_0/256] MB)" endif echo !_sw_rec endif echo # of Image DBs : !_sw_tot_imgdb if _sw_lev_db and _sw_tot_imgdb > 0 then echo # of DBs -!> DBEs : !_sw_tot_imgTC echo # of jumbo DBs : !_sw_tot_jumbo echo # of indexed DBs : !_sw_tot_idx setvar _sw_rec " Largest Image DB : !_sw_sys_big_imgdb_name (" if _sw_sys_big_imgdb > $800000 then setvar _sw_rec _sw_rec+"![_sw_sys_big_imgdb/256] MB)" elseif _sw_sys_big_imgdb < $800 then setvar _sw_rec _sw_rec+"![_sw_sys_big_imgdb*4] KB)" else setvar _sw_rec _sw_rec+"![_sw_sys_big_imgdb*4] KB, & ![_sw_sys_big_imgdb/256] MB)" endif echo !_sw_rec endif if _sw_tot_alldb > 0 then echo # of Allbase DBEs : !_sw_tot_alldb endif setvar _sw_rec " Largest account : !_sw_sys_big_aname (" if _sw_sys_big_acct > $800000 then setvar _sw_rec _sw_rec+"![_sw_sys_big_acct/256] MB)" elseif _sw_sys_big_acct < $800 then setvar _sw_rec _sw_rec+"![_sw_sys_big_acct*4] KB)" else setvar _sw_rec _sw_rec+"![_sw_sys_big_acct*4] KB, & ![_sw_sys_big_acct/256] MB)" endif echo !_sw_rec setvar _sw_rec " Largest group : !_sw_sys_big_gname (" if _sw_sys_big_grp > $800000 then setvar _sw_rec _sw_rec+"![_sw_sys_big_grp/1024] MB)" elseif _sw_sys_big_grp < $800 then setvar _sw_rec _sw_rec+"![_sw_sys_big_grp*4] KB)" else setvar _sw_rec _sw_rec+"![_sw_sys_big_grp*4] KB, & ![_sw_sys_big_grp/256] MB)" endif echo !_sw_rec if _sw_tot_dirs > 0 then setvar _sw_rec " Largest directory : !_sw_sys_big_dname (" if _sw_sys_big_dir > $800000 then setvar _sw_rec _sw_rec+"![_sw_sys_big_dir/256] MB)" elseif _sw_sys_big_dir < $800 then setvar _sw_rec _sw_rec+"![_sw_sys_big_dir*4] KB)" else setvar _sw_rec _sw_rec+"![_sw_sys_big_dir*4] KB, & ![_sw_sys_big_dir/256] MB)" endif echo !_sw_rec endif setvar _sw_rec " Largest file : !_sw_sys_big_fname (" if _sw_sys_big_file > $800000 then setvar _sw_rec _sw_rec+"![_sw_sys_big_file/256] MB)" elseif _sw_sys_big_file < $800 then setvar _sw_rec _sw_rec+"![_sw_sys_big_file*4] KB)" else setvar _sw_rec _sw_rec+"![_sw_sys_big_file*4] KB, & ![_sw_sys_big_file/256] MB)" endif echo !_sw_rec echo Account most files : !_sw_sys_aname_most_files (!_sw_sys_a_most_files) echo Group most files : !_sw_sys_gname_most_files (!_sw_sys_g_most_files) if _sw_tot_dirs > 0 then echo Dir most files : !_sw_sys_dname_most_files & (!_sw_sys_d_most_files) endif # 4. **** Database Info **** if _sw_lev_db then echo echo echo ----------------------- Database Summary ----------------------- echo xeq !_sw_me entry=db_info endif # 5. **** Files by Filecode Info **** if _sw_lev_fc then xeq !_sw_me entry=fc_info endif # 6. **** 3rd Party Info **** if _sw_lev_vend then echo echo ------------------------- 3rd Party Info ------------------------ echo setvar _sw_i 0 while setvar(_sw_i,_sw_i+1) <= _sw_kva_0 do if lft(_sw_kva_!_sw_i,1) = 'x' then echo ![xword(_sw_kva_!_sw_i,'=')] installed in account: & ![word(_sw_kva_!_sw_i,'/',2)] endif endwhile endif ###### done! ###### echo echo ****************************************************************** echo # compute elapsed time setvar _sw_end_time lft(hphhmmssmmm,6) setvar _sw_tot_hrs ![lft(_sw_end_time,2)]-![lft(_sw_start_time,2)] setvar _sw_tot_mins ![str(_sw_end_time,3,2)]-![str(_sw_start_time,3,2)] setvar _sw_tot_secs ![rht(_sw_end_time,2)]-![rht(_sw_start_time,2)] if _sw_tot_secs < 0 then setvar _sw_tot_secs 60+_sw_tot_secs setvar _sw_tot_mins _sw_tot_mins-1 endif if _sw_tot_mins < 0 then setvar _sw_tot_mins 60+_sw_tot_mins setvar _sw_tot_hrs _sw_tot_hrs-1 endif if _sw_tot_hrs < 0 then setvar _sw_tot_hrs 24+_sw_tot_hrs endif # leading zero if needed setvar _sw_tot_hrs rpt('0',2-len("!_sw_tot_hrs"))+"!_sw_tot_hrs" setvar _sw_tot_mins rpt('0',2-len("!_sw_tot_mins"))+"!_sw_tot_mins" setvar _sw_tot_secs rpt('0',2-len("!_sw_tot_secs"))+"!_sw_tot_secs" echo Ended on !hpdatef, !hptimef Elapsed time: !_sw_tot_hrs:& !_sw_tot_mins:!_sw_tot_secs (![hpcpusecs-_sw_start_cpu] cpu secs) # write elapsed time to error log file too echo Ended on !hpdatef, !hptimef Elapsed time: !_sw_tot_hrs:!_sw_tot_mins& :!_sw_tot_secs (![hpcpusecs-_sw_start_cpu] cpu secs) >>*!_sw_logf # report total number of errors and warnings, even if 0. echo *** !_sw_err_cnt ERRORs, *** !_sw_warn_cnt WARNINGs >>*!_sw_logf if _sw_err_cnt <> 1 then echo *** !_sw_err_cnt errors reported *** else echo *** !_sw_err_cnt error reported *** endif if _sw_warn_cnt <> 1 then echo *** !_sw_warn_cnt warnings reported *** else echo *** !_sw_warn_cnt warning reported *** endif if _sw_err_cnt+_sw_warn_cnt > 0 then echo *** All error/warnings logged to: !_sw_logf endif echo #deletevar _sw_@ return ##### end of main outer block ##### # ***** All alternate entry points are below ***** # ***** in alphabetic order ***** # **** ALLBASE_SIZE **** # elseif '!entry' = 'allbase_size' then # Calculates the size in pages for the ALLBASE database. # # Input has been redirected to output of the DB pgm that produces listf,6 # like output when run with parm=2. Input file may be empty or blank. # # Parm1 = the fully qualified Allbase DB-con file name (MPE syntax) # Parm2 = CI variable name to hold cumulated page count # setvar _sw_tmp 0 setvar _sw_eof2 finfo(hpstdin,'eof') while setvar(_sw_eof2,_sw_eof2-1) >= 0 do # read db pgm output and get the # sectors if setvar(_sw_rec,ltrim(rtrim(input()))) <> "" and & finfo(_sw_rec,"exists") then # use caution with FINFO 'sectors' since it fails on a large file and # for other reasons- would be nice if finfo accepted a status parm... setvar hpcierr 0 setvar hpmsgfence 2 continue setvar _sw_sec finfo(_sw_rec,'sectors') setvar hpmsgfence _sw_save_mfence if hpcierr <> 0 and finfo(_sw_rec,'exists') then echo *** WARN ![setvar(_sw_warn_cnt,_sw_warn_cnt+1)]: Sectors & error for file "!_sw_rec". File size not counted. echo *** WARN !_sw_warn_cnt: Sectors error for file & "!_sw_rec" >>*!_sw_logf setvar _sw_sec 0 elseif hpcierr <> 0 then # file disappeared setvar _sw_sec 0 endif # convert sectors to pages (always divides evenly) setvar _sw_tmp _sw_tmp + (_sw_sec/16) endif endwhile # return pages via parm2 setvar !level _sw_tmp return # **** DB_INFO **** # elseif '!entry' = 'db_info' then # Report the database summary for the system. This, in part, may include # running a program that reads the Image "TC" file which contains DBE names # for a given Image/SQL database. The two array vars used below are filled # in the "FILE" section of the "LIST_FILES" routine. The format for the # IMAGE arrays are: # -- IMGDB array -- # byte 1 : char, "Y" if Jumbo else "N" # byte 2 : char, "Y" if Indexed else "N" # byte 3 : char, "Y" if DBE else "N" # bytes 4+ : string, absolute database name in HFS format # -- IMGDBSZ array -- # bytes 1-4: integer, size in pages for entire database # # Allbase info is also displayed via a similar array, but page usage is # calculated here. # # Allbase array: # -- ALLDB array -- # bytes 1+ : string, absolute database name in HFS format # if _sw_tot_imgdb = 0 then echo No Image databases were found else echo Image Root File KB size (MB*) Jumbo Idx DBE echo -------------------------- ------------- ----- --- --- # process the IMGDB and IMGDBSZ arrays and display above info setvar _sw_i 0 while setvar(_sw_i,_sw_i+1) <= _sw_IMGDB_0 setvar _sw_rec _sw_IMGDB_!_sw_i setvar _sw_db_jumbo str(_sw_rec,1,1) setvar _sw_db_idx str(_sw_rec,2,1) setvar _sw_db_dbe str(_sw_rec,3,1) # convert HFS root file name to MPE setvar _sw_db rht(_sw_rec,-4) setvar _sw_db word(_sw_rec,"/",-1)+"."+word(_sw_rec,"/",-2)+"."+ & word(_sw_rec,"/",-3) # convert size from pages to KB or MB, as ascii, not an integer if _sw_IMGDBSZ_!_sw_i > $10000000 then # pretty big, so convert to MB - '*' flags MB setvar _sw_sz "![_sw_IMGDBSZ_!_sw_i/256]*" else setvar _sw_sz "![_sw_IMGDBSZ_!_sw_i*4] " endif echo !_sw_db ![rpt(" ",26-len("!_sw_db"))] & ![rpt(" ",12-len(_sw_sz))]!_sw_sz & !_sw_db_jumbo !_sw_db_idx !_sw_db_dbe if _sw_db_dbe = "Y" and _sw_dbpgm_ok then # run "TC" file mapping pgm(parm=1) to extract the DBE info # append "TC" to the absolute root file pathname setvar _sw_db rht(_sw_rec,-4) + "TC" xeq !_sw_db_pgm !_sw_db,1 echo endif endwhile endif if _sw_tot_alldb = 0 then echo echo No Allbase databases were found else echo echo Allbase DB-Con File KB size (MB*) echo -------------------------- ------------- # process the ALLDB and ALLDBSZ arrays and display above info setvar _sw_i 0 while setvar(_sw_i,_sw_i+1) <= _sw_ALLDB_0 setvar _sw_db _sw_ALLDB_!_sw_i # convert HFS root file name to MPE setvar _sw_db word(_sw_db,"/",-1)+"."+word(_sw_db,"/",-2)+"."+ & word(_sw_db,"/",-3) # calculate pages disk space for this Allbase database # first, run db pgm(parm=2) to get list of Allbase DBE files xeq !_sw_db_pgm !_sw_db,2 >swdbef # next, accumulate pages for each DBE file xeq !_sw_me !_sw_db _sw_sz entry=allbase_size $10000000 then # pretty big, so convert to MB - '*' flags MB setvar _sw_sz "![_sw_sz/256]*" else setvar _sw_sz "![_sw_sz*4] " endif echo !_sw_db ![rpt(" ",26-len("!_sw_db"))] & ![rpt(" ",12-len(_sw_sz))]!_sw_sz endwhile endif return # **** DIR_INFO **** # elseif "!entry" = 'dir_info' then # Main entry for collecting and driving all directory based reporting. # After parsing the "what" parm, use a two layer approach for listing all # lower level files, groups, dirs, etc. First, :lisfile,6 just the # highest level ("what") to a file. This handles wildcards so that the # temp/scratch files used are large enough. The second level reads the # output from the first listfile and performs another :listfile,6;tree in # HFS format for each record. # # Parse the "what" parm echo echo -------------------------- Directory Info -------------------------- setvar _sw_dirx 0 while setvar(_sw_dir,word("!what",' ,',setvar(_sw_dirx,_sw_dirx+1)))<> "" do # convert POSIX wildcard '*' to MPE '@' setvar _sw_dir repl(rtrim(_sw_dir),"*","@") if delimpos(_sw_dir,"/.") <> 1 then # convert MPE name to POSIX if pos(".",_sw_dir) = 0 then # convert "acct" to "/ACCT" setvar _sw_dir "/" + ups(_sw_dir) elseif wordcnt(_sw_dir,".") >= 2 then echo An account or /dir name must be specified. You used "!_sw_dir". echo An account or /dir name must be specified. >>*!_sw_logf if wordcnt(_sw_dir,".") > 2 then echo A qualified filename is not supported. else echo A "group.account" name is not supported. endif escape endif # else, a POSIX syntax name elseif_sw_dir = "/" then setvar _sw_dir "/@" else if lft(_sw_dir,1) = "." then echo A relative pathname is not supported. You used "!_sw_dir". echo A relative pathname is not supported. You used "!_sw_dir" & >>*!_sw_logf echo Use the MPE account name or "/directory-name". escape else # name start with "/" if wordcnt(_sw_dir,"/") > 2 then echo Absolute pathnames may only contain a single component. echo Absolute pathnames may only contain a single component.& >>*!_sw_logf echo Reduce the name to simply "![xword(_sw_dir,"/",-1)]" escape endif endif if rht(_sw_dir,1) = "/" then setvar _sw_dir lft(_sw_dir,len(_sw_dir)-1) endif endif setvar hpcierr 0 # list just this dir (could be wildcarded) to a scratch file continue listfile !_sw_dir,6 ;notree >swinvlf0 if hpcierr <> 0 then if hpcierr = 929 then echo The account, group or directory "!_sw_dir" does not exist. else print swinvlf0 endif echo Processing stopped... echo escape endif # the bulk of the work is done by the "read_level0" routine continue xeq !_sw_me !_sw_dir entry=read_level0 "" do echo !_sw_rec endwhile echo echo Combinations of the above level names are supported, & e.g., echo "VENDOR FILECODE DB ACCT", which corresponds to a & numeric level echo value of: #15 (%17). echo echo Note: not all individual files are displayed when the FILE & level is echo selected. Only files with filecodes or file types deemed & significant echo by this tool are listed. echo echo Integer bit-mask values: echo ----------------------- echo bit 31 = show account summary info echo bit 30 = show database info echo bit 29 = show 3rd party account(s) info echo bit 28 = show special filecode counts echo bit 27 = show group/directory info echo bit 26 = show individual files that matter (note that echo many file are not displayed, e.g. standard files echo bit 25 = show I/O config info echo echo For example, a "level" value of 11 (%13) asks that, in & addition echo to the default summary report, the following additional & information echo be shown: echo individual account info + echo database info + echo special filecode files echo An easy way to see everything is to use a level of -1. echo return # **** FC_INFO **** # elseif '!entry' = 'fc_info' then # Report filecode summary. All unique filecodes on this system are # kept track of and the number of files of each filecode are counted. # The filecodes are kept in a string variable array with the prefix: # '_sw_fc_'. Negative (PRIV) filecodes are similarly # stored as '_sw_fc_PRIV'. There is no variable that tracks # the array size, thus a :showvar _sw_fc_@ is done to obtain the full list # of filecode mnemonics. After processing the output of each showvar, the # same set of filecode variables are deleted. The processing order is # important: PRIV filecodes are done first, followed by all remaining # alphanumeric filecode mnemonics, followed last by numeric filecodes. # # Note: due to this handling of filecodes no script variables should # begin with "_sw_fc_", except for those variable tracking specific file # code counts. # echo echo echo ---------------- Files by Filecode Info ------------------------ # first, process file counts for all priv files setvar hpcierr 0 showvar _sw_fc_PRIV@ >swfcvars if hpcierr = 0 then xeq !_sw_me entry=file_info_privFC swfcvars if hpcierr = 0 then xeq !_sw_me entry=file_info_fmtFC swfcvars if hpcierr = 0 then xeq !_sw_me entry=file_info_otherFC = 0 do setvar _sw_rec input() setvar _sw_fcstr rht(word(_sw_rec),-8) setvar _sw_fc_tot _sw_fc_tot+![setvar(_sw_fccnt,word(_sw_rec,,-1))] echo # of !_sw_fcstr![rpt(' ',6-len(_sw_fcstr))]: !_sw_fccnt endwhile echo Total: !_sw_fc_tot return # **** FILE_INFO_OTHERFC **** # elseif '!entry' = 'file_info_otherFC' then # This routine reports all numeric filecode mnemonics found on the system. # Input has been redirected to the output of :showvar _sw_fc_@ *after* all # PRIV files *and* alphanumeric filecodes have been processed and deleted. # echo echo Other filecode files: echo setvar _sw_fc_tot 0 setvar _sw_eof0 finfo(hpstdin,'eof') while setvar(_sw_eof0,_sw_eof0-1) >= 0 do setvar _sw_rec input() setvar _sw_fcstr rht(word(_sw_rec),-8) setvar _sw_fc_tot _sw_fc_tot+![setvar(_sw_fccnt,word(_sw_rec,,-1))] echo # of !_sw_fcstr![rpt(' ',6-len(_sw_fcstr))]: !_sw_fccnt endwhile echo Total: !_sw_fc_tot return # **** FILE_INFO_PRIVFC **** # elseif '!entry' = 'file_info_privFC' then # This routine reports all PRIV filecode mnemonics found on the system. # Input has been redirected to the output of :showvar _sw_fc_PRIV@. # PRIV file codes are processed first, before numeric and alphanumeric # filecode mnemonics. # echo echo PRIV filecode files: echo # skip first record, which is _sw_fc_PRIV, which is the total number of # priv filecode files. input _sw_rec setvar _sw_eof0 finfo(hpstdin,'eof')-1 while setvar(_sw_eof0,_sw_eof0-1) >= 0 do setvar _sw_rec input() setvar _sw_fcstr "-"+rht(word(_sw_rec),-12) setvar _sw_fccnt word(_sw_rec,,-1) echo # of !_sw_fcstr![rpt(' ',6-len(_sw_fcstr))]: !_sw_fccnt endwhile echo Total: !_sw_fc_priv return # **** IMAGE_SIZE **** # elseif '!entry' = 'image_size' then # Calculates the size in pages for the IMAGE database. The caller issued the # listfile to display all files for this database, including jumbo control # files, jumbo chunk files, partial b-tree index files, Omnidex TPI files, # etc. However, it is still possible to construct a DB name such that the # caller's listfile will match more files than belong to the root DB being # counted. Thus, this routine needs to check the file code to ensure that # we only have Image files (and not another DB's root file). # # Input has been redirected to output of a listfile /ACCT/GRP/ROOT??|??.@,6 # # Parm1 = the absolute pathname of the root file (HFS syntax) # Parm2 = CI variable name to hold cumulated page count # Returns: parm2, plus: # _sw_db_dbe Y="TC" file exists, which maps to DBE # _sw_db_jumbo Y=one or more jumbo datasets # _sw_db_idx Y=one or more sets use b-tree partial keys # setvar _sw_db_dbe "N" setvar _sw_db_jumbo "N" setvar _sw_db_idx "N" setvar _sw_sec 0 setvar _sw_tmp 0 # check if the caller's listfile had some error. If so skip the root file, # but return something reasonable... if hpcierr = -9043 then # Cannot find expected datasets for root file # See if the set is unexpectedly missing or has not been created, by # reading the first user label in the root file and examining the ASCII # RL'CONDITION code in the 1st two bytes. if finfo("!what",'exists') and & finfo("!what",'user labels written') > 0 and & lft(finfo("!what",'first user label'),2) = "JB" then echo *** WARN ![setvar(_sw_warn_cnt,_sw_warn_cnt+1)]: & Datasets not created for "!what"... skipped # write to the log file too echo *** WARN !_sw_warn_cnt: & Datasets not created for "!what"... skipped >>*!_sw_logf else echo *** ERROR ![setvar(_sw_err_cnt,_sw_err_cnt+1)]: & Datasets missing for "!what"... skipped echo *** ERROR !_sw_err_cnt: & Datasets missing for "!what"... skipped >>*!_sw_logf endif echo elseif hpcierr <> 0 then echo *** ERROR ![setvar(_sw_err_cnt,_sw_err_cnt+1)]: & Cannot access datasets for "!what" (CIERR !hpcierr)... skipped echo *** ERROR !_sw_err_cnt: & Cannot access datasets for "!what" (CIERR !hpcierr)... skipped & >>*!_sw_logf echo else setvar _sw_eof2 finfo(hpstdin,'eof') while setvar(_sw_eof2,_sw_eof2-1) >= 0 do # read listfile output and get the filecode if setvar(_sw_db_fc,finfo(setvar(_sw_rec,ltrim(rtrim(input()))), & 'fcode')) <= -401 and _sw_db_fc >= -490 then # an expected Image file and not a root file for another DB # use caution with FINFO 'sectors' since it fails on a large file setvar hpcierr 0 setvar hpmsgfence 2 continue setvar _sw_sec finfo(_sw_rec,'sectors') setvar hpmsgfence _sw_save_mfence if hpcierr <> 0 and finfo(_sw_rec,'exists') then echo *** WARN ![setvar(_sw_warn_cnt,_sw_warn_cnt+1)]: Sectors & error for file "!_sw_rec". File size not counted. echo *** WARN !_sw_warn_cnt: Sectors error for file & "!_sw_rec" >>*!_sw_logf setvar _sw_sec 0 setvar hpcierr 0 elseif hpcierr <> 0 then # file disappeared setvar _sw_sec 0 endif # convert to pages and accumulate setvar _sw_tmp _sw_tmp + (_sw_sec/16) # check for jumbo control file if hpcierr = 0 then if setvar(_sw_db_fc,finfo(_sw_rec,'fcode')) = -408 then setvar _sw_db_jumbo "Y" # check for partial key index file elseif _sw_db_fc = -412 then setvar _sw_db_idx "Y" # check for "TC" file with DBE info elseif rht(_sw_rec,2) = "TC" and _sw_db_fc = -430 then setvar _sw_db_dbe "Y" endif endif endif endwhile endif # return pages via parm2 setvar !level _sw_tmp return # **** IO_INFO **** # elseif '!entry' = 'io_info' then # if sysinfo.prvxl.telesup was run in the sysinfo step, get io info there, # else do a simple SHOWDEV command. # if finfo('sysinfoz','exists') then # sysinfo.prvxl.telesup was run with the IO command print sysinfoz;start=18;end=-2;page=0 else echo echo ------------------------- IO Configuration ------------------------- echo showdev endif return # **** LIST_FILES **** # elseif "!entry" = 'list_files' then # Process each record from the :listfile,6;tree [in HFS format] executed # in the "read_level0" routine. This "list_files" routine performs the # bulk of individual account, group, directory and file processing, # including handling database files. All filecodes are processed here. # setvar _sw_eof1 finfo(hpstdin,'eof') if not (_sw_lev_file or _sw_lev_group) then # let the user know if we are processing a lot of files if _sw_eof1 > 5000 then echo if setvar(_sw_tmp,hpcpumsecs mod 5) = 0 then echo ... processing !_sw_eof1 files, so hang loose... elseif _sw_tmp = 1 then echo ... processing !_sw_eof1 files, so get some coffee... elseif _sw_tmp = 2 then echo ... processing !_sw_eof1 files, so relax... elseif _sw_tmp = 3 then echo ... processing !_sw_eof1 files, so take five... else echo ... processing !_sw_eof1 files, so chill... endif if _sw_eof1 > 50000 then if setvar(_sw_tmp,hpcpumsecs mod 3) = 0 then echo ... why do you have that many files in one spot? elseif _sw_tmp = 1 then echo ... you have time to jog around the block (twice!) else echo ... preparing next year's taxes might be faster! endif endif endif endif while setvar(_sw_eof1,_sw_eof1-1) >= 0 do setvar _sw_f ltrim(rtrim(input())) setvar _sw_cur_depth wordcnt(_sw_f,'/')-1 # Check for exiting an account, group, or directory. Extra test # to handle the previous level being empty. if (_sw_cur_depth < _sw_prev_depth) or & (_sw_cur_depth = _sw_prev_depth and & (_sw_rty="GROUP" or _sw_rty="DIRECTORY" or _sw_rty="ACCOUNT")) then # done with a dir, group or acct-- report subtotals and clear counters xeq !_sw_me entry=subtotals endif setvar _sw_prev_depth _sw_cur_depth # cap the directory reporting depth at 4 levels deep setvar _sw_arry_ndx min(4,_sw_cur_depth) # use caution calling FINFO since the file could be gone by now, or # there can be other problems, like bad UFID, etc... setvar hpcierr 0 # use caution with FINFO since the file could be gone by now... setvar hpcierr 0 setvar hpmsgfence 2 continue setvar _sw_rty finfo(_sw_f,'rectype') setvar hpmsgfence _sw_save_mfence if hpcierr <> 0 and finfo(_sw_f,'exists') then echo *** ERROR ![setvar(_sw_err_cnt,_sw_err_cnt+1)]: file & "!_sw_f" skipped getting 'rectype' # write to log file too echo *** ERROR !_sw_err_cnt: file "!_sw_f" skipped hpcierr getting & 'rectype' >>*!_sw_logf setvar _sw_rty "" elseif hpcierr <> 0 then # file gone, so just quietly skip it setvar _sw_rty "" endif # ***** ACCOUNT ***** if _sw_rty = "ACCOUNT" then setvar _sw_a word(_sw_f,"/",2) if _sw_lev_group then echo echo In account: !_sw_a endif setvar _sw_tot_accts _sw_tot_accts+1 setvar _sw_in_acct true # set level 1 dir type to "A" for account setvar _sw_dir_ty_1 "A" if _sw_lev_vend then # see if the acct is a Known Vendor Acct (KVA) setvar _sw_vend_a "" setvar _sw_i 0 while setvar(_sw_i,_sw_i+1) <= _sw_kva_0 and & not pmatch(word(_sw_kva_![_sw_i+1],'='),_sw_f) do endwhile if _sw_i <= _sw_kva_0 # match setvar _sw_vend_a xword(_sw_kva_!_sw_i,"=") if _sw_lev_group then echo contains !_sw_vend_a products endif setvar _sw_kva_cnt _sw_kva_cnt+1 # mark this vendor array element as matched setvar _sw_kva_!_sw_i "x"+_sw_kva_!_sw_i endif endif # ***** GROUP ***** elseif _sw_rty = "GROUP" then setvar _sw_tot_grps _sw_tot_grps+1 setvar _sw_acct_num_grps _sw_acct_num_grps+1 setvar _sw_g word(_sw_f,"/",3) setvar _sw_in_grp true # set level 2 dir type to "G" for group setvar _sw_dir_ty_2 "G" # get homed user volset info if setvar(_sw_uv,finfo(_sw_f,'volume set name')) <> & "MPEXL_SYSTEM_VOLUME_SET" then setvar _sw_acct_num_vs_grps _sw_acct_num_vs_grps+1 setvar _sw_tot_vs_grps _sw_tot_vs_grps+1 endif # ***** DIRECTORY ***** elseif _sw_rty = "DIRECTORY" then if _sw_cur_depth = 1 and _sw_lev_group then # entering a new 'root level' dir echo echo In directory: !_sw_f endif setvar _sw_tot_dirs _sw_tot_dirs+1 setvar _sw_in_dir true # set level n dir type to "D" for directory setvar _sw_dir_ty_!_sw_arry_ndx "D" setvar _sw_d _sw_f if _sw_in_acct then setvar _sw_acct_num_dirs _sw_acct_num_dirs+1 if _sw_in_grp then setvar _sw_grp_num_dirs _sw_grp_num_dirs+1 endif endif # ***** FILE ***** elseif _sw_rty <> "" then # We (hopefully still) have a file! # Programming Note: this section of the script used to be a separate # entry routine, but due to its high usage the overall performance of # the script decreased by a factor of 3! :-{ So, to alleviate this # situation I have inlined routine here again... # # Count the file size (sectors converted to pages), database info if # the file is an IMAGE or ALLBASE file, filecode info, etc. Also, # since this section is likely called the most frequently, progress # data is logged. Note: the file may have been purged since the # LISTFILE found it, and this is detected trying to get the sectors. # #echo File: !_sw_f setvar _sw_tot_files _sw_tot_files+1 # decrement depth(level) index since files accumulate to parent, but # don't do this when the curr level is beyond the "folding" level of 4. setvar _sw_arry_ndx min(4,_sw_cur_depth-1) # log basic progress approx every 200 CPU seconds if hpcpusecs - _sw_prev_cpu >= 200 then echo progress= cpu: ![hpcpusecs-_sw_start_cpu] sec, # files: & !_sw_tot_files, file: !_sw_f >>*!_sw_logf setvar _sw_prev_cpu hpcpusecs endif # use caution with FINFO 'sectors' since it will fail on large files setvar hpcierr 0 setvar hpmsgfence 2 continue setvar _sw_size finfo(_sw_f,'sectors') setvar hpmsgfence _sw_save_mfence if hpcierr <> 0 and finfo(_sw_f,'exists') then echo *** WARN ![setvar(_sw_warn_cnt,_sw_warn_cnt+1)]: Sectors & error for file "!_sw_f". File size not counted. # write to error log too echo *** WARN !_sw_warn_cnt: Sectors error for file "!_sw_f" & >>*!_sw_logf setvar _sw_size 0 setvar hpcierr 0 elseif hpcierr <> 0 then # file disappeared, so skip it setvar _sw_tot_files _sw_tot_files - 1 endif if hpcierr = 0 then # get filecode and optionally file type via finfo setvar hpmsgfence 2 continue setvar _sw_fc finfo(_sw_f,'fcode') setvar hpmsgfence _sw_save_mfence if hpcierr <> 0 and finfo(_sw_f,'exists') then echo *** WARN ![setvar(_sw_warn_cnt,_sw_warn_cnt+1)]: can't & get filecode for "!_sw_f", using 0. echo *** WARN !_sw_warn_cnt: can't get filecode for "!_sw_f", & using 0. >>*!_sw_logf setvar _sw_fc 0 setvar hpcierr 0 elseif hpcierr <> 0 then # file disappeared, so skip it setvar _sw_tot_files _sw_tot_files - 1 endif endif # accumulate to parent num files for this traversal depth setvar _sw_num_files_!_sw_arry_ndx _sw_num_files_!_sw_arry_ndx+1 # convert size to pages and accumulate to parent level # note: sectors is always a multiple of pages(16 sectors=1 page) setvar _sw_size _sw_size / 16 # accumulate to parent size for this traversal depth setvar _sw_size_!_sw_arry_ndx _sw_size_!_sw_arry_ndx + _sw_size # determine largest file on the system if _sw_size > _sw_sys_big_file then setvar _sw_sys_big_file _sw_size setvar _sw_sys_big_fname _sw_f endif # determine largest file in the account if _sw_size > _sw_acct_big_file then setvar _sw_acct_big_file _sw_size setvar _sw_acct_big_fname _sw_f endif # determine the file type using the filecode # handle IMAGE db (root filecode = -400) if _sw_fc = -400 then setvar _sw_tot_imgdb _sw_tot_imgdb+1 # (Assume IMAGE dbs are in an group.account setvar _sw_acct_num_imgdb _sw_acct_num_imgdb+1 setvar _sw_grp_num_imgdb _sw_grp_num_imgdb+1 # Compute page size for this IMAGE db including the root file, all # datasets (remember datasets higher than 99 use a letter followed # by digit suffix), jumbo control files, jumbo chunk files, partial # key index files, Bradmark TPI files, etc. Note: the goal using # the listfile command below is to have a high chance of listing # only the files belong to the root DB. However, if one DB is named # "F" and another is named "F12" then a listfile F?? will include # the root file "F12". Thus, the routine that processes this # listfile needs to check the file code so that "F12" (in this # example) is not counted. if _sw_lev_db then setvar hpcierr 0 continue listfile (!"_sw_f"??,!"_sw_f"??.@),6 >swlfdb xeq !_sw_me !_sw_f _sw_db_sz entry=image_size < swlfdb # returns _sw_db_sz, _sw_db_jumbo, _sw_db_idx, _sw_db_dbe # add root file pages to the DB total setvar _sw_db_sz _sw_db_sz+_sw_size # fill database "arrays" per this format: # -- IMGDB array -- # byte 1 : char, "Y" if Jumbo else "N" # byte 2 : char, "Y" if Indexed else "N" # byte 3 : char, "Y" if DBE else "N" # bytes 4+ : string, absolute database name in HFS format # -- IMGDBSZ array -- # bytes 1-4: integer, size in pages for entire database # if hpcierr = 0 then # no error from listfile above setvar _sw_IMGDB_0 _sw_IMGDB_0+1 setvar _sw_IMGDB_!_sw_IMGDB_0 & _sw_db_jumbo + _sw_db_idx + _sw_db_dbe + _sw_f setvar _sw_IMGDBSZ_!_sw_IMGDB_0 _sw_db_sz endif # count DBE "TC" files if _sw_db_dbe = "Y" then setvar _sw_tot_imgTC _sw_tot_imgTC+1 setvar _sw_acct_num_imgTC _sw_acct_num_imgTC+1 endif # count jumbo datasets if _sw_db_jumbo = "Y" then setvar _sw_tot_jumbo _sw_tot_jumbo+1 setvar _sw_acct_num_jumbo _sw_acct_num_jumbo+1 endif # count partial key (b-tree) indexing if _sw_db_idx = "Y" then setvar _sw_tot_idx _sw_tot_idx+1 setvar _sw_acct_num_idx _sw_acct_num_idx+1 endif # find largest Image DB in this account if _sw_db_sz > _sw_acct_big_imgdb then setvar _sw_acct_big_imgdb _sw_db_sz setvar _sw_acct_big_imgdb_name _sw_f endif # find largest Image DB on system if _sw_db_sz > _sw_sys_big_imgdb then setvar _sw_sys_big_imgdb _sw_db_sz setvar _sw_sys_big_imgdb_name _sw_f endif endif # handle ALLBASE DB-Con filecode = -491) elseif _sw_fc = -491 then setvar _sw_tot_alldb _sw_tot_alldb+1 if _sw_lev_db then setvar _sw_ALLDB_0 _sw_ALLDB_0+1 setvar _sw_ALLDB_!_sw_ALLDB_0 _sw_f endif endif if (_sw_lev_fc or _sw_lev_file) and hpcierr = 0 then # get the string filecode mnemonic too # use caution with finfo since the file could be deleted etc... setvar hpcierr 0 setvar hpmsgfence 2 continue setvar _sw_fcstr finfo(_sw_f,'fmtfcode') setvar hpmsgfence _sw_save_mfence if hpcierr <> 0 and finfo(_sw_f,'exists') then echo *** WARN ![setvar(_sw_warn_cnt,_sw_warn_cnt+1)]: can't get & filecode for "!_sw_f", using "0". echo *** WARN !_sw_warn_cnt: can't get filecode for "!_sw_f", & using "0". >>*!_sw_logf setvar _sw_fcstr "0" elseif hpcierr <> 0 then # file disappeared setvar _sw_tot_files _sw_tot_files - 1 endif if _sw_fcstr = "" then setvar _sw_fcstr "0" endif # increment file code counter array element if _sw_lev_fc and hpcierr = 0 then if bound(_sw_fc_!_sw_fcstr) then setvar _sw_fc_!_sw_fcstr _sw_fc_!_sw_fcstr+1 else setvar _sw_fc_!_sw_fcstr 1 endif if _sw_fc < 0 then # PRIV code, all mnemonics are just "priv" setvar _sw_fc -_sw_fc if bound(_sw_fc_PRIV!_sw_fc) then setvar _sw_fc_PRIV!_sw_fc _sw_fc_PRIV!_sw_fc+1 else setvar _sw_fc_PRIV!_sw_fc 1 endif setvar _sw_fc -_sw_fc endif endif if _sw_lev_file and hpcierr = 0 then # echo individual file info to $stdlist setvar _sw_f_desc "" if _sw_fc < 0 then # negative (PRIV) filecodes if _sw_fc = -10 or _sw_fc = -20 or _sw_fc = -30 or & _sw_fc = -40 or _sw_fc = -50 or _sw_fc = -60 or & _sw_fc = -73 or _sw_fc = -100 or _sw_fc = -101 or & _sw_fc = -300 then setvar _sw_f_desc "HP Desk" elseif _sw_fc = -12 then setvar _sw_f_desc "Unison DiscMaster compressed" elseif _sw_fc = -200 then setvar _sw_f_desc "HPUID" #elseif _sw_fc = -201 then # setvar _sw_f_desc "HPUIDX" elseif _sw_fc = -202 then setvar _sw_f_desc "HPGID" #elseif _sw_fc = -203 then # setvar _sw_f_desc "HPGIDX" elseif _sw_fc = -296 then setvar _sw_f_desc "FYI Mail" elseif _sw_fc = -400 then setvar _sw_f_desc "IMAGE root" # don't bother echoing the IMAGE datasets... elseif _sw_fc = -402 then setvar _sw_f_desc "IMAGE remote DB" elseif _sw_fc = -404 then setvar _sw_f_desc "IMAGE ILR" elseif _sw_fc = -408 then setvar _sw_f_desc "IMAGE Jumbo Cntl" elseif _sw_fc = -410 or _sw_fc = -411 then setvar _sw_f_desc "IMAGE TPI" elseif _sw_fc = -430 then setvar _sw_f_desc "IMAGE DBE map" elseif _sw_fc <= -490 and _sw_fc >= -499 then setvar _sw_f_desc "ALLBASE" elseif _sw_fc = -516 then setvar _sw_f_desc "AIF" elseif _sw_fc = -601 then setvar _sw_f_desc "TEACHME" elseif _sw_fc = -893 then setvar _sw_f_desc "Oracle" elseif (_sw_fc <= -900 and _sw_fc >= -997) or & _sw_fc = -7652 or _sw_fc = -7653 or _sw_fc = -9876 then setvar _sw_f_desc "Orbit Backup+" elseif _sw_fc = -998 or _sw_fc = -999 then setvar _sw_f_desc "Orbit or RoadRunner" elseif _sw_fc = -1234 then setvar _sw_f_desc "MPE V MemLog" elseif _sw_fc = -16976 then setvar _sw_f_desc "BackPack virt tape" elseif _sw_fc = -21074 then setvar _sw_f_desc "RoadRunner virt tape" elseif _sw_fc <= -21000 and _sw_fc >= -21099 then setvar _sw_f_desc "Unison" endif elseif _sw_fc > 0 then # positive filecodes if (_sw_fc >= 8 and _sw_fc <= 19) or & _sw_fc = 65 then setvar _sw_f_desc "ADAGER" elseif _sw_fc = 72 then setvar _sw_f_desc "Uhaul" #elseif _sw_fc = 111 then # setvar _sw_f_desc "QEDIT" elseif _sw_fc >= 171 and _sw_fc <= 176 then setvar _sw_f_desc "VESoft" elseif _sw_fc = 230 then setvar _sw_f_desc "SpeedEdit" elseif _sw_fc >= 430 and _sw_fc <= 449 then setvar _sw_f_desc "DataExpress" elseif _sw_fc = 634 then setvar _sw_f_desc "HiBack save" # some Cognos filecodes follow ... elseif _sw_fc = 640 then setvar _sw_f_desc "QDD" elseif _sw_fc = 641 then setvar _sw_f_desc "Quick" elseif _sw_fc = 642 then setvar _sw_f_desc "Quiz" elseif _sw_fc = 643 then setvar _sw_f_desc "QTP compiled run" elseif _sw_fc = 644 then setvar _sw_f_desc "Cognos subfile" elseif _sw_fc = 647 then setvar _sw_f_desc "Cognos portable subfile mini-dict" elseif _sw_fc = 648 then setvar _sw_f_desc "Cognos portable subfile data" elseif _sw_fc = 649 then setvar _sw_f_desc "QTP mini-dict" elseif _sw_fc = 655 then setvar _sw_f_desc "PDL/PHD dictionary" # Cognos catch-all elseif _sw_fc >= 640 and _sw_fc <= 655 then setvar _sw_f_desc "Cognos" elseif _sw_fc = 665 then setvar _sw_f_desc "LZW" elseif _sw_fc = 707 then setvar _sw_f_desc "QUARK" elseif _sw_fc = 711 or _sw_fc = 712 or _sw_fc = 719 or & _sw_fc = 757 then setvar _sw_f_desc "Squisher" elseif _sw_fc = 777 then setvar _sw_f_desc "Compression Storage Mgr" elseif _sw_fc = 793 then setvar _sw_f_desc "SPLASH! error" elseif _sw_fc = 817 or _sw_fc = 993 then setvar _sw_f_desc "WordPerfect" elseif _sw_fc = 900 or & (_sw_fc >= 994 and _sw_fc <= 998) then setvar _sw_f_desc "WRQ" elseif _sw_fc = 1012 then setvar _sw_f_desc "OCS" elseif _sw_fc = 1020 then setvar _sw_f_desc "SLATE" elseif _sw_fc = 1023 then setvar _sw_f_desc "BackPack" elseif _sw_fc = 1024 then setvar _sw_f_desc "CM USL" elseif _sw_fc = 1025 then setvar _sw_f_desc "BASIC-V data" elseif _sw_fc = 1026 then setvar _sw_f_desc "BASIC-V prog" elseif _sw_fc = 1027 then setvar _sw_f_desc "BASIC-V fast prog" elseif _sw_fc = 1028 then setvar _sw_f_desc "CM RL"