Operating System - OpenVMS
1753899 Members
7763 Online
108809 Solutions
New Discussion юеВ

Displaying JOB_SIZE with F$GETQUI

 
Robert Atkinson
Respected Contributor

Displaying JOB_SIZE with F$GETQUI

18 years with VMS.....you'd have thought I'd have cracked F$GETQUI by now!

Anyway,
does anyone know how to go from F$GETQUI/DISPLAY_ENTRY to F$GETQUI/DISPLAY_JOB/JOB_SIZE without having to rescan the database?

Doing it like this gives me "%JBC-E-NOQUECTX, no queue context" :-


$ JOB_FORM = F$GETQUI("DISPLAY_ENTRY","FORM_NAME","''ENTRY'","WILDCARD,ALL_JOBS")
$ JOB_SIZE = F$GETQ("DISPLAY_ENTRY","JOB_SIZE","''ENTRY'","WILDCARD,ALL_JOBS")
$ !

Cheers, Rob.
8 REPLIES 8
Robert Atkinson
Respected Contributor

Re: Displaying JOB_SIZE with F$GETQUI

Sorry, that should read :-

$ JOB_FORM = F$GETQUI("DISPLAY_ENTRY","FORM_NAME","''ENTRY'","WILDCARD,ALL_JOBS")
$ JOB_SIZE = F$GETQ("DISPLAY_JOB","JOB_SIZE","''ENTRY'","WILDCARD,ALL_JOBS")
$ !

Robert Atkinson
Respected Contributor

Re: Displaying JOB_SIZE with F$GETQUI

Answered my own question :-

ALPHA_ROB$ $ JOB_ENTRY = F$GETQUI("DISPLAY_ENTRY","ENTRY_NUMBER","''ENTRY'")
ALPHA_ROB$ $ 'DEBUG' SH SYM JOB_ENTRY
JOB_ENTRY = 877 Hex = 0000036D Octal = 00000001555
ALPHA_ROB$ $ !
ALPHA_ROB$ $ JOB_FORM = F$GETQUI("DISPLAY_ENTRY","FORM_NAME","''ENTRY'","WILDCARD,ALL_JOBS")
ALPHA_ROB$ $ 'DEBUG' SH SYM JOB_FORM
JOB_FORM = "OCE_A4"
ALPHA_ROB$ $ !
ALPHA_ROB$ $ JOBFILE_FILESPEC = F$GETQ("DISPLAY_FILE","FILE_SPECIFICATION",,"FREEZE_CONTEXT,ALL_JOBS")
ALPHA_ROB$ $ 'DEBUG' SH SYM JOBFILE_FILESPEC
JOBFILE_FILESPEC = "_$1$DGA20:[SPOOL.070206]TWXP_X.TW3_07F3459;1"
ALPHA_ROB$ $ !
ALPHA_ROB$ $ JOB_SIZE = F$GETQ("DISPLAY_ENTRY","JOB_SIZE","''ENTRY'")
ALPHA_ROB$ $ 'DEBUG' SH SYM JOB_SIZE
JOB_SIZE = 167 Hex = 000000A7 Octal = 00000000247
ALPHA_ROB$ $ !

I wish someone would rewrite GF$GETQUI and make it a bit more logical. It's one of the few areas of VMS that just doesn't 'feel right'.

Rob.
Volker Halle
Honored Contributor

Re: Displaying JOB_SIZE with F$GETQUI

Rob,

did you check the examples:

$ HELP LEX F$GETQUI EXAMPLES

Volker.
Karl Rohwedder
Honored Contributor

Re: Displaying JOB_SIZE with F$GETQUI

Rob,

if you know the entryumber, a simple

$ say F$getqui("display_entry","job_size","459")
25

would suffice.

If you get the entrynumber by a F$GETQUI loop, you should enter a f$getqui("cancel_operation") before to exit the context.

regards Kalle
Uwe Zessin
Honored Contributor

Re: Displaying JOB_SIZE with F$GETQUI

I don't have any material handy, but I am fairly sure you can loop over individual jobs, "FREEZE_CONTEXT" on a job and then get different items about that job.
Have a look at the online help - I am fairly sure there used to be some examples.
.
Ian Miller.
Honored Contributor

Re: Displaying JOB_SIZE with F$GETQUI

See
http://dcl.openvms.org/stories.php?story=05/06/23/3527566

for one example. F$GETQUI is always fun :-)
____________________
Purely Personal Opinion
Robert_Boyd
Respected Contributor

Re: Displaying JOB_SIZE with F$GETQUI

Here's an example that I use on the systems I manage:

$! time_of_day_message.com -- generate time of day welcome message for
$! any process mode
$!
$! TARGET_INCLUDE = TOOLS_TARGETS.COM
$!
$ vfl = f$ver(0+f$trnlnm("debug$login"))
$ wo = "write sys$output "
$ bl = " "
$ null = ""
$ user_name = "''username'"
$ if user_name.eqs."" then $ user_name = f$getjpi("","USERNAME")
$ time = f$getjpi("","LOGINTIM")
$ arch = f$getsyi("Arch_NAME")
$ process_name = f$getjpi(null,"PRCNAM")
$ mode = f$mode()
$ HOURS = F$EXTRACT(12,2,TIME)
$ IF HOURS.GE.12 THEN $ GOTO AFTERNOON
$ MESSAGE = "Good Morning"
$ goto message
$AFTERNOON:
$ IF HOURS.GT.18 THEN GOTO EVENING
$ MESSAGE = "Good Afternoon"
$ goto message
$EVENING:
$ MESSAGE = "Good Evening"
$MESSAGE:
$ node = f$edit(F$GETSYI("NODENAME"),"TRIM")
$ len_mod = 1
$ set noon
$ mode = f$mode()
$ goto mess_'MODE'
$MESS_OTHER:
$MESS_DETACHED:
$ job = f$getjpi("","PRCNAM")
$ lgin_msg = bl+mode+" process "+job+" started at "+time+" on "+arch+" node "+node
$ goto center
$MESS_NETWORK:
$ job = f$getjpi("","PRCNAM")
$ lgin_msg = bl+mode+" process "+job+" started at "+time+" on "+arch+" node "+node
$ goto center
$MESS_BATCH:
$ set output_rate=0:0:15
$ queue = "BATCH"
$ job_queue_name = f$getqui("DISPLAY_JOB","QUEUE_NAME",,"THIS_JOB")
$ job_entry = f$getqui("DISPLAY_JOB","ENTRY_NUMBER",,"THIS_JOB")
$ job_submit_time = f$getqui("DISPLAY_JOB","SUBMISSION_TIME",,"THIS_JOB")
$ job_name = f$getqui("DISPLAY_JOB","JOB_NAME",,"THIS_JOB")
$ job_msg = "Job "+job_name + ", # "+f$edit(Job_entry,"collapse,trim")
$ queue_msg = job_queue_name+ ", Submitted at "+job_submit_time
$ queue_name = job_queue_name
$ if queue.eqs.null then $ queue = "DETACHED"
$ lgin_msg = f$fao("!AS!/!AS",mode+" "+job_msg+" started at "-
+time+" on "+arch+" node "+node," from QUEUE "+queue_msg)
$ len_mod = 2
$ GOTO center
$MESS_INTERACTIVE:
$ term = f$getdvi("tt","DEVNAM") - "_"-"_"-":"
$ lgin_msg = bl+user_name+" logged in at "+time+" on node "+node+" from "+term
$CENTER:
$ STRLEN=(F$LENGTH(lgin_msg)/len_mod-F$LENGTH(MESSAGE))/2
$ blk_str = f$fao("!#* ",strlen)
$ if (mode.eqs."INTERACTIVE")
$ then
$ wo blk_str,message
$ endif
$END_TOD:
$ border = f$fao("!#*=",75)
$ wo border
$ wo lgin_msg
$ wo border
$ EXIT !'f$ver(vfl)'
$!Last Modified: 14-DEC-2004 19:03:44.19
Master you were right about 1 thing -- the negotiations were SHORT!
Robert_Boyd
Respected Contributor

Re: Displaying JOB_SIZE with F$GETQUI

For another example look at 2 variants of FindJOB and FINDJOB:

http://dcl.openvms.org/stories.php?story=05/04/04/4429625

and

http://dcl.openvms.org/stories.php?story=03/09/23/1819255

Robert
Master you were right about 1 thing -- the negotiations were SHORT!