1753769 Members
5143 Online
108799 Solutions
New Discussion юеВ

Help writing a com file

 
SOLVED
Go to solution
vmsserbo
Super Advisor

Help writing a com file

I need to put together a SPECIAL_SUB procedure to parse out the ENQLM of ALL our accounts nationwide and return a list of those with 32767 or greater (including our system-level accounts.)


Can someone help me to write a simple com file so I can use it on all of our 90+ nodes? Is it as simple as that? Your help would be greatly appreciated!

32 REPLIES 32
Jess Goodman
Esteemed Contributor
Solution

Re: Help writing a com file

I would use the freeware package SCANUAF. It can search multiple SYSUAF.DATs for user fields <,=,> to a given value.
I have one, but it's personal.
vmsserbo
Super Advisor

Re: Help writing a com file

Isn't there a simple dcl procedure that someone could write to do these things and execute them ?

Peter Zeiszler
Trusted Contributor

Re: Help writing a com file

I would suggest looking into using the GETUAI tool. You could then call each account and evaluate the output.

Another simple way could also be to do the following search:
mc authorize list */full
sea sysuaf.lis username,Enqlm

That output then has the Username and Enqlm values. You could output the data to a file and read 2 lines at a time. Then use string manipulations to pull out the values on enqlm > 32767.

Quick example:
mc authorize list */full
sea sysuaf.lis username,Enqlm/out=x.x

Create file: x.com
$ set noon
$ open/read/err=close_file in_file x.x
$Next_record:
$ read/end_of_file=close_files in_file user_rec
$ read/end_of_file=close_files in_file record1
enq = f$element(3," ",f$edit(record1,"compress"))
$ if enq .ge. 32767
$ then
$ username = f$element(1," ",f$edit(user_rec,"compress"))
$ write sys$output "''username' - ''enq'"
$ goto next_record
$!
$close_files:
$ close in_file
$ exit
vmsserbo
Super Advisor

Re: Help writing a com file

Can you be more speific? Sorry I am still learning.

I created a come file called enqlm_fix.com

$ set noon
$ open/read/err=close_file in_file x.x
$ Next_record:
$ read/end_of_file=close_files in_file user_rec
$ read/end_of_file=close_files in_file record1
enq = f$element(3," ",f$edit(record1,"compress"))
$ if enq .ge. 32767
$ then
$ username = f$element(1," ",f$edit(user_rec,"compress"))
$ write sys$output "''username' - ''enq'"
$ goto next_record
$!
$close_files:
$ close in_file
$ exit

What file name do I put in for the x.x

Also, when I am done can I run it and how?
If this works I plan to copy thos to all our nodes?
vmsserbo
Super Advisor

Re: Help writing a com file

The in_file x.x is the output file I created when I did the search. Is that correct?

Once I finish do I do an @enqlm_fix.com
or a submit?

vmsserbo
Super Advisor

Re: Help writing a com file

Hello,

Here is what I did on our Test Server.

In my home directory USRDSK1:[BLS]
I did a mc authorize list */full
Which produced a sysuaf.lis

Directory DUA1:[BLS]
SYSUAF.LIS;1 201/210 9-AUG-2006 15:24

Then I did a:
sea sysuaf.lis username,Enqlm/out=x.x
Which produced a x.x file in my home directory as well

I created a come file called enqlm_fix.com
which is also in my home directory as well.

typ enqlm_fix.com
$ set noon
$ open/read/err=close_file in_file x.x
$ Next_record:
$ read/end_of_file=close_files in_file user_rec
$ read/end_of_file=close_files in_file record1
enq = f$element(3," ",f$edit(record1,"compress"))
$ if enq .ge. 32767
$ then
$ username = f$element(1," ",f$edit(user_rec,"compress"))
$ write sys$output "''username' - ''enq'"
$ goto next_record
$!
$close_files:
$ close in_file
$ exit

Now, what do I do? Do I @enqlm_fix.com

or submit it?

Let me know!

Thanks!




Dale A. Marcy
Trusted Contributor

Re: Help writing a com file

Miles,

Welcome to VMS. Since nobody has replied yet. I will try to answer your last question:

"Once I finish do I do an @enqlm_fix.com or a submit?"

You can execute it either way. The way the command procedure is currently written, it will expect the file X.X to be in the default directory. You can combine the external commands into the command procedure as follows:

$ set noon
$ mc authorize list */full
$ sea sysuaf.lis username,Enqlm/out=x.x
$ open/read/err=close_file in_file x.x
$ Next_record:
$ read/end_of_file=close_files in_file user_rec
$ read/end_of_file=close_files in_file record1
$ enq = f$element(3," ",f$edit(record1,"compress"))
$ if enq .ge. 32767
$ then
$ username = f$element(1," ",f$edit(user_rec,"compress"))
$ write sys$output "''username' - ''enq'"
$ goto next_record
$!
$close_files:
$ close in_file
$ exit

If you submit the procedure, then the output will be in the log file. By default it is created in the Sys$Login directory of the user with the same name as the command procedure and an extension of .Log. If you wish to direct it elsewhere or change the name, you can specify /Log=disk:[directory]filename.ext on the submit command.

Hope this helps.
vmsserbo
Super Advisor

Re: Help writing a com file

Fantastic! Thanks! I will try it now!

vmsserbo
Super Advisor

Re: Help writing a com file

Sorry,

One more question? What will this com file do exactly? Is it going to chane the values of the enqlm or just do a listing?

Thanks again!