Highlighted
Absent Member.
Absent Member.
1474 views

[archive] redirection of standard console ouput from VUTIL32

[Migrated content. Thread originally posted on 12 September 2006]

I use the following construct successfully to get the number of records in a file.

STRING "VUTIL32 -I -X " DELIMITED BY SIZE
W-FILE-PREFIX DELIMITED BY " "
LNK-UTIL-FILE-NAME DELIMITED BY " "
" >" DELIMITED BY SIZE
W-FILE-PREFIX DELIMITED BY " "
"GARBAGE.TMP" DELIMITED BY SIZE
INTO COMMAND-NAME.
CALL "C$SYSTEM" USING COMMAND-NAME 96.
CANCEL "C$SYSTEM".

'command-name' actually reads
VUTIL32 -I -X C:\DATA\STHMI01 >C:\DATA\GARBAGE.TMP

I then read the file c:\data\garbage.tmp to get the record count. All perfect.

I am now also using
VUTIL32 -R -A -5 C:\DATA\STHMI01 >C:\DATA\GARBAGE.TMP
to rebuild the file and to convert it to version 5 format.

It never writes to the file GARBAGE.TMP even though it does create it. Anyone got any ideas why my redirection of the output works in the first example but not in the second?

Keith
0 Likes
5 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] redirection of standard console ouput from VUTIL32

vutil -info displays information on a screen and therefore the information can be redirected to a file. vutil -rebuild rebuils a file, with the -a switch (unless there are duplicates) the original file gets replaced by the new file. Redirecting in this case will not affect the rebuild. Once the rebuild has occurred you can launch another C$SYSTEM command to copy the rebuilt file to another file name.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] redirection of standard console ouput from VUTIL32

AcuGT versions prior to 6.2 had problems with vutil output. Some output from the vutil command was sent to standard error instead of standard output. This is OK if you're using vutil from the command line because stderr and stdout are the same thing - i.e. your screen. When you start to redirect output from vutil like you are trying to do, some of the output is "lost" because the screen isn't there to show stderr.

Add "2>&1" to the end of your command to redirect standard error to standard output, which means both outputs will be sent to your file. It will not necessarily in the same sequence that you would expect it to be in, so if you are reading your output file looking for a particular record number, it may contain values the you don't expect because of the rearranged sequence caused by the stderr redirection.

Hope this helps 🙂
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] redirection of standard console ouput from VUTIL32

To Dilbert - thanks for your input but it is only the screen output I am trying to redirect (which gives infoon recordslost, coimpressed, etc. etc. ) and it is this that is somehow not going to the redirection I put into my command line

To Blacky

Where did you get this great bit of info? I am on version 7.0.1 of the VUTIL32 utility. I will check out your suggestion but it does on the face of it explain why my redirection may be failing - I will let you know if it really cures my issues.

Thanks guys for your help

Keith
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] redirection of standard console ouput from VUTIL32

I live in the *NIX world where redirection and command pipelining are par for the course, but to be truthful, I redirected vutil output one day and found that most went to my file but some appeared on the screen. I redirected stderr to stdout (2>&1) and bingo, everything went to my file.

As far as I know Acucorp fixed this in 6.2, so if you're using 7, it might be something else :confused: Try it tough, there may be options of vutil that I don't use that you are, which still exhibit the problem.

Happy coding...

PS: Just tested your vutil command options with versions 7.0 & 7.2, and they have the same problems that I thought were fixed in 6.2. I only reported problems in vutil -info, so you might like to let them know that -r is also broken. The 2>&1 added to the very end of the command will fix it for now.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] redirection of standard console ouput from VUTIL32

Blacky - you're a star, I will report the problem to ACU support. Thanks.
Regards
Keith
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.