RE: Pipe search of command procedure log file containing pipe search command. command.command. - VMS
This is a discussion on RE: Pipe search of command procedure log file containing pipe search command. command.command. - VMS ; Hein,
I must admit my ignorance here.
What is the "seg0_1 2" accomplishing in the convert statements below.
I use segmented keys but have always been taught to write them in the form "seg0_position " and "seg0_length ", etc.
How ...
-
RE: Pipe search of command procedure log file containing pipe search command. command.command.
Hein,
I must admit my ignorance here.
What is the "seg0_1 2" accomplishing in the convert statements below.
I use segmented keys but have always been taught to write them in the form "seg0_position " and "seg0_length ", etc.
How does convert see the statement you presented? I cannot find anything like this in the RMS Utilities Reference manual.
TIA,
Mike Farrell
-----Original Message-----
From: Hein RMS van den Heuvel [mailto:heinvandenheuvel@gmail.com]
Sent: Wednesday, September 10, 2008 10:11 PM
To: Info-VAX@Mvb.Saic.Com
Subject: Re: Pipe search of command procedure log file containing pipe search command. command.command.
On Sep 10, 9:40*am, norm.raph...@metso.com wrote:
> Here is a code fragment designed to search the running command procedure
> to
> see if any of the converts in the log got duplicate error messages.
CONVERT-I-DUP is an informational and NOT reflected in the $STATUS, so
that's a non-starter.
CONVERT-I-DUP is really an annoying obnoxious implementation. I should
have fixed it while I was in the area, but did not realize how bad it
was. A line per record and no stopping the fun! :-(
Commands I used for testing:
To generate dups:
$ convert/stat/fdl="fi;or in;key 0; seg0_l 2"/exc=login.dup login.com
login.idx
To not generate dups:
$ convert/stat/fdl="fi;or in;key 0; seg0_l 2"/exc=login.dup login.idx
login.idx
Two suggestions:
1) always convert with /STAT (which you do) AND also /
EXCEPTION='exection_file' ...
Now you can just use something like
$ IF F$FILE(exception_file, "EOF") .NE. 0
$ THEN
$ MAIL...
$ ELSE
$ DELETE 'F$SEARCH(exception_file) ! Always created, so
clean up last one
$ ENDIF
If that EOF returns non-zero then it is bad.
You probably do not care wether the badness was duplicates or
something else right?
2)
If you are going to spawn anyway, consider a perl wrapper to eat those
annoying duplicate lines.
Here is an initial test version.
Of course you probably want to pass is the command and/or read from a
file.
---- convert_wrapper.pl -----
use strict;
use warnings;
my $dups = 0;
open(STDERR, '>login.err'); # or send to Holland? (NL
my $convert_command = q(convert/stat/fdl="fi;or in;key 0; seg0_l 2") ..
q(/exc=login.dup login.com login.idx);
for (qx($convert_command)) {
print unless /^%CONVERT-I-DUP/ and $dups++;
}
print "$dups duplicate keys reported\n" if $dups;
-----------------------
fwiw,
Hein.
-
Re: Pipe search of command procedure log file containing pipe searchcommand. command.command.
On Sep 11, 9:05*am, "Farrell, Michael" wrote:
> Hein,
:
> What is the "seg0_1 2" accomplishing in the convert statements below.
Which was in reference to an example I gave in an other tread.
Dunno why Frank's reply showed up as a new topic, for me.
My example:
$ convert/stat/fdl="fi;or in;key 0; seg0_l 2"/exc=login.dup login.com
login.idx
So that is not an 0_1 but 0_L or 0_l
Depending on the font use it can be ard to distinguish between 1 and
l... they were actually the same on my old typewriter!
Anyway....
It was a minor brain teaser I planted. You found it. Super!
The example 'shows of' the, new with 8.3, option to provide the FDL
file as a string, not just as a file.
The example also show just about the smallest FDL string you can use
to create a real indexed file.
It does not actually generate a segmented key.
The way to specify a single field primary key is, as you point out
seg0_position + seg0_length
The seg0_position defaults to 0, so I omitted that,
The seg0_llength can ba abreviated to seg0_l
The 2 is the number of charaters in the key, chosen low, to generate
dups.
grins,
Hein.