man8db/LABELreport

Table of Contents

Name

LABELreport - database label report generator

Synopsis

LABELreport [type] < list_of_tuples > label_report

Description

This program generates a report of the LABELREC, DESCREC, and DATAREC tables sorted in label order.

A set of SQL queries and other tools are used to extract the necessary information from the database and massage it into a form suitable for use with this program.

The input should contain one tuple per line. Lines are terminated by a newline. Fields within a tuple are separated by a |.

Tuple format

The following fields from the LABELREC, DESCREC, and DESCREC tables are used and appear as input to this program in this order:

DescRec.Label
RefKeys.RefVal
DescRec.RefName
LabelRec.Name
RefKeys.RefAttNme

DescRec.Llabel
DescRec.LrefName

DescRec.Units
DescRec.DataType
DescRec.CrtKey
DescRec.CtlKey
DescRec.Owner
DescRec.ScaKey
DescRec.WpermD
DescRec.Message
DescRec.SpanMin
DescRec.SpanMax
DescRec.PhyMin
DescRec.PhyMax
DescRec.Size
DescRec.OffSet
DescRec.DRkey
DataRec.RecId
DataRec.DevType
DataRec.Driver
DataRec.Crate
DataRec.Slot
DataRec.ChanNo
DataRec.DTkey
LabelRec.Lcomm
DescRec.Dcomm

Examples

#
# produce label report using postgres
#
# get Label list from LABEL records
# sort it to make sure
#
psql -d testdb -qt -f lab.pqry -o f1    
#
#
# get Label list from DESC records and sort it
# filter in order to have list of unique entries
#
psql -d testdb -qt -f desc.pqry | sort | uniq > f2
#
#
# filter out common members of both files
# (leave only differences)
# NOTE: since DESCs may only have Labels that are
# entered in LABEL table this will always give list
# of Labels that do not have corresponding DESC records
# massage output file to clean up comm’s output and
# also to make file look like output from dsel2.qry
#
/usr/bin/comm -3 f1 f2 | sed -f escript > f3
#
# pull all DESCs out of database
#
psql -d testdb -qt -f desc2.pqry -o f4
#
# pull all logical link DESCs out of database
#
psql -d testdb -qt -f desc3.pqry -o f5
#
# merge the DESCs with missing DESC list
# trim the whitespace
# sort it to make sure
#
cat f3 f4 f5 | WStrim trim.desc | sort > f6
#
# generate report
#
LABELreport < f6 > Label.lst

Manual page revision

$Id: LABELreport.8,v 1.0 1999/02/09 18:16:21 kitchen Exp $


Table of Contents