Operating System - OpenVMS
1748074 Members
5227 Online
108758 Solutions
New Discussion юеВ

How to find the output file used with @something.com/out=file

 
Jeff Bath
Advisor

How to find the output file used with @something.com/out=file

Is there a way to find the filename used with the /out= qualifier for a DCL procedure run interactively? I would like to be able to get the output filename from within the procedure. I can use sho dev/files or SDA to see which files it has opened but there is no way to know which is the one from the /output qualifier.
22 REPLIES 22
Volker Halle
Honored Contributor

Re: How to find the output file used with @something.com/out=file

Jeff,

Guy Peleg has written an article about DCL internals in V1 of the OpenVMS Technical Journal:

http://h71000.www7.hp.com/openvms/journal/v1/dcl.html

Somewhere in there should be information to help find out the filename of the output file...

Volker.
Heinz W Genhart
Honored Contributor

Re: How to find the output file used with @something.com/out=file

Hi Jeff

the file is located in your current working directory.

$ SET DEF user_disk:[user1]
$ @test/out=a.a

You can find a.a in user_disk:[user1]

$ SET DEF user_disk:[user1]
$ @test/out=disk_mgr:[output]test.out

Now you will find the file test.out in disk_mgr:[output]

Hope thet answers your questin

regards

Geni
Jeff Bath
Advisor

Re: How to find the output file used with @something.com/out=file

What if they do /out=somedisk:[dir]a.a? I want to be able to do this from within the procedure. If some other user executes this procedure with the /out qualifier there is currently no way for me to know where the output file is or its name.
Volker Halle
Honored Contributor

Re: How to find the output file used with @something.com/out=file

Jeff,

looks like there is a PPF.MAR example on some old VMSSIG tape:

http://wwwvms.mppmu.mpg.de/vmssig/src/MAR/

ppf.mar (10KB): PPF.MAR PPF translate specified PPF logical name to file specification

SYS$OUTPUT is a process permanent file (PPF) and the above example program seems to be able to obtain the full filespec for a PPF file - I haven't tested that...

Volker.
Jeff Bath
Advisor

Re: How to find the output file used with @something.com/out=file

I was hoping to find a way to do this in DCL.
Dean McGorrill
Valued Contributor

Re: How to find the output file used with @something.com/out=file

I'd guess SDA>sho proc xxx/chan
on your suspect individual. they can
always do it w/o a procedure..

$ @tt:/out=x.tmp
_$ dir x.tmp;
_$ Exit
$ ty x.tmp

Directory DISK$USER2:[MCGORRILL]

X.TMP;153 0/0 25-JUN-2007 10:47:25.33

sda could find this.
Hein van den Heuvel
Honored Contributor

Re: How to find the output file used with @something.com/out=file


Curious minds want to know... WHY do u care?

Anyway, Unless I'm missing something this is a SMOP!?

$create test.c
/*
** show_sys$output.c Hein van den Heuvel, June 2007
**
** Have fun.
*/
#include
#include
main (int argc, char *argv[])
{
struct FAB fab;
struct NAM nam;
int sys$open(), sys$display();
int i, stat;
char rsa[256], sys$output[] = "sys$output:";
fab = cc$rms_fab;
fab.fab$b_shr = FAB$M_UPD;
fab.fab$b_fac = FAB$M_PUT;
fab.fab$l_fna = sys$output;
fab.fab$b_fns = sizeof (sys$output);
fab.fab$l_nam = &nam;
nam = cc$rms_nam;
nam.nam$l_rsa = rsa;
nam.nam$b_rss = sizeof (rsa) - 1;
stat = sys$open ( &fab );
if (!(stat&1)) return stat;
/*
** Ask RMS to fill in the NAM hooked off the FAB.
*/
stat = sys$display ( &fab );
if (!(stat&1)) return stat;

i = nam.nam$b_rsl;
rsa[i]=0;

printf ("fid=(%d,%d,%d), ifi=%04X, rsl=%d, rsa=%s\n",
nam.nam$w_fid[0], nam.nam$w_fid[1], nam.nam$w_fid[2],
fab.fab$w_ifi, i, rsa);
}
$
$cc test
$link test
$create test.com
$run test/nodebug
$exit
[exit]
$@test/output=[.tmp]x.y
$type [.tmp]x.y
fid=(43789,1341,256), ifi=C004, rsl=42, rsa=.TMP]X.Y;1

Cool?

Hope this helps some,
Hein van den Heuvel (at gmail dot com)
HvdH Performance Consulting
Jeff Bath
Advisor

Re: How to find the output file used with @something.com/out=file

Hein,

Basically we want to monitor what the user is doing with this procedure. We also want to keep a log of the exact command line used to invoke this procedure.
Hein van den Heuvel
Honored Contributor

Re: How to find the output file used with @something.com/out=file

Actually... looks like you want this from a DCL procedure. So here is the same, but setting up a (local) symbol: "my_sys$output".
You can readily make that name of that symbol a program argument and/or global.

Hein.

$ type SHOW_SYS$OUTPUT.c
/*
** show_sys$output.c Hein van den Heuvel, June 2007
** Defines DCL Local Symbol: my_sys$output
** Optionally prints details, if any argument is provided.
** Have fun.
*/


#include
#include

main (int argc, char *argv[])
{
struct FAB fab;
struct NAM nam;
struct {int len; char *addr;} symbol_desc, value_desc;
int sys$open(), sys$display(), lib$set_symbol();
int i, stat;
char rsa[256], sys$output[] = "sys$output:", symbol[] = "my_sys$output";
fab = cc$rms_fab;
fab.fab$b_shr = FAB$M_UPD;
fab.fab$b_fac = FAB$M_PUT;
fab.fab$l_fna = sys$output;
fab.fab$b_fns = sizeof (sys$output);
fab.fab$l_nam = &nam;
nam = cc$rms_nam;
nam.nam$l_rsa = rsa;
nam.nam$b_rss = sizeof (rsa) - 1;
stat = sys$open ( &fab );
if (!(stat&1)) return stat;
/*
** Ask RMS to fill in the NAMs hooked off the FAB.
*/
stat = sys$display ( &fab );
if (!(stat&1)) return stat;

i = nam.nam$b_rsl;
rsa[i]=0;

if (argc > 1) printf ("fid=(%d,%d,%d), ifi=%04X, rsl=%d, rsa=%s\n",
nam.nam$w_fid[0], nam.nam$w_fid[1], nam.nam$w_fid[2],
fab.fab$w_ifi, i, rsa);

symbol_desc.addr = symbol;
symbol_desc.len = sizeof (symbol) - 1;
value_desc.addr = rsa;
value_desc.len = i;
return lib$set_symbol ( &symbol_desc, &value_desc);
}