rda-python-metrics 1.0.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rda-python-metrics might be problematic. Click here for more details.
- rda_python_metrics/PgIPInfo.py +188 -0
- rda_python_metrics/PgView.py +782 -0
- rda_python_metrics/__init__.py +1 -0
- rda_python_metrics/fillawsusage.py +282 -0
- rda_python_metrics/fillawsusage.usg +17 -0
- rda_python_metrics/fillcodusage.py +247 -0
- rda_python_metrics/fillcodusage.usg +21 -0
- rda_python_metrics/fillcountry.py +79 -0
- rda_python_metrics/fillendtime.py +93 -0
- rda_python_metrics/fillglobususage.py +287 -0
- rda_python_metrics/fillglobususage.usg +17 -0
- rda_python_metrics/fillipinfo.py +185 -0
- rda_python_metrics/fillipinfo.usg +18 -0
- rda_python_metrics/filloneorder.py +155 -0
- rda_python_metrics/filloneorder.usg +41 -0
- rda_python_metrics/fillrdadb.py +151 -0
- rda_python_metrics/fillrdadb.usg +32 -0
- rda_python_metrics/filltdsusage.py +289 -0
- rda_python_metrics/filltdsusage.usg +17 -0
- rda_python_metrics/filluser.py +216 -0
- rda_python_metrics/filluser.usg +16 -0
- rda_python_metrics/logarch.py +359 -0
- rda_python_metrics/logarch.usg +27 -0
- rda_python_metrics/pgperson.py +72 -0
- rda_python_metrics/pgusername.py +50 -0
- rda_python_metrics/viewallusage.py +350 -0
- rda_python_metrics/viewallusage.usg +198 -0
- rda_python_metrics/viewcheckusage.py +289 -0
- rda_python_metrics/viewcheckusage.usg +185 -0
- rda_python_metrics/viewcodusage.py +314 -0
- rda_python_metrics/viewcodusage.usg +184 -0
- rda_python_metrics/viewordusage.py +340 -0
- rda_python_metrics/viewordusage.usg +224 -0
- rda_python_metrics/viewrqstusage.py +362 -0
- rda_python_metrics/viewrqstusage.usg +217 -0
- rda_python_metrics/viewtdsusage.py +323 -0
- rda_python_metrics/viewtdsusage.usg +191 -0
- rda_python_metrics/viewwebfile.py +294 -0
- rda_python_metrics/viewwebfile.usg +212 -0
- rda_python_metrics/viewwebusage.py +371 -0
- rda_python_metrics/viewwebusage.usg +211 -0
- rda_python_metrics-1.0.4.dist-info/METADATA +18 -0
- rda_python_metrics-1.0.4.dist-info/RECORD +47 -0
- rda_python_metrics-1.0.4.dist-info/WHEEL +5 -0
- rda_python_metrics-1.0.4.dist-info/entry_points.txt +22 -0
- rda_python_metrics-1.0.4.dist-info/licenses/LICENSE +21 -0
- rda_python_metrics-1.0.4.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
#
|
|
3
|
+
###############################################################################
|
|
4
|
+
#
|
|
5
|
+
# Title : viewwebfile
|
|
6
|
+
# Author : Zaihua Ji, zji@ucar.edu
|
|
7
|
+
# Date : 03/15/2022
|
|
8
|
+
# 2025-03-28 transferred to package rda_python_metrics from
|
|
9
|
+
# https://github.com/NCAR/rda-database.git
|
|
10
|
+
# Purpose : python program to view info for web online files
|
|
11
|
+
#
|
|
12
|
+
# Github : https://github.com/NCAR/rda-python-metrics.git
|
|
13
|
+
#
|
|
14
|
+
###############################################################################
|
|
15
|
+
#
|
|
16
|
+
import os
|
|
17
|
+
import re
|
|
18
|
+
import sys
|
|
19
|
+
import PgLOG
|
|
20
|
+
import PgUtil
|
|
21
|
+
import PgDBI
|
|
22
|
+
from . import PgView
|
|
23
|
+
|
|
24
|
+
FILE = {
|
|
25
|
+
'SNMS' : "BCDEFGHIJKLMNOPQRSTUVWYZ", # all available short field names in %FLDS
|
|
26
|
+
'OPTS' : 'AabCdDefFgGHijJlLmMnNoOprsStTuUvwyYzZ', # all available options, used for %params
|
|
27
|
+
'NOPT' : 'abjJw', # stand alone option without inputs
|
|
28
|
+
'ACND' : 'defgGilmMnopStuvyYz', # available array condition options
|
|
29
|
+
'RCND' : 'DFNrsTZ', # available range condition options
|
|
30
|
+
'CNDS' : 'adDefFgGilmMnNoprstTuvyYzZ', # condition options, ACND, RCND and 'a'
|
|
31
|
+
'ECND' : 'mMyY', # condition options need evaluating
|
|
32
|
+
'SFLD' : 'DEFILNOPQTUVZ', # string fields, to be quoted in condition
|
|
33
|
+
'UFLD' : 'ILOPV', # string fields must be in upper case
|
|
34
|
+
'LFLD' : 'EQTU' # string fields must be in lower case
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
# keys %FLDS - short field names
|
|
38
|
+
# column 0 - column title showing in mss file view
|
|
39
|
+
# column 1 - field name in format as shown in select clauses
|
|
40
|
+
# column 2 - field name shown in where condition query string
|
|
41
|
+
# column 3 - table name that the field belongs to
|
|
42
|
+
# column 4 - output field length, the longer one of data size and comlun title, determine
|
|
43
|
+
# dynamically if it is 0. Negative values indicate right justification
|
|
44
|
+
# column 5 - precision for floating point value if positive and show total value if not zero
|
|
45
|
+
# column 6 - field flag to indicate it is a group, distinct or sum field
|
|
46
|
+
FLDS = {
|
|
47
|
+
# SHRTNM COLUMNNANE FIELDNAME CNDNAME TBLNAM Size Prc Grp/Sum
|
|
48
|
+
'D' : ['DATEWRITE', "date_modified", 'date_modified', 'wfile', 0, 0, 'G'],
|
|
49
|
+
'E' : ['EMAIL', "email", 'email', 'user', 0, 0, 'G'],
|
|
50
|
+
'F' : ['FILENAME', "wfile", 'wfile', 'wfile', 0, 0, 'G'],
|
|
51
|
+
'G' : ['PRODUCT', "tindex", 'tindex', 'wfile', 0, 0, 'G'],
|
|
52
|
+
'H' : ['CMONTH', PgDBI.fmtym("date_created"), 'date_created', 'wfile', 7, 0, 'G'],
|
|
53
|
+
'I' : ['FIRSTNAME', "fstname", 'fstname', 'user', 0, 0, 'G'],
|
|
54
|
+
'K' : ['CYEAR', PgDBI.fmtyr("date_created"), 'date_created', 'wfile', 5, 0, 'G'],
|
|
55
|
+
'L' : ['LASTNAME', "lstname", 'lstname', 'user', 0, 0, 'G'],
|
|
56
|
+
'M' : ['WMONTH', PgDBI.fmtym("date_modified"), 'date_modified', 'wfile', 7, 0, 'G'],
|
|
57
|
+
'N' : ['DSCREATED', "date_create", 'date_create', 'dataset',10, 0, 'G'],
|
|
58
|
+
'P' : ['TYPE', "wfile.type", 'wfile.type', 'wfile', 4, 0, 'G'],
|
|
59
|
+
'O' : ['STAT', "status", 'status', 'wfile', 4, 0, 'G'],
|
|
60
|
+
'Q' : ['DSOWNER', "specialist", 'specialist', 'dsowner', 8, 0, 'G'],
|
|
61
|
+
'R' : ['DSTITLE', "search.datasets.title", 'search.datasets.title', 'search.datasets', 0, 0, 'G'],
|
|
62
|
+
'S' : ['FILESIZE', "data_size", 'data_size', 'wfile', -14, -1, 'G'],
|
|
63
|
+
'T' : ['DATASET', "wfile.dsid", 'wfile.dsid', 'wfile', 0, 0, 'G'],
|
|
64
|
+
'U' : ['SPECIALIST', "logname", 'logname', 'user', 10, 0, 'G'],
|
|
65
|
+
'V' : ['DSARCH', "use_rdadb", 'use_rdadb', 'dataset', 6, 0, 'G'],
|
|
66
|
+
'W' : ['DSTYPE', "search.datasets.type", 'search.datasets.type', 'search.datasets', 6, 0, 'G'],
|
|
67
|
+
'Y' : ['WYEAR', PgDBI.fmtyr("date_modified"), 'date_modified', 'wfile', 5, 0, 'G'],
|
|
68
|
+
'Z' : ['DATECREATE', "date_created", 'date_created', 'wfile', 10, 0, 'G'],
|
|
69
|
+
'A' : ['DSCOUNT', "wfile", 'A', 'wfile', -7, -1, 'D'],
|
|
70
|
+
'B' : ['MBYTEDATA', "round(sum(data_size)/(1000000), 4)", 'B', 'wfile', -14, 3, 'S'],
|
|
71
|
+
'C' : ['#UNIQSPLST', "uid", 'C', 'wfile', -10, -1, 'D'],
|
|
72
|
+
'J' : ['#UNIQFILE', "wid", 'J', 'wfile', -9, -1, 'D'],
|
|
73
|
+
'X' : ['INDEX', "", 'X', '', -6, 0, ' ']
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
# valid options for %params, a hash array of command line parameters
|
|
77
|
+
# a -- 1 to view all usage info available
|
|
78
|
+
# A -- number or records to return
|
|
79
|
+
# C -- a string of short field names for viewing usages
|
|
80
|
+
# d -- array of specified dates of file last written
|
|
81
|
+
# D -- last written dates range, array of 1 or 2 dates in format of YYYY-MM-DD
|
|
82
|
+
# e -- array of specified email addresses
|
|
83
|
+
# f -- array of specified online file names
|
|
84
|
+
# F -- file name range, array of 1 or 2 file names
|
|
85
|
+
# g -- array of specified top group indices
|
|
86
|
+
# G -- array of specified top group IDs
|
|
87
|
+
# H -- a string of report title to replace the default one
|
|
88
|
+
# i -- array of specified first names
|
|
89
|
+
# j -- 1 to include group ID for GROUP
|
|
90
|
+
# J -- 1 to include group title for GROUP
|
|
91
|
+
# l -- array of specified last names
|
|
92
|
+
# L -- column delimiter for output
|
|
93
|
+
# m -- array of specified months of file last written
|
|
94
|
+
# M -- array of specified months of file created
|
|
95
|
+
# n -- array of specified user numbers
|
|
96
|
+
# D -- dates range, datasets created between, array of 1 or 2 dates in format of YYYY-MM-DD
|
|
97
|
+
# o -- array of specified file status
|
|
98
|
+
# O -- a string of short field names for sorting on
|
|
99
|
+
# p -- array of web file types, Data, Document, and etc.
|
|
100
|
+
# r -- group index range, array of 1 or 2 group indices
|
|
101
|
+
# s -- file size range, arrage of 1 or 2 sizes in unit of MByte
|
|
102
|
+
# S -- specialist lognames who handle the datasets
|
|
103
|
+
# t -- array of specified dataset names
|
|
104
|
+
# T -- dataset range, array of 1 or 2 dataset names
|
|
105
|
+
# u -- array of specified specialist user names
|
|
106
|
+
# U -- use given unit for file or data sizes
|
|
107
|
+
# v -- array of specified use RDADB flags
|
|
108
|
+
# w -- generate view without totals
|
|
109
|
+
# y -- array of specified years of file last written
|
|
110
|
+
# Y -- array of specified years of file created
|
|
111
|
+
# z -- array of specified dates when files created
|
|
112
|
+
# Z -- created dates range, array of 1 or 2 dates in format of YYYY-MM-DD
|
|
113
|
+
params = {}
|
|
114
|
+
|
|
115
|
+
# relationship between parameter options and short field names, A option is not
|
|
116
|
+
# related to a field name if it is not in keys %SNS
|
|
117
|
+
SNS = {
|
|
118
|
+
'd' : 'D', 'D' : 'D', 'e' : 'E', 'f' : 'F', 'F' : 'F', 'g' : 'G', 'i' : 'I',
|
|
119
|
+
'l' : 'L', 'm' : 'M', 'M' : 'H', 'N' : 'N', 'o' : 'O', 'p' : 'P', 'r' : 'G',
|
|
120
|
+
's' : 'S', 'S' : 'Q', 't' : 'T', 'T' : 'T', 'u' : 'U', 'v' : 'V', 'W' : 'W',
|
|
121
|
+
'y' : 'Y', 'Y' : 'K', 'z' : 'Z', 'Z' : 'Z'
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
tablenames = fieldnames = condition = ''
|
|
125
|
+
sfields = []
|
|
126
|
+
gfields = []
|
|
127
|
+
dfields = []
|
|
128
|
+
pgname = 'viewwebfile'
|
|
129
|
+
|
|
130
|
+
#
|
|
131
|
+
# main function to run this program
|
|
132
|
+
#
|
|
133
|
+
def main():
|
|
134
|
+
|
|
135
|
+
PgDBI.view_dbinfo()
|
|
136
|
+
argv = sys.argv[1:]
|
|
137
|
+
inputs = []
|
|
138
|
+
option = 'C' # default option
|
|
139
|
+
|
|
140
|
+
for arg in argv:
|
|
141
|
+
if re.match(r'^-.*$', arg):
|
|
142
|
+
curopt = arg[1:2]
|
|
143
|
+
if curopt and FILE['OPTS'].find(curopt) > -1:
|
|
144
|
+
if FILE['NOPT'].find(option) > -1:
|
|
145
|
+
params[option] = 1
|
|
146
|
+
elif inputs:
|
|
147
|
+
params[option]= inputs # record input array
|
|
148
|
+
inputs = [] # empty input array
|
|
149
|
+
option = curopt # start a new option
|
|
150
|
+
else:
|
|
151
|
+
PgLOG.pglog(arg + ": Unknown Option", PgLOG.LGWNEX)
|
|
152
|
+
else:
|
|
153
|
+
val = arg
|
|
154
|
+
if val != '!':
|
|
155
|
+
if option == 's':
|
|
156
|
+
val = int(val)*1000000 # convert MBytes to Bytes
|
|
157
|
+
elif option in SNS:
|
|
158
|
+
sfld = SNS[option]
|
|
159
|
+
if FILE['SFLD'].find(sfld) > -1:
|
|
160
|
+
if FILE['UFLD'].find(sfld) > -1:
|
|
161
|
+
val = arg.upper() # in case not in upper case
|
|
162
|
+
elif FILE['LFLD'].find(sfld) > -1:
|
|
163
|
+
val = arg.lower() # in case not in lower case
|
|
164
|
+
if option == 'c':
|
|
165
|
+
val = PgView.get_country_name(val)
|
|
166
|
+
elif option == 't' or option == 'T':
|
|
167
|
+
val = PgUtil.format_dataset_id(val) # add 'ds' if only numbers
|
|
168
|
+
val = "'{}'".format(val)
|
|
169
|
+
inputs.append(val)
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
# record the last option
|
|
173
|
+
if FILE['NOPT'].find(option) > -1:
|
|
174
|
+
params[option] = 1
|
|
175
|
+
elif inputs:
|
|
176
|
+
params[option] = inputs # record input array
|
|
177
|
+
|
|
178
|
+
if not params:
|
|
179
|
+
PgLOG.show_usage(pgname)
|
|
180
|
+
else:
|
|
181
|
+
check_enough_options()
|
|
182
|
+
|
|
183
|
+
usgtable = "wfile"
|
|
184
|
+
build_query_strings(usgtable) # build tablenames, fieldnames, and conditions
|
|
185
|
+
records = PgDBI.pgmget(tablenames, fieldnames, condition, PgLOG.UCLWEX)
|
|
186
|
+
if not records: PgLOG.pglog("No Usage Found For Given Conditions", PgLOG.LGWNEX)
|
|
187
|
+
totals = None if 'w' in params else {}
|
|
188
|
+
if dfields or totals != None:
|
|
189
|
+
records = PgView.compact_hash_groups(records, gfields, sfields, dfields, totals)
|
|
190
|
+
if 'j' in params or 'J' in params:
|
|
191
|
+
j = 1 if 'j' in params else 0
|
|
192
|
+
J = 1 if 'J' in params else 0
|
|
193
|
+
records['g'] = PgView.expand_groups(records['g'], records['t'], j, J)
|
|
194
|
+
ostr = params['O'][0] if 'O' in params else params['C'][0]
|
|
195
|
+
records = PgView.order_records(records, ostr.replace('X', ''))
|
|
196
|
+
PgView.simple_output(params, FLDS, records, totals)
|
|
197
|
+
|
|
198
|
+
PgLOG.pgexit(0)
|
|
199
|
+
|
|
200
|
+
#
|
|
201
|
+
# cehck if enough information entered on command line for generate view/report, exit if not
|
|
202
|
+
#
|
|
203
|
+
def check_enough_options():
|
|
204
|
+
|
|
205
|
+
cols = params['C'][0] if 'C' in params else 'X'
|
|
206
|
+
if cols == 'X': PgLOG.pglog("{}: miss field names '{}'".format(pgname, FILE['SNMS']), PgLOG.LGWNEX)
|
|
207
|
+
|
|
208
|
+
for sn in cols:
|
|
209
|
+
if sn == 'X': continue # do not process INDEX field
|
|
210
|
+
if FILE['SNMS'].find(sn) < 0:
|
|
211
|
+
PgLOG.pglog("{}: Field {} must be in field names '{}X'".format(pgname, sn, FILE['SNMS']), PgLOG.LGWNEX)
|
|
212
|
+
|
|
213
|
+
if 'g' in params or 'G' in params:
|
|
214
|
+
if 't' not in params:
|
|
215
|
+
PgLOG.pglog("Miss dataset condition via Option -t for processing Group", PgLOG.LGWNEX)
|
|
216
|
+
elif len(params['t']) > 1:
|
|
217
|
+
PgLOG.pglog("More than one dataset provided via Option -T for processing Group", PgLOG.LGWNEX)
|
|
218
|
+
|
|
219
|
+
if 'G' in params:
|
|
220
|
+
if 'g' not in params: params['g'] = []
|
|
221
|
+
params['g'] = PgView.get_group_indices(params['G'], params['t'], params['g'])
|
|
222
|
+
del params['G']
|
|
223
|
+
|
|
224
|
+
if 'j' in params or 'J' in params:
|
|
225
|
+
if cols.find('T') < 0: params['C'][0] += 'T'
|
|
226
|
+
if cols.find('G') < 0: params['C'][0] += 'G'
|
|
227
|
+
|
|
228
|
+
for opt in params:
|
|
229
|
+
if FILE['CNDS'].find(opt) > -1: return
|
|
230
|
+
PgLOG.pglog("{}: miss condition options '{}'".format(pgname, FILE['CNDS']), PgLOG.LGWNEX)
|
|
231
|
+
|
|
232
|
+
#
|
|
233
|
+
# process parameter options to build all query strings
|
|
234
|
+
# global variables are used directly and nothing passes in and returns back
|
|
235
|
+
#
|
|
236
|
+
def build_query_strings(usgtable):
|
|
237
|
+
|
|
238
|
+
# initialize query strings
|
|
239
|
+
global condition, fieldnames, tablenames
|
|
240
|
+
joins = groupnames = ''
|
|
241
|
+
tablenames = usgtable
|
|
242
|
+
cols = params['C'][0]
|
|
243
|
+
|
|
244
|
+
if 'U' in params: # reset units for file and read sizes
|
|
245
|
+
if cols.find('B') > -1: FLDS['B'] = PgView.set_data_unit(FLDS['B'], params['U'][0], "sum(data_size)")
|
|
246
|
+
if cols.find('S') > -1: FLDS['S'] = PgView.set_data_unit(FLDS['S'], params['U'][0], "data_size")
|
|
247
|
+
|
|
248
|
+
for opt in params:
|
|
249
|
+
if opt == 'C': # build field, table and group names
|
|
250
|
+
for sn in cols:
|
|
251
|
+
if sn == 'X': continue # do not process INDEX field
|
|
252
|
+
fld = FLDS[sn]
|
|
253
|
+
if fieldnames: fieldnames += ', '
|
|
254
|
+
fieldnames += "{} {}".format(fld[1], sn) # add to field name string
|
|
255
|
+
(tablenames, joins) = PgView.join_query_tables(fld[3], tablenames, joins, usgtable)
|
|
256
|
+
if fld[6] == 'S':
|
|
257
|
+
sfields.append(sn)
|
|
258
|
+
else:
|
|
259
|
+
if groupnames: groupnames += ', '
|
|
260
|
+
groupnames += sn # add to group name string
|
|
261
|
+
if fld[6] == 'D':
|
|
262
|
+
dfields.append(sn)
|
|
263
|
+
else:
|
|
264
|
+
gfields.append(sn)
|
|
265
|
+
elif opt == 'O':
|
|
266
|
+
continue # order records later
|
|
267
|
+
elif FILE['CNDS'].find(opt) > -1:
|
|
268
|
+
if FILE['NOPT'].find(opt) > -1: continue
|
|
269
|
+
sn = SNS[opt]
|
|
270
|
+
fld = FLDS[sn]
|
|
271
|
+
# build having and where conditon strings
|
|
272
|
+
cnd = PgView.get_view_condition(opt, sn, fld, params, FILE)
|
|
273
|
+
if cnd:
|
|
274
|
+
if condition: condition += ' AND '
|
|
275
|
+
condition += cnd
|
|
276
|
+
(tablenames, joins) = PgView.join_query_tables(fld[3], tablenames, joins, usgtable)
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
# append joins, group by, and order by strings to condition string
|
|
280
|
+
if condition:
|
|
281
|
+
if 'o' not in params: condition += " AND status <> 'D'"
|
|
282
|
+
else:
|
|
283
|
+
condition = "status <> 'D'"
|
|
284
|
+
if joins:
|
|
285
|
+
if condition:
|
|
286
|
+
condition = "{} AND {}".format(joins, condition)
|
|
287
|
+
else:
|
|
288
|
+
condition = joins
|
|
289
|
+
if groupnames and sfields: condition += " GROUP BY " + groupnames
|
|
290
|
+
|
|
291
|
+
#
|
|
292
|
+
# call main() to start program
|
|
293
|
+
#
|
|
294
|
+
if __name__ == "__main__": main()
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
|
|
2
|
+
View information of WEB Online files stored on DSS Web Server.
|
|
3
|
+
|
|
4
|
+
Usage: viewwebfile [-C] ColumnNames [-O OrderColumnNames] [-a] \
|
|
5
|
+
[-A rowLimit] [-d DateWriteList] \
|
|
6
|
+
[-D StartWriteDate [EndWriteDate]] \
|
|
7
|
+
[-e EMailList] [-f FileNameList] \
|
|
8
|
+
[-F MinFileName [MaxFileName]] [-g GroupIndices] \
|
|
9
|
+
[-G GroupIDs] [-i FirstNamelist] [-j] [-J] [-l LastNameList] \
|
|
10
|
+
[-m MonthWriteList] [-M MonthCreateList] [-n UserNumberList] \
|
|
11
|
+
[-o FileStatus] [-p TypeList] \
|
|
12
|
+
[-r MinGroupIndex [MaxGroupIndex]] \
|
|
13
|
+
[-s MinFileSize [MaxFileSize]] [-t DatasetList] \
|
|
14
|
+
[-T MinDataset [MaxDataset]] [-u UserNamelist] \
|
|
15
|
+
[-v DivisionList] [-W DatasetTypes] [-y YearWriteList] \
|
|
16
|
+
[-Y YearCreateList] [-z DateCreateList] \
|
|
17
|
+
[-Z StartCreateDate [EndCreateDate]] \
|
|
18
|
+
[-H Title] [-L Delimiter] [-U SizeUnit] [-w] \
|
|
19
|
+
[> OutputFileName] [| lp -d PrinterName]
|
|
20
|
+
|
|
21
|
+
Specify [-C] ColumnNames, refer to Option -C section for detail
|
|
22
|
+
description, and choose at least one of the condition options, -a, -d,
|
|
23
|
+
-D, -e, -f, -F, -g, -G, -i, -l, -m, -M, -o, -p, -r, -s -S, -t, -T, -u,
|
|
24
|
+
-v, -y, -Y, -z and -Z, to run this application.
|
|
25
|
+
|
|
26
|
+
For all condition options, except option -a, an '!' sign can be added
|
|
27
|
+
between an option flag and its option values to get an excluding
|
|
28
|
+
condition. For example, choose '-o ! OrganizationList' to gather WEB
|
|
29
|
+
file information last written by users from organizations other than
|
|
30
|
+
the ones given in OrganizationList. Refer to the example given at the
|
|
31
|
+
end of this help document for how to select excluding condition.
|
|
32
|
+
|
|
33
|
+
String condition options, -e, -f, -G, -i, -l, -o, -t, -u and -v, allow
|
|
34
|
+
wildcard inputs. '%' matches any number of characters and '_' matches
|
|
35
|
+
any one character. Refer to the example given at the end of this help
|
|
36
|
+
document for how to use wildcard for string condition options.
|
|
37
|
+
|
|
38
|
+
Output of this application is defaulted to page format with a page
|
|
39
|
+
header on each page. A page header includes main title, sub titles and
|
|
40
|
+
column titles according to which column names and options are selected,
|
|
41
|
+
as well as page number and report date. If the output is used directly
|
|
42
|
+
for input of other applications, add option -w to remove page header
|
|
43
|
+
and show only the column titles and the WEB file information.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
Column Options:
|
|
47
|
+
- Option -C, the ColumnNames must be present to run this application.
|
|
48
|
+
The flag -C can be omitted if it is the first parameter option on
|
|
49
|
+
the command line. The ColumnNames is a string that includes column
|
|
50
|
+
names listed below:
|
|
51
|
+
|
|
52
|
+
COLUMN - COLUMN - COLUMN
|
|
53
|
+
NAME - TITLE - DESCRIPTION
|
|
54
|
+
GroupColumns:
|
|
55
|
+
A - CYEAR - year, the WEB file created in
|
|
56
|
+
D - DATEWRITE - date, the WEB file written on
|
|
57
|
+
E - EMAIL - email address of file-written user
|
|
58
|
+
F - FILENAME - WEB data file name
|
|
59
|
+
G - PRODUCT - product (top group) information
|
|
60
|
+
H - CMONTH - month, the WEB file created in
|
|
61
|
+
I - FIRSTNAME - first name of file-written user
|
|
62
|
+
K - TIMEWRITE - time, the WEB file written at
|
|
63
|
+
L - LASTNAME - last name of file-written user
|
|
64
|
+
M - WMONTH - month, the WEB file written in
|
|
65
|
+
N - USERNO - account number of file-written user
|
|
66
|
+
O - STAT - Web file status, Public or Internal
|
|
67
|
+
P - TYPE - Web file types, Data, Software , and etc.
|
|
68
|
+
Q - TIMECREATE - time, the WEB file created at
|
|
69
|
+
R*- DSTITLE - dataset title
|
|
70
|
+
S - FILESIZE - individual WEB file size (BYTES)
|
|
71
|
+
T - DATASET - dataset name
|
|
72
|
+
U - USERNAME - login name of file-written user
|
|
73
|
+
V - DIV. - division of file-written user
|
|
74
|
+
W - DSTYPE - flag, dataset type: P, H, I or W
|
|
75
|
+
Y - WYEAR - year, the WEB file written in
|
|
76
|
+
Z - DATECREATE - date, the WEB file created on
|
|
77
|
+
SummaryColumns:
|
|
78
|
+
B - MBYTESFILES - data size (MB) written by given Group
|
|
79
|
+
C - #USER - number of users in given Group
|
|
80
|
+
J - #FILE - number of files written by given Group
|
|
81
|
+
IndexColumn:
|
|
82
|
+
X - INDEX - index of line
|
|
83
|
+
|
|
84
|
+
The column names are used to build up string of ColumnNames, while
|
|
85
|
+
their associated column titles are shown in view/report output of
|
|
86
|
+
this application. The display order of the column titles is
|
|
87
|
+
determined by the order of the column names in the ColumnNames
|
|
88
|
+
string. The INDEX column should be always the first column in the
|
|
89
|
+
ColumnNames string. At least one of the group and summary columns
|
|
90
|
+
must be selected, in the ColumnNames string, to generate WEB file
|
|
91
|
+
status view/report;
|
|
92
|
+
|
|
93
|
+
For example, choose '-C UMJ' to display column titles of USERNAME,
|
|
94
|
+
MONTH and #FILE, in the first, second and third columns respectively,
|
|
95
|
+
for numbers of WEB files last written by each user in each month.
|
|
96
|
+
|
|
97
|
+
- Option -O, sort WEB file information in ascending or descending order
|
|
98
|
+
based on column names specified in OrderColumnNames string. These
|
|
99
|
+
order column names must be in the selected [-C] ColumnNames string.
|
|
100
|
+
If an order column name is in upper case, its associated column is
|
|
101
|
+
sorted in ascending order, and a lower case means sorting in
|
|
102
|
+
descending order;
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
Condition Options:
|
|
106
|
+
- Option -a, for all WEB file information in table 'dssdb.wfile';
|
|
107
|
+
|
|
108
|
+
- Option -A, gives a row limit for querying;
|
|
109
|
+
|
|
110
|
+
- Option -d, for files last written on given dates, in format YYYY-MM-DD;
|
|
111
|
+
|
|
112
|
+
- Option -D, for files last written between two given dates, each date
|
|
113
|
+
is in format YYYY-MM-DD. Omit EndWriteDate for no upper limit;
|
|
114
|
+
|
|
115
|
+
- Option -e, for files last written by users with given email addresses;
|
|
116
|
+
|
|
117
|
+
- Option -f, for WEB file information of given WEB file names;
|
|
118
|
+
|
|
119
|
+
- Option -F, for WEB files with names between MinFileName and
|
|
120
|
+
MaxFileName. Omit MaxFileName for no upper limit;
|
|
121
|
+
|
|
122
|
+
- Option -g, for WEB file information of given top group indices;
|
|
123
|
+
|
|
124
|
+
- Option -G, for WEB file information of given top group IDs;
|
|
125
|
+
|
|
126
|
+
- Option -i, for WEB files last written by users with given first names;
|
|
127
|
+
|
|
128
|
+
- Option -j, includes Group IDs in column PRODUCT;
|
|
129
|
+
|
|
130
|
+
- Option -J, includes Group Titles in column PRODUCT;
|
|
131
|
+
|
|
132
|
+
- Option -l, for WEB files last written by users with given last names;
|
|
133
|
+
|
|
134
|
+
- Option -m, for files last written in given months, in format YYYY-MM;
|
|
135
|
+
|
|
136
|
+
- Option -M, for files created in given months, in format YYYY-MM;
|
|
137
|
+
|
|
138
|
+
- Option -n, for files last written by given user numbers;
|
|
139
|
+
|
|
140
|
+
- Option -o, for WEB file status, P for public or I for internal;
|
|
141
|
+
|
|
142
|
+
- Option -p, for WEB files of given types; D - Data, I - Internal Data,
|
|
143
|
+
O - Document, S - Software;
|
|
144
|
+
|
|
145
|
+
- Option -r, for WEB files between two given group indices;
|
|
146
|
+
|
|
147
|
+
- Option -s, for WEB files with sizes, in unit of MByte, between
|
|
148
|
+
MinFileSize and MaxFileSize. Omit MaxFileSize for no upper limit;
|
|
149
|
+
|
|
150
|
+
- Option -t, for WEB files associated to given dataset names;
|
|
151
|
+
|
|
152
|
+
- Option -T, for WEB files associated to datasets between
|
|
153
|
+
MinDataset and MaxDataset. Omit MaxDataset for no upper limit.
|
|
154
|
+
For example, -T d540000 d550009, for datasets numbers d540000-d550009;
|
|
155
|
+
|
|
156
|
+
- Option -u, for WEB files last written by given user names;
|
|
157
|
+
|
|
158
|
+
- Option -v, for WEB files last written by users from given division;
|
|
159
|
+
|
|
160
|
+
- Option -W, for dataset type, P, H, I or W;
|
|
161
|
+
|
|
162
|
+
- Option -y, for WEB files last written in given years, in format YYYY;
|
|
163
|
+
|
|
164
|
+
- Option -Y, for WEB files created in given years, in format YYYY;
|
|
165
|
+
|
|
166
|
+
- Option -z, for files created on given dates, in format YYYY-MM-DD;
|
|
167
|
+
|
|
168
|
+
- Option -Z, for files created between two given dates, each date
|
|
169
|
+
is in format YYYY-MM-DD. Omit EndWriteDate for no upper limit;
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
Miscellaneous Options:
|
|
173
|
+
- Option -H, use given report title to replace the default one;
|
|
174
|
+
|
|
175
|
+
- Option -L, use given delimiter for output, instead of defaulted spaces;
|
|
176
|
+
|
|
177
|
+
- Option -U, show file or data sizes in given unit SizeUnit [BKMG].
|
|
178
|
+
B - Byte, K - KiloBytes, M - MegaByte, and G - GigaByte;
|
|
179
|
+
|
|
180
|
+
- Option -w, view WEB file info in a simple format without totals;
|
|
181
|
+
|
|
182
|
+
- option > OutputFilename, redirect output into an output file,
|
|
183
|
+
for example, wfile.out, instead of viewing on screen directly;
|
|
184
|
+
|
|
185
|
+
- option | lp -d PrinterName, redirect output to printer of PrinterName.
|
|
186
|
+
Replace PrinterName with lj100 to print through DSS LaserJet printer.
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
For example:
|
|
190
|
+
To view information of files last written in years 2004 with columns,
|
|
191
|
+
INDEX(X), USERNAME(U), ORGTYPE(O), #FILE(J), and MBYTESFILES(B); ordered
|
|
192
|
+
by ORGTYPE as ascending and MBYTESFILES(B) as descending; the command
|
|
193
|
+
line should be:
|
|
194
|
+
|
|
195
|
+
viewwebfile XUOJB -y 2004 -O Ob
|
|
196
|
+
|
|
197
|
+
For status of 'Y' series files only, out of the file status gathered
|
|
198
|
+
above, the command line should be:
|
|
199
|
+
|
|
200
|
+
viewwebfile XUOJB -y 2004 -f /DSS/Y% -O Ob
|
|
201
|
+
|
|
202
|
+
For files last written by users not in Organization 'DDS', out of
|
|
203
|
+
the file status gathered above, the command line should be:
|
|
204
|
+
|
|
205
|
+
viewwebfile XUOJB -y 2004 -f /DSS/Y% -o ! DSS -O Ob
|
|
206
|
+
|
|
207
|
+
To redirect the previous output to a file named wfile.out:
|
|
208
|
+
|
|
209
|
+
viewwebfile XUOJB -y 2004 /DSS/Y% -o ! DSS -O Ob > wfile.out
|
|
210
|
+
|
|
211
|
+
Then you can view the file or print it as a report.
|
|
212
|
+
|