Robelle Solutions Technology Inc. Dbedit, STExport, Suprlink, Suprtool 5.7, Suprtool/MPE, Suprtool/UX Database Handyman Software Quick Reference Guide
जाहिरात
जाहिरात
SUPRTOOL™ 5.7
Database Handyman for HP e3000 and HP-UX and Linux
Quick Reference Guide
In/Out
Add
Base
Chain
Suprtool Commands by Function
Process
Clean
Delete
Extract
Select
Define
Duplicate
If
Control
Edit
Export
Link
Get
Input
Numrecs
Open
Output
Select
Key
List
Put
Sort
Total
Update
Item
Table
Q
Reset
Userpause
Xeq
=calc
:o/s cmd
Dbedit Suprlink
Add
Change
Delete
File
List
Modify
Q
Input
Join
Link
Output
Reset
Xeq
Columns
Clean
Date
STExport
Input
Output
Quote
Decimal
Delimeter
Escape
Floating
Heading
HTML
Reset
Sign
Spaces
Xeq
Xml
Zero
Commands Common to All Modules
Before
Do
Form
Help
Redo
Set
Use
Verify
Exit Listredo
Robelle Solutions Technology Inc.
Suite 372, 7360 137 Street
Surrey, BC Canada
V3W 1A3
Phone: (604) 501-2001
Support: (289) 480-1060
E-mail: [email protected]
Web: www.robelle.com
Copyright 1985-2015 Robelle Solutions Technology Inc.
Suprtool Commands
The following list describes the commands that Suprtool understands at the
">" prompt. Continue command lines with "&" and combine commands on one line with ";". Shorten command names to the substring printed in capitals (e.g., BA for Base). You can use CI !variables in commands on
MPE and $environment variables on HP-UX.
Add tablename
Add ownername.tablename
The Add command inserts records into an Oracle table. Before records can be added, an Oracle database must be open. You can specify just the tablename or the ownername.tablename combination. The specified table name must be a valid table, not a view. For adding records to an Eloquence database please see the Put command.
>add customer
BAse [[host][:service]/]database
Open an Eloquence database (close current base). Base command also follows value of Eloquence variable EQ_DBSERVER.
base sample,5
base :eloqdb/sample,5
base hostname.robelle.com:eloqdb/sample,5
BAse [system#] base [ mode ] [ pass ]
Open an IMAGE database (close current base). Specify remote base with system# prefix. Use "?" for pass to prompt with no echo in batch. (Default: logon = system, mode = 1, pass = ";")
>base actrec.dat {mode = 1, pass = ";"}
>base actrec.dat,5,reader
>base sys2#act.db,5 {remote on sys2}
Before [ start [ /stop ]] | string | [ ALL | @ ]
Redo commands with chance to modify. (Default: previous)
Clean [ SPECIAL | <string> <range> ]
Specifies what characters to clean when using the $Clean function. The
SPECIAL keyword means characters from Decimal 0 to Decimal 31.
Characters that match those defined with the Clean command, will be replaced by the value defined by Set CleanChar, which defaults to space.
Clean characters can be defined with decimal notation "^" and/or the actual character as a string. To find records with specific characters see the
$findclean function in the IF command.
>in mysdfile
>clean special,"^128:^190","^255","}"
>extract byte-field = $clean(byte-field)
Chain setname search-field = [ key-values | table ]
Read an IMAGE or Eloquence dataset by search path, TPI, or B-tree and select specific records (masters) or chains of records (details) for explicit key values; requires previous Base command. Specify the key values either
2
Legend: MPE version only HP-UX version only
by an explicit list of values separated by commas or by a table name (see
Table command on page 9.)
>chain d-sales,customer="12345"
>table slist,customer,file,slist.db
>chain d-sales,customer=slist
>chain d-sales,part-no="3YJ "
Define field byteposition sublen [ type ][ subcount ]
Define a new data field (name <33 characters) by specifying an absolute location and format. First byte of input record is 1. See Data-Types on page 12. (Default: type = byte, subcount = 1)
>define city,11,10 {byte type}
>define TransType,1,2,int {1 = first}
>def amt,11,2,int,12 {amt repeats 12 times}
Define field fieldname [ qualifier ]
Define a new data field that is relative to the position of an existing database or Defined field. The qualifier equals
[(subscript)] [ [offset] ] [sublen] [type] [subcount]
The (subscript) specifies one sub-item of a compound item such as 5J2; 1 is the first and default sub-item. The offset specifies a byte offset from the existing location of fieldname; 1 is the default. The sublen and type override the existing size and data-type. See Data-Types on page 12. When you specify a subcount, the sublen is the byte-length of each subfield.
>define itemcount,status,2,int
>define costtotal,status[2],4,ieee
>define middle,name(2)
DELete
Delete selected records from IMAGE or Eloquence input dataset using
DBDELETE.
DO [ start [ /stop ]] | string | [ ALL | @ ]
Repeat previous commands without modifying them.
>do 5/9 {repeat several commands}
>do if {repeat last If command}
DUplicate ONLY | NONE KEYS [num] | RECORD
[ COUNT ] [ TOTAL field ... ]
Include or exclude duplicate records for the output file. There are options to count the duplicate output records, and to total up to fifteen fields.
>duplicate none keys {remove dups}
>duplicate only keys {keep only dups}
>duplicate none keys 1 {first sort level}
>duplicate none keys count {count dups}
>duplicate none keys total sales-amt, units-sold
EDit
Edit a database (see Dbedit Subsystem on page 18). Use the Base command before using the Edit command.
3
Legend: MPE version only HP-UX version only
Exit [ ABORT |
SUSPEND |
XEQ ]
Perform task and return to parent process. Exit Abort abandons task.
Suspend lets you return to task later.
>exit {default = Xeq}
>exit suspend {stop without executing}
EXPort [ stexport-command ]
Invoke STExport/MPE as a son process or pass a command to STExport.
>export input sdfile
You cannot use Suprtool/UX's Export command to invoke STExport/UX, but you can run STExport/UX by itself.
>/opt/robelle/bin/stexport
EXTract field [ (subscript)]
[ = value | = field2 | = expression ]
[ ,.. ]
Create output records by stringing together fields from the input record and constant values. Extracts are cumulative; you can use multiple extract commands. Extract can use dates (see Item command on page 6) and expressions (one per command, must be at the end of the command).
>ext custnum,transtable(3)
>ext CustTotal=15000
>ext CustName," ",CustAddr
>ext SalePrice = (SalePrice * 1.10)
>ext Day = (date-field mod 100)
>ext ByteField = ^7 {= ^G (bell)}
>ext c = (6000 - cost)
>ext yesterdate = $today(-1)
>ext date-field = $date(*/*/*-1)
>ext ccyymmdd-i2 = $stddate(date-mmddyy)
>ext date-field = $stddate($days(date-field) +7)
>ext num-days = ($days(date1) - $days(date2))
>ext positive = $abs(num-expression)
>ext packed-field = $signed(integer-field)
>ext int-field = $truncate(real-expression)
>ext full-name = ($trim(first-name) + " " + &
$trim(last-name))
>ext lowercase = $lower(city)
>ext uppercase = $upper(city)
>ext $ETOA(ByteField) {EBCDIC to ASCII}
>ext field = $lookup(table,key,tabledata)
>ext new-price=$number(new-price-ascii)
>ext dbl-count=$counter
>ext count=$subcount(order-number)
>ext first-name=$split(full-name,first,"/")
>ext address(1)=$clean(address(1))
>ext mytotal=$total(sales-dollars)
>ext mysub=$subtotal(sales-dollars,order-number)
>ext int-field=$number(byte-number)
>ext edit-amount=$edit(sales-amount,"$$,$$$.99-")
>ext mycbcount=$subcount(sort-break)
>ext full-name=$proper(full-name)
>ext name=$translate(name)
EXTract field1 [ (subscript1) ] \ field2 [ (subscript2) ]
Specify an inclusive range of fields to extract.
>ext ProductNo \ SalesQty
>ext SalesAmt(4) \ SalesAmt(6)
4
Legend: MPE version only HP-UX version only
Form [ SETS | ITEMS | PATHS |
dataset | data-item | filename ]
Show information about IMAGE or Eloquence database, datasets, items, or self-describing files. On HP-UX output goes to $stdlist.
On MPE output goes to Formout file, defaulting to $stdlist.
>form sets {list the datasets}
>form d-cust {details on d-cust set}
>form sdfile {fields in self-describing file}
Get setname [ subset ]
Select an IMAGE or Eloquence dataset as input source; requires previous
Base command. Subset options select only part of dataset. (Default: read the entire dataset.)
[ (startrec/endrec) ] {range of record numbers}
[ (#n) ] {selects every nth record}
>get dtrans
>get dtrans(100/200) {first record is 1}
>get dtrans(#4) {every 4th record}
Help [ command-name | keyword [ ,section ]]
Provide access to the on-line user manual. Type a keyword (e.g., Help
Access) or a command-name. HQ for brief help.
>help {default is browse}
>hq list {quick summary of List command}
IF expression
Select a logical subset of the input source through an expression that tests one or more fields. See Record Selection on page 13 for details.
>if TransCode="01" and amount>1000
>if $upper(City)="VANC","SEAT","PORT"
>if StatWord.(4:1)=1 and addr=="@BC@"
>if a = alpha
>if $lookup(part-no-table,partno)
>if date=$today
>if TotalPrice <> (SalesTotal + Taxes)
>if $null(salestotal)
>if not $null(salestotal)
>if $invalid(date-field)
>if $stddate(dt-mmyydd) < $stddate(dt-aammdd)
>if (date-field mod 100) = 01
>if InDate <= $date(*/*-6/*) {6 months ago}
>if ($days(ship-date) - $days(order-date)) > 14
>if $abs(oldprice - newprice) > 10
>if $truncate(total / months) > 10
>if $lower(city) = "niagara falls"
>if $ltrim(last-name) = "Armstrong"
>if $findclean(last-name)
>if $lookup(mytable,char-field,id-field)=id-field
Input file [ = dataset ] [ subset ]
Select an MPE or KSAM file as input source. The file can be the name of an existing disc file or a reference to a :File equation (*name). The =set option requires an open base because the file is assigned the same record format as the IMAGE set. The first record is 0, except for some KSAM files where it is 1. Subset options select only part of the file.
[ (startrec/endrec) ] {range of record numbers}
5
Legend: MPE version only HP-UX version only
[ (#n) ] {selects every nth record}
>input log23 {disc file}
>input * {$stdinx}
>input trans(#5) {every 5th record}
Input file [ fileinfo ] [ subset ]
The file is the name of an HP-UX file. The fileinfo options are Reclen, LF, and NOLF. The Reclen option must be followed by the record length (in bytes) of each data record. Subset options select only part of the file.
[ (startrec/endrec) ] {range of record numbers}
[ (#n) ] {selects every nth record}
>input uxfile,reclen 80,nolf
>input sdfile {requires ".sd" file}
ITem itemname DATE | DECIMAL attribute
Define the date format or implied decimal places for an item. For compound items, all sub-items are assigned the same date type or number of decimal places. The attribute is a string for Date and the number of decimal places for Decimal. The Date attributes describe the format of the date. yymmdd ddmmyy mmddyy yyyymmdd ddmmyyyy mmddyyyy
ASK
PHdate calendar yymm yyymmdd
Oracle ccyymmdd ccyymm yyyymm aamm
X6 Z6 J2 K2 P8
X6 Z6 J2 K2 P8
X6 Z6 J2 K2 P8
X8 Z8 J2 K2 P10
X8 Z8 J2 K2 P10
X8 Z8 J2 K2 P10
J1
J1 K1 J2 K2
J1 K1
X4 Z4 J1 K1
J2 P8
X7
X8 Z8 J2 K2 P10
X6 Z6 J2 K2 P8
X6 Z6 J2 K2 P8
X4 aammdd mmddaa ddmmaa ccyy
X6
X6
X6
X4 Z4 J1 K1
SRNChronos X6 mmyyyy X6 Z6 J2 K2 P8 yyddd ccyyddd
X5 Z5 J2 K2 P8
X7 Z7 J2 K2 P10
HPCalendar
EDSDate
JulianDay
PHdate8
J2 K2
J2 P8
J2
J1 K1 J2 K2
>item UnitCost,decimal,2
>item InDate,date,ddmmyy
>extract InDate=$today(-1) {yesterday}
>if InDate<=$date(*/*-6/*) {6 months ago}
6
Legend: MPE version only HP-UX version only
[ Key ] byteposition bytelen [ type ] [ DESC ]
Define an arbitrary sort field anywhere within the input record. See Data-
Types on page 12. (Default: type = byte, ascending)
>key 1,10 {first ten bytes}
>key 21,4,double {double integer}
>key 25,2,int,desc {descending order}
>25,2,int,desc {omitted the Key command name}
LINk [ suprlink-command ]
Invoke Suprlink as a son process or pass a command to Suprlink .
>link input sdfile
You cannot use Suprtool/UX's Link command to invoke Suprlink/UX, but you can run Suprlink/UX by itself.
/opt/robelle/bin/suprlink
List [ STANDARD ]
[ RECORD ]
[ DUPLEX ]
[ TITLE "string" [ DATE format ] ]
[ HEADING "string" [ "string"... ] ]
[ ONEPERLINE ]
[ LABEL ]
[ PCL format ]
[ NOREC ]
[ NONAME ]
[ NOSKIP ]
[ OCTAL | HEX | DECIMAL ]
[ CHAR ]
[ LEFTJUSTNUM ]
[ RIGHTJUSTNUM ]
[ TIME format ]
[FILE name APPEND RECLEN size]
[ LP ]
[ DEVICE name ]
Report selected records to Suprlist file, defaulting to $stdlist.
Report selected records to $stdlist to an LP device or to a file using the FILE option and control the size with the RECLEN option.
Standard produces a columnar report, but the default is either a formatted listing or Octal/Char if the file is unstructured. Use Title and Heading to customize the listing.
Record prints on attached printer, and Duplex prints two sided.
>list standard record {to attached printer}
>list stand title "Overdue Accounts"
LISTREDO [ start[ /stop ] | [ ALL | @ ] string ]
[ ;ABS | ;REL | ;UNN ]
[ ;OUT file ]
Display previous commands; ",," is shortcut. (Default: last 20 commands)
>listredo 10/40
>listredo input {all Input commands}
7
Legend: MPE version only HP-UX version only
Numrecs number | percentage%
Specify size of input, output and Sortscr files as an absolute number of entries or as a percent of input size. Required for input tape files.
>numrecs 100000
>numrecs 5% {5% of the input}
OPen ALLBASE dbename owner
ORACLE username password
Open an SQL database. Allbase is supported on MPE and HP-UX. Oracle is supported on HP-UX only.
>open allbase inventory anne
>open oracle scott tiger
>open oracle scott/tiger@machine
Output file [ format ] [ APPEND | ERASE |
TEMP
]
Define the name of the output file as one of the following: a new disc file
(default), an existing disc or KSAM file (Append or Erase option), "*" for
$stdlist, a reference to a :File equation (*name), or =Input to sort a file into itself. If you use List, Put, or Total, output defaults to $null. Output produces the same record format as the input source (adjusted by Extract commands), unless you override with format keywords:
DATA
ELSE
KEY
PRN
QUERY
LINK
ASCII
DISPLAY default
Records not qualified by if condition sort keys only
PC file format self-describing better self-describing format convert from numeric convert to display
NUM
NUM,KEY
J2 input record number only
J2 input record number & sort keys
NUM,DATA J2 input record number & data record
NUM,QUERY "numbers" format
NOLF
LF
Do not write out line feeds to end of record
Write out line feeds to end of record
Converted ASCII fields have a trailing sign (usually blank for positive values). Size depends on the binary field's format:
E2 R2 12 bytes
I1 J1 06 bytes
I3 J3
K1
Zn
16 bytes
05 bytes n+1 bytes
E4 R4
I2 J2
I4 J4
K2
Pn
23 bytes
11 bytes
20 bytes
10 bytes n bytes
>output newfile {build newfile}
>output newfile,temp {build temp file}
>output *,ascii {$stdlist display}
>output =input {sort into itself}
>output cleanfl,erase {existing file}
>output ksamfl,erase {load KSAM file}
>output trans1,append {append to file}
>output sdfile,link {self-describing}
>output lotus,prn {ready to download}
Put set [,[host][:service]/]database]
Put the output records to an Eloquence dataset by using DBPUT.
8
Legend: MPE version only HP-UX version only
Put trans
Put dtrans,sample,5
Put dataset,:eloqdb/sample,5 put dataset,hostname.robelle.com:eloqdb/sample,5
Put set [ ,base [ ,mode [ ,password ] ] ]
Put the output records to an IMAGE dataset by using DBPUT.
>put dtrans,actrec,4 {another base}
>get curmonth;put history {same base}
Q [ "string" ]
Print a string on the CRT. (Default: print blank line)
>q "Sorting customer records" {quoted}
REDO [ start[ /stop ]] | string | [ ALL | @ ]
Redo command lines; modify using MPE control codes.
>redo input {repeat previous Input command}
Reset [[ ALL | @ ] | command [ ... ]]
Reset aspects of the current task. Reset All resets all input and output commands, but not Define and Set options. (Default: Reset Delete, Sort,
Key, If, List)
>reset if {reset If command}
>reset all
SELect statement
Specify an input source with an SQL select statement. Some processing options can be specified on the Select statement or with other Suprtool commands.
Using SQL to sort:
>select * from user.acct@emp order by name
Using Suprtool to sort:
>select * from user.acct@emp
>sort name
Set option-name value
Enable/disable options. See Configuration Options on page 14. Verify Set shows current values.
>set statistics off
SOrt field [ (subscript) ] [ DESCending]
Specify a field or a Defined field as a sort field. For compound items, the first sub-item is the default.
>sort CustNumber {default ascending sort}
>sort total desc {descending order}
>sort StreetAddress(2)
TAble tablename itemname keyword qualifier
Build a table of values for testing in the If and Chain commands, or for extracting from the table with the Extract command. The tablename (up to
16 characters) must be unique. Itemname is a database item or a Defined
9
Legend: MPE version only HP-UX version only
field, or a field in a self-describing file. For compound items, Table uses the first sub-item. The keyword is one of ITEM, FILE, or SORTED. The format of qualifier depends on keyword: for ITEM, a list of explicit data values; for FILE and SORTED, a filename whose data is unsorted or sorted by itemname, followed by an optional HOLD keyword and an optional Data keyword indicating a list of data fields to be loaded from the self-describing file.
Keyword
ITEM
Qualifier
value [ value ... ]
FILE or SORTED filename [ HOLD ] [ DATA (fieldlist) ]
>table select,ccode,item,"ABCD","FILM"
>chain m-customer,ccode=select
>table select,ccode,file,extract.file,hold
>if $lookup(select,ccode)
>table t,ccode,file,sdfile,data(updatefield)
>update
>extract dbfield=$lookup(t,ccode,updatefield)
>table t,ccode,file,sdfile,data(updatefield)
>if dbfield=$lookup(t,ccode,updatefield)
Total field [ (subscript) ] [ decplaces ]
$FILE file [ APPEND | ERASE | TEMP ]
$FILE $LIST
Compute sum total of a numeric field value in all selected records and print the result with a specified number of decplaces (default is 0 unless specified in Item command). The $file option prints the totals to a file or to the List device ($list). (Default: subscript = 1)
>total cust-balance,2
>total $file tothist,append
UPdate [ CIUPDATE ]
Update IMAGE or Eloquence fields specified by subsequent Extract commands.
>update
>extract status-code="OLD"
Use[Q] filename
Execute commands from a Text file or a Qedit file.
>use define6.usefile
USERpause "string"
Print prompt string; wait for any key.
>userpause "Press Return"
Verify [ ALL | @ | VERSION | command [ ... ] ]
Show current specifications.
>verify input {print name of input file}
Xeq
Perform the specified task, then wait for more commands.
10
Legend: MPE version only HP-UX version only
More Suprtool Functions
O/S commands
>purge abc
>run myprog
>!rm abc
>!chmod 777 myfile
Calculations
>=312/4 {try "=?" for help}
Sort keys
>10,2,integer
Comments
>{this is a comment in braces}
Modify Functions In The Before Command
Printing characters replace; control keys edit. Move with the spacebar.
Press the Return key after each function. ^ means Control.
^A
^B
^D
^G
Append to end of line (also ^L).
Insert before a column (^^ on console).
Delete (default = end of line).
Restart with original line.
^O
^T
Overwrite characters (default).
Stop current editing mode.
^A,^D Delete from end of line, then add.
Calling Suprtool2
User programs can call Suprtool via the interface routine Suprtool2 (see
St2usl.Pub.Robelle, St2xl.Pub.Robelle
, /opt/robelle/lib ). The user program calls Suprtool2 repeatedly, passing in Suprtool commands via a control record (COBOL definition in Cobol.Qlibsrc.Robelle
). The last command passed to a user program must be Exit. Normally, Suprtool creates an output file which the user program then reads. To avoid typing mistakes, copy the control record from the file. Be careful to :Prep or :Link program with Cap=PH.
Suprtool Fields
Suprtool recognizes fields in databases and self-describing files. The
Define command can define new fields or redefine existing fields into new sizes or data-types so that you can name and use important parts of existing fields. Refer to the Defined field in other commands (e.g., Extract, If, etc.).
Select one element of a compound field by specifying a subscript in parentheses. The first element is (1).
field-name (subscript)
The default subscript is the first sub-item for Total, Define, Sort, and If, but the entire compound item for Extract. Table does not allow subscripts; it always uses one (1). The If command's syntax uses up to 3 subscripts, so you can refer to subfields without using Define (see user manual).
>define two,address(2),20,byte
>extract two {20 bytes of 2nd line}
>define trans,partnum[7],2
>if trans="XT" {last 2 bytes of X8}
11
Legend: MPE version only HP-UX version only
Data-Types
The data-types for the Define and Key commands:
Byte ASCII characters
Integer two's complement
Double two's complement
Real floating-point
Long
Ieee packed display logical packed-decimal packed* last nibble unused zoned-decimal unsigned integer floating-point
IEEE floating-point character for NLS
The Suprtool definitions for the IMAGE data-types:
Un
Xn
Zn
Pn
K1
K2
R2
R4
E2
E4
I4
J1
J2
J4
IMAGE
Type
I1
I2
2
4
4
8 n n n n/2
4
8
8
2
4
8
Bytes COBOL
Declaration
2
4
S9(4)comp
S9(9)comp
S9(18)comp
S9(4)comp
S9(9)comp
S9(18)comp
A(n)
X(n)
9(n)
S9(n-1) comp-3
SUPRTOOL
Definition
>def a,1,2,integer
>def a,1,4,double
>def a,1,8,integer
>def a,1,2,integer
>def a,1,4,double
>def a,1,8,integer
>def a,1,n,byte
>def a,1,n,byte
>def a,1,n,display
>def a,1,n/2,packed
>def a,1,2,logical
>def a,1,4,logical
>def a,1,4,real
>def a,1,8,real
>def a,1,4,ieee
>def a,1,8,ieee
The Suprtool definitions for PowerHouse data types:
K
J
P
Z
IMAGE
U or X
R
E
PowerHouse
Character
Float (non-IEEE)*
Float (IEEE)*
Integer Unsigned
Integer Signed
Packed
Zoned
Suprtool
Byte (Character for NLS)
Real or Long
IEEE
Logical
Integer or Double
Packed
Display
•
* IEEE or Non-IEEE depends on whether "float IEEE" or "float
NONIEEE" was declared under "System Options" in your System
Dictionary
•
Use QSHOW to view the attributes of a subfile.
The Suprtool definitions for the Allbase data types:
Allbase Data-Type
Integer
Smallint
Binary
Char
Varchar
Real
Float
Decimal
Numeric
TID
Date
Suprtool Data-Type
Double
Integer
Not Supported
Byte
Byte
IEEE-32
IEEE-64
Packed
Packed
Not Supported
Byte
12
Legend: MPE version only HP-UX version only
Time
Datetime
Interval
Varbinary
Long binary
Long varbinary
Byte
Byte
Byte
Not Supported
Not Supported
Not Supported
The Allbase date and time fields are returned as byte-type fields with the following lengths:
Data-Type
Date
Time
Datetime
Interval
Length
10
8
23
8
The Suprtool definitions for the Oracle data types:
Oracle Data-Type
Varchar2
Number
Long
Rowid
Date
Raw
Long raw
Char
Mislabel
Suprtool Data-Type
Byte
Varies, see Precision below*
Not supported
Not supported
Oracle Date
Not supported
Not supported
Byte
Not supported
The following table describes the translation for each case:
*Precision
None
1-4
5-9
1-9
10-27
28-38
Decimal Places
Any
Zero
Zero
Non-zero
Any
Any
Suprtool Data Type
8-byte IEEE
2-byte Integer
4-byte Integer
Packed-decimal
Packed-decimal
8-byte IEEE
You can change the Suprtool format for certain fields using the command
Set Oracle Integer On, which when extracted will give the following
Suprtool Data types:
Precision
1-4
5-9
10-27
Decimal Places
Any
Any
Any
Suprtool Data-Type
2-byte Integer
4-byte Integer
8-byte Integer
$Clean Function and Clean Command
Record Selection
The If command lets you select a subset of the input source based on field values in the entries, and it allows you to combine tests. Operator precedence is parentheses, NOT, AND, OR, unary minus, multiply and divide, add and subtract.
field relop value
field == "pattern"
{relop: = < > <= >= <>}
{see Pattern Matching on page 16}
byte-field = NUMERIC | ALPHA | SPECIAL
field = value-list
field = field
{If A=1,2,3}
(expression)
NOT expression
{parentheses}
{reverse test}
13
Legend: MPE version only HP-UX version only
expression AND expression
expression OR expression
$INVALID(date-field)
$STDDATE(date-field)
$LOOKUP(tablename,field)
$LOOKUP(tablename,field,data)
date-field = $TODAY
{see Item command on page 6}
date-field = $DATE(yy/mm/dd){see Item command on page 6}
word-field.(bit:count)
byte-field = ^7
$READ
$NULL(fieldname)
{bit extracts}
{bits go from 0 to 15, left to right}
{Control-G}
Configuration Options
Override Suprtool's default options with Set commands.
Set Option Name
ALLBASE
ARITHMETIC
AMXW
AMXW
BASECLOSE
BLOCKSIZE
BUFFER
CLEANCHAR
CURRENCYSYMBOL
DATE
DATE
DATE
DATE
DECIMALSYMBOL
DEFER
DUMPONERROR
EOFREAD
EDITSTOPERROR
FASTREAD
FILECODE
FILENAME
LOCK
MAKEABSENT
NLS
Sub-Option
ROWS
PERFWRITE
EXTERNALSD
Value
number
CLASSIC |
IEEE
ON|OFF
ON| OFF
Default
100 see manual
OFF *
OFF *
ON | OFF OFF size <none> size 14,336 or
24,576
<string>
“<null>”
<space> for no string
CUTOFF
<string> size
$
10
FORCECENTURY ON | OFF OFF
IFYY2000ERROR ON | OFF ON
MAPTOPHDATE8 ON | OFF OFF
<string>
ON | OFF
.
OFF
Help | Link | Edit |
Hint | Export |
Outcount
ON | OFF ON
ON | OFF OFF
ON | OFF OFF
ON | OFF ON (OFF)* number 0 filename
FIRSTREC
HINTS
HPUXCMDERR
IFCHECK
IGNORE
INITEXTENTS
INTERACTIVE
ITEMABBREVIATEDATE
ITEMLOCK
LABELLEDTAPEREWIND
LIMITS
LIMITS
MPE
READONLY
LIMITS
LIMITS
TABLE
TABLE
0 | 1 see manual
ON | OFF ON
<string> <none>
ON | OFF ON
ON | OFF OFF
ON | OFF OFF
ON | OFF depends
ON | OFF ON
<string> <none>
ON | OFF ON
ON | OFF ON
ON | OFF OFF size size
1(CM)
2,047(NM)
500(UX)
1 0 | 1 | number
ON|OFF number
OFF
0, Nldatalang
14
Legend: MPE version only HP-UX version only
NUMBUG
OPENMODE
ORACLE
ORACLE
ORACLE
ORACLE
ORACLE
ORACLE
PATTERN
PREFETCH
PRIVMODE
PROGRESS
PROGRESS
PROMPT
REALMAP
RECOVER
ROWS
INTEGER
OPENFIX
PASSSHIFT
SPACENULL
ZERONULL
PERCENT
MINIMUM
ON | OFF OFF number 1 number 100
ON | OFF OFF
ON | OFF OFF
ON | OFF ON
ON|OFF OFF
ON | OFF OFF
NEW |
OLD
NEW number 0 (MPE/iX)
ON | OFF ON number 5 records 10,000 (MPE
V); 50,000 character
(MPE/iX)
>
ON | OFF ON
ON | OFF OFF
REDO
SDEXTNAME
SQUEEZE
SORTFAST
STATISTICS
SUBSYSTEM
SUSPEND
THOUSANDSYMBOL
USERLABELS
VARSUB
VARSUBCOMPAT
VARSUBDEBUG
WARNINGS
XLTRIM
LIST
LIST
FORMFEED
LIST
TIME
DATE
PCL
•
Suprtool for HP-UX
•
Fastread default is On for regular Suprtool for HP-UX and Off for the
Dynamic Image loading version. (uses ROBELLELIB_IMAGE variable)
List PCL Number
(+1,000 = ASCII,
Letter-size (cols/lines) A4 paper (cols/lines)
+2,000 = A4)
0 default font
1 Landscape-tiny
2 Landscape-Courier
3 Standard Courier
4 Portrait-tiny
5 Courier A4 "tight"
80 x 60
175 x 60
100 x 45
80 x 60
132 x 80
80 x 60
6 Landscape-legal-tiny 223 x 60 filename <temp>
ON | OFF OFF
ON | OFF |
<none>
<none>
ON | OFF ON
ON | OFF OFF
ON | OFF OFF
ON | OFF varies
<string> ,
ON | OFF ON
ON | OFF OFF
ON | OFF OFF
ON | OFF OFF
ON | OFF ON
ON | OFF OFF format
0-4
0 = Sep 20,
1994
1 =
94/09/20
2 =
09/20/94
3 =
20/09/94
4 = 20 Sep
1
0
94
ON | OFF OFF number
(see below)
0
188 x 58
110 x 43
77 x 64
128 x 85
80 x 64
223 x 60
Legend:
15
MPE version only HP-UX version only
Ways to Run Suprtool/MPE
:Run Suprtool.Pub.Robelle [;parm=value] [;info="string"]
Parm=
1,2
4
8
16
32
64
Meaning
Not used
Execute Info = string
Repeat Info = string on every activate
Copy file input to output
Default Set Suspend to Off
Verify Exit with user
Job Control Words (JCW)
Suprtool sets the system JCW to a fatal state when Suprtool fails in a batch job. Suprtool sets a JCW named SuprtoolOutCount to the number of output records. SuprtoolOutCount has a maximum number of 65,535. On
MPE/iX, Suprtool sets a variable named SuprtoolFullCount to the number of output records.
Suprmgr files
This usefile is executed every time Suprtool runs:
Suprmgr.Pub.Sys
/opt/robelle/suprmgr
Ways to Run Suprtool/UX
/opt/robelle/bin/suprtool [option]
Option
-c
-lw
-v
-oc
Meaning
Execute specified command string.
Execute and print any loader warnings
Exit with verify.
Write count to specified file.
Pattern Matching
The If command can search a byte field for a pattern of characters.
if bytefield == "pattern" {match}
if bytefield >< "pattern" {does not match}
@ Zero or more characters (any) & Escape character
~ Zero or more blanks
? One alphanumeric character
! Reserved for future use
^ Reserved for future use
# One numeric character
>if item-desc >< "@bolt@"
>if address=="e@" {look for # sign}
Suprlink
Suprlink can access multiple files, produce a sorted disc file with a composite record of related fields from up to 7 files, and feed the merged file into your report program. Suprlink accepts only one command per line, but commands can be continued on the next line with an ampersand (&).
The prompt character is "+", not ">."
:run Suprlink.Pub.Robelle
16
Legend: MPE version only HP-UX version only
/opt/robelle/bin/suprlink
Before
See Suprtool section, page 2.
DO
See Suprtool section, page 3.
Exit [ ABORT |
SUSPEND
| XEQ ]
Perform task specified, and return to O/S or parent process. (:Run
Suprlink/MPE with Parm=64 to verify on exit.)
+exit {default = Xeq}
+exit suspend {stop without executing}
Form [ filename ]
Display the fields in a self-describing file.
+form {default = show fields in the input file}
+form customer
Help [ command-name | keyword [ ,section ]]
Access the on-line user manual.
+help {default is browse all}
+help input {explain Input command}
Input filename [ BY key-field ]
Select the primary input source. There is an option to specify the key-field by which the file is sorted.
+input invoices by cust-no
Join filename [ BY link-keys [ FROM input-keys ] ]
[ REQUIRED | OPTIONAL ]
Join two files that have multiple keys in both the input file and the Join file.
+join custfile
Link filename [ BY link-keys [ FROM input-keys ] ]
[ REQUIRED | OPTIONAL ]
Link the input file to another link file, maximum of seven.
+link custfile
+link sales by customer-no
LISTREDO
See Suprtool section, page 7.
Output filename [
TEMP
] [ ERASE ]
[ DATA ] [LINK]
Specify output file name and whether it is temporary .
+output custsale {default file name = Output}
17
Legend: MPE version only HP-UX version only
REDO
See Suprtool section, page 9.
Reset
Cancel the current task.
+reset {reset everything}
Set option-name value
Set configurable options.
+set mapped on
+set statistics on
+set varsub on
+set warnings off {batch only}
Use[Q] filename
Execute commands from a Text or Qedit file.
+use cap2.infile
Verify
Show current specifications.
+verify {show everything}
Xeq
Perform the current Suprlink task.
+xeq
Ways to Run Suprlink/UX
/opt/robelle/bin/suprlink [option]
Option
-v
-oc
-cv
Meaning
Turn on Variable Substitution
Write count to specified file.
Turn on VarsubCompat
Dbedit Subsystem
Edit records in an IMAGE, Eloquence or Oracle (with IMAX library) database. Most Dbedit commands prompt for a key value, then process matching entries. Dbedit accepts one command per line. Command abbreviations are shown in capitals. The Dbedit prompt character is "#".
The generic format of a Dbedit command is
command [file] [;option [;option]]
The file parameter consists of dataset:fieldlist. See page 20 for details.
Add [ file ] [ ;options ]
Add new entries to a dataset manually.
#add m-customer {add to master}
#add d-address;limit=1 {only 1 record}
18
Legend: MPE version only HP-UX version only
Before
See Suprtool section, page 2.
Change [ file ] [ ;options ]
Replace a key value in a master and all related details.
#change m-customer {must be master}
Delete [ file ] [ ;options ]
Remove selected entries from a dataset.
#delete m-cust {prompts for key}
#d d-address;key=cust-no
DO
See Suprtool section, page 3.
Exit
Return control to the main part of Suprtool.
#exit {leave Dbedit subsystem}
File [ file ] [ ;options ]
Establish the current file and field list as a default for other commands.
(Default: none)
#file d-address {entire entry}
#file m-cust:cur-bal {only 1 field}
Form [ SETS | ITEMS | PATHS |
dataset | data-item | filename ]
Show information on items and sets of database. (Default: datasets in database or fields in current dataset)
#form sets {list datasets}
#fo d-cust {details on d-cust set}
Help [ command-name | keyword [ ,section ]]
Access the help file.
#help list {explain List command}
#hq form {quick summary of Form}
List [ file ] [ ;options ]
Display entries from a dataset or a group of related datasets.
#list d-address {prompts for key}
#l m-cust;related {linked details too}
#l d-control;all {serial dump}
LISTREDO
See Suprtool section, page 7.
Modify [ file ] [ ;options ]
Change field values in a dataset.
#modify d-address
19
Legend: MPE version only HP-UX version only
#m m-cust;updatekey {critical fields!}
#m d-address;key=city {alternate key}
Q [ string ]
Print a literal message on the screen. (Default: none)
#q Add a new customer to the files:
REDO
See Suprtool section, page 9
Set option-name value
Configure Dbedit options such as the prompt character or underlining input fields. See Dbedit Configuration Options below.
#set reset off {retain Key = options}
Use[Q] filename
Do commands from a Keep or Qedit file. (Default: none)
#use selfile
Verify [ ALL | BASE | DSET | SET | CIUPDATE ]
Show the Dbedit specifications and options. (Default: Base, Dset,
CIUpdate, changed Set values)
#verify all
Dbedit File Parameter
The file parameter consists of a dataset name with an optional list of fields.
(Default: same as previous command)
dataset [ : field, ... ]
You can use the :File command to set up the current values.
#delete m-customer
#list m-customer:name,address
Dbedit Command Options
The options come after the file parameter and can be combined with semicolons: n
ALL
Limit prompts to n times.
Process an entire dataset.
KEY=field
LIMIT=count
RELATED
UNDER
Change search field prompt order.
Limit entries per key value.
List related entries in linked datasets.
Prompt with underlines.
UPDATEKEY Modify search and sort fields.
Dbedit Configuration Options
Set Option-Name
LP
PROMPT
QUIET
RESET
UNDERLINE
Value
ON | OFF character
ON | OFF
ON | OFF
ON | OFF
Default
OFF
#
OFF
ON
ON
20
Legend: MPE version only HP-UX version only
VERIFY ON | OFF ON
>edit {enter Dbedit first}
#set quiet on {reduce screen output}
#set verify off {don't list new records}
Dbedit Subcommands
<<
>
>>
'
*
Enter subcommands when Dbedit prompts for field values.
// Stop the current command immediately (same as \\)
?
<
Describe the current field
Go back one field in the list ( <3 for 3 fields)
[
@F
=
Return to the first field in the list
Go forward one field in the list ( >3 for 3 fields)
Skip the rest of the fields in the list
Use blanks for the field (useful in batch)
Use the last value for this field
Force what follows "[" to be a value, not a subcommand
Search for field F (e.g., @bin-no)
Calculator
STExport
STExport reads a self-describing input file and applies formatting rules to create an output file, which is suitable for importing into other applications. STExport accepts only one command per line, but commands can be continued on the next line with an ampersand (&). The STExport prompt character is "$", not ">."
:run STExport.Pub.Robelle
/opt/robelle/bin/stexport
Before
See Suprtool section, page 2.
Columns FIXED | NONE
Specify whether fields are formatted into variable- or fixed-length columns.
Clean [ SPECIAL | <string> <range> ]
Specifies what characters to clean from byte type fields. Characters that match those defined with the Clean command, will be replaced by the value defined by Set CleanChar, which defaults to space.
$in mysdfile
$clean special,"^128:^190","^255","}"
$out prnfile
Date NONE | date-format [ "separator" ]
| INVALID [ ASTERISKS | NULL | "string" ]
Specify a date format for all dates and how to process invalid dates.
DECimal PERIOD | COMMA
Specify which symbol will be used to indicate the decimal place in numeric fields.
21
Legend: MPE version only HP-UX version only
DElimiter NONE | COMMA | TAB | "string"
Specify which delimiter character, if any, is to appear between each formatted field.
EScape delimeter quote eol "string"
The Escape command will take the defined delimeter, quote and Eol and escape with a "/", if found in any byte type field. This is for easier importing for some SQL Import programs.
escape delimeter quote eol "/"
DO
See Suprtool section, page 3.
Exit [ ABORT |
SUSPEND
| XEQ ]
Perform specified task, and return to O/S or parent process. (:Run
STExport/MPE with Parm=64 to verify on exit.)
$exit {default = Xeq}
$exit suspend {stop without executing}
FLoating DEFAULT | FIXED decimal-places |
SCIENTIFIC decimal-places
Specify the format and the number of decimal places for floating-point fields.
Form [ filename ]
Display the fields in a self-describing file.
$form {default = show fields in the input file}
$form customer
HEAding NONE | FIELDNAMES | "string" |
ADD "string"| COLUMN "string"|
Specify which heading, if any, is to appear as the first record of the output file.
HElp [ command-name | keyword [ ,section ]]
Access the on-line user manual.
$help {default is browse all}
$help input {explain Input command}
HTML NONE | PREFORMATTED | TABLE
[ TITLE "string" ]
[ HEADING "string" ]
Use HTML to format Web pages for either Internet or intranet applications.
$html table title "Product Listing"
Input filename
Select a file to read and format.
$input invoices
22
Legend: MPE version only HP-UX version only
LISTREDO
See Suprtool section, page 7.
Output * | filename [
TEMP
]
[ LF | NOLF ]
[ ERASE ]
Specify output file name and whether it is temporary .
$output custsale {default file name = Output}
Quote NONE | DOUBLE | SINGLE
Specify which quote character, if any, is to be used around byte-type fields.
REDO
See Suprtool section, page 9.
Reset
Resets the Input and Output files, cancels the task in progress. Does not reset formatting commands such as Delimiter, Head, Spaces, etc.
$reset
Set option-name value
Set configurable options.
$set cleanchar " "
$set mapped on
$set statistics on
$set varsub on
$set warnings off {batch only}
$set xmltagchar "_"
$set zonedfix on
SIgn NONE | FLOATING | LEADING | TRAILING
Specify what should be done with the sign character for numeric fields.
SPaces NONE | TRAILING
Specify whether byte-type fields have trailing spaces.
Use[Q] filename
Execute commands from a Text or Qedit file.
$use cap2.infile
Verify
Show current specifications.
$verify {show everything}
Xeq
Perform the current STExport task.
$xeq
23
Legend: MPE version only HP-UX version only
XML VERSION "string"
DOCTYPE "string" |
filename
FILE "string"
RECORD "string"
Generate output consisting of well-formed XML output.
$xml
$xml doctype myfile.xml
Zero NONE | LEADING
Specify whether numeric fields have leading zeros.
Ways to Run STExport/UX
/opt/robelle/bin/stexport [option]
Option
-v
-oc
-cv
Meaning
Turn on Variable Substitution
Write count to specified file.
Turn on VarsubCompat
Speed Demon
For large datasets, replace DBGET mode-2 calls in your programs with
Speed Demon calls (native or compatibility mode), which should be 2-5 times faster than DBGET. Restrictions: database cannot be open in modes-
3 or -7, requires full-read access, cannot be remote, and cannot update or delete after Get. See Cobol2.Qlibsrc.Robelle for sample code.
SPDEEXPLAIN status
Print a three-line message based on the status array.
SPDEDBINIT base, set, mode, status, control, list
Initialize Speed Demon and specify what dataset to read. For partial field lists, specify mode-2. If your dataset may change during the read, specify mode-3 to read to end-of-file.
SPDEDBSCAN base, status, buffer, dummy
Read the next entry in the set specified in SPDEDBINIT, returning it in the buffer.SPDEDBSHUT base, set, mode, status, dummy
Mode-1: Close the Speed Demon environment (this must be done before reading another dataset). Mode-2: Close the environment and print statistics about the read operation.
SUPRTOOL TIPS AND TECHNIQUES
Converting Numeric Data Types
Suprtool does not change the data type in the input file, but it can change the data type as it copies numeric data to the output file.
To convert a field from Integer to Packed: define my-packed-field,1,size,packed extract my-packed-field = integer-field
24
Legend: MPE version only HP-UX version only
To convert a numeric field from ASCII to binary: define ascii-field,start,length,display define binary-field,1,size,integer extract binary-field = ascii-field
To convert a numeric field from ASCII to binary with sign and decimal place : define ascii-field,start,length,display define binary-field,1,size,integer extract binary-field = $number(ascii-field)
Update Fields in A Dataset
Update a field in a dataset, using replacement values stored in a selfdescribing file. (Create the self-describing file using the Link option of
Suprtool or Suprlink.) Load the self-describing file into a Suprtool table, then update the dataset field with the values loaded in the table. E.g., to update credit-balance with new values found in myfile: get dataset table t,acct-no,file,myfile,data(new-balance) if $lookup(t,acct-no) update extract credit-balance = &
$lookup(t,acct-no,new-balance) xeq
Counting Values Found in A File
Use the Duplicate command to list all the different values in a field, and to count how many times each value occurs. E.g., to list how many shipments we have made, by state: get ship-dataset sort state-code extract state-code duplicate none keys count list standard xeq
Subtotaling A Field
Use the Duplicate command to total a field based on a sort key. E.g., to report the sales figures by date: get invoices sort invoice-date extract invoice-date duplicate none keys total sales-amount list standard xeq
Searching For Records in One File Based on
Selection Criteria in Another File
E.g., to select all invoices for customers in California, when state-code is not in the invoices file: get customer-master if state-code = "CA" extract acct-no output myfile,link xeq
25
Legend: MPE version only HP-UX version only
get invoices table t,acct-no,file,myfile if $lookup(t,acct-no)
Finding the Intersection of Two Files
If a Suprlink input record does not have a matching link record, that input record does not appear in the output file. Use this to find the "intersection" of two files. E.g., list all the invoices over $1,000 for customers in
California: get invoices item sales-total,decimal,2 if sales-total > 1000.00 sort cust-no output inv1000,link xeq get customer-master if state-code = "CA" sort cust-no output custca,link xeq link input inv1000 link link custca link output cagt1000 link xeq
Suprlink Tips and Rules-of-Thumb
•
You can have only one Input file, but up to seven Link files.
•
All the files must be self-describing, created using the Link or Query option.
•
All the files must be sorted by a common linking field.
•
The common linking field must have the same size, data type, and content in all the files.
•
Input records without matching link records will be dropped from the output file, unless the Optional keyword is used on the Link command.
•
In general, the input file is made up of "detail-like" records, and the link file is made up of "master-like" records, even though they may not actually come from masters and details.
•
Specifically, the input file will be the file that has multiple records with the same key value (the common linking field), and the link file will be the file that has only one record with a given key value.
•
To improve speed, try to reduce the files before feeding them to
Suprlink. When creating the files with Suprtool, select only the desired records using the If command, and select only the needed fields using the Extract command.
•
If both the Input file and the Link file have multiple key values then you should use the Join command instead of the Link command.
Dynamically Loading Libraries
Suprtool for HP-UX and AMXW dynamically loads the required
Eloquence and Oracle routines on startup. Suprtool will no longer give a warning on startup unless you run Suprtool with the –lw option. Suprtool requires two Eloquence libraries, namely: libimage3k.sl and libeqdb.sl. and
26
Legend: MPE version only HP-UX version only
one from Oracle, typically libclntsh.sl. The optional version that dynamically a third-party Image Replacement library needs to have the
ROBELLELIB_IMAGE variable set to the fully qualified path name of the replacement variable.
Suprtool for AMXW and Suprtool for HP-UX use two methods for dynamic loading. By default, Suprtool will use shl_load to load the necessary routines which will look in the directories defined in the
SHLIB_PATH. If you have the ROBELLE_DYN_LOAD variable set to
Y, then Suprtool will use dlopen, which will look at
LD_LIBRARY_PATH first when deciding where to look for the library files that it requires.
For example to insure that Suprtool resolves the library loads you can set the SHLIB_PATH (or LD_LIBRARY_PATH) system wide in your
/etc/profile file in the following manner:
export SHLIB_PATH=/opt/eloquence6/lib/pa11_32:/opt/oracle/lib
If you do not have the SHLIB_PATH or (LD_LIBRARY_PATH) variable set to a value where the libraries can be found, Suprtool will then try to load from their default names locations. The Oracle interface will first try to load libclntsh.so and then attempt to load libclntsh.sl from
$ORACLE_HOME/lib32/libclntsh.sl.
27
Legend: MPE version only HP-UX version only
डाउनलोड
जाहिरात