- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- how to print to screen when com-procedure is run w...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2010 04:57 AM
тАО11-16-2010 04:57 AM
the c-program has a loop for 1000 where it does some work. i run command-procedure like
@work/output=work.log
all the detailed output of the work.com goes to work.log which is correct. but for every 20 entries processed, i want a message like "processed 20 elements" to be displayed on the screen. how to do this ?
expected output,
$@work/output=work.log
processed 20 files
processed 40 files
processed 60 files
processed 80 files
$
what changes to do in the c-prgram ?
after every 20 entries, should the c-program call some com procedure for the printing work ?
Scotty
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2010 05:12 AM
тАО11-16-2010 05:12 AM
Solutionone way: open an extra output channel to the TT device (logical name: tt) and write to that
another way: write to SYS$ERROR
or: (as you suggested) spawn a DCL procedure, with the number as parameter, and have the DCL write that number + your fixed text.
If it needs "a lot" (whatever you define that to be) of invcations, DO realise that each SPAWN creates another supprocess, which is quite expensive in VMS (unlike Unices).
I am sure there are a gazillion other ways...
PS. you may well want to also find a way to turn your progress reporting OFF and ON again.
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2010 05:25 AM
тАО11-16-2010 05:25 AM
Re: how to print to screen when com-procedure is run with /output ?
#open an extra output channel to the TT device (logical name: tt) and write to that
do you mean i do a assign to tt: and get a channel number ?
i use printf but that put data to sys$output always i think. what other print call should i use so that i can tell it where to print?
#write to SYS$ERROR
When i try this using a single com-procedure it works. but it does not work in case of,
com1->c_prg->com2.
in com2, i find sys$error is same as sys$output. all output goes to work.log.
any comment.?
Scotty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2010 05:40 AM
тАО11-16-2010 05:40 AM
Re: how to print to screen when com-procedure is run with /output ?
Com1->c_prg->com2
i got this working. i use sys$command, it is set to terminal in com2.
from your reply, i want
Com->c_prg
with c_prg printing progress. this way i can avoid the costly subprocess creation.
from c program, how to print to sys$command ?
lib$put_output and printf always use sys$output, correct?
Scotty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2010 05:42 AM
тАО11-16-2010 05:42 AM
Re: how to print to screen when com-procedure is run with /output ?
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2010 08:31 AM
тАО11-16-2010 08:31 AM
Re: how to print to screen when com-procedure is run with /output ?
fprintf (stderr, "hello world\n");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2010 10:57 AM
тАО11-16-2010 10:57 AM
Re: how to print to screen when com-procedure is run with /output ?
use TEE output to 2 streams, sys$output and sys$command (TT:) ?
$ help pipe examples
...
5.$ ! TEE.COM - command procedure to display/log data flowing through
$ ! a pipeline
$ ! Usage: @TEE log-file
...
You could use it like this:
$ pipe @abc | @tee abc.log
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2010 01:06 PM
тАО11-16-2010 01:06 PM
Re: how to print to screen when com-procedure is run with /output ?
If you want the same output to screen and log file use:
$ SUBMIT/LOG=work.log work
then:
$ TYPE/TAIL/CONTINUOUS WORK.LOG
If you want different output, then you'll need two channels. Use SYS$OUTPUT for your log and SYS$ERROR for progress:
$ c=0
$ loop: c=c+1
$ WRITE SYS$OUTPUT "C=''c'"
$ IF c/20*20.EQS.c THEN WRITE SYS$ERROR "Processed ''c'"
$ WAIT 00:00:00.1
$ GOTO loop
A benefit of using SYS$ERROR is, in BATCH mode both SYS$OUTPUT and SYS$ERROR will go to the log file. SYS$COMMAND will work in interactive mode, but techhnically it's supposed to be an input channel, so in BATCH mode it will attempt to write back to the executing procedure, which will fail.
Example of batch log file sending output to SYS$ERROR:
...
C=15
C=16
C=17
C=18
C=19
C=20
Processed 20
C=21
C=22
C=23
C=24
and using SYS$COMMAND:
...
C=16
C=17
C=18
C=19
C=20
%RMS-F-FAC, record operation not permitted by specified file access (FAC)
GILLINGS_J job terminated at 17-NOV-2010 08:01:04.89
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-18-2011 07:40 AM
тАО02-18-2011 07:40 AM
Re: how to print to screen when com-procedure is run with /output ?
Scotty