Re: F$GETJPI doesn't match SHOW PROCESS/ACCOUNTING



Hi David,

It looks like you're doing this que lookup stuff in DCL and are presumably
very happy with it. But I'm just curious to know if using a html and
Javascript front-end was as easy as below, whether you'd consider using
that. (Granted that for such an application where requirements are limited,
you could've easily had a html (+/- Javascript) front end years ago with
simple http submit IBM3270 crap page refreshing stuff, and more recently
that httpxmlfudgestate thingy, but I was just wondering if you or others see
anything appealing in the following. And it's ramifications for more robust
and demanding applications.)

Regards Richard Maher

Example1.html
=============

<html>

<head>

<title>
Example Client for Tier3 demo queue-lookup server
Author: Richard Maher
</title>

<style>

h2
{
color: Turquoise;
}

p.credits
{
color: Turquoise;
}

.green_screen
{
color: Lime;
background-color: Black;
font-family: courier;
}

</style>

<script type="text/javascript">

function enter(nextfield)
{
if (window.event && window.event.keyCode == 13)
{
nextfield.focus();
return false;
}
else
return true;
}

function num_only(numObj)
{
if (isNaN(numObj.value))
{
numObj.value = "";
alert("Numeric value required");
numObj.focus();
return false;
}
else
return true;
}

function job_lookup()
{
if (!num_only(document.getjobs.entry_number))
return true;

var recTypeLen = 2;
var recType = "";
var msgGetInfo = "10";
var jobInfo = "11";
var errorInfo = "00";

var zeroFill = "0000";
var maxRows = "9999";
var outPad = "";
var ok = true;

var selectRef = document.getjobs.job_list;
var msgEntry = "";

selectRef.options[0].selected=true;
var holdHdr = selectRef.options[0];

while (selectRef.options.length > 0)
{
selectRef.remove(selectRef.options[0]);
}
selectRef.options[0] = holdHdr
document.getjobs.job_list.size = 1;

msgEntry = document.getjobs.entry_number.value;
outPad = zeroFill.substring(0, (zeroFill.length - msgEntry.length));

var chan = document.getElementById("CornuCopiae");
chan.sendMessage(msgGetInfo.concat(outPad,msgEntry,maxRows));

if (chan.readMessage(recTypeLen) != recTypeLen)
{
alert ("Error receiving reply from server");
return false;
}
recType = chan.getString(0,recTypeLen);

if (recType == jobInfo)
{
ok = process_jobs(chan);
}
else
{
if (recType == errorInfo)
{
ok = process_error(chan);
}
else
{
alert ("Unknown message type " + recType);
return false;
}
}

if (!ok) return false;

document.getjobs.entry_number.focus();

return true;
}

function process_error(chan)
{
document.getjobs.rec_count.value = 0;

var errMsgLen = 0;
var errLenLen = 3;
var alertMsg = "Error retrieving job entry information\n";

if (chan.readMessage() < errLenLen)
{
alert ("Error receiving Error Length from server");
return false;
}

errMsgLen = parseInt(chan.getString(0,errLenLen),10);
alertMsg = alertMsg + chan.getString(errLenLen,errMsgLen);
alert(alertMsg);

return true;
}

function process_jobs(chan)
{
var recTypeLen = 2;
var recType = "";
var jobInfo = "11";
var eofInfo = "99";
var eofLen = 3;
var jobMsgLen = 109;
var jobMsg = "";
var rc = 1;
var eofInfo = "99";
var selectRef = document.getjobs.job_list;

for (;;)
{
rc = rc + 1;
if (rc < 6)
document.getjobs.job_list.size = rc;

if (chan.readMessage(jobMsgLen) != jobMsgLen)
{
alert ("Error receiving Job Information from server");
return false;
}

jobMsg = chan.getString(0,4) + "|" +
chan.getString(4,39) + "|" +
chan.getString(43,15) + "|" +
chan.getString(58,31) + "|" +
chan.getString(89,10) + "|" +
chan.getString(99,10);
selectRef.options[selectRef.options.length] = new Option (jobMsg);

if (chan.readMessage(recTypeLen) != recTypeLen)
{
alert ("Error receiving reply from server");
return false;
}

recType = chan.getString(0,recTypeLen);
if (recType != jobInfo)
break;
}

if (recType != eofInfo)
return false;

if (chan.readMessage(eofLen) != eofLen)
{
alert ("Error receiving reply from server");
return false;
}

document.getjobs.rec_count.value = (rc - 1);

return true;
}

</script>

</head>

<body>

<h2>Example Client for Tier3 DEMO application server on VMS</h2><hr>

<form name="getjobs">

<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width= "0" height= "0" name="CornuCopiae"
id="CornuCopiae">
<param name="archive" value="tier3.jar">
<param name="codebase"
value="http://1.2.3.6/";>
<param name="code"
value="CornuCopiae">
<param name="mayscript" value="yes">
<param name="scriptable" value="true">
<param name="name"
value="CornuCopiae">
<param name="PORT" value="1024">
<param name="HOSTCHARSET"
value="ISO-8859-1">
<param name="MAXBUF" value="512">
<param name="APPLICATION" value="DEMO">

</object>

<br />Enter Job Entry Number [Default is All jobs]:
<input
type="text"
onkeypress="return enter(document.getjobs.send)"
name="entry_number"
maxlength=4
size=4
dir="rtl"
/>

<input
type="button"
onmouseup="job_lookup()"
name="send"
value="Get Job Info."
/>

Jobs Found:
<input
type="text"
name="rec_count"
readonly
value="0"
size=5
/>

<br /><br />

<select
name="job_list"
id="Job_list"
class="green_screen"
size=1>
<option
value="lovhdr"
selected=true
disable=true
>
Nbr--Job-Name--------------------------------Job Status------Queue
Name----------------------Queue Type-Status----</option>
</select>

<br />

</form>

<p>
This is an example of a browser-based, html and JavaScript,
client interacting with a VMS hosted Tier3 Application Server
in a connection-oriented and context-rich environment.<br /><br />

You would have noticed that, when this page was initially displayed,
you were immediately prompted for your VMS Username and Password.
Once authorization is successful your credentials, and an accompanying
Persona, are automatically made available to your 3GL User Action
Routines each time their Server Process is chosen to perform work on
behalf of the client. In this example, the user only gets to see those
Print and Batch jobs that they have privileges to view. You can find
the corresponding server code for this example (demo_uars.cob) in your
t3$examples directory.<br /><br />

The session and server connection are terminated when you change
web pages or refresh this page.
</p>

<hr>

<p class="credits">
"Tier3" is a registered trademark of Tier3 Software Ltd<br />
"CornuCopiae" is a trademark of Richard Maher
</p>

</body>
</html>

"David J Dachtera" <djesys.no@xxxxxxxxxxxxxxxx> wrote in message
news:45DFB780.462B5295@xxxxxxxxxxxxxxxxxxx
Hein RMS van den Heuvel wrote:

On Feb 22, 7:19 pm, David J Dachtera <djesys...@xxxxxxxxxxxxxxxx>
wrote:
Hhmmm...
:
$ jbi = f$getjpi( jpi, "biocnt" )
:
Why don't the Direct I/O and Buffered I/O counts match the values
returned by F$GETJPI()?

Because you did not ask for those? :-)

This topic seems to call for a teasing reply or two.

I'll go with:

- David has forgotten more about DCL than most programmers ever know,
and here is a case in point.

my runner up:

- Senior moment Dave?

Yeah, kinda. I really wanted DIRIO and BUFIO.

See, I'm developing a sort of an extended DELETE|SET|SHOW ENTRY. The SHOW
output
looks like this ("sanitized" for publication):

$ ent show q=node$batch
Entry Jobname Username Blocks Status
----- ------- -------- ------ ------
3450 SITE_RELL SYSTEM Executing
On available batch queue NODE$BATCH
SUBMITted 23-FEB-2007 00:04:40.05
/AFTER=23-FEB-2007 00:45:00.00
Running since 23-FEB-2007 00:45:00.05
000030BB SITE_RELL CPU=00:09:51.85 PF=87830 IO=2388646
MEM=36

3418 SITE_PAT SYSTEM Executing
On available batch queue NODE$BATCH
SUBMITted 22-FEB-2007 17:00:19.57
/AFTER=23-FEB-2007 02:00:00.00
Running since 23-FEB-2007 02:00:00.00
000030C0 SITE_PAT CPU=00:00:02.53 PF=15849 IO=2419 MEM=39

3518 SYSHOURLY SYSTEM Holding until 23-FEB-2007
09:00:00.00
On available batch queue NODE$BATCH
SUBMITted 23-FEB-2007 08:00:02.18
/AFTER=23-FEB-2007 09:00:00.00

3451 SYSDAILY SYSTEM Holding until 24-FEB-2007
00:05:00.00
On available batch queue NODE$BATCH
SUBMITted 23-FEB-2007 00:05:02.17
/AFTER=24-FEB-2007 00:05:00.00

Note the "mini-CTRL+T" display for jobs that are running. I'm sure the MEM
value
is still wrong. I'm using PPGCNT, but it doesn't match an actual CTRL+T
display.

Notice also that the /AFTER time is shown for jobs that are Executing,
unlike
the standard SHOW ENTRY display. The procedure uses SHOW ENTRY as well as
F$GETQUI("DISPLAY_ENTRY", ...).

P1 can be DEL, SET or SHOW (DEL and SET are obviously potentially VERY
dangerous!).

P2 can be a list of (range(s) of) entry numbers, a single entry number
(range)
or the expression Q[UEUE]=queue_name. Yes, the expression
"Q=SYS$BATCH,NODE$BATCH" is allowed (list does not require parens -
F$ELEMENT()
is used looking for comma-separated items to the right of the "=" before
the
next whitespace), and wild-cards in queue names are supported. (!CAUTION!)

P3 can be /LOG (for DEL or SET), /FULL for SHOW or any qualifier supported
by
the matching SET ENTRY, SHOW ENTRY to DELETE/ENTRY command (though some
may not
make sense for this usage).

Ideally, I'd like to see this functionality added to:

SHOW
ENTRY
/EXTENDED
/QUEUE=queue_name[/BY_JOB_STATUS=value]
/[NO]CTRLT (default should be CTRLT for Executing jobs)
.
.
.

SET
ENTRY
/QUEUE=queue_name[/BY_JOB_STATUS=value]
.
.
.


DELETE/ENTRY=[([entry_number[,entry_number[,...]]]|QUEUE={queue_name[,queue_
name[,...]]])]

...with support for ranges of entry numbers (SET, SHOW and DELETE already
support lists of specific entry numbers) and selection of entries by queue
name
and job status.

Also, how 'bout letting SET ENTRY/DELETE duplicate the function of
DELETE/ENTRY?

Nothing version-specific here; so, back-porting is reasonably expectable.
;-)

...oh, yeah: count my hand raised, also, for RENAME/QUEUE. Bloody pain
doing it
the other way!

--
David J Dachtera
dba DJE Systems
http://www.djesys.com/

Unofficial OpenVMS Marketing Home Page
http://www.djesys.com/vms/market/

Unofficial Affordable OpenVMS Home Page:
http://www.djesys.com/vms/soho/

Unofficial OpenVMS-IA32 Home Page:
http://www.djesys.com/vms/ia32/

Unofficial OpenVMS Hobbyist Support Page:
http://www.djesys.com/vms/support/





.