home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / vms / 18198 < prev    next >
Encoding:
Internet Message Format  |  1992-11-18  |  4.2 KB

  1. Path: sparky!uunet!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!elroy.jpl.nasa.gov!nntp-server.caltech.edu!SOL1.GPS.CALTECH.EDU!CARL
  2. From: carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick)
  3. Newsgroups: comp.os.vms
  4. Subject: Re: Problem(s) with F$GETQUI
  5. Date: 19 Nov 1992 02:39:36 GMT
  6. Organization: HST Wide Field/Planetary Camera
  7. Lines: 81
  8. Distribution: world
  9. Message-ID: <1eeup8INNhgv@gap.caltech.edu>
  10. References: <1992Nov18.170944.486@lrc.edu>
  11. Reply-To: carl@SOL1.GPS.CALTECH.EDU
  12. NNTP-Posting-Host: sol1.gps.caltech.edu
  13.  
  14. In article <1992Nov18.170944.486@lrc.edu>, todd@lrc.edu writes:
  15. >$ SHOW QUEUE/ALL
  16. >$ IF P1 .EQS. "" THEN INQUIRE/NOPUNCTUATION P1 -
  17.     "ENTER THE NAME OF THE JOB TO STOP> "
  18. >$ ENTRY_NUMBER = F$INTEGER(F$GETQUI("DISPLAY_ENTRY","ENTRY_NUMBER",-
  19.     P1,"ALL_JOBS"))
  20. >$ WRITE SYS$OUTPUT "THE ENTRY NUMBER OF ", P1, " IS ", ENTRY_NUMBER, "."
  21. >$ !DELETE/ENTRY = ENTRY_NUMBER
  22. >
  23. >Hi,
  24. >     My name is Todd, and I am having the following problem when I use 
  25. >the F$GETQUI utility.  When I call the utility in the above command 
  26. >file, entry_number is always coming up to be 0.  I have used all sources of
  27. >help for this problem... can anyone out there tell me the thing(s) that I am
  28. >doing wrong?
  29.  
  30. Well, first of all, your definition of "all sources of help" and my definition
  31. of the same phrase are worlds apart.  My definition, for example, includes using
  32. the online help facility.  For example, one could issue the command:
  33.  
  34. $ HELP LEX F$GETQ FLAG
  35.  
  36. Lexicals
  37.  
  38.   F$GETQUI
  39.  
  40.     flags
  41.  
  42.          Specifies a list of keywords, separated by commas, that
  43.          corresponds to the flags defined for the $GETQUI system service
  44.          QUI$_SEARCH_FLAGS input item code. (These flags are used to
  45.          define the scope of the object search specified in the call to
  46.          the $GETQUI system service.) Note that the following keywords can
  47.          be used only with certain function codes:
  48.  
  49.          Keyword             Valid Function Code   Description
  50.  
  51.          ALL_JOBS            DISPLAY_JOB           Requests that F$GETQUI
  52.                                                    search all jobs included
  53.                                                    in the established
  54.                                                    queue context. If you
  55.                                                    do not specify this
  56.                                                    flag, F$GETQUI returns
  57.                                                    information only about
  58.                                                    jobs that have the same
  59.                                                    user name as the caller.
  60.  
  61. You see, the ALL_JOBS flag has no effect at all when you use the DISPLAY_ENTRY
  62. function code.  I guess reading the online help was just too much trouble.  Now,
  63. armed with this bit of information along with example number 3 from the online
  64. help for F$GETQUI, one can very easily construct the following DCL procedure:
  65.  
  66. $ SHOW QUEUE/ALL
  67. $ IF P1 .EQS. "" THEN INQUIRE/NOPUNCTUATION P1 -
  68.     "ENTER THE NAME OF THE JOB TO STOP> "
  69. $! This command procedure loops all queues and the jobs in them.
  70. $    TEMP = F$GETQUI("")
  71. $ QLOOP:
  72. $    QNAME = F$GETQUI("DISPLAY_QUEUE","QUEUE_NAME","*")
  73. $    IF QNAME .EQS. "" THEN EXIT
  74. $ JLOOP:
  75. $    NOACCESS = F$GETQUI("DISPLAY_JOB","JOB_INACCESSIBLE",,"ALL_JOBS") 
  76. $    IF NOACCESS .EQS. "TRUE" THEN GOTO JLOOP
  77. $    IF NOACCESS .EQS. "" THEN GOTO QLOOP
  78. $    JNAME = F$GETQUI("DISPLAY_JOB","JOB_NAME",,"FREEZE_CONTEXT,ALL_JOBS")
  79. $    IF JNAME .NES. P1 THEN GOTO JLOOP
  80. $    ENTRY_NUMBER = F$INTEGER(F$GETQUI("DISPLAY_JOB","ENTRY_NUMBER",,-
  81.         "FREEZE_CONTEXT,ALL_JOBS"))
  82. $    WRITE SYS$OUTPUT "THE ENTRY NUMBER OF ", P1, " IS ", ENTRY_NUMBER, "."
  83. $    !DELETE/ENTRY = ENTRY_NUMBER
  84. $    GOTO JLOOP
  85.  
  86. Which does what you want.
  87. --------------------------------------------------------------------------------
  88. Carl J Lydick | INTERnet: CARL@SOL1.GPS.CALTECH.EDU | NSI/HEPnet: SOL1::CARL
  89.  
  90. Disclaimer:  Hey, I understand VAXen and VMS.  That's what I get paid for.  My
  91. understanding of astronomy is purely at the amateur level (or below).  So
  92. unless what I'm saying is directly related to VAX/VMS, don't hold me or my
  93. organization responsible for it.  If it IS related to VAX/VMS, you can try to
  94. hold me responsible for it, but my organization had nothing to do with it.
  95.