From: vjh21@cas.org (Vince Herried ext 2877)
Subject: DFHSM V2.6.0 REXX tool
Organization: CAS
Date: Thu, 21 Jan 1993 19:45:31 GMT


My company's support staff that copes with the day to day
grind of DFHSM tells me that this REXX exec is wunderful.
You may also find it to be of use.  He looks at the DFHSM log
data sets using ISPF 3.4 and calls this command giving it the
data set name of the daily space management "sysout" file.

The purpose of this EXEC is to review the log and ignore the messages
that need to be ignore, notify you of those you really should look at,
take some kind of action against those where possible.


You may have to do some adjusting of the EXEC to comply with your
shop standards, we have our TSO system prefix set to 'TSO' opposed to
the logonid of the tso user.
Please be sure to look it over first before running it.


I'll answer a few questions about it (unless I'm overwhelmed by silly ones)
but don't blame me if you didn't read it first before running it and it
ends up deleting the last copy of your company's payroll master file.

The person running this must have ACF/RACF/whatever authority for most all
system data sets because on of things this guy does is ask permission to
delete data sets that are cataloged on a volume other than the one being migrated
by DFHSM.  So without further ado....

/* hsmrept.rexx  12/09/91 VJH21 */                                      00010026
arg indsn                                                               00020007
									00030007
/*  History:                                                            00040030
									00050030
	v3   01/14/93 - Give ability to delete data sets that are:      00060031
			uncataloged or have invalid DSORG.              00070031
									00080031
	v2   02/27/92 - Don't send a message on an unmoveable           00090031
			dataset.                                        00100031
									00110030
	V1   12/09/91 - initial version                                 00120030
									00130030
*/                                                                      00140030
									00150030
/*   hsmrept -  a rexx exec to read in the dfhsm log data sets.         00160007
     logic                                                              00170007
       1.  Read in the dfhsm log data set and search for                00180007
	   ARC0374I messages.                                           00190007
       2.  If needed read next line to get the dsname.                  00200007
       3.  Output the full message to a disk data set.                  00210007
       4.  Sort the above data set on the return code field.            00220007
       5.  Read it back in.                                             00230026
       6.  If RC=0 or selected values, mearly count em.                 00240007
       7.  For some return codes a fix action has been determined       00250007
	   and the caller will be prompted for permission to fix.       00260007
	   If permission is given, do the fix.                          00270007
       8.  For other errors just display on the screen.                 00280010
       9.  Summarize the records found.                                 00290007
									00300016
								  */    00310016
do while (coord \= 'Y' & coord \= 'N')                                  00320028
  say "Do you wish to pull in the system coord list(Y or N)?"           00330027
  parse upper external coord                                            00340027
end                                                                     00350025
if coord = 'Y' then do                                                  00360027
  dsname="TSO."userid()".SYSLIST"        /* name of syslist file */     00370025
  dsname = strip(dsname,,"'")             /* remove any quotes */       00380025
  "delstack"                              /* delete prev stack */       00390025
  "alloc f(input) da('"dsname"') reuse shr" /* allocate input file */   00400025
  if rc <> 0 then do                      /* alloc failed */            00410025
     say "Allocation of system exper list - " dsname "failed."          00420025
     exit(16)                                                           00430025
  end                                                                   00440025
  "EXECIO * DISKR INPUT (FINIS"           /* read the file */           00450025
  lastrc = rc                             /* save return code */        00460025
  "free f(input)"                         /* release file */            00470025
  select                                  /* check read status */       00480025
    when lastrc = 0 then nop                                            00490025
    when lastrc = 1 then,                                               00500025
     say 'data was truncated'                                           00510025
    when lastrc = 2 then ,                                              00520025
     say 'premature eof'                                                00530025
     otherwise                                                          00540025
     say "severe error, rc = " lastrc                                   00550025
     "delstack"                           /* empty stack again */       00560025
     exit (16)                            /* get outa dodge */          00570025
  end    /* select */                                                   00580025
  count = queued()                      /* get stack size (file size)*/ 00590025
  do i = 1 to count                                                     00600025
    pull theline                                                        00610025
    sysnm = substr(theline,1,4)           /* get system name */         00620025
    syscord = substr(theline,38,5)        /* get system coordinator */  00630025
    interpret sysnm '=syscord'                                          00640025
  end                                                                   00650025
end                                                                     00660025
									00670016
"delstack"                                                              00680007
dsname=strip(indsn,,"'")                                                00690007
									00700007
do while (dsname = "" )                 /* prompt for input file */     00710007
   say "enter dsname"                                                   00720004
   parse upper pull  dsname                                             00730003
end                                                                     00740000
									00750000
x=msg('on')                                                             00760000
"alloc f(input) da('"dsname"') reuse shr" /* allocate input file */     00770000
if rc \= 0 then do                                                      00780000
  say "unable to allocate f(input) da("dsname")"                        00790000
  cleanup(16) */         /* alloc failed */                             00800012
end                                                                     00810000
									00820000
									00830007
x=msg('off')                                                            00840010
sortin=userid()||".sortin"                                              00850000
"free f(sortin)"                                                        00860000
"delete " sortin                                                        00870001
"alloc f(sortin)",                                                      00880007
"lrecl (150) new sp(5 10) track unit(vio)"                              00890007
/* da("sortin") */                                                      00900007
if rc \= 0 then do                                                      00910000
  say "unable to allocate f(sortin) da("sortin")"                       00920000
  cleanup(16) */         /* alloc failed */                             00930012
end                                                                     00940000
									00950000
"free f(sysin)"                                                         00960007
sysin = userid()||".sortin.parms"                                       00970007
x=msg('off')                                                            00980007
"delete" sysin                                                          00990007
x=msg('on')                                                             01000007
"alloc f(sysin) lrecl (80) new sp(1 1) track",                          01010007
  " unit(vio) "                                                         01020007
  /*"da("sysin") unit(vio) " */                                         01030007
if rc \= 0 then do                                                      01040007
  say "unable to allocate f(sysin) da("sysin")"                         01050007
  cleanup(16) */         /* alloc failed */                             01060012
end                                                                     01070007
x=msg('off')                                                            01080007
									01090007
outcnt=0                                                                01100002
									01110002
do while(getline() = 0)                 /* read a line from in dsn */   01120007
  pull theline;                         /* remove it from the stack */  01130007
  if index(theline,"ARC0734I") = 0 then iterate                         01140007
					/* skip it if wrong kind */     01150007
  saveline = theline                                                    01160007
  if index(theline,"DSN=") =0 then do                                   01170007
    if getline() \= 0 then leave       /* read the file */              01180002
									01190002
    pull theline                                                        01200000
    saveline = strip(saveline,"T") || space(theline)                    01210002
  end                                                                   01220000
									01230000
  /* calculate the sort columns                                    */   01240007
									01250007
  if action_parm = "ACTION_PARM" then call srt_cols                     01260007
									01270000
  push saveline                                                         01280000
									01290000
  "EXECIO 1 DISKW sortin "                                              01300000
  lastrc = rc                                                           01310002
  if lastrc \= 0 then do                                                01320002
    done="error"                                                        01330002
    say "disk write to sortin failed, ending"                           01340002
    cleanup(16)                                                         01350012
  end                                                                   01360002
  outcnt=outcnt+1                                                       01370000
									01380000
									01390000
end /*of loop*/                                                         01400000
									01410000
"delstack"                              /* delete prev stack */         01420000
									01430000
"EXECIO 0 DISKR input  (finis"           /* close output */             01440002
"free f(input)"                         /* release file */              01450000
									01460002
if outcnt = 0 then do                                                   01470002
  say "no output created, ending"                                       01480000
  cleanup(4)                                                            01490012
end                                                                     01500000
									01510000
"EXECIO 0 DISKW sortin (finis"          /* close the file */            01520002
									01530002
/* generate the sort statement */                                       01540010
									01550010
									01560013
 sortp=" SORT FIELDS=(",                                                01570010
 ||action_parm,                                                         01580010
 ||","rccol_parm,                                                       01590010
 ||","reason_parm,                                                      01600010
 ||","dsn_parm,                                                         01610010
 ||")"                                                                  01620010
									01630010
									01640013
push sortp                                                              01650000
									01660000
"EXECIO 1 DISKW sysin (finis"           /* close output */              01670000
									01680000
sortout=userid()||".hsm.sortout"                                        01690000
"free f(sortout)"                                                       01700000
"delete" sortout                                                        01710000
"alloc f(sortout) da("sortout") lrecl (150) mod sp(1 10) track release" 01720007
if rc \= 0 then do                                                      01730000
  say "unable to allocate f(sortout) da("sortout")"                     01740000
  cleanup(16) */         /* alloc failed */                             01750012
end                                                                     01760000
									01770000
"free f(sysout)"                                                        01780000
"alloc f(sysout) da(*)"                                                 01790013
									01800000
"free f(sysprint)"                                                      01810000
"alloc f(sysprint) da(*)"                                               01820013
									01830003
say "Now calling sort."                                                 01840003
									01850003
"call 'sys1.sync.sortlib(sort)' 'size=max-100k,dynalloc=scrta'"         01860013
									01870003
lastrc = rc                                                             01880003
if lastrc \= 0 then do                                                  01890003
									01900003
  say "The sort failed with a return code of" lastrc                    01910003
  say "Sorry, I've got to exit now"                                     01920007
  cleanup(16)                                                           01930012
									01940003
end                                                                     01950003
									01960003
"free f(sortin)"                                                        01970000
"delete" sortin                                                         01980000
"free f(sysin)"                                                         01990000
"delete" sysin                                                          02000000
									02010002
"alloc f(input) da("sortout")"                                          02020002
if rc \= 0 then do                                                      02030002
  say "unable to allocate f(INPUT) da("sortout")"                       02040002
  cleanup(16) */         /* alloc failed */                             02050012
end                                                                     02060002
									02070000
  /* sample message ...                                                 02080002
ARC0734I ACTION=MIGRATE FRVOL=HSM022 TOVOL=041191 TRACKS=    1 RC=  13, 02090002
	 REASON=      8, AGE= 184,                                      02100002
 DSN=N066FILE.EN04.SYSOUT.I03#.LIST.G0718V00                            02110002
   if the dsn will fit, then it will be on the first line.. */          02120002
									02130002
  count_scratch = 0                                                     02140002
  count_reduced = 0                                                     02150002
  count_recycle = 0                                                     02160002
  count_recover = 0                                                     02170002
  count_partrel = 0                                                     02180002
  count_movevt = 0                                                      02190002
  count_movebv = 0                                                      02200002
  count_migrate = 0                                                     02210002
  count_expired = 0                                                     02220002
  count_exbackv = 0                                                     02230002
  count_deleted = 0                                                     02240002
  count_del_age = 0                                                     02250002
  count_backup = 0                                                      02260002
  count_errors. = 'x'                                                   02270003
  high_retcode = 0                                                      02280003
									02290003
									02300002
say "Now reading the sorted log file back in."                          02310003
									02320003
"delstack"                              /* empty the stack first */     02330020
									02340020
do while(getline() = 0)                                                 02350002
  parse pull theline                                                    02360002
  theline = translate(theline,' ',',') /* remove all commas */          02370003
									02380003
  theline = space(theline)                                              02390003
  parse var theline msgid,                                              02400002
	"ACTION=" action,                                               02410002
	"FRVOL=" frvol,                                                 02420003
	"TOVOL=" tovol,                                                 02430003
	"TRACKS=" tracks,                                               02440003
	"RC=" retcode,                                                  02450003
	"REASON=" reason,                                               02460003
	"AGE=" age,                                                     02470003
	"DSN=" dsname therest                                           02480003
									02490003
  tracks = strip(tracks)             /* remove blanks */                02500003
									02510003
  retcode = space(retcode)           /* remove all blanks */            02520003
									02530003
  reason = space(reason)             /* remove all blanks */            02540003
									02550003
  age = space(age)                   /* remove all blanks */            02560003
									02570003
  select                                                                02580003
    when action = "DEL-AGE" then do                                     02590007
      count_DEL_AGE = count_DEL_AGE + 1                                 02600017
      select                                                            02610007
	when retcode = 0 then nop;                                      02620007
	otherwise                                                       02630007
	  say "See msg ARC12nnI"                                        02640017
	  say theline                                                   02650017
	  say ""                                                        02660017
      end  /* select */                                                 02670007
    end                                                                 02680007
    when action = "DELETED" then do                                     02690007
      count_DELETED = count_DELETED + 1                                 02700007
      select                                                            02710007
	when retcode = 0 then nop;                                      02720007
	otherwise                                                       02730007
	  if retcode < 100 then,                                        02740017
	    say "See Table 6 Page 258"                                  02750017
	  if retcode > 399 & retcode < 500 then,                        02760017
	    say "See msg ARC9998I"                                      02770017
	  say theline                                                   02780017
	  say ""                                                        02790017
      end   /* select */                                                02800007
    end                                                                 02810007
    when action = "EXBACKV" then do                                     02820007
      count_EXBACKV = count_EXBACKV + 1                                 02830007
      select                                                            02840007
	when retcode = 0 then nop;                                      02850007
	otherwise                                                       02860007
	  say "See table 7 on page 258."                                02870017
	  say theline                                                   02880017
	  say ""                                                        02890017
      end   /* select */                                                02900007
    end                                                                 02910007
    when action = "EXPIRED" then do                                     02920007
      count_EXPIRED = count_EXPIRED + 1                                 02930007
      select                                                            02940007
	when retcode = 0 then nop;                                      02950007
	otherwise                                                       02960007
	  say "action="action"error",                                   02970007
	  theline                                                       02980007
      end  /* select */                                                 02990007
    end;                                                                03000007
    when action = "MIGRATE" then do                                     03010007
      count_MIGRATE = count_MIGRATE + 1                                 03020007
      select                                                            03030007
	when retcode = 0 then nop                                       03040007
	when retcode = 8 & reason = 6 then nop  /* sdsp busy */         03050018
	when retcode = 8 & reason = 7 then nop  /* sdsp busy */         03060018
	when retcode = 8 & reason =20 then nop  /* cancel by exit */    03070018
	when retcode = 13 then do                                       03080007
	  say "Migrated data set "dsname" not cataloged, OK to remove?" 03090014
	  fix = "?"                                                     03100007
	  do while(fix \= 'Y' & fix \= 'N')                             03110007
	    parse upper pull fix                                        03120007
	  end                                                           03130007
	  if fix = 'Y' then,                                            03140007
	    "hsend fixcds d " dsname "verify(6,bits(1.......))",        03150007
	    "patch(6,bits(0..1....))"                                   03160007
	end;                                                            03170007
	when retcode = 19 then nop;   /* in use by another job */       03180007
	when retcode = 20 & reason = 4 then do                          03190014
									03200031
	/* v3 allow Davy to delete it if he feels brave */              03210031
									03220031
	  do until(ans='Y' | ans='N')                                   03230032
	    say "During an attempt to migrate" dsname "on" frvol        03240031
	    say "DFHSM found that it was cataloged on another volume,"  03250032
	    say "this can lead to multiple copies of same data set."    03260032
	    say "Reply 'y' to delete it or 'n' to ignore?"              03270032
	    pull ans                                                    03280032
	  end                                                           03290031
									03291031
	  if ans='Y' then do   /* delete that sucker */                 03300031
	    x=msg("on")                                                 03310031
	    "alloc f(wonkus) unit(sysallda) old da('"dsname"')",        03320031
	    "volume("frvol") delete reuse"                              03330033
	    "free f(wonkus)"                                            03350033
	    x=msg(x)                                                    03360031
	  end                                                           03370031
	  else say "No action taken"                                    03380031
									03390031
	end                                                             03410014
	when retcode = 30 & age < 14 then nop  /* may be in use*/       03420010
	when retcode = 30 & age >= 14 then do                           03430020
									03440020
	  queue "When DFHSM attempted to migrate "dsname" on "frvol     03450020
	  queue "that is" age "days old, it found that it was not"      03460020
	  queue "cataloged.  Please catalog this data set so that"      03470020
	  queue "it can be managed properly."                           03480020
									03490020
	  x=sendmsg(dsname)                                             03500020
									03510020
	end                                                             03520014
	when retcode = 51 then nop;   /* in use by another dfhsm */     03530017
	when retcode = 99 & reason=0 then do                            03540030
									03550030
	  say dsname "has an extent for user labels and is either",     03560030
	      " empty or non-sequential!"                               03570030
									03580030
	end                                                             03590030
	when retcode = 99 & reason=2 then do                            03600030
									03610030
	  say dsname "on" frvol,                                        03620030
	      "is VSAM. it may not be cataloged correctly,",            03630030
	      " or it is a vsam catalog, or it has the erase attribute" 03640030
									03650030
	end                                                             03660030
	when retcode = 99 & reason=4 then do                            03670030
									03680030
	  /* dsorg other than ps, po, bdam, or vsam */                  03690030
									03700030
	  if age > 7 then call emptydsn                                 03710030
									03720030
	end                                                             03730030
	when retcode = 99 & reason=6 then do                            03740030
	  /* invalid blocksize */                                       03750030
	  queue "When DFHSM attempted to migrate "dsname" on "frvol     03760030
	  queue "that is" age "days old, it found that the blocksize"   03770030
	  queue "was invalid.  It might be 0, or too big for the device"03780030
	  queue "Please check it out."                                  03790030
									03800030
	  x=sendmsg(dsname)                                             03810030
									03820030
									03830030
	end                                                             03840030
	when retcode = 99 & reason=8 then nop; /* unmoveable data*/     03850030
	when retcode = 99 & reason=10 then nop; /* usr labels?     */   03860030
	when retcode = 99 & reason=12 then nop; /* split over cyls */   03870030
	when retcode = 99 & reason=14 then nop; /* apf authorized */    03880030
	when retcode = 99 & reason=20 then do                           03890030
	  /* vsam with erase attribute */                               03900030
	end                                                             03910030
	when retcode = 99 & reason=36 then do                           03920030
	  /* invalid dsname            */                               03930030
	  say dsname "on" frvol "appears to have an invalid dsname."    03940030
	end                                                             03950030
	when retcode = 99 & age < 8  then nop  /* may be in use*/       03960024
	when retcode = 99 & age > 7  then,                              03970024
	  call emptydsn                                                 03980021
									03990020
	otherwise                                                       04000007
	  if retcode < 10 then,                                         04010018
	    say "See msg ARC120"retcode"I "                             04020018
	  else,                                                         04030018
	    say "See msg ARC12"retcode"I "                              04040018
									04050018
	  say theline                                                   04060017
	  say " "                                                       04070017
      end   /* select */                                                04080007
    end;                                                                04090007
    when action = "MOVE VT" then do                                     04100007
      count_MOVEVT = COUNT_MOVEVT + 1                                   04110007
      select                                                            04120007
	when retcode = 0 then nop;                                      04130007
	otherwise                                                       04140007
	  say "action="action"error",                                   04150007
	  theline                                                       04160007
      end  /* select */                                                 04170007
    end;                                                                04180007
    when actioin= "MOVE BV" then do                                     04190007
      COUNT_MOVEBV = COUNT_MOVEBV + 1                                   04200007
      select                                                            04210007
	when retcode = 0 then nop;                                      04220007
	otherwise                                                       04230007
	  say "action="action"error",                                   04240007
	  theline                                                       04250007
      end                                                               04260007
    end                                                                 04270007
    when action = "PARTREL" then do                                     04280007
      count_PARTREL = count_PARTREL + 1                                 04290007
      select                                                            04300007
	when retcode = 0 then nop;                                      04310007
	otherwise                                                       04320007
	  say "action="action"error",                                   04330007
	  theline                                                       04340007
      end                                                               04350007
    end;                                                                04360007
    when action = "RECOVER" then do                                     04370007
      count_RECOVER = count_RECOVER + 1                                 04380007
      select                                                            04390007
	when retcode = 0 then nop;                                      04400007
	otherwise                                                       04410007
	  say "action="action"error",                                   04420007
	  theline                                                       04430007
      end                                                               04440007
    end;                                                                04450007
    when action = "RECYCLE" then do                                     04460007
      count_RECYCLE = count_RECYCLE + 1                                 04470007
      select                                                            04480007
	when retcode = 0 then nop;                                      04490007
	otherwise                                                       04500007
	  say "action="action"error",                                   04510007
	  theline                                                       04520007
      end                                                               04530007
    end;                                                                04540007
    when action = "REDUCED" then do                                     04550007
      count_REDUCED = count_REDUCED + 1                                 04560007
      select                                                            04570007
	when retcode = 0 then nop;                                      04580007
	when retcode = 19 then nop;   /* in use by another job */       04590007
	otherwise                                                       04600007
	  say "action="action"error",                                   04610007
	  theline                                                       04620007
      end                                                               04630007
    end                                                                 04640007
    when action = "SCRATCH" then do                                     04650007
      count_SCRATCH = count_SCRATCH + 1                                 04660007
      select                                                            04670007
	when retcode = 0 then nop;                                      04680007
	otherwise                                                       04690007
	  say "action="action"error",                                   04700007
	  theline                                                       04710007
      end                                                               04720007
    end                                                                 04730007
    when action = "BACK-UP" then do                                     04740009
      count_backup = count_backup + 1                                   04750007
      select                                                            04760007
	when retcode = 0 then nop;                                      04770007
	when retcode = 16 & reason = 6 then do                          04780024
	  queue "DFHSM was unable to backup" dsname "on" frvol          04790024
	  queue "he says that the block descriptor word is probably"    04800024
	  queue "larger than the data set BLKSIZE.  It has been bad for"04810024
	  queue age "days.  If you don't need it anylonger please"      04820024
	  queue "DELETE it.  If you still need it contact D28 for"      04830024
	  queue "assistance."                                           04840024
	  x=sendmsg(dsname)                                             04850024
	end                                                             04860024
	when retcode = 17 then do                                       04870024
	  queue "DFHSM was unable to backup" dsname "on" frvol          04880020
	  queue "It appears to be broken and has not been backed up for"04890020
	  queue age "days.  If you don't need it anylonger please"      04900020
	  queue "DELETE it.  If you still need it contact D28 for"      04910020
	  queue "assistance."                                           04920020
	  x=sendmsg(dsname)                                             04930020
	end                                                             04940020
									04950020
	when retcode = 19 then nop;    /* in use */                     04960020
	when retcode = 35 then nop;    /* in use by dfhsm */            04970011
	when retcode = 53 then nop;    /* in use */                     04980011
	when retcode = 56 & reason = 12 then nop; /* cluster components 04990014
						     on diff vols */    05000014
									05010014
	when retcode = 56 & reason = 15 then nop; /* blksize to big */  05020014
	when retcode = 99 & age < 8  then nop  /* may be in use*/       05030024
	when retcode = 99 & age > 7  then,     /* may be in use*/       05040024
	  call emptydsn                                                 05050021
	otherwise                                                       05060007
	  if retcode < 10 then,                                         05070018
	    say "See msg ARC130"retcode"I "                             05080018
	  else,                                                         05090018
	    say "See msg ARC13"retcode"I "                              05100018
									05110018
	  say theline                                                   05120017
	  say " "                                                       05130017
      end                                                               05140007
    end                                                                 05150007
    otherwise                                                           05160007
      say "unknown action" action "in line",                            05170007
      theline;                                                          05180007
  end   /* end select ? */                                              05190007
									05200002
  if retcode \= 0 then do                                               05210007
    if datatype(count_errors.retcode) \= "NUM" then                     05220007
       count_errors.retcode = 0                                         05230007
    if high_retcode < retcode then high_retcode = retcode               05240007
    count_errors.retcode = count_errors.retcode +1                      05250007
  end                                                                   05260007
									05270002
end                                                                     05280002
									05290002
"EXECIO 0 DISKR input  (finis"           /* close output */             05300002
"free f(input)"                         /* release file */              05310002
									05320002
do i=1 to high_retcode                                                  05330003
  if datatype(count_errors.i) = "NUM" then do                           05340003
  say "There were/was" count_errors.i "return code " i "errors."        05350003
  end                                                                   05360003
end                                                                     05370003
									05380003
say " "                                                                 05390003
say "The number of action=SCRATCH was" count_scratch                    05400003
say "The number of action=REDUCED was" count_reduced                    05410003
say "The number of action=RECYCLE was" count_recycle                    05420003
say "The number of action=RECOVER was" count_recover                    05430003
say "The number of action=PARTREL was" count_partrel                    05440003
say "The number of action=MOVEVT was" count_movevt                      05450003
say "The number of action=MOVEBV was" count_movebv                      05460003
say "The number of action=MIGRATE was" count_migrate                    05470003
say "The number of action=EXPIRED was" count_expired                    05480003
say "The number of action=EXBACKV was" count_exbackv                    05490003
say "The number of action=DELETED was" count_deleted                    05500003
say "The number of action=DEL AGE was" count_del_age                    05510003
say "The number of action=BACKUP was" count_backup                      05520003
									05530003
cleanup(0)                              /* G'Day mate.         */       05540012
									05550002
exit(99) /* should not come here. */                                    05560018
									05570018
getline:                                                                05580002
"EXECIO 1 DISKR INPUT "                 /* read the file */             05590002
lastrc = rc                                                             05600002
return(lastrc)                                                          05610002
									05620002
srt_cols:                                                               05630007
    action=index(saveline,"ACTION=") + 7                                05640007
    action_parm=action||",8,CH,A"                                       05650007
									05660007
    frvol= index(saveline,"FRVOL=") + 6                                 05670007
    frvol_parm=frvol||",6,CH,A"                                         05680007
									05690007
    tovol= index(saveline,"TOVOL=") + 6                                 05700007
    tovol_parm=tovol||",6,CH,A"                                         05710007
									05720007
    tracks=index(saveline,"TRACKS=") + 7                                05730007
    tracks_parm=tracks||",5,CH,A"                                       05740007
									05750007
    rccol= index(saveline,"RC=") + 3                                    05760007
    rccol_parm=rccol||",4,CH,A"                                         05770007
									05780007
    reason=index(saveline,"REASON=") +7                                 05790007
    reason_parm=reason||",5,CH,A"                                       05800010
									05810007
    age=   index(saveline,"AGE=") + 4                                   05820007
    age_parm=age||",4,CH,A"                                             05830010
									05840007
    dsncol=index(saveline,"DSN=")  + 4                                  05850007
    dsn_parm=dsncol||",44,CH,A"                                         05860010
									05870007
									05880007
 /* say "ACTION= starts in col" action                                  05890007
    say "FRVOL= starts in col"  frvol                                   05900007
    say "TOVOL= starts in col" tovol                                    05910007
    say "TRACKS=starts in col" tracks                                   05920007
    say "RC= starts in col" rccol                                       05930007
    say "REASON= starts in col" reason                                  05940007
    say "AGE= starts in col" age                                        05950007
    say "DSN= starts in col" dsncol  */                                 05960007
return;                                                                 05970007
									05980012
emptydsn:                                                               05990021
    queue "DFHSM was unable to "action dsname "on" frvol                06000021
    queue "because it has an invalid DSORG."                            06010021
    queue "It looks like it has never been opened.  It has been"        06020021
    queue "around for" age "days.  If you don't need it please"         06030021
    queue "delete it."                                                  06040021
									06050021
    x=sendmsg(dsname)                                                   06060021
return                                                                  06070021
									06080021
sendmsg:                                                                06090025
arg  dsname                             /* who to send it to */         06100020
				    /* write everything on the stack*/  06110020
parse var dsname hi'.'user'.'therest                                    06120022
									06130020
queue " "                                                               06140020
queue "If you wish to reply, do not use the login id in the header of " 06150021
queue "this message.  Please use the loginid in the signature instead." 06160028
queue " "                                                               06170021
queue "Thanks,"                                                         06180021
queue " "                                                               06190021
queue left(bitand(userid(),'bfbfbfffff'x),5)                            06200029
									06210020
queue ''                                /* write an eof mark?? */       06220020
									06230020
if index("I088,I200,I300,I301,I302",hi) \= 0 then,                      06240025
   dest=substr(user,1,5)                                                06250025
else do                                                                 06260025
   interpret 'dest = ' hi                                               06270025
end                                                                     06280025
									06290028
if hi="E080"        \= 0 then dest="ply24"                              06300028
if hi="E440"       \= 0 then dest="ply24"                               06310023
if hi="ED09"       \= 0 then dest="kfm24"                               06320028
if hi="ED13"      \= 0 then dest="ply24"                                06330022
if hi="ED14"      \= 0 then dest="ply24"                                06340022
if hi="EP01"      \= 0 then dest="wjr24"                                06350023
if hi="ED55"      \= 0 then dest="ply24"                                06360022
if hi="EX00"      \= 0 then dest="kbp24"                                06370022
if hi="EX02"      \= 0 then dest="kbp24"                                06380024
if hi="N071FILE"  \= 0 then dest="cdoc"                                 06390022
if user="MARKUSH"  \= 0 then dest="awp24"                               06400028
if user="STEREO"    \= 0 then dest="pae26"                              06410022
if hi="Y151"      \= 0 then dest="jcw26"                                06420028
if hi="Y154"      \= 0 then dest="ljb26"                                06430022
									06440028
									06450020
ans = '?'                                                               06460025
say "Reply 'Y' to send msg to" dest "N to discard or supply an",        06470028
    "alternative destination?"                                          06480028
parse upper external ans                                                06490025
if (ans \= 'N' & length(ans)=5) then do                                 06500028
  dest=ans                                                              06510028
  ans='Y'                                                               06520028
end                                                                     06530028
									06540028
if ans = 'Y' then do                                                    06550025
  "alloc f(mesg) sysout(a) dest(casmail."dest") reuse"                  06560028
									06570020
  "EXECIO * DISKW mesg (FINIS"                                          06580028
									06590020
  lastrc = rc                                                           06600028
  select                                                                06610028
    when lastrc = 0 then nop                                            06620028
    when lastrc = 1 then,                                               06630028
     say 'data was truncated'                                           06640028
    when lastrc = 2 then ,                                              06650028
     say 'premature eof'                                                06660028
     otherwise                                                          06670028
     say "severe error, rc = " lastrc                                   06680028
     "free f(mesg)"                                                     06690028
     "delstack"                                                         06700028
     cleanup(16)                                                        06710028
  end   /* end select */                                                06720028
									06730028
  say "Notice about" dsname "sent to" dest                              06740028
end /* ask if ok to send msg */                                         06750025
else do                                                                 06760025
    count=queued()                                                      06770025
    do count                                                            06780025
      parse pull crud                                                   06790025
      say crud                                                          06800025
    end                                                                 06810025
end /* ask if ok to send msg */                                         06820025
									06830025
return(0)                                                               06840020
									06850020
cleanup:                                                                06860025
arg value                                                               06870012
"free f(mesg)"                                                          06880020
"free f(sysout)"                                                        06890012
"free f(sysprint)"                                                      06900012
exit(value)                                                             06910012
									06920012
									06930025
									06940025


-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
				 |     Vincent Herried  (614) 447-3600 x 2877
				 |     Chemical Abstracts Service
 _____________________           |     P.O. Box 3012
(_)________________   \          |     Columbus, OH 43210-0012
  ________________|\   \         |
 (_)______________\_\   \        |     Current thought: People who cannot be
   ______________________\       |     understood are geniuses, so management
  (_)____________________|       |     assigns them the toughest projects.
				 |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU