home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / bit / listserv / vmutil / 1882 next >
Encoding:
Text File  |  1993-01-21  |  4.0 KB  |  124 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!paladin.american.edu!auvm!DB0FUB11.BITNET!MAINT
  3. Return-Path: <@OHSTVMA.ACS.OHIO-STATE.EDU:VM-UTIL@UBVM.BITNET>
  4. Message-ID: <VM-UTIL%93012114145827@DEARN>
  5. Newsgroups: bit.listserv.vm-util
  6. Date:         Thu, 21 Jan 1993 11:25:38 +0100
  7. Sender:       VM Utilities Discussion List <VM-UTIL@OHSTVMA.BITNET>
  8. From:         Wolfram Fassbender <MAINT@DB0FUB11.BITNET>
  9. Subject:      Re: change to originid rdr
  10. In-Reply-To:  Message of Wed,
  11.               20 Jan 93 15:04:46 EST from <VALDIS@VTVM1.CC.VT.EDU>
  12. Lines: 110
  13.  
  14. On Wed, 20 Jan 93 15:04:46 EST Valdis Kletnieks said:
  15. >
  16. >
  17. >On Tue, 19 Jan 1993 14:23:20 LCL you said:
  18. >>jobs come to prtserv rdr). Then, it receives
  19. >>the file with DEPRINT MODULE and does PRINT.
  20. >>I like to skip this step: if I could change the
  21. >>ORIGINID of the file in prtserv rdr, I could
  22. >>transfer it directly to printer without having rscs
  23. >>rejecting the file, after counting pages in rdr.
  24. >>Therefore, I need a program to change the originid
  25. >>of a rdr file. Prtserv has, of course, all necessary
  26. >>privileged classes available to do this.
  27. >
  28. >Changing the userid of a spool file is fraught with danger.  The biggest
  29. >problem is that there are a lot of pointers to "previous" and "next"
  30. >files - and these get even more complicated in HPO(5/6/etc) and the
  31. >XA and ESA systems...
  32. >
  33. >Thinking about the problem here, perhaps what you *really* need to do
  34. >is create a CP mod that would count the pages of the file *as it prints*
  35. >and do something reasonable.  Someplace on a tape I have mods I made to
  36. >an SP/5 system to count pages on a 1403 or 3203 printer by watching
  37. >the CCW chaing go by, and cut an accounting record at job end.  This
  38. >had the advantage of Doing The Right Thing if the operator issued a
  39. >'FLUSH 50F' to purge the job.  We also had hooks into RSCS to handle
  40. >remote printers, and incoming files coming from other machines..
  41. >
  42.  
  43. I have programmed such a beast a while ago. Of course, rotten, quick'n dirty
  44. handmade ware. I guess that you have to make some changes to meet the needs
  45. of HPO. Hopem this helps.
  46.  
  47.  
  48. -Wolfram
  49.  
  50. btw. be careful, it patches directly in CP data areas :-))
  51.  
  52.  
  53. /*- Scan Spool queues */
  54. Arg Spid User
  55. If Spid = '' | Spid = '?',
  56. Then; Do;
  57.         Say 'XFER Spid UserID'
  58.         Exit
  59.       End;
  60. User = Left(User,8,' ');
  61.  Call SpoolChk Diag(8,'DCP 388'); /* Test Rdr   queue */
  62. exit
  63.  Call SpoolChk Diag(8,'DCP 380'); /* Test Print queue */
  64.  Call SpoolChk Diag(8,'DCP 384'); /* Test Punch queue */
  65. exit
  66. /*------------------------ Subroutine ------------------------*/
  67. SpoolChk:
  68.   Arg . Anchor .
  69. /*
  70.  *            +--------------+
  71.  *            |   DevName    |
  72.  *            +--------------+
  73.  * Anchor --> |   SFBQueue   |
  74.  *            +--------------+
  75.  *
  76.  * SFBlock.0  = Pointer to next SFBlock
  77.  * SFBlock.8  = SFBOwner
  78.  * SFBlock.10 = SFBOrigin
  79.  * SFBlock.1E = Spool ID
  80.  * SFBlock.40 = Creation Date
  81.  * SFBlock.48 = Creation Time
  82.  */
  83.  
  84.  Anchor = X2D(Left(Anchor,8)) - 4; /* we need Device */
  85.  
  86.  Parse Value Diag(8,'DCP 'D2X(Anchor)'.8') with . Device Chain .
  87.  Device = X2C(Device); SFBAdr = X2D(Left(Chain,8))
  88.  
  89.   If SFBAdr = 0  Then Return 0
  90.   Do Forever
  91.  
  92.   Parse Value Diag(8,'DCP 'D2X(SFBAdr)) with . SFBNext .
  93.   SFBNext = X2D(Left(SFBNext,8))
  94.  
  95.   Parse Value Diag(8,'DCP 'D2X(SFBAdr+8)'.8') with . O1 O2 .
  96.   SFBOwner = X2C(Left(O1,8))||X2C(Left(O2,8))
  97.  
  98.   Parse Value Diag(8,'DCP 'D2X(SFBAdr+16)'.8') with . O1 O2 .
  99.   SFBOrigin = X2C(Left(O1,8))||X2C(Left(O2,8))
  100.  
  101.  
  102.   Parse Value Diag(8,'DCP 'D2X(SFBAdr+30)) with . O1 O2 .
  103.   SFBId = X2D(Substr(O1,5,4))
  104.  
  105.   If SFBid = SPid,
  106.   Then; Do;
  107.        'STCP 'D2X(SFBAdr+8) C2X(SubStr(User,1,4)) C2X(SubStr(User,5,4))
  108.         Return 0
  109.         End;
  110.  
  111.   Parse Value Diag(8,'DCP 'D2X(SFBAdr+64)'.8') with . O1 O2 .
  112.   SFBDate = X2C(Left(O1,8))||X2C(Left(O2,8))
  113.  
  114.   Parse Value Diag(8,'DCP 'D2X(SFBAdr+72)'.8') with . O1 O2 .
  115.   SFBTime = X2C(Left(O1,8))||X2C(Left(O2,8))
  116. /*
  117.   Say Device SFBOwner SFBOrigin SFBId SFBDate SFBTime
  118. */
  119.  
  120.   SFBAdr = SFBNext
  121.   If SFBAdr = 0 Then Return 0
  122. End;
  123. Return 0 /* to be safe */
  124.