HELPLIB.HLB  —  Lexicals  F$GETQUI  Examples
    1.$  BLOCKS = F$GETQUI("DISPLAY_ENTRY" ,"JOB_SIZE", 1347)

      In this example, the F$GETQUI lexical function is used to
      obtain the size in blocks of print job 1347. The value returned
      reflects the total number of blocks occupied by the files
      associated with the job.

    2.$ IF F$GETQUI("DISPLAY_QUEUE", "QUEUE_STOPPED", "VAX1_BATCH") .EQS.
      "TRUE" THEN GOTO 500

      In this example, the F$GETQUI lexical function is used to
      return a value of TRUE or FALSE depending on whether the queue
      VAX1_BATCH is in a stopped state. If VAX1_BATCH is not in the
      system, F$GETQUI returns a null string ("").

    3.! This command procedure shows all queues and the jobs in them.
      $  TEMP = F$GETQUI("")
      $  QLOOP:
      $  QNAME = F$GETQUI("DISPLAY_QUEUE","QUEUE_NAME","*")
      $  IF QNAME .EQS. "" THEN EXIT
      $  WRITE SYS$OUTPUT ""
      $  WRITE SYS$OUTPUT "QUEUE: ", QNAME
      $  JLOOP:
      $  NOACCESS = F$GETQUI("DISPLAY_JOB","JOB_INACCESSIBLE",,"ALL_JOBS")
      $  IF NOACCESS .EQS. "TRUE" THEN GOTO JLOOP
      $  IF NOACCESS .EQS. "" THEN GOTO QLOOP
      $  JNAME = F$GETQUI("DISPLAY_JOB","JOB_NAME",,"FREEZE_CONTEXT")
      $  WRITE SYS$OUTPUT "    JOB:  ", JNAME
      $  GOTO JLOOP

      This sample command procedure displays all the queues in the
      system and all the jobs to which the user has read access
      in the system. In the outer loop a wildcard display queue
      operation is performed. No call is made to establish the right
      to obtain information about the queue, because all users have
      implicit read access to queue attributes. Because a wildcard
      queue name is specified ("*"), wildcard queue context is
      maintained across calls to F$GETQUI.

      In the inner loop, to obtain information about all jobs, we
      enter nested wildcard mode from wildcard display queue mode.
      In this loop, a call is made to establish the right to obtain
      information about these jobs because users do not have implicit
      read access to jobs. The FREEZE_CONTEXT keyword is used in
      the request for a job name to prevent the advance of the
      wildcard context to the next object. After the job name has
      been retrieved and displayed, the procedure loops back up for
      the next job. The context is advanced because the procedure has
      not used the FREEZE_CONTEXT keyword. The wildcard queue context
      is dissolved when the list of matching queues is exhausted.
      Finally, F$GETQUI returns a null string ("")  to denote that no
      more objects match the specified search criteria.

    4.$ THIS_NODE = F$EDIT(F$GETSYI("SCSNODE"),"COLLAPSE")
      $ TEMP = F$GETQUI("CANCEL_OPERATION")
      $ SET NOON
      $LOOP:
      $ QUEUE = F$GETQUI("DISPLAY_QUEUE","QUEUE_NAME","*","WILDCARD")
      $ IF QUEUE .EQS. "" THEN GOTO ENDLOOP
      $ IF THIS_NODE .EQS.-
      F$GETQUI("DISPLAY_QUEUE","SCSNODE_NAME","*","WILDCARD,FREEZE_CONTEXT")
      $ THEN
      $    IF .NOT.-
        F$GETQUI("DISPLAY_QUEUE","QUEUE_AUTOSTART","*","WILDCARD,FREEZE_CONTEXT")-
        THEN START/QUEUE 'QUEUE'
      $ ENDIF
      $ GOTO LOOP
      $ENDLOOP:
      $ SET ON

      This command procedure looks at all queues associated with the
      local cluster node and starts any queue that is not marked as
      autostart.

      The procedure starts by obtaining the nodename of the local
      system and clearing the F$GETQUI context. In addition, error
      handling is turned off for the loop so that, if a queue had
      been started previously, the resulting error from the START
      QUEUE command does not abort the command procedure.

      Inside the loop, the F$GETQUI function gets the next queue name
      in the queue list. If the result is empty, then it has reached
      the end of the list and it exits the loop.

      The next IF statement checks to see if the queue runs on the
      local node. If it does, then the next statement checks to see
      if the queue is marked as an autostart queue. If that is false,
      then the queue is started with the start command. The loop is
      then repeated.

      The final command of the procedure restores DCL error handling
      to the previous setting.

    5.$  IF p1.EQS."" THEN INQUIRE p1 "Queue name"
      $ TEMP = F$GETQUI("")
      $ QLOOP:
      $   QNAME = F$GETQUI("DISPLAY_QUEUE","QUEUE_NAME",p1,"WILDCARD")
      $   IF QNAME .EQS. "" THEN EXIT
      $   WRITE SYS$OUTPUT ""
      $   WRITE SYS$OUTPUT "QUEUE: ", QNAME
      $   JLOOP:
      $     RETAINED = F$GETQUI("DISPLAY_JOB","JOB_RETAINED",,"ALL_JOBS")
      $     IF RETAINED .EQS. "" THEN GOTO QLOOP
      $     Entry = F$GETQUI("DISPLAY_JOB","ENTRY_NUMBER",,"FREEZE_CONTEXT,ALL_JOBS")
      $     WRITE SYS$OUTPUT "    Entry: ''Entry' Retained: ''RETAINED'"
      $     IF RETAINED.EQS."TRUE" THEN DELETE/ENTRY='Entry'
      $   GOTO JLOOP

      This command procedure deletes all retained entries from a
      nominated queue or queues. Wildcards are allowed.

    6.$ WRITE SYS$OUTPUT F$GETQUI("DISPLAY_QUEUE","RAD","BATCHQ1")
       -1

      This example returns the value of the RAD. A value of "-1"
      indicates no RAD value is attributed to the queue.
Close Help