-
Notifications
You must be signed in to change notification settings - Fork 1
/
dfc-list-handletotal.r
45 lines (40 loc) · 1.32 KB
/
dfc-list-handletotal.r
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
listHandleTotal {
# dfc-list-handletotal.r
# list how many data objects have handle approval
writeLine("stdout", "Handle Report for $rodsZoneClient");
writeLine("stdout", "");
writeLine("stdout", "HandleApproval Total");
writeLine("stdout", "---------------------------------");
*Nam.total = str(0);
*Q = select META_DATA_ATTR_VALUE where META_DATA_ATTR_NAME like '*AVU_NAME';
foreach (*R in *Q) {
*Metavalue = *R.META_DATA_ATTR_VALUE;
*Q2 = select count(DATA_ID) where META_DATA_ATTR_VALUE like *Metavalue and META_DATA_ATTR_NAME like *AVU_NAME;
foreach (*R2 in *Q2) {
*Num = *R2.DATA_ID;
*Nam.*Metavalue = *Num;
*Nam.total = str(int(*Nam.total) + int(*Num));
break;
}
*PreviousVal = *Metavalue;
}
foreach (*Metavalue in *Nam) {
if (*Metavalue != "total") {
*C1 = *Nam.*Metavalue;
*C2 = *Metavalue;
if (strlen(*C2) < 8) {*C2 = *C2 ++ "\t";}
if (strlen(*C2) < 16) {*C2 = *C2 ++ "\t";}
if (strlen(*C2) < 24) {*C2 = *C2 ++ "\t";}
writeLine ("stdout", "*C2 *C1");
}
}
*C1 = *Nam.total;
*C2 = "Total Data Objects that have Handles:\t\t\t";
writeLine("stdout", "");
writeLine ("stdout", "*C2 *C1");
foreach (*Metaname in *Nam ) {
*Nam.*Metaname = str(0);
}
}
INPUT *AVU_NAME="HandleApproval"
OUTPUT ruleExecOut