Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Customizing the output of CTRL-T

31 views
Skip to first unread message

Guy Peleg

unread,
Dec 10, 2004, 4:57:40 PM12/10/04
to
We have added the ability to customize the output of the CTRL-T routine.

If the symbol DCL$CTRLT is defined DCL will append it's contents to

the traditional CTRL-T output. It allows users to use CTRL-T for their

own needs in their applications. It may also be used for debugging

user/supervisor mode code.

Here is a simple DCL procedure using the new feature

IPL31> ty ctrlt_loop.com

$ inner=0

$ outer=0

$ loop:

$ loop1:

$ if inner .gt. 20000 then goto end_loop1

$ inner=inner+1

$ dcl$ctrlt=F$FAO("Inner loop count is !SL !/ Outer loop count is
!SL",inner,outer)

$ goto loop1

$ end_loop1:

$ inner=0

$ outer=outer+1

$ goto loop

IPL31> @ctrlt_loop

IPL31::GUY 10:46:37 (DCL) CPU=00:03:42.68 PF=13453 IO=6743 MEM=187

Inner loop count is 12306

Outer loop count is 0

IPL31::GUY 10:46:43 (DCL) CPU=00:03:49.19 PF=13455 IO=6744 MEM=187

Inner loop count is 19200

Outer loop count is 2

Here is a simple C program utilizing the new feature

IPL31> ty ctrlt_looper.c

#include <descrip>

void main()

{

int counter=0;

$DESCRIPTOR(sym_name,"dcl$ctrlt");

static struct dsc$descriptor_s value_desc;

char buffer[256]={0};

value_desc.dsc$b_dtype = DSC$K_DTYPE_T;

value_desc.dsc$b_class = DSC$K_CLASS_S;

while (1){

counter++;

sprintf(buffer,"Counter is %d",counter);

value_desc.dsc$a_pointer = buffer;

value_desc.dsc$w_length = strlen(buffer);

lib$set_symbol(&sym_name,&value_desc);

}

}

IPL31> r ctrlt_looper

IPL31::GUY 10:47:27 CTRLT_LOO CPU=00:03:53.26 PF=13631 IO=6784 MEM=335

Counter is 216766

IPL31::GUY 10:47:28 CTRLT_LOO CPU=00:03:54.45 PF=13631 IO=6785 MEM=335

Counter is 338429

The DCL$CTRLT symbol may have different values in different procedure levels

which I find useful as well.

What do you think? unfortunately we missed the V8.2 train so this

will ship with the first version after V8.2. However, if the response is

positive enough, I'll consider backporting it to V7.3-2 or V8.2

Guy Peleg

OpenVMS Engineering


Alan Winston - SSRL Central Computing

unread,
Dec 10, 2004, 5:45:29 PM12/10/04
to
In article <41ba1eac$1...@usenet01.boi.hp.com>, "Guy Peleg" <guy.peleg@remove_this_hp.com> writes:
>We have added the ability to customize the output of the CTRL-T routine.

[Snippage]


>
>
>What do you think? unfortunately we missed the V8.2 train so this
>
>will ship with the first version after V8.2. However, if the response is
>
>positive enough, I'll consider backporting it to V7.3-2 or V8.2

I think this is pretty darn cool. I don't have a business case for backporting
it, and I don't have a need right this second, but I can think of a number of
cases where this would have been very, very handy in the past.

-- Alan

JF Mezei

unread,
Dec 10, 2004, 5:57:31 PM12/10/04
to
Guy Peleg wrote:
> We have added the ability to customize the output of the CTRL-T routine.

"We" ???? Shouldn't this be "I" ???? :-)

> If the symbol DCL$CTRLT is defined DCL will append it's contents to
> the traditional CTRL-T output. It allows users to use CTRL-T for their

Neat trick. However, I tried this on my all mighty microvax II (VMS 7.2) and
it doesn't work as documented. The "We" must learn to be better santas to
deliver those improvements to existing systems faster (without customers
realising someone has penetrated their systems to replace DCL.EXE, of course)
:-) :-) :-)

Remember that SANTA gets to deliver goodies inside people's homes without
trigerring any alarms around the world in 24 hours. Shirley you can deliver
little gifts to those 400k systems in less time ? :-)

Also, personally, I would have prefered to see the text added on the same line
if it fits within 80 characters. Would have made for cleaner output.

Guy Peleg

unread,
Dec 10, 2004, 5:56:42 PM12/10/04
to

"JF Mezei" <jfmezei...@teksavvy.com> wrote in message
news:41BA29C2...@teksavvy.com...

I'm up to the challenge !!! I'm willing to provide VAX image for V7.3

Stanley F. Quayle

unread,
Dec 10, 2004, 6:20:58 PM12/10/04
to
On 11 Dec 2004 at 0:56, Guy Peleg wrote:
> I'm up to the challenge !!! I'm willing to provide VAX image for V7.3

Please do.

--Stan Quayle
Quayle Consulting Inc.

----------
Stanley F. Quayle, P.E. N8SQ +1 614-868-1363
8572 North Spring Ct., Pickerington, OH 43147 USA
stan-at-stanq-dot-com http://www.stanq.com

Peter 'EPLAN' LANGSTOEGER

unread,
Dec 10, 2004, 6:29:21 PM12/10/04
to

Thanks Guy for the good work
(and thanks Alan to find the right words)

--
Peter "EPLAN" LANGSTOEGER
Network and OpenVMS system specialist
E-mail pe...@langstoeger.at
A-1030 VIENNA AUSTRIA I'm not a pessimist, I'm a realist

Peter 'EPLAN' LANGSTOEGER

unread,
Dec 10, 2004, 6:30:54 PM12/10/04
to
In article <41ba...@usenet01.boi.hp.com>, "Guy Peleg" <guy.peleg@remove_this_hp.com> writes:
>I'm up to the challenge !!! I'm willing to provide VAX image for V7.3

Whoopie.
But what has happened to OpenVMS VAX V8.2 ?

Alan Frisbie

unread,
Dec 10, 2004, 7:41:13 PM12/10/04
to
Guy Peleg wrote:

> We have added the ability to customize the output of the CTRL-T routine.

Guy, you are one Cool Guy! Thank you very much. I can think
of many times over the years when this would have save me a *lot*
of debugging time, especially with other people's code.

I'm sorry that it missed the v8.2 cutoff, but if a back-ported
image should become available for either v8.2 or v7.3-2 I will
install it immediately.

Thanks,
Alan

Barry

unread,
Dec 10, 2004, 11:48:45 PM12/10/04
to
I will add my voice to the chorus. This is a long overdue feature.
Not only would it have helped when debugging complicated loops, but
even when doing file i/o - it would be an easy way to find out what
record you're on (without going into SDA and parsing the RABs). Please
let us know when we can get it and how to put it on the VAXes (Alphas?)
we have access to. Thanks!!

Dave Weatherall

unread,
Dec 11, 2004, 2:06:20 AM12/11/04
to
On Fri, 10 Dec 2004 21:57:40 UTC, "Guy Peleg"
<guy.peleg@remove_this_hp.com> wrote:

> We have added the ability to customize the output of the CTRL-T routine.
>
> If the symbol DCL$CTRLT is defined DCL will append it's contents to
>
> the traditional CTRL-T output. It allows users to use CTRL-T for their

<Snip>

> What do you think? unfortunately we missed the V8.2 train so this
>
> will ship with the first version after V8.2. However, if the response is
>
> positive enough, I'll consider backporting it to V7.3-2 or V8.2
>
> Guy Peleg
>
> OpenVMS Engineering

Neat !! and useful. How about 7.3-1 too? We finally get to move up to
it next year.

--
Cheers - Dave W.

Richard Maher

unread,
Dec 11, 2004, 2:57:56 AM12/11/04
to
Hi,

While I'm all for any and all new functionality, I'm a bit confused on this.
At least, from a 3GL point of view, what does this give you that an
out-of-band CTRL/T AST doesn't? Admittedly DCL is a bit harder; but I
remember at least one example in the old VAX Professional (Oooohh, remember
those!) of a Terminate and Stay Resident job that would do the DCL bits.

Anyway, well done. But sadly it would appear that after the 8.2 workload,
VMS engineering now has some fat that could be trimmed. It's a shame, as I
certainly have some functionality that I'd like to see go in ahead of this.

Regards Richard Maher.

"Guy Peleg" <guy.peleg@remove_this_hp.com> wrote in message
news:41ba1eac$1...@usenet01.boi.hp.com...

R.A.Omond

unread,
Dec 11, 2004, 4:45:53 AM12/11/04
to
Guy Peleg wrote:

> We have added the ability to customize the output of the CTRL-T routine.
> If the symbol DCL$CTRLT is defined DCL will append it's contents to
> the traditional CTRL-T output. It allows users to use CTRL-T for their
> own needs in their applications. It may also be used for debugging
> user/supervisor mode code.

Just to add another vote for this !

Excellent, and this will *greatly* aid debugging.

VAXman-

unread,
Dec 11, 2004, 7:21:14 AM12/11/04
to
In article <cpe9a3$i3$1...@hercules.btinternet.com>, "Richard Maher" <mahe...@hotspamnotmail.com> writes:
>Hi,
>
>While I'm all for any and all new functionality, I'm a bit confused on this.
>At least, from a 3GL point of view, what does this give you that an
>out-of-band CTRL/T AST doesn't? Admittedly DCL is a bit harder; but I
>remember at least one example in the old VAX Professional (Oooohh, remember
>those!) of a Terminate and Stay Resident job that would do the DCL bits.
>
>Anyway, well done. But sadly it would appear that after the 8.2 workload,
>VMS engineering now has some fat that could be trimmed. It's a shame, as I
>certainly have some functionality that I'd like to see go in ahead of this.
>
>Regards Richard Maher.

ftp://ftp.process.com/vms-freeware/fileserv/ctrl-verify.zip

--
http://www.ProvN.com for the *best* OpenVMS system security
solutions that others only claim to be.
--
Cyber-Terrorism (si'-ber tayr'-or-iz-em) n.:
The release of, the sale of, or the use of any Micro$oft software product!
--
VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)COM

VAXman-

unread,
Dec 11, 2004, 7:30:18 AM12/11/04
to
In article <cpe9a3$i3$1...@hercules.btinternet.com>, "Richard Maher" <mahe...@hotspamnotmail.com> writes:
>Hi,
>
>While I'm all for any and all new functionality, I'm a bit confused on this.
>At least, from a 3GL point of view, what does this give you that an
>out-of-band CTRL/T AST doesn't? Admittedly DCL is a bit harder; but I
>remember at least one example in the old VAX Professional (Oooohh, remember
>those!) of a Terminate and Stay Resident job that would do the DCL bits.
>
>Anyway, well done. But sadly it would appear that after the 8.2 workload,
>VMS engineering now has some fat that could be trimmed. It's a shame, as I
>certainly have some functionality that I'd like to see go in ahead of this.

ftp://ftp.process.com/vms-freeware/fileserv/ctrl-verify.zip

Guy Peleg

unread,
Dec 11, 2004, 9:52:22 AM12/11/04
to
All people responded suggested they would benefit using
this in debugging situations. I might say that I was a little
surprised. While this makes a great debugging tool it may
also use in your applications to indicate some kind of progress.
Assuming I'm calculating the largest prime number, I might
define the symbol (in the application) to indicate what is the
current number being processed (maybe update the symbol
only every 50000 loop iteration)....

It is always surprising to see how people use our features.

Thank you for your valuable feedback. Keep it coming

Guy


Larry Kilgallen

unread,
Dec 11, 2004, 10:05:02 AM12/11/04
to
In article <cpe9a3$i3$1...@hercules.btinternet.com>, "Richard Maher" <mahe...@hotspamnotmail.com> writes:

> While I'm all for any and all new functionality, I'm a bit confused on this.
> At least, from a 3GL point of view, what does this give you that an
> out-of-band CTRL/T AST doesn't? Admittedly DCL is a bit harder; but I

As I see it, being able to do it from DCL is the goal, and being able
to use it from a real program just falls out for free due to the way
it is implemented.

> remember at least one example in the old VAX Professional (Oooohh, remember
> those!) of a Terminate and Stay Resident job that would do the DCL bits.

This implementation is (or will be) SUPPORTED !!!

That is crucial for many sites.

Terminate and Stay Resident is for another operating system :-)

> Anyway, well done. But sadly it would appear that after the 8.2 workload,
> VMS engineering now has some fat that could be trimmed.

What makes you say that ? While adding this feature may not be so
crucial a job for Guy as making LMF work for Itanium, this category
of change is what VMS Development used to call a "delighter". It
will not sell any additional machines per se, but it keeps the loyal
VMS fans enthused, which is quite important. A similar status is
true for other forthcoming features discussed at the VMS Symposium
in Nashua -- much desired by those customers who personally use VMS
but not strategic enough to slow down the Itanium release.

Larry Kilgallen

unread,
Dec 11, 2004, 9:58:24 AM12/11/04
to
In article <41ba...@usenet01.boi.hp.com>, "Guy Peleg" <guy.peleg@remove_this_hp.com> writes:

> I'm up to the challenge !!! I'm willing to provide VAX image for V7.3

But if you can get the feature into the VAX 8.2 release, for once
VAX would be ahead of Alpha in getting the new stuff !!!

Larry Kilgallen

unread,
Dec 11, 2004, 10:07:16 AM12/11/04
to
In article <41bb0c85$1...@usenet01.boi.hp.com>, "Guy Peleg" <guy.peleg@remove_this_hp.com> writes:
> All people responded suggested they would benefit using
> this in debugging situations. I might say that I was a little
> surprised. While this makes a great debugging tool it may
> also use in your applications to indicate some kind of progress.
> Assuming I'm calculating the largest prime number, I might
> define the symbol (in the application) to indicate what is the
> current number being processed (maybe update the symbol
> only every 50000 loop iteration)....

I gather from the idea of only updating every so often that Guy
does not get paid according to how much time customer machines
spend in Supervisor Mode :-)

Rob Brooks

unread,
Dec 11, 2004, 12:34:06 PM12/11/04
to
"Dave Weatherall" <djw-n...@nospam.nohow> writes:
> Neat !! and useful. How about 7.3-1 too? We finally get to move up to
> it next year.

Since V7.3-1 is not supported after the end of the calendar year (and it
is not eligible for prior version support), there is a reluctance to spend time
working on unsupported software.

Please note that I'm not speaking for Guy, however.

--

Rob Brooks VMS Engineering -- I/O Exec Group brooks!cuebid.zko.dec.com

Richard Levitte

unread,
Dec 11, 2004, 1:29:42 PM12/11/04
to
Guy Peleg wrote:
> We have added the ability to customize the output of the CTRL-T
routine.
>
> If the symbol DCL$CTRLT is defined DCL will append it's contents to
> the traditional CTRL-T output. It allows users to use CTRL-T for
their
> own needs in their applications. It may also be used for debugging
> user/supervisor mode code.
I love this idea! Please implement.

--
Richard Levitte

Guy Peleg

unread,
Dec 11, 2004, 2:19:41 PM12/11/04
to
I agree
"Rob Brooks" <bro...@cuebid.zko.dec.nospam> wrote in message
news:i$He1Nd...@cuebid.zko.dec.com...

Richard Maher

unread,
Dec 11, 2004, 2:39:41 PM12/11/04
to
Hi Guy,

> All people responded suggested they would benefit using
> this in debugging situations.

No they didn't. I suggested it was a waste of time and money.

>While this makes a great debugging tool it may
> also use in your applications to indicate some kind of progress.

Maybe something like: -

DO6 >> rmu/unload my_db my_table my_table
MYNODE::MAHER_R 18:21:35 RMU71 CPU=00:00:05.03 PF=3245 IO=4688 MEM=1150
----------------------------------------------------------------------------
----
ELAPSED: 0 00:00:02.30 CPU: 0:00:01.81 BUFIO: 98 DIRIO: 1623 FAULTS:
1041
21750 records unloaded.
----------------------------------------------------------------------------
----
MYNODE::MAHER_R 18:21:38 RMU71 CPU=00:00:06.93 PF=3286 IO=6418 MEM=1150
----------------------------------------------------------------------------
----
ELAPSED: 0 00:00:04.59 CPU: 0:00:03.71 BUFIO: 119 DIRIO: 3332
FAULTS: 1057
55950 records unloaded.
----------------------------------------------------------------------------
----
%RMU-I-DATRECUNL, 97191 data records unloaded.

. . . or is your wheel just that bit rounder than everybody elses?

> (maybe update the symbol only every 50000 loop iteration)....

Or you could bypass the overhead of updating a DCL symbol and simply dump
the contents of local working-storage.

Regards Richard Maher

"Guy Peleg" <guy.peleg@remove_this_hp.com> wrote in message

news:41bb0c85$1...@usenet01.boi.hp.com...

JF Mezei

unread,
Dec 11, 2004, 2:50:24 PM12/11/04
to
Larry Kilgallen wrote:
> What makes you say that ? While adding this feature may not be so
> crucial a job for Guy as making LMF work for Itanium, this category
> of change is what VMS Development used to call a "delighter". It
> will not sell any additional machines per se, but it keeps the loyal
> VMS fans enthused,


I disagree. As an operating system, it is those little "unimportant" features
that Guy is addding which most improve our productivity as VMS
users/programmers/system managers. They benefit a hell of a lot more features
than the ability to build a cluster with nodes on mars , moon and earth.
(earth having more votes than moon and mars).

VMS management has decided that VMS should only be for very large sites, at
which point the priorities do become clustering for far away backup sites,
using fancy fibre stuff for disk arrays etcm, but the vasty majorioty fo the
POTENTIAL vms customer base doesn't benefit from this. They benefit from the
neat little gadgets that Guy adds to VMS.

The installed base doesn't quite benefit from Guy's neat little gadgets since
they are not availabel on the version they are running.

Larry Kilgallen

unread,
Dec 11, 2004, 4:52:26 PM12/11/04
to
In article <cpfids$884$1...@titan.btinternet.com>, "Richard Maher" <mahe...@hotspamnotmail.com> writes:

>> All people responded suggested they would benefit using
>> this in debugging situations.
>
> No they didn't. I suggested it was a waste of time and money.


That seems a bit harsh. It also seems a bit imperious, since I doubt
that anybody other than Guy knows how hard or easy it was to implement
(excluding the time to think about the need).

Personally, I don't think I would benefit from this, due to how I spend
my time on VMS.

But I am fully willing to admit that _other_ may get considerable
benefit from the feature.

David J Dachtera

unread,
Dec 11, 2004, 5:48:05 PM12/11/04
to

Bravo! Excellent new feature! Will come in very handy, I'm sure!

As there are precious few debugging tools available for DCL, how 'bout
back-porting as far as possible, preferably at least to VAX V5.5-2, and
Alpha V6.2, V7.1-2, V7.2-2, V7.3-2 (the Alpha "landing zones").

For future enhancements, how about:

$! DCL$CTRLT_DEBUG as a bitmap:
$! Bit 0 = Display procedure line number
$! Bit 1 = Display all local symbols
$! Bit 2 = Display all global symbols
$! Bit 3 = Display most recent label
$! Bit 4 = Display current procedure depth
$! Bit 5 = Display current procedure filespec
$! Bit 6 = Display current statement
$! Bit 7 = Display calling procedure filespec
$! Bit 8 - 15 Reserved
$ DCL$CTRLT_DEBUG == 1 + 2 + 8 + 16 + 64 + 128

$ TYPE MYPROC.COM
$!
$LABEL_1:
$ WAIT 00:00:15
$ EXIT

$ @MYPROC
^T
DJAS01::DJD 10:46:43 (DCL) CPU=00:03:49.19 PF=13455 IO=6744 MEM=187
LINE = 3
P1 = ""
P2 = ""
P3 = ""
P4 = ""
P5 = ""
P6 = ""
P7 = ""
P8 = ""
LABEL = "LABEL_1"
DEPTH = 1
COMMAND = "WAIT 00:00:15"
CALLER = "SYS$COMMAND"

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

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

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

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

Guy Peleg

unread,
Dec 11, 2004, 9:03:55 PM12/11/04
to

"David J Dachtera" <djesys...@comcast.net> wrote in message
news:41BB7925...@comcast.net...


Very interesting idea!

David J Dachtera

unread,
Dec 11, 2004, 10:26:46 PM12/11/04
to

If you got into it enough you could even cook up a small program to add
a SET keyword:

SET
CTRLT_DEBUG

Set or clear features of DCL Control+T debug.

Additional Information available:

Qualifiers
/ALL /CALLER /COMMAND /DEPTH /GLOBAL_SYMBOLS
/LABEL /LINE_NUMBER /LOCAL_SYMBOLS
/PROCEDURE

...set [un]set the bits. Qualifiers (including /ALL) would need to be
negatable. SET CTRLT_DEBUG/NOALL turns them all off, for example.

Paddy O'Brien

unread,
Dec 12, 2004, 2:47:40 AM12/12/04
to
Guy (and others - an interesting thread),

Again as someone mentioned, supported is often preferred, but our group
are somewhat ambivalent.

There has been some discussion of using Guy's feature for debugging.
I'm not totally clear whether the responses are discussing within
programs (but without $link/debug) or at DCL level.

I picked up (from the comments in my .com file), a file called
DCL_DEBUG.COM by Laurent Quivogne from DECUS CD10. This debugs DCL with
similar (but limited) commands to the VMS debugger for language support.
I have modified it for local usage as it does not support $type
sys$input lines very well.

In conjunction with Charlie Hammond's DCL_CHECK, these give me the best
debugging tools for large .COM files. DCL errors are sometimes hard to
discern, even when verify is on, particularly when a $endif is missing
and a $goto or $gosub are involved.

For progress reports, I write periodically (I indulge in large
electrical engineering programs as a maintainer and developer in Fortran
95), but these are from codes that I write the algorithm and know there
is a lot of wait time, but see the later sentences since our main wait
times are in CXML and NAG routines.. Not yet clear how to use Guy's
CTRL*T to effect this any simpler in my routines. One of our major
programs uses CXM (LAPACK), to evaluate eigenvalues/eigenvectors; it
would be nice to see the progress here (since the state matrix is large
(non-sparse) and can take considerable time even on our ES40), but I
cannot see how they can be interfaced. Similarly from integration
routines using NAG.

Regards, Paddy

Guy Peleg wrote:
> All people responded suggested they would benefit using
> this in debugging situations. I might say that I was a little
> surprised. While this makes a great debugging tool it may
> also use in your applications to indicate some kind of progress.
> Assuming I'm calculating the largest prime number, I might
> define the symbol (in the application) to indicate what is the
> current number being processed (maybe update the symbol
> only every 50000 loop iteration)....
>
> It is always surprising to see how people use our features.
>
> Thank you for your valuable feedback. Keep it coming
>

> Guy
>

***********************************************************************

"This electronic message and any attachments may contain privileged
and confidential information intended only for the use of the
addressees named above. If you are not the intended recipient of
this email, please delete the message and any attachment and advise
the sender. You are hereby notified that any use, dissemination,
distribution, reproduction of this email is prohibited.

If you have received the email in error, please notify TransGrid
immediately. Any views expressed in this email are those of the
individual sender except where the sender expressly and with
authority states them to be the views of TransGrid. TransGrid uses
virus-scanning software but excludes any liability for viruses
contained in any attachment.

Please note the email address for TransGrid personnel is now
firstname...@transgrid.com.au"

***********************************************************************

Rob

unread,
Dec 13, 2004, 4:00:45 AM12/13/04
to
Guy - a superb idea, and one that will help all of us DCL programmers.

Now, if you could add a 'DIRECTORY/SORT=' as well, I'd be in heaven

Rob.

Peter 'EPLAN' LANGSTOEGER

unread,
Dec 13, 2004, 4:05:21 AM12/13/04
to
In article <1102928445.3...@z14g2000cwz.googlegroups.com>, "Rob" <ratk...@tbs-ltd.co.uk> writes:
>Guy - a superb idea, and one that will help all of us DCL programmers.
>
>Now, if you could add a 'DIRECTORY/SORT=' as well, I'd be in heaven

Not yet. First we need a wildcard function (such as in F$SEARCH) with
customizable (eg. via logical) features (most important: reverse alphabet).
Then we should base utilities and DCL commands on top of it...

Larry Kilgallen

unread,
Dec 13, 2004, 8:01:34 AM12/13/04
to
In article <newscache$mjkn8i$cmo1$1...@news.sil.at>, pe...@langstoeger.at (Peter 'EPLAN' LANGSTOEGER) writes:
> In article <1102928445.3...@z14g2000cwz.googlegroups.com>, "Rob" <ratk...@tbs-ltd.co.uk> writes:
>>Guy - a superb idea, and one that will help all of us DCL programmers.
>>
>>Now, if you could add a 'DIRECTORY/SORT=' as well, I'd be in heaven
>
> Not yet. First we need a wildcard function (such as in F$SEARCH) with
> customizable (eg. via logical) features (most important: reverse alphabet).
> Then we should base utilities and DCL commands on top of it...

Certainly utilities should not be based on lexical functions !

Bob Koehler

unread,
Dec 13, 2004, 8:27:37 AM12/13/04
to
In article <41ba1eac$1...@usenet01.boi.hp.com>, "Guy Peleg" <guy.peleg@remove_this_hp.com> writes:
> We have added the ability to customize the output of the CTRL-T routine.
>
> If the symbol DCL$CTRLT is defined DCL will append it's contents to
> the traditional CTRL-T output. It allows users to use CTRL-T for their
> own needs in their applications. It may also be used for debugging
> user/supervisor mode code.
>

> What do you think? unfortunately we missed the V8.2 train so this


> will ship with the first version after V8.2. However, if the response is
> positive enough, I'll consider backporting it to V7.3-2 or V8.2

Cool, neat, and way easier then writing our on control-T AST.
Especially since we can use it in DCL.

Thanks.


Peter 'EPLAN' LANGSTOEGER

unread,
Dec 13, 2004, 9:36:37 AM12/13/04
to

I didn't say that. Read again.

Lexical functions are based on system functions and/or library functions.
I don't know which is used for F$SEARCH. But of course of all of the inner
functions which give a list of files should get this customize improvement.

Phillip Helbig---remove CLOTHES to reply

unread,
Dec 13, 2004, 9:51:02 AM12/13/04
to

> Now, if you could add a 'DIRECTORY/SORT=' as well, I'd be in heaven

I got this somewhere off the web or usenet several years ago. Not DCL,
but useful.

PROGRAM SDIR
C*
C* *******************************
C* *******************************
C* ** **
C* ** SDIR **
C* ** **
C* *******************************
C* *******************************
C*
C* AUTHOR :
C* Arthur E. Ragosta
C* RAG...@MERLIN.ARC.NASA.GOV
C*
C* MS 219-1
C* NASA Ames Research Center
C* Moffett Field, Ca. 94035-1000
C* (415) 604-5558
C*
C* DESCRIPTION :
C* SORTED DIRECTORY
C* PRODUCE A SIMPLE DIRECTORY LISTING SORTED BY DATE or SIZE
C*
C* /DESCENDING = OLDEST DATES FIRST, ELSE NEWEST FIRST
C* /SIZE = sort by size instead of date
C*
C* SUBPROGRAM REFERENCES :
C*
C* ASSUMPTIONS AND RESTRICTIONS :
C* NOT TRANSPORTABLE.
C* DIRECTORY TRUNCATED AT 'max_files' FILE NAMES.
C*
C* LANGUAGE AND COMPILER :
C* ANSI FORTRAN 77
C*
C* CHANGE HISTORY :
C* 22 MAR 1993 - INITIAL VERSION
C* 14 SEP 1995 - Converted to alpha
C* 30 OCT 1995 - Bug fixed in USEROPEN
C*
C***********************************************************************
C*
PARAMETER (MAX_FILES=1000)
common /data/
$ date(max_files), direc(max_files), size(max_files),
$ names(max_files), num_files
logical direc
integer size
integer *8 date
character *80 names
c
integer indx(max_files)
c
CHARACTER *127 P(2), PATH, next_file
CHARACTER *20 Q(2)
character *23 adate
CHARACTER *4 ON, OFF
LOGICAL D_FLAG, S_FLAG
external my_open
C
ON = CHAR(27) // '[1m' ! Bold on
OFF = CHAR(27) // '[0m' ! Bold off
D_FLAG = .FALSE.
S_FLAG = .FALSE.
CALL GETFOR (NQ, Q, NP, P)
DO 1 I = 1, NQ
IF (Q(I)(1:1) .EQ. 'D') THEN ! Just in case he said /DATE
IF ((LENGTH(Q(I)) .LE. 1) .OR. (Q(I)(2:2) .NE. 'A'))
$ D_FLAG = .TRUE.
ENDIF
IF (Q(I)(1:1) .EQ. 'S') S_FLAG = .TRUE.
1 CONTINUE
C
C --- Defaults to current directory
C
IF (NP .EQ. 0) THEN
CALL DEFAULT ( PATH )
ELSE
PATH = P(1)
ENDIF
CALL PARSE ( PATH, '*.*;*', 'FULL', PATH )
num_files = 0
c
c --- loop over wildcards for each file; "MYOPEN" does all the work
c
10 call getfile ( path, next_file )
if (next_file .ne. ' ') then
call parse (next_file, ' ', 'LO', names(num_files+1))
OPEN (UNIT=0, FILE=next_file(1:length(next_file)),
$ STATUS='OLD', ERR=10, useropen=my_open)
30 close(unit=0)
if (num_files .le. max_files) go to 10
endif
C
C --- sort file list by date or size
C
IF (S_FLAG) THEN
call isorti (size, num_files, indx) ! by File SIZE !!!
ELSE
call isorti8 (date, num_files, indx) ! by DATES !!!
ENDIF
C
C --- In descending order ?
C
IF (D_FLAG) THEN
ISTART = NUM_FILES
IEND = 1
INCR = -1
ELSE
ISTART = 1
IEND = NUM_FILES
INCR = 1
ENDIF
C
C -- Note that directory files are bolded on output
c
DO 100 I = ISTART, IEND, INCR
ln = length(names(indx(i)))
c
c ----- Sorted by size
c
if (s_flag) then
if (direc(indx(i))) then
if (ln .le. 30) then
write (6,900) on,
$ names(indx(i))(1:ln), off, size(i)
else
write (6,901) on,
$ names(indx(i))(1:ln), off, size(i)
endif
else
if (ln .le. 30) then
write (6,910) names(indx(i))(1:ln), size(i)
else
write (6,911) names(indx(i))(1:ln), size(i)
endif
endif
c
c ----- Sorted by date
c
else
call sys$asctim ( , adate, date(i) ,)
if (direc(indx(i))) then
if (ln .le. 30) then
write (6,920) on,
$ names(indx(i))(1:ln), off, adate(1:17)
else
write (6,921) on,
$ names(indx(i))(1:ln), off, adate(1:17)
endif
else
if (ln .le. 30) then
write (6,930) names(indx(i))(1:ln), adate(1:17)
else
write (6,931) names(indx(i))(1:ln), adate(1:17)
endif
endif
endif
100 CONTINUE
C
CALL EXIT
900 format(' ',3a,t38,i5)
901 format(' ',3a/,t38,i5)
910 format(' ',a,t30,i5)
911 format(' ',a/,t30,i5)
920 format(' ',3a,t38,a)
921 format(' ',3a/,t30,a)
930 format(' ',a,t30,a)
931 format(' ',a/,t30,a)
END
C
C---END SDIR
C
integer function my_open (fab, rab, lun)
c*
c* This routine is called by the FORTRAN OPEN statement to extract the
c* file size, date, and directory flag for each file.
c*
PARAMETER (MAX_FILES=1000)
common /data/
$ date(2,max_files), direc(max_files), size(max_files),
$ names(max_files), num_files
logical direc
integer size
integer *4 date ! Fudge to make it easier to move quadword
character *80 names
c
include '($fabdef)'
c include '($rabdef)'
include '($xabdef)'
include '($xabdatdef)'
include '($xabfhcdef)'
include '($xabitmdef)'
c
c --- is this complicated, or what?
c
structure /bigxab/
union
map
record/xabdef/ xab
endmap
map
record /xabdatdef/ xabdat
endmap
endunion
endstructure
c
structure /bigxab1/
union
map
record/xabdef/ xaba
endmap
map
record /xabfhcdef/ xabfhc
endmap
endunion
endstructure
c
structure /bigxab2/
union
map
record/xabdef/ xabb
endmap
map
record /xabitmdef/ xabitm
endmap
endunion
endstructure
c
record /fabdef/ fab
c record /rabdef/ rab
record /bigxab/ xab0
record /bigxab1/ xab1
record /bigxab2/ xab2
c
structure /itmlst/
integer *2 buflen
integer *2 itemcode
integer *4 bufadr
integer *4 retlen
end structure
record /itmlst/ items(3)
c
logical is_dir
integer sys$open, sys$connect
c
c --- WARNING !!! The following is not strictly accurate as it should
c scan the XAB list and resolve any differences between my XABs
c and any passed by the USEROPEN routine, but this was a pain
c and (not being a file system expert) I couldn't get it to work
c right. This SEEMS to work.
c
isave = fab.fab$l_xab
fab.fab$b_fac = fab$m_get ! readonly
fab.fab$l_xab = %loc(xab0)
c
xab0.xab.xab$b_cod = xab$c_dat ! This is a DATE XAB
xab0.xab.xab$b_bln = xab$c_datlen
xab0.xab.xab$l_nxt = %loc(xab1)
c
xab1.xaba.xab$b_cod = xab$c_fhc ! size XAB
xab1.xaba.xab$b_bln = xab$c_fhclen
xab1.xaba.xab$l_nxt = %loc(xab2)
c
xab2.xabb.xab$b_cod = xab$c_itm ! Item code XAB
xab2.xabb.xab$b_bln = xab$c_itmlen
xab2.xabitm.xab$b_mode= xab$k_sensemode
xab2.xabitm.xab$l_itemlist = %loc(items)
c
c --- This SHOULD be set to ISAVE, but when I do that, the OPEN fails.
c Also, there is the possibility of a duplicate XAB, which is a pain
c to correct.
c
xab2.xabb.xab$l_nxt = 0
c
items(1).buflen = 4
items(1).itemcode = XAB$_UCHAR_DIRECTORY ! Is this file a directory?
items(1).bufadr = %loc(is_dir)
items(1).retlen = 0
items(2).buflen = 0
items(2).itemcode = 0
my_open = sys$open (fab) ! Just to fill the XABs
c
c --- Undo the damage done above.
c
fab.fab$l_xab = isave
if (.not. my_open) return
c
num_files = num_files + 1 ! Success, add the file
date(1,num_files) = xab0.xabdat.xab$q_cdt(1) ! Date is stored in
date(2,num_files) = xab0.xabdat.xab$q_cdt(2) ! two parts
direc(num_files) = is_dir
c
c --- the calculation for size comes from an example on the DEC
c bulletin board
c
if (xab1.xabfhc.xab$w_ffb .eq. 0) then
if (xab1.xabfhc.xab$l_hbk .eq. 0) then
size(num_files) = 0
else
size(num_files) = xab1.xabfhc.xab$l_ebk - 1
endif
else
size(num_files) = xab1.xabfhc.xab$l_ebk
endif
c
return
end
c
c---end my_open
c

Dave Froble

unread,
Dec 13, 2004, 1:38:01 PM12/13/04
to
Rob wrote:

> Guy - a superb idea, and one that will help all of us DCL programmers.
>
> Now, if you could add a 'DIRECTORY/SORT=' as well, I'd be in heaven


The current implementation of DIRECTORY is basically a real-time operation. To
sort the list, you must first access all filenames, then sort the list, and
finally produce a 'report'.

I wouldn't want to lose the real-time listing of filenames.

That said, a sorting capability would be nice.

Dave

Dave Froble

unread,
Dec 13, 2004, 1:40:53 PM12/13/04
to
Peter 'EPLAN' LANGSTOEGER wrote:

> In article <OwqEa6...@eisner.encompasserve.org>, Kilg...@SpamCop.net (Larry Kilgallen) writes:
>
>>In article <newscache$mjkn8i$cmo1$1...@news.sil.at>, pe...@langstoeger.at (Peter 'EPLAN' LANGSTOEGER) writes:
>>
>>>In article <1102928445.3...@z14g2000cwz.googlegroups.com>, "Rob" <ratk...@tbs-ltd.co.uk> writes:
>>>
>>>>Guy - a superb idea, and one that will help all of us DCL programmers.
>>>>
>>>>Now, if you could add a 'DIRECTORY/SORT=' as well, I'd be in heaven
>>>>
>>>Not yet. First we need a wildcard function (such as in F$SEARCH) with
>>>customizable (eg. via logical) features (most important: reverse alphabet).
>>>Then we should base utilities and DCL commands on top of it...
>>>
>>Certainly utilities should not be based on lexical functions !
>>
>
> I didn't say that. Read again.
>
> Lexical functions are based on system functions and/or library functions.
> I don't know which is used for F$SEARCH. But of course of all of the inner
> functions which give a list of files should get this customize improvement.
>
>

I'd disagree. Any such functions would have some amount of overhead above that
incured in directly stepping through the directory. Note that a custom program
could possibly have some efficiencies included that wouldn't be possible in a
general function.

Dave

Richard Maher

unread,
Dec 15, 2004, 2:03:17 PM12/15/04
to
Hi Brian,

I like the look of it! (But it's gonna take a while for me to digest it
all).

Do you not get a tad despondent when pearls like this tend to be ignored by
the peasants that frequent this news group?

Funny thing was, I went up into the loft the other day trying to track down
that VAX Professional TSR article (How to pop up a calendar with an OOB AST
if I recall correctly) and I couldn't find it. Must have been binned a
couple of moves ago. But what I did come across was a *very* interesting
article "Caching in on File System Locks" in the Digital Systems Journal
Nov/Dec 1993 by one Brian Schenkenberger. Why didn't I remember I had that
when I was trying to do that File-Watch System Service a few months ago???

Anyway, it was very instructive! As were other articles such as Writing
Privileged Code (by Hunter Goatley and Edward A. Heinrich). And then I found
other extracts from the Hitchhiker's guide to VMS and I started to become
all emotional. Where did it all go wrong Brian eh? What the fuck happened?
Now you get spat on from above if you even think about writing any MACRO at
all. And then you have the Larry Ks of this world warning everyone that
*all* bespoke software is unsupported and inherently dangerous.

Still it's Christmas so I want get too depressing, but I'm not ashamed to
admit that the odd tear was sched in my loft that day. Thanks for the
pointer.

Cheers Richard Maher

<VAXman- @SendSpamHere.ORG> wrote in message
news:00A3C2DA...@SendSpamHere.ORG...

0 new messages