Operating System - OpenVMS
1828354 Members
2939 Online
109976 Solutions
New Discussion

Got empty output file from "Run/detached/output" process.

 
SOLVED
Go to solution
Z.K.
Frequent Advisor

Got empty output file from "Run/detached/output" process.

Hi.
I wrote a c program to execute some procedures periodically,and return some output from which I can find whether the procedures are properly executed.I used the "Run/detached/output" way to start the program as a process,and I did find the procedures executed but not from the output file because the output file is empty.
My operation system is openvms8.2.
I used the following command to start the process:"$ RUN/DETACHED/PRIV="ALL"/PROC=proc_name-
/AST_LIMIT=100-
/ERROR=proc_name.ERR-
/OUTPUT=proc_name.OUT-
proc_name.EXE".
Anybody tell me why the output file is empty and what should I do.
Thanks in advance.
19 REPLIES 19
John Gillings
Honored Contributor

Re: Got empty output file from "Run/detached/output" process.

Z.K,

My guess is the process died immediately for lack of quotas. If you start a detached process like this, you will need to specify values for ALL quotas as the default values are typically too small.

For a periodic job, you're probably better off using a batch procedure.

On the other hand, if the process is still running, the output won't be visible as it's not a shared file and the EOF mark won't be updated until the process exits.
A crucible of informative mistakes
Z.K.
Frequent Advisor

Re: Got empty output file from "Run/detached/output" process.

Thanks John,
I stoped the process before I examine the output file(the output file is locked while the process is running).
You mean I should start the process using the sys$creprc function and specifies values for ALL quotas?Can I just specify these quotas using DCL commands?
Does the process write the output file synchronously or asynchronously?
Karl Rohwedder
Honored Contributor

Re: Got empty output file from "Run/detached/output" process.

Z.K.,,
pls. check the HELP for RUN PROCESS for all quotas that can be set.
Another easy way to give status info from the running process would be some logical names e.g.

regards Kalle
Ian Miller.
Honored Contributor

Re: Got empty output file from "Run/detached/output" process.

you may find a record in acconting for the process when it exited which will give you the final exit status and this will help diagnose the problem.
____________________
Purely Personal Opinion
Z.K.
Frequent Advisor

Re: Got empty output file from "Run/detached/output" process.

I tried to use the sys$creprc way and specified some quotas like "PQL$_BYTLM, PQL$_WSQUOTA",but still got an empty output file.
Anybody help.
Karl Rohwedder
Honored Contributor

Re: Got empty output file from "Run/detached/output" process.

Z.K.,

have you checked the accouting records for the detached process, any errors?

You may also want to change your RUN command to something like:
$ RUN /DET/AUTHORIZE-
/INPUT=yourcommand.com- ...
SYS$SYSTEM:LOGINOUT.EXE

In YOURCOMMAND.COM you may output some loging and then start your images. /AUTH takes the quotas from the UAF records, which maqy easily be changed.

regards Kalle
Hein van den Heuvel
Honored Contributor
Solution

Re: Got empty output file from "Run/detached/output" process.

Is the output file empty: no blocks allocated, or is it 'just' the EOF still 0?

See also: http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1046761

You may want to try FORCE_EXIT instead of DELPRC to give the process a better chance to cleanup next time.

Better still, give the process an (input) mailbox (with write attention ast?) to be able to give it a command to stop gracefully.

hth,
Hein
Guenther Froehlin
Valued Contributor

Re: Got empty output file from "Run/detached/output" process.

Maybe the program is written in C and has not flushed the output stream before the process gets deleted?

So neither the data nor the new EOF made it to disk.

/Guenther
Z.K.
Frequent Advisor

Re: Got empty output file from "Run/detached/output" process.

Ian and Karl mentioned "the accouting records for the detached process",sorry I don't quite understand what the accouting records means.How can I get these accouting records?

Hein,
Yes I examined the output file and found no blocks allocated to it.I used to stop these kind of programs using the DCL command "stop ...",maybe I should try your suggestion.
Hein van den Heuvel
Honored Contributor

Re: Got empty output file from "Run/detached/output" process.

>> sorry I don't quite understand what the accouting records means.How can I get these accouting records?

Check out HELP ACCOUNTING
You may need your system managers help on this.
He would issue something like:

$ACCOU/FULL/USER=xxx/SINCE=yyy

>> Yes I examined the output file and found no blocks allocated to it.

Ouch... then there is nothing much to do after the fact.

It may be that the data never made is to RMS (in a C buffer such as Guenther suggest), or it may be that RMS never filled a buffer ($SHOW RMS for default size).
If you are desperate, then some playing with ANAL/SYSTEM may allow you to look from the outside in. I like SDA> SHOW PROC xxx/RMS=BDBSUM
Then look for a VBN=1 and for the virtual address. Now examie data at that address.

Use HELP (at DCL level, and withing ANA/SYS)

Cheers,
Hein.



I used to stop these kind of programs using the DCL command "stop ...",maybe I should try your suggestion.
Z.K.
Frequent Advisor

Re: Got empty output file from "Run/detached/output" process.

Hein,
I am desperate now.Sorry we don't have any system managers to help me.I've justed studied this system for a few months and I'am afraid I am the most experienced people in my company now(please don't laugh).Maybe I should read more books about VMS system management when I have time.
Here is the structure of my program.
Regards Z.K.
Z.K.
Frequent Advisor

Re: Got empty output file from "Run/detached/output" process.

$ show rms
MULTI- | MULTIBUFFER COUNTS | NETWORK
BLOCK | Indexed Relative Sequential | BLOCK
COUNT | Disk Magtape Unit Record | COUNT
Process 0 | 0 0 0 0 0 | 0
System 32 | 0 0 0 0 0 | 8

Prolog Extend Quantity QUERY_LOCK
Process 0 0 System
System 0 0 Enabled

CONTENTION_POLICY
Process System
System Never

SDA> show process ***/RMS=BDBSUM

Process index: 004F Name: *** Extended PID: 2020084F
--------------------------------------------------------------------
BDB/GBPB Summary
----------------
Address USERS SIZE NUMB VBN BLB_PTR ADDR VAL ID FLGS
------- ----- ---- ---- --- ------- ---- --- -- ----

7B071560 0 00000000 00000000 00000000 00000000 00000000 0 BDB
1. BDBs were processed
0. GBPBs were processed
Thomas Ritter
Respected Contributor

Re: Got empty output file from "Run/detached/output" process.

Z.K. maybe trying writing to another output file inside the C program. Our programmers typcial use two output streams. The user created stream is typically written to a date and time stamped file. And data is typically appended and thereby not locking the file. In other words the standard output as directed in the run command is just not flexible enough.



Troodon
Frequent Advisor

Re: Got empty output file from "Run/detached/output" process.

Do quotes really work around the requested privileges on the command line?
Thomas Ritter
Respected Contributor

Re: Got empty output file from "Run/detached/output" process.

Z. I actually forgot to mention the most important aspect of using your output streams. Consider the jobs run indefinitely. For the job to be operationally friendly the output streams are closed and reopened every day. Every day a new log file is created. You then have the ability to archive, defrage and readily examine. Compare this to having one big locked file forever growing.

AUS 2 cents.
Troodon
Frequent Advisor

Re: Got empty output file from "Run/detached/output" process.

I very definitely get an error when I do this type of thing interactively or in a com procedure.

Athena$ run-
_$ /det/author/priv="all"-
_$ /out=x.x -
_$ sys$system:loginout.exe ! What's unimp.

%DCL-W-IVKEYW, unrecognized keyword - check validity and spelling
\all\

Z.K.
Frequent Advisor

Re: Got empty output file from "Run/detached/output" process.

Tomas,
your suggestion sounds good,would you please send me an example? My operation system is OPENVMS 8.2,I've installed COMPAQ C V6.4.

>> Do quotes really work around the requested privileges on the command line
I think it doesn't work in my situation.
Hein van den Heuvel
Honored Contributor

Re: Got empty output file from "Run/detached/output" process.

Good job on the RMS stuff.
It shows it would use a 16kb buffer, but none is allocated.
Maybe you still needed to hit for the next bdbsum?

I also always doublecheck with show
SDA> proc/chan to see if the right file are open.

SDA> SHOW PROC/RMS=(FAB,RAB) can also be handy.

If this is C application, and a simple unshared output, then C will be doing 'block IO' and bypass RMS record IO.
The program would have to call the c functions flush/sync to force data out.
Do this in a main loop, or in a timer ast loop, every 'n' times.

Since you appear to have plenty of privs, just run the account command as outlined.
That woudl be helpfull if the process just went away. Oh the other hand, if you shot it with stop/id then one can not expect useful information from accounting.

fwiw,
Hein.
Z.K.
Frequent Advisor

Re: Got empty output file from "Run/detached/output" process.

>> I very definitely get an error when I do this type of thing interactively or in a com procedure.
You should specify the privileges like this "run/det/author/priv=all/output=... ..."

Hein,
>> Maybe you still needed to hit for the next bdbsum?
No,that's all the bdbsum I got.

SDA> show process db_bck_sch/channel
Process index: 0081 Name: DB_BCK_SCH Extended PID: 20200881
--------------------------------------------------------------------
Process active channels
-----------------------

Channel CCB Window Status Device/file accessed
------- --- ------ ------ --------------------
0010 7FF72000 00000000 $1$DGA1:
0020 7FF72020 81AB9480 $1$DGA1:[ORACLE.SCHEDULE_BCK]DB_BCK_SCH.
EXE;14
0030 7FF72040 81953C80 $11$DKA0:[VMS$COMMON.SYSLIB]LIBOTS.EXE;1
(section file)
0040 7FF72060 81953880 $11$DKA0:[VMS$COMMON.SYSLIB]LIBRTL.EXE;1
(section file)
0050 7FF72080 81958040 $11$DKA0:[VMS$COMMON.SYSLIB]DECC$SHR_EV5
6.EXE;1 (section file)
0060 7FF720A0 81957940 $11$DKA0:[VMS$COMMON.SYSLIB]DPML$SHR.EXE
;1 (section file)


Press RETURN for more.
SDA>

Process index: 0081 Name: DB_BCK_SCH Extended PID: 20200881
--------------------------------------------------------------------

Channel CCB Window Status Device/file accessed
------- --- ------ ------ --------------------
0070 7FF720C0 81955EC0 $11$DKA0:[VMS$COMMON.SYSLIB]CMA$TIS_SHR.
EXE;1 (section file)
0080 7FF720E0 81A36740 $1$DGA1:[ORACLE.SCHEDULE_BCK]DB_BCK_SCH.
OUT;23

Total number of open channels : 8.

SDA> SHOW PROC db_bck_sch/RMS=(FAB,RAB)
Process index: 0081 Name: DB_BCK_SCH Extended PID: 20200881
--------------------------------------------------------------------
FAB Address: 00044D10
-----------

BID: 03 3.
BLN: 50 80.
IFI: 0001
FOP: 00000000
STS: 00010001 ALQ: 00000000
STV: 00000080 DEQ: 0000
FAC: 5B PUT,GET,UPD,TRN,BRO
SHR: 00
CTX: 00000000 RTV: 00
ORG: 00 Sequential
RAT: 02 CR
RFM: 05 STMLF
JOURNAL: 00
RU_FACILITY: 00
XAB: 000474A8 NAM: 00044D68
FNA: FFFFFFFF DNA: 00000000

Press RETURN for more.
SDA> show process db_bck_sch/rms=bdbsum

Process index: 0081 Name: DB_BCK_SCH Extended PID: 20200881
--------------------------------------------------------------------
BDB/GBPB Summary
----------------
Address USERS SIZE NUMB VBN BLB_PTR ADDR VAL ID FLGS
------- ----- ---- ---- --- ------- ---- --- -- ----

7B071560 0 00000000 00000000 00000000 00000000 00000000 0 BDB
1. BDBs were processed
0. GBPBs were processed

You can see my program in the attachment upstairs.
I tried the "account/full/user=.../since=..." way but got no records for this process(the process was not stop in the stop/id way).