Operating System - OpenVMS
1753819 Members
9355 Online
108805 Solutions
New Discussion юеВ

DFU Results Symbol Creation

 
SOLVED
Go to solution
Jack Trachtman
Super Advisor

DFU Results Symbol Creation

Does DFU create a symbol indicating the
results of cmds such as: DFU sea/ver=min=20000?

It would be useful to know if there is at
least one match without having to parse
a log file. Thanks
5 REPLIES 5
John Gillings
Honored Contributor
Solution

Re: DFU Results Symbol Creation

Jack,

Running DFU V2.7-A (old?), I can't find any symbols or logical names defined after a DFU SEARCH command. $STATUS is SS$_NORMAL regardless of the number of files found.

>at least one match without having
>to parse a log file.

With PIPE you never have to parse a log file again! ;-) The following pipeline will define the JOB logical name FOUND with the number of files found:

$ DEFINE DFU$NOSMG TRUE ! don't do SMG output
$ PIPE MCR DFU SEARCH/VERSION=MIN=20000 | -
SEARCH SYS$PIPE "%DFU-S-FND" | -
(READ SYS$PIPE LINE ; -
found=F$ELEMENT(0,",",F$ELEMENT(1,":",line)) ; -
DEFINE/JOB/NOLOG FOUND &FOUND)

Now test the logical name:

$ IF 'F$TRNLNM("FOUND").GT.0
$ THEN
$ ! At least one match
$ ELSE
$ ! no matches
$ ENDIF

Somewhere in the DFU docs there's an email address to send enhancement requests.
A crucible of informative mistakes
Hein van den Heuvel
Honored Contributor

Re: DFU Results Symbol Creation

I don't have access to DFU just now, so I'll use DIR/TOT as an example.

With perl a similar problem would be solved with:

$ perl -e "foreach (`dir/tot `) { $ENV{TEMP}=$1 if /of (\d+)/}"

$ show log temp
"TEMP" = "170" (LNM$PROCESS_TABLE)

The (untested) DFU example is probably:

$ perl -e "foreach (`DFU SEARCH/VERSION=MIN=20000`) { $ENV{FOUND}=$1 if /found : (\d+)/}"

Moreover, you could readily do stuff with the strings found.

fwiw,
Hein.

Robert_Boyd
Respected Contributor

Re: DFU Results Symbol Creation

Jack,

Please see my reply under:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1008543

Robert
Master you were right about 1 thing -- the negotiations were SHORT!
Jack Trachtman
Super Advisor

Re: DFU Results Symbol Creation

Thanks all

John - I use PIPE lots for this sort of thing. Just wanted to see if there was another way.

Hein - You seem to be a 1-man bandwagon for getting more people to use Perl! I'll have to spend more time with it.
Hein van den Heuvel
Honored Contributor

Re: DFU Results Symbol Creation

>> Hein - You seem to be a 1-man bandwagon for getting more people to use Perl! I'll have to spend more time with it.

Ah, I missed this comment.

Yeah, I realize it's not too popular within VMS circles to talk perl, awk, or... shudder... vi. But hese things have their purposes.

I was semi-forced to do Unix for a while (actually, still do) be decided NOT to learn a SHell, as none of those can not compete with DCL (can they now?)
I opted to learn perl a little and it has served me well under Tru64, HPUX, Linux, as well as windows and OpenVMS.

I feel I am the right person to show Perl as an option because (I'd like to think that) folks know I know DCL inside out.

Some times DCL is more efficient (when many commands are issued), many times Perl or Awk is advantageous (when the script is mostly about data/text processing).

Cheers,
Hein.