home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / bit / listserv / ibmmain / 3078 < prev    next >
Encoding:
Text File  |  1993-01-21  |  48.6 KB  |  745 lines

  1. Newsgroups: bit.listserv.ibm-main
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!malgudi.oar.net!chemabs!vjh21
  3. From: vjh21@cas.org (Vince Herried ext 2877)
  4. Subject: DFHSM V2.6.0 REXX tool
  5. Message-ID: <1993Jan21.194531.22080@cas.org>
  6. Sender: usenet@cas.org
  7. Organization: CAS
  8. Date: Thu, 21 Jan 1993 19:45:31 GMT
  9. Lines: 734
  10.  
  11.  
  12. My company's support staff that copes with the day to day
  13. grind of DFHSM tells me that this REXX exec is wunderful.
  14. You may also find it to be of use.  He looks at the DFHSM log
  15. data sets using ISPF 3.4 and calls this command giving it the
  16. data set name of the daily space management "sysout" file.
  17.  
  18. The purpose of this EXEC is to review the log and ignore the messages
  19. that need to be ignore, notify you of those you really should look at,
  20. take some kind of action against those where possible.
  21.  
  22.  
  23. You may have to do some adjusting of the EXEC to comply with your
  24. shop standards, we have our TSO system prefix set to 'TSO' opposed to
  25. the logonid of the tso user.
  26. Please be sure to look it over first before running it.
  27.  
  28.  
  29. I'll answer a few questions about it (unless I'm overwhelmed by silly ones)
  30. but don't blame me if you didn't read it first before running it and it
  31. ends up deleting the last copy of your company's payroll master file.
  32.  
  33. The person running this must have ACF/RACF/whatever authority for most all
  34. system data sets because on of things this guy does is ask permission to
  35. delete data sets that are cataloged on a volume other than the one being migrated
  36. by DFHSM.  So without further ado....
  37.  
  38. /* hsmrept.rexx  12/09/91 VJH21 */                                      00010026
  39. arg indsn                                                               00020007
  40.                                     00030007
  41. /*  History:                                                            00040030
  42.                                     00050030
  43.     v3   01/14/93 - Give ability to delete data sets that are:      00060031
  44.             uncataloged or have invalid DSORG.              00070031
  45.                                     00080031
  46.     v2   02/27/92 - Don't send a message on an unmoveable           00090031
  47.             dataset.                                        00100031
  48.                                     00110030
  49.     V1   12/09/91 - initial version                                 00120030
  50.                                     00130030
  51. */                                                                      00140030
  52.                                     00150030
  53. /*   hsmrept -  a rexx exec to read in the dfhsm log data sets.         00160007
  54.      logic                                                              00170007
  55.        1.  Read in the dfhsm log data set and search for                00180007
  56.        ARC0374I messages.                                           00190007
  57.        2.  If needed read next line to get the dsname.                  00200007
  58.        3.  Output the full message to a disk data set.                  00210007
  59.        4.  Sort the above data set on the return code field.            00220007
  60.        5.  Read it back in.                                             00230026
  61.        6.  If RC=0 or selected values, mearly count em.                 00240007
  62.        7.  For some return codes a fix action has been determined       00250007
  63.        and the caller will be prompted for permission to fix.       00260007
  64.        If permission is given, do the fix.                          00270007
  65.        8.  For other errors just display on the screen.                 00280010
  66.        9.  Summarize the records found.                                 00290007
  67.                                     00300016
  68.                                   */    00310016
  69. do while (coord \= 'Y' & coord \= 'N')                                  00320028
  70.   say "Do you wish to pull in the system coord list(Y or N)?"           00330027
  71.   parse upper external coord                                            00340027
  72. end                                                                     00350025
  73. if coord = 'Y' then do                                                  00360027
  74.   dsname="TSO."userid()".SYSLIST"        /* name of syslist file */     00370025
  75.   dsname = strip(dsname,,"'")             /* remove any quotes */       00380025
  76.   "delstack"                              /* delete prev stack */       00390025
  77.   "alloc f(input) da('"dsname"') reuse shr" /* allocate input file */   00400025
  78.   if rc <> 0 then do                      /* alloc failed */            00410025
  79.      say "Allocation of system exper list - " dsname "failed."          00420025
  80.      exit(16)                                                           00430025
  81.   end                                                                   00440025
  82.   "EXECIO * DISKR INPUT (FINIS"           /* read the file */           00450025
  83.   lastrc = rc                             /* save return code */        00460025
  84.   "free f(input)"                         /* release file */            00470025
  85.   select                                  /* check read status */       00480025
  86.     when lastrc = 0 then nop                                            00490025
  87.     when lastrc = 1 then,                                               00500025
  88.      say 'data was truncated'                                           00510025
  89.     when lastrc = 2 then ,                                              00520025
  90.      say 'premature eof'                                                00530025
  91.      otherwise                                                          00540025
  92.      say "severe error, rc = " lastrc                                   00550025
  93.      "delstack"                           /* empty stack again */       00560025
  94.      exit (16)                            /* get outa dodge */          00570025
  95.   end    /* select */                                                   00580025
  96.   count = queued()                      /* get stack size (file size)*/ 00590025
  97.   do i = 1 to count                                                     00600025
  98.     pull theline                                                        00610025
  99.     sysnm = substr(theline,1,4)           /* get system name */         00620025
  100.     syscord = substr(theline,38,5)        /* get system coordinator */  00630025
  101.     interpret sysnm '=syscord'                                          00640025
  102.   end                                                                   00650025
  103. end                                                                     00660025
  104.                                     00670016
  105. "delstack"                                                              00680007
  106. dsname=strip(indsn,,"'")                                                00690007
  107.                                     00700007
  108. do while (dsname = "" )                 /* prompt for input file */     00710007
  109.    say "enter dsname"                                                   00720004
  110.    parse upper pull  dsname                                             00730003
  111. end                                                                     00740000
  112.                                     00750000
  113. x=msg('on')                                                             00760000
  114. "alloc f(input) da('"dsname"') reuse shr" /* allocate input file */     00770000
  115. if rc \= 0 then do                                                      00780000
  116.   say "unable to allocate f(input) da("dsname")"                        00790000
  117.   cleanup(16) */         /* alloc failed */                             00800012
  118. end                                                                     00810000
  119.                                     00820000
  120.                                     00830007
  121. x=msg('off')                                                            00840010
  122. sortin=userid()||".sortin"                                              00850000
  123. "free f(sortin)"                                                        00860000
  124. "delete " sortin                                                        00870001
  125. "alloc f(sortin)",                                                      00880007
  126. "lrecl (150) new sp(5 10) track unit(vio)"                              00890007
  127. /* da("sortin") */                                                      00900007
  128. if rc \= 0 then do                                                      00910000
  129.   say "unable to allocate f(sortin) da("sortin")"                       00920000
  130.   cleanup(16) */         /* alloc failed */                             00930012
  131. end                                                                     00940000
  132.                                     00950000
  133. "free f(sysin)"                                                         00960007
  134. sysin = userid()||".sortin.parms"                                       00970007
  135. x=msg('off')                                                            00980007
  136. "delete" sysin                                                          00990007
  137. x=msg('on')                                                             01000007
  138. "alloc f(sysin) lrecl (80) new sp(1 1) track",                          01010007
  139.   " unit(vio) "                                                         01020007
  140.   /*"da("sysin") unit(vio) " */                                         01030007
  141. if rc \= 0 then do                                                      01040007
  142.   say "unable to allocate f(sysin) da("sysin")"                         01050007
  143.   cleanup(16) */         /* alloc failed */                             01060012
  144. end                                                                     01070007
  145. x=msg('off')                                                            01080007
  146.                                     01090007
  147. outcnt=0                                                                01100002
  148.                                     01110002
  149. do while(getline() = 0)                 /* read a line from in dsn */   01120007
  150.   pull theline;                         /* remove it from the stack */  01130007
  151.   if index(theline,"ARC0734I") = 0 then iterate                         01140007
  152.                     /* skip it if wrong kind */     01150007
  153.   saveline = theline                                                    01160007
  154.   if index(theline,"DSN=") =0 then do                                   01170007
  155.     if getline() \= 0 then leave       /* read the file */              01180002
  156.                                     01190002
  157.     pull theline                                                        01200000
  158.     saveline = strip(saveline,"T") || space(theline)                    01210002
  159.   end                                                                   01220000
  160.                                     01230000
  161.   /* calculate the sort columns                                    */   01240007
  162.                                     01250007
  163.   if action_parm = "ACTION_PARM" then call srt_cols                     01260007
  164.                                     01270000
  165.   push saveline                                                         01280000
  166.                                     01290000
  167.   "EXECIO 1 DISKW sortin "                                              01300000
  168.   lastrc = rc                                                           01310002
  169.   if lastrc \= 0 then do                                                01320002
  170.     done="error"                                                        01330002
  171.     say "disk write to sortin failed, ending"                           01340002
  172.     cleanup(16)                                                         01350012
  173.   end                                                                   01360002
  174.   outcnt=outcnt+1                                                       01370000
  175.                                     01380000
  176.                                     01390000
  177. end /*of loop*/                                                         01400000
  178.                                     01410000
  179. "delstack"                              /* delete prev stack */         01420000
  180.                                     01430000
  181. "EXECIO 0 DISKR input  (finis"           /* close output */             01440002
  182. "free f(input)"                         /* release file */              01450000
  183.                                     01460002
  184. if outcnt = 0 then do                                                   01470002
  185.   say "no output created, ending"                                       01480000
  186.   cleanup(4)                                                            01490012
  187. end                                                                     01500000
  188.                                     01510000
  189. "EXECIO 0 DISKW sortin (finis"          /* close the file */            01520002
  190.                                     01530002
  191. /* generate the sort statement */                                       01540010
  192.                                     01550010
  193.                                     01560013
  194.  sortp=" SORT FIELDS=(",                                                01570010
  195.  ||action_parm,                                                         01580010
  196.  ||","rccol_parm,                                                       01590010
  197.  ||","reason_parm,                                                      01600010
  198.  ||","dsn_parm,                                                         01610010
  199.  ||")"                                                                  01620010
  200.                                     01630010
  201.                                     01640013
  202. push sortp                                                              01650000
  203.                                     01660000
  204. "EXECIO 1 DISKW sysin (finis"           /* close output */              01670000
  205.                                     01680000
  206. sortout=userid()||".hsm.sortout"                                        01690000
  207. "free f(sortout)"                                                       01700000
  208. "delete" sortout                                                        01710000
  209. "alloc f(sortout) da("sortout") lrecl (150) mod sp(1 10) track release" 01720007
  210. if rc \= 0 then do                                                      01730000
  211.   say "unable to allocate f(sortout) da("sortout")"                     01740000
  212.   cleanup(16) */         /* alloc failed */                             01750012
  213. end                                                                     01760000
  214.                                     01770000
  215. "free f(sysout)"                                                        01780000
  216. "alloc f(sysout) da(*)"                                                 01790013
  217.                                     01800000
  218. "free f(sysprint)"                                                      01810000
  219. "alloc f(sysprint) da(*)"                                               01820013
  220.                                     01830003
  221. say "Now calling sort."                                                 01840003
  222.                                     01850003
  223. "call 'sys1.sync.sortlib(sort)' 'size=max-100k,dynalloc=scrta'"         01860013
  224.                                     01870003
  225. lastrc = rc                                                             01880003
  226. if lastrc \= 0 then do                                                  01890003
  227.                                     01900003
  228.   say "The sort failed with a return code of" lastrc                    01910003
  229.   say "Sorry, I've got to exit now"                                     01920007
  230.   cleanup(16)                                                           01930012
  231.                                     01940003
  232. end                                                                     01950003
  233.                                     01960003
  234. "free f(sortin)"                                                        01970000
  235. "delete" sortin                                                         01980000
  236. "free f(sysin)"                                                         01990000
  237. "delete" sysin                                                          02000000
  238.                                     02010002
  239. "alloc f(input) da("sortout")"                                          02020002
  240. if rc \= 0 then do                                                      02030002
  241.   say "unable to allocate f(INPUT) da("sortout")"                       02040002
  242.   cleanup(16) */         /* alloc failed */                             02050012
  243. end                                                                     02060002
  244.                                     02070000
  245.   /* sample message ...                                                 02080002
  246. ARC0734I ACTION=MIGRATE FRVOL=HSM022 TOVOL=041191 TRACKS=    1 RC=  13, 02090002
  247.      REASON=      8, AGE= 184,                                      02100002
  248.  DSN=N066FILE.EN04.SYSOUT.I03#.LIST.G0718V00                            02110002
  249.    if the dsn will fit, then it will be on the first line.. */          02120002
  250.                                     02130002
  251.   count_scratch = 0                                                     02140002
  252.   count_reduced = 0                                                     02150002
  253.   count_recycle = 0                                                     02160002
  254.   count_recover = 0                                                     02170002
  255.   count_partrel = 0                                                     02180002
  256.   count_movevt = 0                                                      02190002
  257.   count_movebv = 0                                                      02200002
  258.   count_migrate = 0                                                     02210002
  259.   count_expired = 0                                                     02220002
  260.   count_exbackv = 0                                                     02230002
  261.   count_deleted = 0                                                     02240002
  262.   count_del_age = 0                                                     02250002
  263.   count_backup = 0                                                      02260002
  264.   count_errors. = 'x'                                                   02270003
  265.   high_retcode = 0                                                      02280003
  266.                                     02290003
  267.                                     02300002
  268. say "Now reading the sorted log file back in."                          02310003
  269.                                     02320003
  270. "delstack"                              /* empty the stack first */     02330020
  271.                                     02340020
  272. do while(getline() = 0)                                                 02350002
  273.   parse pull theline                                                    02360002
  274.   theline = translate(theline,' ',',') /* remove all commas */          02370003
  275.                                     02380003
  276.   theline = space(theline)                                              02390003
  277.   parse var theline msgid,                                              02400002
  278.     "ACTION=" action,                                               02410002
  279.     "FRVOL=" frvol,                                                 02420003
  280.     "TOVOL=" tovol,                                                 02430003
  281.     "TRACKS=" tracks,                                               02440003
  282.     "RC=" retcode,                                                  02450003
  283.     "REASON=" reason,                                               02460003
  284.     "AGE=" age,                                                     02470003
  285.     "DSN=" dsname therest                                           02480003
  286.                                     02490003
  287.   tracks = strip(tracks)             /* remove blanks */                02500003
  288.                                     02510003
  289.   retcode = space(retcode)           /* remove all blanks */            02520003
  290.                                     02530003
  291.   reason = space(reason)             /* remove all blanks */            02540003
  292.                                     02550003
  293.   age = space(age)                   /* remove all blanks */            02560003
  294.                                     02570003
  295.   select                                                                02580003
  296.     when action = "DEL-AGE" then do                                     02590007
  297.       count_DEL_AGE = count_DEL_AGE + 1                                 02600017
  298.       select                                                            02610007
  299.     when retcode = 0 then nop;                                      02620007
  300.     otherwise                                                       02630007
  301.       say "See msg ARC12nnI"                                        02640017
  302.       say theline                                                   02650017
  303.       say ""                                                        02660017
  304.       end  /* select */                                                 02670007
  305.     end                                                                 02680007
  306.     when action = "DELETED" then do                                     02690007
  307.       count_DELETED = count_DELETED + 1                                 02700007
  308.       select                                                            02710007
  309.     when retcode = 0 then nop;                                      02720007
  310.     otherwise                                                       02730007
  311.       if retcode < 100 then,                                        02740017
  312.         say "See Table 6 Page 258"                                  02750017
  313.       if retcode > 399 & retcode < 500 then,                        02760017
  314.         say "See msg ARC9998I"                                      02770017
  315.       say theline                                                   02780017
  316.       say ""                                                        02790017
  317.       end   /* select */                                                02800007
  318.     end                                                                 02810007
  319.     when action = "EXBACKV" then do                                     02820007
  320.       count_EXBACKV = count_EXBACKV + 1                                 02830007
  321.       select                                                            02840007
  322.     when retcode = 0 then nop;                                      02850007
  323.     otherwise                                                       02860007
  324.       say "See table 7 on page 258."                                02870017
  325.       say theline                                                   02880017
  326.       say ""                                                        02890017
  327.       end   /* select */                                                02900007
  328.     end                                                                 02910007
  329.     when action = "EXPIRED" then do                                     02920007
  330.       count_EXPIRED = count_EXPIRED + 1                                 02930007
  331.       select                                                            02940007
  332.     when retcode = 0 then nop;                                      02950007
  333.     otherwise                                                       02960007
  334.       say "action="action"error",                                   02970007
  335.       theline                                                       02980007
  336.       end  /* select */                                                 02990007
  337.     end;                                                                03000007
  338.     when action = "MIGRATE" then do                                     03010007
  339.       count_MIGRATE = count_MIGRATE + 1                                 03020007
  340.       select                                                            03030007
  341.     when retcode = 0 then nop                                       03040007
  342.     when retcode = 8 & reason = 6 then nop  /* sdsp busy */         03050018
  343.     when retcode = 8 & reason = 7 then nop  /* sdsp busy */         03060018
  344.     when retcode = 8 & reason =20 then nop  /* cancel by exit */    03070018
  345.     when retcode = 13 then do                                       03080007
  346.       say "Migrated data set "dsname" not cataloged, OK to remove?" 03090014
  347.       fix = "?"                                                     03100007
  348.       do while(fix \= 'Y' & fix \= 'N')                             03110007
  349.         parse upper pull fix                                        03120007
  350.       end                                                           03130007
  351.       if fix = 'Y' then,                                            03140007
  352.         "hsend fixcds d " dsname "verify(6,bits(1.......))",        03150007
  353.         "patch(6,bits(0..1....))"                                   03160007
  354.     end;                                                            03170007
  355.     when retcode = 19 then nop;   /* in use by another job */       03180007
  356.     when retcode = 20 & reason = 4 then do                          03190014
  357.                                     03200031
  358.     /* v3 allow Davy to delete it if he feels brave */              03210031
  359.                                     03220031
  360.       do until(ans='Y' | ans='N')                                   03230032
  361.         say "During an attempt to migrate" dsname "on" frvol        03240031
  362.         say "DFHSM found that it was cataloged on another volume,"  03250032
  363.         say "this can lead to multiple copies of same data set."    03260032
  364.         say "Reply 'y' to delete it or 'n' to ignore?"              03270032
  365.         pull ans                                                    03280032
  366.       end                                                           03290031
  367.                                     03291031
  368.       if ans='Y' then do   /* delete that sucker */                 03300031
  369.         x=msg("on")                                                 03310031
  370.         "alloc f(wonkus) unit(sysallda) old da('"dsname"')",        03320031
  371.         "volume("frvol") delete reuse"                              03330033
  372.         "free f(wonkus)"                                            03350033
  373.         x=msg(x)                                                    03360031
  374.       end                                                           03370031
  375.       else say "No action taken"                                    03380031
  376.                                     03390031
  377.     end                                                             03410014
  378.     when retcode = 30 & age < 14 then nop  /* may be in use*/       03420010
  379.     when retcode = 30 & age >= 14 then do                           03430020
  380.                                     03440020
  381.       queue "When DFHSM attempted to migrate "dsname" on "frvol     03450020
  382.       queue "that is" age "days old, it found that it was not"      03460020
  383.       queue "cataloged.  Please catalog this data set so that"      03470020
  384.       queue "it can be managed properly."                           03480020
  385.                                     03490020
  386.       x=sendmsg(dsname)                                             03500020
  387.                                     03510020
  388.     end                                                             03520014
  389.     when retcode = 51 then nop;   /* in use by another dfhsm */     03530017
  390.     when retcode = 99 & reason=0 then do                            03540030
  391.                                     03550030
  392.       say dsname "has an extent for user labels and is either",     03560030
  393.           " empty or non-sequential!"                               03570030
  394.                                     03580030
  395.     end                                                             03590030
  396.     when retcode = 99 & reason=2 then do                            03600030
  397.                                     03610030
  398.       say dsname "on" frvol,                                        03620030
  399.           "is VSAM. it may not be cataloged correctly,",            03630030
  400.           " or it is a vsam catalog, or it has the erase attribute" 03640030
  401.                                     03650030
  402.     end                                                             03660030
  403.     when retcode = 99 & reason=4 then do                            03670030
  404.                                     03680030
  405.       /* dsorg other than ps, po, bdam, or vsam */                  03690030
  406.                                     03700030
  407.       if age > 7 then call emptydsn                                 03710030
  408.                                     03720030
  409.     end                                                             03730030
  410.     when retcode = 99 & reason=6 then do                            03740030
  411.       /* invalid blocksize */                                       03750030
  412.       queue "When DFHSM attempted to migrate "dsname" on "frvol     03760030
  413.       queue "that is" age "days old, it found that the blocksize"   03770030
  414.       queue "was invalid.  It might be 0, or too big for the device"03780030
  415.       queue "Please check it out."                                  03790030
  416.                                     03800030
  417.       x=sendmsg(dsname)                                             03810030
  418.                                     03820030
  419.                                     03830030
  420.     end                                                             03840030
  421.     when retcode = 99 & reason=8 then nop; /* unmoveable data*/     03850030
  422.     when retcode = 99 & reason=10 then nop; /* usr labels?     */   03860030
  423.     when retcode = 99 & reason=12 then nop; /* split over cyls */   03870030
  424.     when retcode = 99 & reason=14 then nop; /* apf authorized */    03880030
  425.     when retcode = 99 & reason=20 then do                           03890030
  426.       /* vsam with erase attribute */                               03900030
  427.     end                                                             03910030
  428.     when retcode = 99 & reason=36 then do                           03920030
  429.       /* invalid dsname            */                               03930030
  430.       say dsname "on" frvol "appears to have an invalid dsname."    03940030
  431.     end                                                             03950030
  432.     when retcode = 99 & age < 8  then nop  /* may be in use*/       03960024
  433.     when retcode = 99 & age > 7  then,                              03970024
  434.       call emptydsn                                                 03980021
  435.                                     03990020
  436.     otherwise                                                       04000007
  437.       if retcode < 10 then,                                         04010018
  438.         say "See msg ARC120"retcode"I "                             04020018
  439.       else,                                                         04030018
  440.         say "See msg ARC12"retcode"I "                              04040018
  441.                                     04050018
  442.       say theline                                                   04060017
  443.       say " "                                                       04070017
  444.       end   /* select */                                                04080007
  445.     end;                                                                04090007
  446.     when action = "MOVE VT" then do                                     04100007
  447.       count_MOVEVT = COUNT_MOVEVT + 1                                   04110007
  448.       select                                                            04120007
  449.     when retcode = 0 then nop;                                      04130007
  450.     otherwise                                                       04140007
  451.       say "action="action"error",                                   04150007
  452.       theline                                                       04160007
  453.       end  /* select */                                                 04170007
  454.     end;                                                                04180007
  455.     when actioin= "MOVE BV" then do                                     04190007
  456.       COUNT_MOVEBV = COUNT_MOVEBV + 1                                   04200007
  457.       select                                                            04210007
  458.     when retcode = 0 then nop;                                      04220007
  459.     otherwise                                                       04230007
  460.       say "action="action"error",                                   04240007
  461.       theline                                                       04250007
  462.       end                                                               04260007
  463.     end                                                                 04270007
  464.     when action = "PARTREL" then do                                     04280007
  465.       count_PARTREL = count_PARTREL + 1                                 04290007
  466.       select                                                            04300007
  467.     when retcode = 0 then nop;                                      04310007
  468.     otherwise                                                       04320007
  469.       say "action="action"error",                                   04330007
  470.       theline                                                       04340007
  471.       end                                                               04350007
  472.     end;                                                                04360007
  473.     when action = "RECOVER" then do                                     04370007
  474.       count_RECOVER = count_RECOVER + 1                                 04380007
  475.       select                                                            04390007
  476.     when retcode = 0 then nop;                                      04400007
  477.     otherwise                                                       04410007
  478.       say "action="action"error",                                   04420007
  479.       theline                                                       04430007
  480.       end                                                               04440007
  481.     end;                                                                04450007
  482.     when action = "RECYCLE" then do                                     04460007
  483.       count_RECYCLE = count_RECYCLE + 1                                 04470007
  484.       select                                                            04480007
  485.     when retcode = 0 then nop;                                      04490007
  486.     otherwise                                                       04500007
  487.       say "action="action"error",                                   04510007
  488.       theline                                                       04520007
  489.       end                                                               04530007
  490.     end;                                                                04540007
  491.     when action = "REDUCED" then do                                     04550007
  492.       count_REDUCED = count_REDUCED + 1                                 04560007
  493.       select                                                            04570007
  494.     when retcode = 0 then nop;                                      04580007
  495.     when retcode = 19 then nop;   /* in use by another job */       04590007
  496.     otherwise                                                       04600007
  497.       say "action="action"error",                                   04610007
  498.       theline                                                       04620007
  499.       end                                                               04630007
  500.     end                                                                 04640007
  501.     when action = "SCRATCH" then do                                     04650007
  502.       count_SCRATCH = count_SCRATCH + 1                                 04660007
  503.       select                                                            04670007
  504.     when retcode = 0 then nop;                                      04680007
  505.     otherwise                                                       04690007
  506.       say "action="action"error",                                   04700007
  507.       theline                                                       04710007
  508.       end                                                               04720007
  509.     end                                                                 04730007
  510.     when action = "BACK-UP" then do                                     04740009
  511.       count_backup = count_backup + 1                                   04750007
  512.       select                                                            04760007
  513.     when retcode = 0 then nop;                                      04770007
  514.     when retcode = 16 & reason = 6 then do                          04780024
  515.       queue "DFHSM was unable to backup" dsname "on" frvol          04790024
  516.       queue "he says that the block descriptor word is probably"    04800024
  517.       queue "larger than the data set BLKSIZE.  It has been bad for"04810024
  518.       queue age "days.  If you don't need it anylonger please"      04820024
  519.       queue "DELETE it.  If you still need it contact D28 for"      04830024
  520.       queue "assistance."                                           04840024
  521.       x=sendmsg(dsname)                                             04850024
  522.     end                                                             04860024
  523.     when retcode = 17 then do                                       04870024
  524.       queue "DFHSM was unable to backup" dsname "on" frvol          04880020
  525.       queue "It appears to be broken and has not been backed up for"04890020
  526.       queue age "days.  If you don't need it anylonger please"      04900020
  527.       queue "DELETE it.  If you still need it contact D28 for"      04910020
  528.       queue "assistance."                                           04920020
  529.       x=sendmsg(dsname)                                             04930020
  530.     end                                                             04940020
  531.                                     04950020
  532.     when retcode = 19 then nop;    /* in use */                     04960020
  533.     when retcode = 35 then nop;    /* in use by dfhsm */            04970011
  534.     when retcode = 53 then nop;    /* in use */                     04980011
  535.     when retcode = 56 & reason = 12 then nop; /* cluster components 04990014
  536.                              on diff vols */    05000014
  537.                                     05010014
  538.     when retcode = 56 & reason = 15 then nop; /* blksize to big */  05020014
  539.     when retcode = 99 & age < 8  then nop  /* may be in use*/       05030024
  540.     when retcode = 99 & age > 7  then,     /* may be in use*/       05040024
  541.       call emptydsn                                                 05050021
  542.     otherwise                                                       05060007
  543.       if retcode < 10 then,                                         05070018
  544.         say "See msg ARC130"retcode"I "                             05080018
  545.       else,                                                         05090018
  546.         say "See msg ARC13"retcode"I "                              05100018
  547.                                     05110018
  548.       say theline                                                   05120017
  549.       say " "                                                       05130017
  550.       end                                                               05140007
  551.     end                                                                 05150007
  552.     otherwise                                                           05160007
  553.       say "unknown action" action "in line",                            05170007
  554.       theline;                                                          05180007
  555.   end   /* end select ? */                                              05190007
  556.                                     05200002
  557.   if retcode \= 0 then do                                               05210007
  558.     if datatype(count_errors.retcode) \= "NUM" then                     05220007
  559.        count_errors.retcode = 0                                         05230007
  560.     if high_retcode < retcode then high_retcode = retcode               05240007
  561.     count_errors.retcode = count_errors.retcode +1                      05250007
  562.   end                                                                   05260007
  563.                                     05270002
  564. end                                                                     05280002
  565.                                     05290002
  566. "EXECIO 0 DISKR input  (finis"           /* close output */             05300002
  567. "free f(input)"                         /* release file */              05310002
  568.                                     05320002
  569. do i=1 to high_retcode                                                  05330003
  570.   if datatype(count_errors.i) = "NUM" then do                           05340003
  571.   say "There were/was" count_errors.i "return code " i "errors."        05350003
  572.   end                                                                   05360003
  573. end                                                                     05370003
  574.                                     05380003
  575. say " "                                                                 05390003
  576. say "The number of action=SCRATCH was" count_scratch                    05400003
  577. say "The number of action=REDUCED was" count_reduced                    05410003
  578. say "The number of action=RECYCLE was" count_recycle                    05420003
  579. say "The number of action=RECOVER was" count_recover                    05430003
  580. say "The number of action=PARTREL was" count_partrel                    05440003
  581. say "The number of action=MOVEVT was" count_movevt                      05450003
  582. say "The number of action=MOVEBV was" count_movebv                      05460003
  583. say "The number of action=MIGRATE was" count_migrate                    05470003
  584. say "The number of action=EXPIRED was" count_expired                    05480003
  585. say "The number of action=EXBACKV was" count_exbackv                    05490003
  586. say "The number of action=DELETED was" count_deleted                    05500003
  587. say "The number of action=DEL AGE was" count_del_age                    05510003
  588. say "The number of action=BACKUP was" count_backup                      05520003
  589.                                     05530003
  590. cleanup(0)                              /* G'Day mate.         */       05540012
  591.                                     05550002
  592. exit(99) /* should not come here. */                                    05560018
  593.                                     05570018
  594. getline:                                                                05580002
  595. "EXECIO 1 DISKR INPUT "                 /* read the file */             05590002
  596. lastrc = rc                                                             05600002
  597. return(lastrc)                                                          05610002
  598.                                     05620002
  599. srt_cols:                                                               05630007
  600.     action=index(saveline,"ACTION=") + 7                                05640007
  601.     action_parm=action||",8,CH,A"                                       05650007
  602.                                     05660007
  603.     frvol= index(saveline,"FRVOL=") + 6                                 05670007
  604.     frvol_parm=frvol||",6,CH,A"                                         05680007
  605.                                     05690007
  606.     tovol= index(saveline,"TOVOL=") + 6                                 05700007
  607.     tovol_parm=tovol||",6,CH,A"                                         05710007
  608.                                     05720007
  609.     tracks=index(saveline,"TRACKS=") + 7                                05730007
  610.     tracks_parm=tracks||",5,CH,A"                                       05740007
  611.                                     05750007
  612.     rccol= index(saveline,"RC=") + 3                                    05760007
  613.     rccol_parm=rccol||",4,CH,A"                                         05770007
  614.                                     05780007
  615.     reason=index(saveline,"REASON=") +7                                 05790007
  616.     reason_parm=reason||",5,CH,A"                                       05800010
  617.                                     05810007
  618.     age=   index(saveline,"AGE=") + 4                                   05820007
  619.     age_parm=age||",4,CH,A"                                             05830010
  620.                                     05840007
  621.     dsncol=index(saveline,"DSN=")  + 4                                  05850007
  622.     dsn_parm=dsncol||",44,CH,A"                                         05860010
  623.                                     05870007
  624.                                     05880007
  625.  /* say "ACTION= starts in col" action                                  05890007
  626.     say "FRVOL= starts in col"  frvol                                   05900007
  627.     say "TOVOL= starts in col" tovol                                    05910007
  628.     say "TRACKS=starts in col" tracks                                   05920007
  629.     say "RC= starts in col" rccol                                       05930007
  630.     say "REASON= starts in col" reason                                  05940007
  631.     say "AGE= starts in col" age                                        05950007
  632.     say "DSN= starts in col" dsncol  */                                 05960007
  633. return;                                                                 05970007
  634.                                     05980012
  635. emptydsn:                                                               05990021
  636.     queue "DFHSM was unable to "action dsname "on" frvol                06000021
  637.     queue "because it has an invalid DSORG."                            06010021
  638.     queue "It looks like it has never been opened.  It has been"        06020021
  639.     queue "around for" age "days.  If you don't need it please"         06030021
  640.     queue "delete it."                                                  06040021
  641.                                     06050021
  642.     x=sendmsg(dsname)                                                   06060021
  643. return                                                                  06070021
  644.                                     06080021
  645. sendmsg:                                                                06090025
  646. arg  dsname                             /* who to send it to */         06100020
  647.                     /* write everything on the stack*/  06110020
  648. parse var dsname hi'.'user'.'therest                                    06120022
  649.                                     06130020
  650. queue " "                                                               06140020
  651. queue "If you wish to reply, do not use the login id in the header of " 06150021
  652. queue "this message.  Please use the loginid in the signature instead." 06160028
  653. queue " "                                                               06170021
  654. queue "Thanks,"                                                         06180021
  655. queue " "                                                               06190021
  656. queue left(bitand(userid(),'bfbfbfffff'x),5)                            06200029
  657.                                     06210020
  658. queue ''                                /* write an eof mark?? */       06220020
  659.                                     06230020
  660. if index("I088,I200,I300,I301,I302",hi) \= 0 then,                      06240025
  661.    dest=substr(user,1,5)                                                06250025
  662. else do                                                                 06260025
  663.    interpret 'dest = ' hi                                               06270025
  664. end                                                                     06280025
  665.                                     06290028
  666. if hi="E080"        \= 0 then dest="ply24"                              06300028
  667. if hi="E440"       \= 0 then dest="ply24"                               06310023
  668. if hi="ED09"       \= 0 then dest="kfm24"                               06320028
  669. if hi="ED13"      \= 0 then dest="ply24"                                06330022
  670. if hi="ED14"      \= 0 then dest="ply24"                                06340022
  671. if hi="EP01"      \= 0 then dest="wjr24"                                06350023
  672. if hi="ED55"      \= 0 then dest="ply24"                                06360022
  673. if hi="EX00"      \= 0 then dest="kbp24"                                06370022
  674. if hi="EX02"      \= 0 then dest="kbp24"                                06380024
  675. if hi="N071FILE"  \= 0 then dest="cdoc"                                 06390022
  676. if user="MARKUSH"  \= 0 then dest="awp24"                               06400028
  677. if user="STEREO"    \= 0 then dest="pae26"                              06410022
  678. if hi="Y151"      \= 0 then dest="jcw26"                                06420028
  679. if hi="Y154"      \= 0 then dest="ljb26"                                06430022
  680.                                     06440028
  681.                                     06450020
  682. ans = '?'                                                               06460025
  683. say "Reply 'Y' to send msg to" dest "N to discard or supply an",        06470028
  684.     "alternative destination?"                                          06480028
  685. parse upper external ans                                                06490025
  686. if (ans \= 'N' & length(ans)=5) then do                                 06500028
  687.   dest=ans                                                              06510028
  688.   ans='Y'                                                               06520028
  689. end                                                                     06530028
  690.                                     06540028
  691. if ans = 'Y' then do                                                    06550025
  692.   "alloc f(mesg) sysout(a) dest(casmail."dest") reuse"                  06560028
  693.                                     06570020
  694.   "EXECIO * DISKW mesg (FINIS"                                          06580028
  695.                                     06590020
  696.   lastrc = rc                                                           06600028
  697.   select                                                                06610028
  698.     when lastrc = 0 then nop                                            06620028
  699.     when lastrc = 1 then,                                               06630028
  700.      say 'data was truncated'                                           06640028
  701.     when lastrc = 2 then ,                                              06650028
  702.      say 'premature eof'                                                06660028
  703.      otherwise                                                          06670028
  704.      say "severe error, rc = " lastrc                                   06680028
  705.      "free f(mesg)"                                                     06690028
  706.      "delstack"                                                         06700028
  707.      cleanup(16)                                                        06710028
  708.   end   /* end select */                                                06720028
  709.                                     06730028
  710.   say "Notice about" dsname "sent to" dest                              06740028
  711. end /* ask if ok to send msg */                                         06750025
  712. else do                                                                 06760025
  713.     count=queued()                                                      06770025
  714.     do count                                                            06780025
  715.       parse pull crud                                                   06790025
  716.       say crud                                                          06800025
  717.     end                                                                 06810025
  718. end /* ask if ok to send msg */                                         06820025
  719.                                     06830025
  720. return(0)                                                               06840020
  721.                                     06850020
  722. cleanup:                                                                06860025
  723. arg value                                                               06870012
  724. "free f(mesg)"                                                          06880020
  725. "free f(sysout)"                                                        06890012
  726. "free f(sysprint)"                                                      06900012
  727. exit(value)                                                             06910012
  728.                                     06920012
  729.                                     06930025
  730.                                     06940025
  731.  
  732.  
  733. -- 
  734. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  735.                  |     Vincent Herried  (614) 447-3600 x 2877
  736.                  |     Chemical Abstracts Service
  737.  _____________________           |     P.O. Box 3012
  738. (_)________________   \          |     Columbus, OH 43210-0012
  739.   ________________|\   \         |
  740.  (_)______________\_\   \        |     Current thought: People who cannot be
  741.    ______________________\       |     understood are geniuses, so management
  742.   (_)____________________|       |     assigns them the toughest projects.
  743.                  |
  744. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  745.