[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference iosg::all-in-1_v30

Title:*OLD* ALL-IN-1 (tm) Support Conference
Notice:Closed - See Note 4331.l to move to IOSG::ALL-IN-1
Moderator:IOSG::PYE
Created:Thu Jan 30 1992
Last Modified:Tue Jan 23 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:4343
Total number of notes:18308

2559.0. "UDP for document count" by ANGLIN::HARRIS (user vicious) Tue Apr 13 1993 23:41

    ALL-IN-1 2.4 
    
    Does anyone have a UDP that will prompt for account name,
    then NEWDIR to account and get a document count of each account?
    
    Or a script that will loop thru ALL aLL-IN-1 accounts and get a
    document count on each account and print it to a file?
    
    thought i'd ask ...
    
    	thanks - ann
    
T.RTitleUserPersonal
Name
DateLines
2559.1A script to count the documents in an accountSCOTTC::MARSHALLSpitfire Drivers Do It ToplessWed Apr 14 1993 09:5327
This does it for the current account; it's easily extendable to loop through
all accounts.

! Script to calculate (an over-estimate of) the size of all document's in the
! drawers of a user's file cabinet that are owned by the user running the
! script.  Note the size doesn't include FILECAB.DAT, DOCDB.DAT, DAF.DAT, etc.

get #total = 0
decimal I
get #owner = '[' OA$USER ']'

for filecab with .unique_name = #owner do -
    cabinet set_drawer .unique_name \\ -
    .text "" \\ -
    .text 'Drawer: "' .unique_name '"' \\ -
    for cab$ do -
        get #size = file$.allocation[.filename] \\\\ -
        compute #total = #total + #size \\\\ -
        .text ,4, 'Document: "' .%key '"' \\\\ -
        .text ,8, .filename:30 #size \\\\ -
        cabinet current .%key \\\\ -
        for cab$attach do -
            get #size = file$.allocation[.filename] \\\\\\\\ -
            compute #total = #total + #size \\\\\\\\ -
            .text ,8, .filename:30 #size

.text "Total size of all files is " #total " blocks"
2559.2For 2.4, you could try...WOTVAX::64354::DoranI like traffic lightsWed Apr 14 1993 13:4864
Re .-1

That's ok for V3.0 but the base note says V2.4...;^)

Re .0

What's wrong with the CDQ housekeeping procedure? That loops through all 
accounts and puts the results into a log file in OA$LOG, and into the 
profile...

You could:-

1) Use CDQ
2) Use the code from the CDQ procedure
3) Do something like the following:-

.label start

for cab$ do oa$null\\get #count = oa$sel_count
get oa$display = "You have " #count " documents"


this could be expanded to do the same for all users by doing something 
like...

.label start

	get #me = oa$user
	text_file open/write out "count.log"
	for profil with .direct nes "" do get #user = .user\\do count
	text_file close out
	get oa$func = 'newdir ' #me
	display Finished
	.exit

COUNT.SCP
---------

.label start

	get oa$func = 'newdir ' #user
	.if oa$status ne 1 then .goto error
	get oa$display = 'Processing user ' #user\force
	get #count = 0
	for cab$ do oa$null\\get #count = oa$sel_count
	get #text = #user:30 " has " #count " documents."
	text_file write out #text
	.exit

.label error

	get #text = "**** Unable to process user " #user " ****"
	text_file write out #text
	.exit

These either need to be in OA$LIB or referenced explicitly (ie do 
user:[bloggs.a1]count)

Cheers,

Andy

P.S. - I just typed these in so they may not work first time, but you should 
be able to get the general idea... ;^)	
2559.3ANGLIN::HARRISuser viciousWed Apr 14 1993 21:006
    i just ran the code in .2 and it worked like a charm!
    
    thanks andy!
    
    	ann