- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Convert File to String
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
Forums
Discussions
Discussions
Discussions
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
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
07-29-2009 12:15 PM
07-29-2009 12:15 PM
Long time reader first time poster
My Question, I am writing a program and wanting to pull Directory of Users, Looking at one record at a time.
$ mcr auth list USERNAME /brief
$ type sysuaf.lis /tail=1 /out=Temp.log
type temp.log displays
SMITH, JOHN SMITHJOH [11,11] 1-11111 All 4 SYS$SYSDEVICE:[SMITHJOH]
If I could turn the file into a string I could use F$Extract to get the info I need
Thanks for the help
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2009 12:29 PM
07-29-2009 12:29 PM
Re: Convert File to String
In what? C? Fortran? DCL? ???
> [...] I could use F$Extract [...]
So, DCL?
> If I could turn the file into a string
> [...]
Then it would probably be too long to fit
into a DCL symbol.
Why not read (READ) it one line at a time?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2009 12:33 PM
07-29-2009 12:33 PM
Re: Convert File to String
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2009 12:36 PM
07-29-2009 12:36 PM
SolutionThat is, get a listing of all the users in
one file, then read that listing:
$ mcr auth list /brief ! No USERNAME
READ will put one line into a DCL symbol, and
then you can f$locate and f$extract all you
want.
There are more direct ways to read the UAF
from DCL, but they're not so simple.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2009 12:37 PM
07-29-2009 12:37 PM
Re: Convert File to String
There are several tools that are geared up help you with all of this. Google around. Mine, and at least one other is called "GETUAI", there is also an are called UAF and such.
http://vms.process.com/scripts/fileserv/fileserv.com?GETUAI
But not using a tool has its use also.
So here is a comamnd file to just grab the right fields.
Easily modified to skip the header or nor, or set outptu into a symbol.
Enjoy!
--------------------- get_defdir.com --------
$clos/nolog lis
$open/read lis sysuaf.lis
$loop:
$read/end=done lis record
$defdir = f$extr(69,99,record)
$if defdir .eqs. "Expired" then goto loop
$write sys$output f$extract(21,13,record), defdir
$goto loop
$done:
$close lis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2009 12:41 PM
07-29-2009 12:41 PM
Re: Convert File to String
http://labs.hoffmanlabs.com/node/1260
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2009 01:42 PM
07-29-2009 01:42 PM
Re: Convert File to String
Here is the output from use
$ @getuaf system
%UAF-I-LSTMSG1, writing listing file
%UAF-I-LSTMSG2, listing file SYSUAF.LIS complete
USER_LINE = "SYSTEM MANAGER SYSTEM [1,4] SYSTEM All 4 SYS$SYSROOT:[SYSMGR]"
$ @getuaf [1,7]
%UAF-I-LSTMSG1, writing listing file
%UAF-I-LSTMSG2, listing file SYSUAF.LIS complete
USER_LINE = "SYSTEST-UETP SYSTEST [1,7] SYSTEST All 4 Disuser"
USER_LINE = "SYSTEST-UETP SYSTEST_CLIG [1,7] SYSTEST All 4 Disuser"
$
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2009 02:03 PM
07-29-2009 02:03 PM
Re: Convert File to String
>> pull Directory of Users,
You may want to elaborate how users are selected.
Because DIR /BRIEF will only fill in the dev+dir for valid users.
My example shows there may be records marked 'Expired'.
Jon shows 'Disuser'. But I guess that is already dealt with earlier, which is why you want to deal with 1 record.
Too bad there is no F$GETUAI huh?
Personally I feel comfortable reading the columns directly from SYSUAF.DAT.
This stuff is not going to change no more.
Here is an other script I had floating around and which you might find handy.
$! uaf_defdevdir.com
$!libr/extr=$uafdef/out=uafdef.tmp sys$library:lib.mlb
$!sea uafdef.tmp _def
$!EQU UAF$S_DEFDEV 32
$!EQU UAF$T_DEFDEV 116
$!EQU UAF$S_DEFDIR 64
$!EQU UAF$T_DEFDIR 148
$!define sysuaf sys$disk:[]sysuaf.dat ! Local copy for testting
$open /write/read/share=write uaf 'f$parse("SYSUAF","SYS$SYSTEM:.DAT",,,"SYNTAX_ONLY")
$loop:
$ read/end=done uaf rec ! more than 1?
$ if p1.nes."" then read/end=done/key=&p1 uaf rec ! just 1
$ defdev=f$extr(116+1,f$cvsi(116*8,8,rec),rec)
$ defdir=f$extr(148+1,f$cvsi(148*8,8,rec),rec)
$ username=f$extr(0,12,rec)
$ write sys$output username, ": ", defdev, defdir
$ if p1.eqs."" then goto loop
$done:
$close uaf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2009 04:53 AM
07-30-2009 04:53 AM
Re: Convert File to String
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2009 04:54 AM
07-30-2009 04:54 AM