ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · web viewuser manual....

491
Suprtool 5.2 for HP-UX: User Manual by Robelle Solutions Technology Inc. Suprtool 5.2 for HP-UX User Manual · 1

Upload: others

Post on 09-Oct-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Suprtool 5.2 for HP-UX:

User Manual

by Robelle Solutions Technology Inc.

Suprtool 5.2 for HP-UX User Manual · 1

Page 2: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Program and manual copyright © 1981-2009 Robelle Solutions Technology Inc.

Permission is granted to reprint this document (but not for profit), provided that copyright notice is given.

Qedit and Suprtool are trademarks of Robelle Solutions Technology Inc. Oracle is a trademark of Oracle Corporation, Redwood City, California, USA. Other product and company names mentioned herein may be the trademarks of their respective owners.

Robelle Solutions Technology Inc.#372 - 7360 137 StreetSurrey, B.C. CanadaV3W 1A3

Phone: 604.501.2001Fax: 604.501.2003

E-mail: [email protected]: [email protected]: www.robelle.com

2 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 3: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Table of Contents

Suprtool 5.2 for HP-UX: 1

User Manual 1

Program and manual copyright © 1981-2009 Robelle Solutions Technology Inc. 2

Permission is granted to reprint this document (but not for profit), provided that copyright notice is given. 2

Phone: 604.501.2001 2

Table of Contents 3

Welcome to Suprtool 16Introduction...............................................................................................................................16Suprtool Components................................................................................................................16

STExport - Data Export Utility...................................................................................16Suprlink - Multidataset Access...................................................................................17

Documentation..........................................................................................................................17Notation.....................................................................................................................................17

Suprtool Version 5.2 19Highlights in HP-UX version 5.2..............................................................................................19Highlights in HP-UX version 5.1.02.........................................................................................19Highlights in AMXW version 5.2.............................................................................................20Highlights in AMXW version 5.1.02........................................................................................20

Installing Suprtool 23Overview...................................................................................................................................23Who Needs To Use These Instructions.....................................................................................23Instructions for HP-UX.............................................................................................................23Instructions for AMXW............................................................................................................23

Suprtool Roadmap for HP-UX 24Road Map to Suprtool on HP-UX.............................................................................................24

Suprtool 5.2 for HP-UX Table of Contents · 3

Page 4: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Suprtool for HP-UX....................................................................................................24Suprtool for HP-UX, with Dynamic Image loading...................................................24Suprtool for AMXW...................................................................................................24

Quick Start Guide for Suprtool 25How to Run Suprtool................................................................................................................25What is a Task?.........................................................................................................................25Copying Files............................................................................................................................26

Copying One File........................................................................................................26Appending to a File....................................................................................................26

Fields in Data Files...................................................................................................................26What is a Self-Describing File?..................................................................................26Creating an SD File....................................................................................................26Define Fields in a Data File........................................................................................26Create an SD File from a Data File............................................................................27

Repeating Commands...............................................................................................................27Repeating a Command................................................................................................27

Selecting Database Records......................................................................................................28Select All Records......................................................................................................28Look at the First Few Records....................................................................................28

Selecting by Criteria..................................................................................................................29Simple Criteria............................................................................................................29Complex Criteria........................................................................................................29String of Digits...........................................................................................................29

Selecting by Date......................................................................................................................29Select by Today's Date...............................................................................................30Select by Particular Date............................................................................................30Select by Year.............................................................................................................30Select Prior Month......................................................................................................30

Selecting by Lists of Values......................................................................................................31Finding Data Based on a List......................................................................................31Finding Data Based on a File......................................................................................31Finding Data Based on Another Table’s Criteria.......................................................32Finding Data in a Data File.........................................................................................32

Sorting Database Records.........................................................................................................32Sort Records................................................................................................................32Sort Records in Descending Order.............................................................................33Sort by Multiple Keys.................................................................................................33

Duplicate Records.....................................................................................................................33Report without Duplicate Records..............................................................................33Report Only the Duplicate Records............................................................................34Report Only the Unique Records................................................................................34Report Only the Duplicates and Their Originals........................................................35Deleting Duplicate Data File Records........................................................................35

Decimal Places..........................................................................................................................36Converting Numbers.................................................................................................................36Counts and Subtotals.................................................................................................................37

Count and Subtotal on Sort Keys................................................................................37Sort by Count or Subtotal...........................................................................................37Total by Field..............................................................................................................38Running Totals............................................................................................................38Running SubTotals.....................................................................................................38

Listing Records.........................................................................................................................39Changing the Output Record Format........................................................................................39Producing a Condensed Table Listing......................................................................................40

4 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 5: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Simple Reports..........................................................................................................................40Your First Report........................................................................................................40Column Headings.......................................................................................................41Printing Mailing Labels..............................................................................................41

Running Suprtool under HP-UX 43Running Suprtool......................................................................................................................43Configuring Different Shells.....................................................................................................43

Bourne and Korn Shells..............................................................................................43C Shell........................................................................................................................43

Setting Up a PATH for Suprtool...............................................................................................44Bourne and Korn Shells..............................................................................................44C Shell........................................................................................................................44

Dynamic Loading......................................................................................................................45Control Characters and stty.......................................................................................................46Suprmgr Configuration Files....................................................................................................46On-Line vs. Batch Access.........................................................................................................47Command Line Options............................................................................................................47

Initial Command Line: -ccmdstring...........................................................................47Default Outcount File Name: -oc..............................................................................47Exit with Verify: -v....................................................................................................48Combining -c and -v...................................................................................................48Loader Warnings........................................................................................................48

HP-UX Notes............................................................................................................................48Shell Commands.........................................................................................................48

Hardcoded File Names and ROBELLE Variable.....................................................................49ROBELLE Variable....................................................................................................49opt/robelle/suprmgr.....................................................................................................49opt/robelle/help/suprtool.............................................................................................49Outcount File..............................................................................................................49

Differences Between MPE and HP-UX....................................................................................50Record Length............................................................................................................50Line Feeds...................................................................................................................50Duplicate Output Files................................................................................................50Classic Reals...............................................................................................................50Input from Stdlist........................................................................................................51Missing Features.........................................................................................................51

Suprtool and AMXW 53What is AMXW........................................................................................................................53What is Suprtool for AMXW....................................................................................................53Running Suprtool......................................................................................................................53Symbolic Links and running Supramxw...................................................................................53Suprtool/AMXW.......................................................................................................................54

Form Command..........................................................................................................54Numrecs Command....................................................................................................54Output Command........................................................................................................54Temporary Files..........................................................................................................55Appending Records....................................................................................................55Table operations..........................................................................................................55Variable Substitution..................................................................................................55Set Commands............................................................................................................55

Command Details for AMXW 56

Suprtool 5.2 for HP-UX Table of Contents · 5

Page 6: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

AMXW......................................................................................................................................56Numrecs Command [N]...........................................................................................................57Set Commands..........................................................................................................................58

AMXW Externalsd.....................................................................................................58AMXW PerfWrite......................................................................................................58Filecode.......................................................................................................................58Squeeze.......................................................................................................................59

Suprtool Issues and Solutions 60A Suprtool Task........................................................................................................................60

Input Choices..............................................................................................................60Processing Selections..................................................................................................60Output Choices...........................................................................................................60

Large File Support....................................................................................................................61Suprtool and Allbase.................................................................................................................61

Data-Types..................................................................................................................61Date and Time Types..................................................................................................62Restrictions.................................................................................................................62

Suprtool and Oracle..................................................................................................................62Data-Types..................................................................................................................62Number Data-Type.....................................................................................................63Order By vs. Sort........................................................................................................63Restrictions.................................................................................................................63

SDUnix Utility..........................................................................................................................64Installation..................................................................................................................64SDUnix Parameters....................................................................................................65LF vs. NOLF...............................................................................................................65Examples.....................................................................................................................65Link vs. Query............................................................................................................66

Suprtool and Self-Describing Files...........................................................................................66Create an SD File from a Table..................................................................................66Create an SD File from a Data File............................................................................66SD Files as Input.........................................................................................................67Listing SD Files..........................................................................................................67Decimal Places and Date Formats..............................................................................67Extended Field Names................................................................................................67Restrictions of SD Files..............................................................................................68

Suprtool and Sorting Files.........................................................................................................68Suprtool and Personal Computers.............................................................................................68

Downloading to the PC...............................................................................................68Decimal Places............................................................................................................68Spreadsheets...............................................................................................................69

Suprtool and PowerHouse Applications...................................................................................69Suprtool with Quiz/QTP.............................................................................................69Step 1: Create a Subfile with Quiz.............................................................................69Step 2: Output Erase in Suprtool................................................................................70Step 3: Report with Quiz............................................................................................70Using QTP to Create Subfiles.....................................................................................70Creating Subfile with Script File................................................................................70Quiz: Generating Suprtool Commands.......................................................................71

Year 2000 Solutions with Suprtool...........................................................................................71What If I Have Four-Digit Years?..............................................................................71What does Set Date Cutoff do?..................................................................................72Stddate and Set Date Cutoff.......................................................................................72What does Set Date ForceCentury do?.......................................................................72

6 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 7: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

What If I Have Two-Digit Years?..............................................................................73What Is Wrong with Two-Digit Years?......................................................................73How Do $Today and $Date Work?............................................................................74Will Suprtool Generate an Error for Two-Digit Year Dates?.....................................74How Do I Use $Today and $Date with yymmdd Dates?...........................................74aammdd Date Format.................................................................................................75Invalid Dates...............................................................................................................75Can Suprtool Convert Two-Digit Years to Four Digits?............................................75Case 1: Converting a J2 Date from yymmdd to ccyymmdd......................................75Case 2: X6 yymmdd Data to X8 ccyymmdd.............................................................77Case 3: Different Date Formats X6 MMDDYY Data to X6 YYMMDD.................78Year 2000 Testing.......................................................................................................80

Performance Issues...................................................................................................................80Eloquence Performance..............................................................................................81Sort Performance........................................................................................................81Oracle Performance....................................................................................................81Analyzing Performance Data......................................................................................82

Variable Substitution.................................................................................................................82

Suprtool Commands 83General Notes............................................................................................................................83

Abbreviating...............................................................................................................83Uppercase or Lowercase.............................................................................................83Multiple Commands per Line.....................................................................................83Continuation...............................................................................................................84Comments on Command Lines..................................................................................84HP-UX Commands.....................................................................................................84Calculator....................................................................................................................85Control-Y Interrupt.....................................................................................................85

Add Command [Add]...............................................................................................................86Examples.....................................................................................................................86

Base Command [BA]...............................................................................................................87Before Command [C]...............................................................................................................89Chain Command [C]................................................................................................................91Clean Command [CL]..............................................................................................................93

Removing Bad Characters..........................................................................................93Define Command [D]...............................................................................................................95Delete Command [DEL]........................................................................................................100Do Command [DO]................................................................................................................102Duplicate Command [DU].....................................................................................................103Edit Command [ED]..............................................................................................................108Exit Command [E].................................................................................................................109Export Command [EXP]........................................................................................................111Extract Command [EXT].......................................................................................................112

Constants...................................................................................................................112Dates.........................................................................................................................114Range of Fields.........................................................................................................116Numeric Expressions................................................................................................117$SubTotal Function..................................................................................................119$Total Function.........................................................................................................119$Counter Function....................................................................................................119String Expressions....................................................................................................120Splitting Variable Length Strings.............................................................................121Cleaning your Data...................................................................................................122Un-printables............................................................................................................123

Suprtool 5.2 for HP-UX Table of Contents · 7

Page 8: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Clean Command Syntax...........................................................................................123Setting the Clean Character......................................................................................123Cleaning a Field........................................................................................................123Cleaning your data....................................................................................................124Extract from a Table.................................................................................................124Data Conversion.......................................................................................................125$Number Function....................................................................................................126Numeric to Byte Conversion....................................................................................127$Edit Function..........................................................................................................128Placeholders and Format Characters........................................................................128Byte-Type Formatting..............................................................................................128Z-placeholder for byte-fields....................................................................................129Overflow and limits..................................................................................................129Numeric field edit-masks..........................................................................................130Signs.........................................................................................................................130Decimal Places..........................................................................................................131Data and Edit mask:..................................................................................................131Currency and Dollar signs........................................................................................131Overflow and floating dollar....................................................................................132Set CurrencySymbol.................................................................................................132Overflow and limits..................................................................................................132Restrictions...............................................................................................................132

Form Command [F]...............................................................................................................135Get Command [G]..................................................................................................................138Help Command [H]................................................................................................................140If Command [IF]....................................................................................................................141

Expressions...............................................................................................................141Constants...................................................................................................................144Subscripts..................................................................................................................145Numeric Expressions................................................................................................146String Expressions....................................................................................................148Date Selection...........................................................................................................151Long Expressions......................................................................................................156

Input Command [I].................................................................................................................159Item Command [IT]...............................................................................................................161

Date Formats.............................................................................................................161Decimal Places..........................................................................................................164Notes.........................................................................................................................165

Key Command [K].................................................................................................................167Link Command [LIN]............................................................................................................169List Command [L]..................................................................................................................170

Format.......................................................................................................................170LaserJet Listings.......................................................................................................171Headings in Listings.................................................................................................172Simple Reports..........................................................................................................173List Device................................................................................................................174List File.....................................................................................................................174

Listredo Command [LISTREDO]..........................................................................................177Numrecs Command [N].........................................................................................................178Open Command [OP].............................................................................................................179

Remote Databases and Oracle Issues.......................................................................179Output Command [O]............................................................................................................180Put Command [P]...................................................................................................................185Q Command [Q].....................................................................................................................186Redo Command [REDO].......................................................................................................187Reset Command [R]...............................................................................................................190

8 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 9: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Select Command [SEL].........................................................................................................191Set Command [S]...................................................................................................................192

Allbase......................................................................................................................194Arithmetic.................................................................................................................194Baseclose..................................................................................................................194Blocksize...................................................................................................................194Buffer........................................................................................................................194CleanChar.................................................................................................................195CurrencySymbol.......................................................................................................195Date Cutoff...............................................................................................................195Date ForceCentury....................................................................................................196Date IfYY2000Error.................................................................................................196Date MapToPHDate8...............................................................................................197DecimalSymbol........................................................................................................197Defer.........................................................................................................................198DumpOnError...........................................................................................................198EditStopError............................................................................................................198Eofread......................................................................................................................198FastRead...................................................................................................................198Filecode.....................................................................................................................199Filename...................................................................................................................199Firstrec......................................................................................................................199Hints..........................................................................................................................199HPUXCmdErr “<string>”........................................................................................199Ifcheck......................................................................................................................200Ignore........................................................................................................................200InitExtents.................................................................................................................200ItemAbbreviateDate..................................................................................................200ItemLock...................................................................................................................201Interactive.................................................................................................................201LabelledTapeRewind................................................................................................201Limits........................................................................................................................202List............................................................................................................................202List Date....................................................................................................................202List PCL....................................................................................................................203List Time...................................................................................................................204List FormFeed...........................................................................................................204Lock..........................................................................................................................205MakeAbsent..............................................................................................................205NLS...........................................................................................................................205NumBug....................................................................................................................205Openmode.................................................................................................................206Oracle Rows..............................................................................................................206Oracle Integer...........................................................................................................206Oracle OpenFix.........................................................................................................207Oracle PassShift........................................................................................................207Oracle ZeroNull........................................................................................................207Pattern.......................................................................................................................207Prefetch.....................................................................................................................208Privmode...................................................................................................................208Progress.....................................................................................................................208Prompt.......................................................................................................................209RealMap....................................................................................................................209Recover.....................................................................................................................209Redo..........................................................................................................................209SDExtname...............................................................................................................210

Suprtool 5.2 for HP-UX Table of Contents · 9

Page 10: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Sortfast......................................................................................................................211Squeeze.....................................................................................................................211Statistics....................................................................................................................211Subsystem.................................................................................................................211Suspend.....................................................................................................................211ThousandSymbol......................................................................................................211Userlabels.................................................................................................................211Varsub.......................................................................................................................211VarsubCompat..........................................................................................................212VarsubDebug............................................................................................................212Warnings...................................................................................................................212

Sort Command [SO]...............................................................................................................213Table Command [TA].............................................................................................................215

Adding Individual Values to a Table........................................................................215Adding Values from a File.......................................................................................216

Total Command [T]................................................................................................................219Update Command [UP]..........................................................................................................221Use Command [U].................................................................................................................222Userpause Command [USER]...............................................................................................224Verify Command [V].............................................................................................................225Xeq Command [X].................................................................................................................226Calculator Command [=]........................................................................................................227

Suprtool Errors and Warnings 230Two Types Of Messages.........................................................................................................230Errors.......................................................................................................................................230Warnings.................................................................................................................................231

Welcome to STExport 232Welcome to STExport.............................................................................................................232Installing STExport.................................................................................................................232

Accessing STExport 233How To Run STExport...........................................................................................................233How to Xeq an STExport Task...............................................................................................233Hardcoded File Names and ROBELLE Variable...................................................................233

ROBELLE Variable..................................................................................................233Using STExport in Batch........................................................................................................234Command Line Options..........................................................................................................234

Default Outcount File Name: -oc............................................................................234Variable Substitution -v............................................................................................234

Introduction to STExport 235Importing Data........................................................................................................................235Input File.................................................................................................................................235Data-Types..............................................................................................................................235Formatting Commands............................................................................................................236Commands..............................................................................................................................236Performance Considerations...................................................................................................236

STExport Commands 237General Notes..........................................................................................................................237

10 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 11: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Abbreviating.............................................................................................................237Uppercase or Lowercase...........................................................................................237Comments on Command Lines................................................................................237HP-UX Commands...................................................................................................237File Names................................................................................................................238Calculator..................................................................................................................238Control-Y..................................................................................................................238

Before Command [B].............................................................................................................239Clean Command [CL]............................................................................................................241

Removing Bad Characters........................................................................................241Columns Command [C].........................................................................................................242Date Command [DA].............................................................................................................243Decimal Command [DEC].....................................................................................................245Delimiter Command [DE]......................................................................................................246Do Command [DO]................................................................................................................247Escape Command [ES]..........................................................................................................248Exit Command [E].................................................................................................................249

Exit Abort [EA]........................................................................................................249Exit Suspend [ES].....................................................................................................249Exit Xeq [EX]...........................................................................................................249

Floating Command [FL]........................................................................................................251Form Command [F]...............................................................................................................252Heading Command [HEA].....................................................................................................253Help Command [H]................................................................................................................255HTML Command [HT]..........................................................................................................256

Dynamic Web Pages.................................................................................................258Web Server...............................................................................................................258Shell Script................................................................................................................259Perl Script.................................................................................................................261CGI Script.................................................................................................................262

Input Command [I].................................................................................................................264Listredo Command [LISTREDO]..........................................................................................265Output Command [O]............................................................................................................266Quote Command [Q]..............................................................................................................267Redo Command [REDO].......................................................................................................268Reset Command [R]...............................................................................................................269Set Command [S]...................................................................................................................270

CleanChar.................................................................................................................270Mapped.....................................................................................................................270Redo..........................................................................................................................270Statistics....................................................................................................................271Varsub.......................................................................................................................271VarsubCompat..........................................................................................................272VarsubDebug............................................................................................................272Warnings...................................................................................................................272Xmltagchar...............................................................................................................273ZonedFix...................................................................................................................273

Sign Command [SI]...............................................................................................................274Spaces Command [SP]...........................................................................................................275Use Command [U].................................................................................................................276Verify Command [V].............................................................................................................277Xeq Command [X].................................................................................................................278XML Command [XML].........................................................................................................279Zero Command [Z]................................................................................................................282

Suprtool 5.2 for HP-UX Table of Contents · 11

Page 12: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Example of STExport Output 283Example..................................................................................................................................283

Limits Within STExport 287Maximums..............................................................................................................................287

Welcome to Dbedit 288Introduction.............................................................................................................................288Restrictions..............................................................................................................................288Functions of Dbedit.................................................................................................................288Performance of Dbedit............................................................................................................289Field Lists................................................................................................................................289Database Locking....................................................................................................................290Decimal Points........................................................................................................................290Critical-Item Update...............................................................................................................291

Dbedit Commands 292General Notes..........................................................................................................................292

Abbreviating.............................................................................................................292Uppercase or Lowercase...........................................................................................292Continuation.............................................................................................................292Control-Y..................................................................................................................293Comments on Command Lines................................................................................293OS Commands..........................................................................................................293Calculator..................................................................................................................293Example Database....................................................................................................294Prompting for Search Criteria...................................................................................294

Command Parameters.............................................................................................................294File Parameter...........................................................................................................294Option Parameter......................................................................................................295Numeric-Value Option.............................................................................................295All Option.................................................................................................................295Key Option................................................................................................................296Limit Option.............................................................................................................296Related Option..........................................................................................................296Under Option............................................................................................................297Updatekey Option.....................................................................................................297

Subcommands.........................................................................................................................297Add Command [A].................................................................................................................299Before Command [B].............................................................................................................300Change Command [C]...........................................................................................................302Delete Command [D].............................................................................................................303Do Command [DO]................................................................................................................304Exit Command [E].................................................................................................................305File Command [F]..................................................................................................................306Form Command [FO].............................................................................................................307Help Command [H]................................................................................................................308List Command [L]..................................................................................................................309Listredo Command [LISTREDO]..........................................................................................310Modify Command [M]...........................................................................................................311Q Command [Q].....................................................................................................................312Redo Command [REDO].......................................................................................................313Set Command [S]...................................................................................................................314

12 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 13: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

LP..............................................................................................................................314Prompt.......................................................................................................................314Quiet.........................................................................................................................314Reset.........................................................................................................................314Underline..................................................................................................................315Verify........................................................................................................................315

Use Command [U].................................................................................................................316Verify Command [V].............................................................................................................317

Welcome to Suprlink 318Welcome to Suprlink..............................................................................................................318Terminology and HP-UX........................................................................................................318Notation...................................................................................................................................318Installing Suprlink...................................................................................................................319Hardcoded File Names and ROBELLE Variable...................................................................319

ROBELLE Variable..................................................................................................319

Accessing Suprlink 321How To Run Suprlink.............................................................................................................321How to Xeq a Suprlink Task...................................................................................................321Suprtool Link Command.........................................................................................................321Exit with Verify......................................................................................................................321Using Suprlink in Batch..........................................................................................................322Command Line Options..........................................................................................................322

Default Outcount File Name: -oc............................................................................322Variable Substitution -v............................................................................................322

Introduction to Suprlink 323How Report Programs Work...................................................................................................323Input Files...............................................................................................................................323Link Files................................................................................................................................323Output Files.............................................................................................................................324Sort Keys.................................................................................................................................324Selection Logic.......................................................................................................................324A Link Example......................................................................................................................324A Join Example.......................................................................................................................325Performance Considerations...................................................................................................326Another Example....................................................................................................................327Illegal Digits............................................................................................................................327Selecting Non-Matches...........................................................................................................328Suprlink with Quiz/QTP.........................................................................................................328

Suprlink Commands 331General Notes..........................................................................................................................331

Abbreviating.............................................................................................................331Uppercase or Lowercase...........................................................................................331Continuation.............................................................................................................331Comments on Command Lines................................................................................332HP-UX Commands...................................................................................................332File Names................................................................................................................332Calculator..................................................................................................................332Control-Y..................................................................................................................332

Before Command [B].............................................................................................................334

Suprtool 5.2 for HP-UX Table of Contents · 13

Page 14: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Do Command [DO]................................................................................................................336Exit Command [E].................................................................................................................337

Exit Abort [EA]........................................................................................................337Exit Suspend [ES].....................................................................................................337Exit Xeq [EX]...........................................................................................................337

Form Command [F]...............................................................................................................338Help Command [H]................................................................................................................340Input Command [I].................................................................................................................341Join Command [J]..................................................................................................................342Link Command [L]................................................................................................................344Listredo Command [LISTREDO]..........................................................................................346Output Command [O]............................................................................................................347Redo Command [REDO].......................................................................................................348Reset Command [R]...............................................................................................................349Set Command [S]...................................................................................................................350

Mapped.....................................................................................................................350Redo..........................................................................................................................350Statistics....................................................................................................................351Varsub.......................................................................................................................351VarsubCompat..........................................................................................................351VarsubDebug............................................................................................................352

Use Command [U].................................................................................................................353Verify Command [V].............................................................................................................354Xeq Command [X].................................................................................................................355

Example Suprlink Output 357Example..................................................................................................................................357

Limits Within Suprlink 359Maximums..............................................................................................................................359

Welcome to Calling Suprtool 361Calling Suprtool......................................................................................................................361Suprtool2 Routine...................................................................................................................361Importance of the Exit Command...........................................................................................361Environment Variables...........................................................................................................362Control Record........................................................................................................................362

Examples of Calling Suprtool 365Copying the Examples............................................................................................................365

COBOL Example......................................................................................................365C Sample...................................................................................................................368

Installing the Suprtool2 Interface 370Installing..................................................................................................................................370

AMXW.....................................................................................................................371

Suprtool2 Error Messages 372Error Numbers.........................................................................................................................372

Glossary of Terms 373

14 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 15: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Commonly-used Terms...........................................................................................................373Special Characters...................................................................................................................377

Index 381

Suprtool 5.2 for HP-UX · 15

Page 16: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Welcome to Suprtool

IntroductionWelcome to version 5.2 of Suprtool -- the HP-UX handyman for Eloquence, Oracle and Allbase databases and fixed-length data files. Use Suprtool to quickly select and sort data records. Combine multiple data files using Suprlink/UX. Use STExport to convert fields in a self-describing input file into an output file that can be imported into other applications.

The Suprtool commands are:Add EDit ITem Q UseBAse Exit Key REDO USERpauseBefore EXPort LINk Reset VerifyChain EXTract List SELect XeqClean Form LISTREDO Set :MPE or HP-UX

commandDefine Get Numrecs SOrt =expressionDELete Help OPen TAbleDO IF Output TotalDuplicate Input Put UPdate

The minimum abbreviation of each command is shown in capital letters.

Suprtool ComponentsThe Suprtool package consists not only of Suprtool, but also of other programs that perform useful database functions. These other programs are STExport and Suprlink.

STExport - Data Export UtilitySTExport converts fields in a self-describing input file into an output file that can be imported into different applications.

Use STExport to produce a formatted output file that can be used to import data into databases and applications.

Other databases have different requirements for the format of input data. You will have to experiment with the various STExport formatting options to find a format that your particular database tool accepts.

16 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 17: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Suprlink - Multidataset AccessSuprlink is a program that works with Suprtool to add "multidataset" capability to Suprtool. Suprlink is not a set of callable routines. To use it, you must :run Suprlink.Pub.Robelle or use Suprtool's Link command.

Rather than take the regular path to multiple datasets -- random retrieval via Eloquence keys -- we have chosen to follow a different path: fast serial extracts plus a very efficient merge.

To understand what Suprlink does, think of the process of writing a report. Your report program (written in COBOL, RPG, PowerHouse, or some other language) hunts all over the database with DBFIND and DBGET to collect your data.

It would be faster if the report program could just read a sorted disc file with a big record containing all the data necessary for the report, and this is Suprlink's function. Suprtool can extract the desired fields from the desired records of the sales detail dataset and put them in a disc file. Then Suprtool can extract the desired fields from the customer master dataset and write them to a second disc file. If Suprtool sorts both files by customer, Suprlink can "link" them together, producing a third file whose composite record consists of the related fields from both files. This file is just what we need to feed into the report program. For example, a sales report program might read a disc file whose records consist of sales transactions plus customer information. This file has been sorted by customer number and date. If there are several sales for the same customer, the customer information is just repeated in each record. The report program reads the records, checks for level breaks, and formats and prints the records.

DocumentationThe user manual contains the full description of all the Suprtool suite of products including Dbedit, Suprlink, STExport, Dbedit and Suprtool2, as well as usage tips and commands for each. The manuals are up-to-date with all the latest changes. To see only the changes in the latest version, see the "What's New" section of the manual, or see the change notice.

You can download our manuals and Change Notices in various formats and even order printed (hardcopy) manuals from our web site at:

http://www.robelle.com/library/manuals/.

NotationThe Suprtool documentation uses a common notation in describing all commands. Here is a sample command definition:

EXTRACT field (subscript)] [=value] [,...]

1. UPPERcase letters - literal symbols to be used in the command as they appear (e.g., EXTRACT).

2. Lowercase, underlined or italic - "variables" to be filled in by the user (example: field). Each such "variable" is defined elsewhere in terms of literal symbols (consult the index). In the help file, underlining and italics are not available and variables appear simply in lowercase.

3. Brackets - enclose optional fields (example: [(subscript)]).

Suprtool 5.2 for HP-UX Welcome to Suprtool · 17

Page 18: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

4. Braces - enclose comments in examples. For example, >INPUT ACTREC {input from a data file}. Braces can be used for comments in actual Suprtool commands.

5. Up lines - separate alternatives from which you select (example: Set Ignore [On|Off]); sometimes, the alternatives are shown listed on several lines.

6. Dot-dot-dot (...) - indicates that the variable may be repeated many times in the command.

7. Other special characters - literal symbols that must appear in the command as they are shown in the format (example: the comma above). Some commas in Suprtool are optional.

In examples, there is an implied carriage return at the end of each line.

18 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 19: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Suprtool Version 5.2

Highlights in HP-UX version 5.2· STExport now has Set ZonedFix On, this setting can be used to zero

out any zoned fields that were unable to be converted from zoned to byte and typically have a "?" in the result. This is often caused by hidden characters or bad data.

· Suprtool now has Set Oracle PassShift On (default) or Off to turn off the upshift of a password. This is to accomodate Oracle 11 which will allow for case-sensitive passwords.

· The Add command in Suprtool for HP-UX would cause a subsequent task to fail in some cases.

· The Add command in Suprtool for HP-UX would fail if the target was a small record.

· Suprtool, STExport, Suprlink and Suprcall are all available as a Native Itanium binaries.

· Suprtool now has the command set list formfeed on, which will put a formfeed at the end of the file when using the list command with the file option. This allows multiple reports to be written to one file and have them line up on a page break.

· Suprtools $edit function now accepts the colon character as a delimiter character in order for edit masks for time fields.

· Suprtools if command would not allow a field name starting with SPECIAL if it was on the right side of the equation.

· The Base command would not pass the database name to be parsed if it was preceded by a command without any parameters. (Itanium Build 2)

Highlights in HP-UX version 5.1.02· Support for extended names in Suprtool and Suprlink.

· STExport did not handle files with 256 fields in an SD file.

· Suprtool would not close the previous database when a base command is issued with a database name specified.

Suprtool 5.2 for HP-UX Suprtool Version 5.2 · 19

Page 20: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

· Suprtool can now execute the if and extract expression $stddate($days(a) + 10) in one task.

· Suprtool now supports stand-alone Z type TPI keys or Eloquence indexes.

· Reset Output did not correctly re-initialize the Output file name.

· Set Stat on did not look at the current value properly when parsing.

· Suprtool now allows you to specify the “lp” program by setting the variable ROBELLE_LP.

· If the data item used in data portion of a $lookup function was 8 bytes or greater in length, type display or byte, the if command would fail with an arithmetic stack error.

· Set VarsubCompat did not work in STExport and the default was set to on.

· Set VarsubDebug has been added to print the line after variable substitution has occurred.

· Suprlink and STExport can now be run with –cv argument to turn on the VarsubCompat Flag.

· STExport XML command did not convert compound items (2)..(n) properly.

· Multiple literal compares now work in the IF command.

· If $lookup can now return the data portion loaded into a table to use in a comparison.

· Suprtool for HP-UX would fail with a DBGET failure on a directed read if fastread was on and if the record number specified did not have a record in the slot previous to the start record number.

Highlights in AMXW version 5.2· STExport now has Set ZonedFix On, this setting can be used to zero

out any zoned fields that were unable to be converted from zoned to byte and typically have a "?" in the result. This is often caused by hidden characters or bad data.

· Suprtool now has Set Oracle PassShift On (default) or Off to turn off the upshift of a password. This is to accomodate Oracle 11 which will allow for case-sensitive passwords.

· The Add command in Suprtool for HP-UX would cause a subsequent task to fail in some cases.

· The Add command in Suprtool for HP-UX would fail if the target was a small record.

· Suprtool, STExport, Suprlink and Suprcall are all available as a Native Itanium binaries.

20 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 21: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Highlights in AMXW version 5.1.02· Total $file did not work properly in Suprtool for AMXW.

· KSAM input files were not opened with ;shr;lock.

· STExport did not handle files with 256 fields in an SD file.

· Suprtool for AMXW would not close the previously opened database when a new base command was issued with database name.

· Suprtool can now execute the if and extract expression $stddate($days(a) + 10) in one task.

· Suprtool for AMXW would abort when trying to get file system error messages from AMXW intrinsics.

· Suprtool now supports stand alone zoned decimal TPI-keys.

· Suprtool for AMXW build version had a conflict with the Dateline intrinsic.

· Suprlink and STExport had an issue detecting the AMXW shell with some versions of AMXW.

· Suprtool, STExport and Suprlink all set the outcount variables by default just like they do on MPE.

· Set UserLabels on now works in Suprtool for AMXW just like it does in the MPE version.

· Set Filecode 0 will work if Set UserLabels is set to off.

· Reset Output would not properly reset the output filename in HP-UX and AMXW versions of Suprtool.

· Set stat on did not look at the correct flag when being parsed.

· Suprtool would fail with Fgetinfo failure when output is to stdlist (out *) and a sort is specified.

· Suprtool for AMXW would use the file size stored in the SD label as opposed to the actual physical file size that AMXW uses.

· Suprtool would not abort nor return an error message when the AMXW FPOINT intrinsic would fail when trying to append to an output file greater than 2Gb. Suprtool now aborts with an error message and Speedware has fixed FPOINT to work with files > 2Gb.

· If the data item used in data portion of a $lookup function was 8 bytes or greater in length, type display or byte, the if command would fail with an arithmetic stack error.

· Set VarsubCompat did not work in STExport and the default was set to on.

· Set VarsubDebug has been added to print the line after variable substitution has occurred.

· Suprlink and STExport can now be run with –cv argument to turn on the VarsubCompat Flag.

· Error handling has been improved when creating or opening large files in STExport and Suprlink. (AMXW only)

Suprtool 5.2 for HP-UX Suprtool Version 5.2 · 21

Page 22: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

· STExport XML command did not convert compound items (2)..(n) properly.

· Multiple literal compares now work in the if command.

· If $lookup can now return the data portion loaded into a table to use in a comparison.

· Suprtool for HP-UX would fail with a DBGET failure on a directed read if fastread was on and if the record number specified did not have a record in the slot previous to the start record number.

· Suprtool2 would fail to detect the ROBSUPR variable even if set in some cases.

22 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 23: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Installing Suprtool

OverviewWe have two types of Installations, Tape and Download. We provide links to the Installation instructions on our web site for each type of Install.

Who Needs To Use These InstructionsThe system manager should use the following installation instructions to install Suprtool/UX. No one can be using Suprtool/UX during the installation. The installation should only take a few minutes.

Instructions for HP-UXIf you received a production release tape from Robelle, then you can install using the instructions on this web page:

http://www.robelle.com/support/install/tape/sxprod.html

If you downloaded the Suprtool production release from our web site then the instructions can be found here for the ftp download method:

http://www.robelle.com/downloads/install-sxprod-ftp.html

and here for the WRQ download method:

http://www.robelle.com/downloads/install-sxprod-wrq.html

Instructions for AMXWSuprtool for AMXW is not available on tape, but can be easily downloaded from our web site. The instructions for the production release install can be found here:

http://www.robelle.com/downloads/install-amxwprod.html

Suprtool 5.2 for HP-UX Installing Suprtool · 23

Page 24: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Suprtool Roadmap for HP-UX

Road Map to Suprtool on HP-UXOver the past year, we have created several new versions and options for Suprtool on HP-UX. This next section describes the various options

Suprtool for HP-UXThis is the original version of Suprtool that supports Eloquence, Oracle and Allbase databases. Suprtool for HP-UX comes in two flavours, one in PA_RISC and one in Native Itanium. The PA_RISC version can run on both platforms, however the Native Itanium version runs strictly on Itanium machines.

The Native Itanium version of Suprtool does not include the DBedit module. The Native Itanium version is a full port of all Robelle software from SPLash to C, using Allegros Splash to C technology and some new underlying supporting C code.

Suprtool for HP-UX, with Dynamic Image loadingThe dynamic load version of Suprtool for HP-UX dynamically loads IMAGE intrinsics from a single shared library. This allows Suprtool for HP-UX to work with products like IMAXSOFT, which builds IMAGE replacement intrinsics to work with other databases like Oracle and DB2.

Suprtool for AMXWSuprtool for AMXW is a new product that works with Speedwares AMXW emulation product and comes in many flavours including Itanium, for any questions on Suprtool for AMXW on PA_RISC or Itanium please e-mail [email protected].

24 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 25: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Quick Start Guide for Suprtool

How to Run SuprtoolUse the following command to access Suprtool:

/opt/robelle/bin/suprtool

SUPRTOOL/Copyright Robelle Solutions Technology Inc. 1981-2009.(Version 5.2) >

Suprtool prints its version number and the current time right after a banner. Suprtool then prompts with ">". Press Return after typing each command. For example, if you type the help command:

>help

Suprtool prints some help text and a keyword list. Type a keyword or press Return to leave Help.

To exit Suprtool, type "Exit" at the Suprtool prompt.

>exit

What is a Task?Tasks are the building blocks with which Suprtool helps you to solve data processing problems. In a task, Suprtool reads information from a file or database, selects and processes some information, and writes out the result. You can visualize a Suprtool task like this:

Suprtoolselects andprocesses

InputRecords

OutputRecords

The examples that follow all consist of Suprtool tasks. Simple solutions require only one task. Complex solutions consist of several tasks, often with the output of one task becoming the input for the next task.

Suprtool 5.2 for HP-UX Quick Start Guide for Suprtool · 25

Page 26: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Copying Files

Copying One FileUse the Input command to specify a data file.

>input file1,reclen 80, nolf>output result>xeq

The Output command creates the file called "result", which is a copy of the input file.

Appending to a FileTo append to an existing file, use the Append option in the Output command.

>input file2, reclen 80, nolf>output result,append>xeq

Fields in Data Files

What is a Self-Describing File?A self-describing (SD) file is actually a pair of files, one with data and the other with field information. These files have the advantage of behaving like data files, which can provide field information to Suprtool without you having to Define all the fields. The Input command is also simpler because there is no need for either the Reclen or the LF parameters.

Creating an SD FileTo create an SD file, use the Link option in the Output command.

>select * from sales>output result,link>xeq

Now the data file "result" has the same field names as the Sales table. Suprtool can read this data file and know about the fields automatically.

>input result>if sales_total>20000 and product_price<5000>output custlist>xeq

Define Fields in a Data FileA regular data file does not have any field information associated with it. If you need to work with the fields in a data file, you need to tell Suprtool about the fields using the Define command. For example, say you have a data file with lines that look like this:

12345678John Rutherford <32>

98765432Catherine Smith <29>

26 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 27: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

| | | |

Account First name Last name Age

8-byte 12-byte 16-byte 2-byte integer

Use these Define commands to tell Suprtool about the fields:

>input datafile, reclen 38, lf>define account, 1, 8, byte>define first_name, 9, 12, byte>define last_name, 21, 16, byte>define age, 37, 2, int | | | | field name | Length | Start Data-type position

Now you can use the field names "account", "first_name", "last_name", and "age" to refer to the corresponding parts of the line, just as if this were a database record.

>input datafile>define ...>if age>65>ext account, last_name>output result>xeq

Create an SD File from a Data FileTo create an SD file from a data file, follow these steps:

1. Define the fields that you want to include in the SD file.

2. Extract the fields in the order you want.

3. Use the Link option in the Output command to create the SD file.

>input datafile, reclen 38, lf>define account, 1, 1, byte>define first_name, 9, 12, byte>define last_name, 21, 16, byte>define age, 37, 2, int

>extract account, age, first_name, last_name

>output result,link>xeq

Repeating Commands

Repeating a CommandUse the Listredo command to see a list of your most recent commands. Use the Do command to repeat a command, or use the Redo command to modify a command before repeating it.

Suprtool 5.2 for HP-UX Quick Start Guide for Suprtool · 27

Page 28: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>listredo {20 most recent commands}>listredo input {most recent Input commands}

>input result>...>xeq>do input {repeat previous Input command}

>input result>if quantity > 10000>...>redo if {modify previous If command, then repeat}

If you have used two commands that begin with the same letter, you have to be careful when repeating those commands. Make sure you use enough letters to identify each command distinctly from the other. In the following example, if you wish to repeat the Input command instead of the If command, you need to use "do i s" instead of just "do i".

>i somefile>if <expression>>...>xeq>do i s {repeats previous Input command}

Selecting Database RecordsThese examples show you how to get records from an Oracle table. It assumes you have opened the database with the Open command. The results are written to a data file called "result", which can be read either by a program or by a report writer.

/opt/robelle/bin/suprtool>open oracle demo reader

Select All RecordsThis example extracts all the records from the table. Note that we didn't specify any selection criteria, so Suprtool selects all the records.

>select * from sales {input table}>output result {output file}>xeq {Xeq command performs the task}

Look at the First Few RecordsIf you want to look at the first few records of a dataset, use the Numrecs command. This command tells Suprtool to extract at most the number of records specified. Then, instead of sending the result to a file, send it to the screen with "output *,ascii". The example shows you how to look at the first 10 records in your dataset.

28 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 29: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>select * from sales>numrecs 10 {first 10 records}>output *,ascii {output to screen, format numbers}>xeq

Selecting by Criteria

Simple CriteriaTo tell Suprtool to choose records based on certain criteria, you can either use any valid SQL command (e.g., select, where), or you can select all the records and use an If command. In these two examples Suprtool extracts all records with a sales_total value greater than 20000 from the Sales table. Both tasks produce identical results, but one way may be faster than the other.

>select * from sales>if sales_total > 20000>output result>xeq

Complex CriteriaTo choose records using more complex criteria, combine several simple criteria using AND, OR, NOT, and parentheses. In this example Suprtool extracts all records that have a sales_total value greater than 20000 and a product_price value less than 5000 from the d-sales dataset.

>select * from sales>if sales_total>20000 and product_price<5000>output result>xeq

String of DigitsIf you have a byte-type field that consists entirely of digits, and you want to use this field as a numeric field, you need to define a new display field on top of the existing field. For example, suppose your data looks like the following, where the customer account number is stored in the 8-digit byte-type field at the start of the record:

20476789...rest of customer record...

To find all customers with an account greater than 20470000, you would do the following:

>select * from table>define accountnum, account, 8, display>if accountnum > 20470000>output result>xeq

Selecting by DateThe following section on dates does not apply to SQL columns, only to defined fields and SD fields. Disc files usually store dates as numeric or character fields; you can use the Define command to isolate the field.

Suprtool 5.2 for HP-UX Quick Start Guide for Suprtool · 29

Page 30: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Before Suprtool can use a date field, it has to know the format of a particular date field. Use the Item command to specify the format. For example, to tell Suprtool that the item purch_date is a date field with a format of yyyymmdd (e.g., 20040319), you would use:

>define purch_date, 11,8 {8 bytes, starts in byte 11}>item purch_date, date, yyyymmdd {date format}

In the following date examples, we show the Define and Item commands in each example. In practice, however, you only need to use these commands once per date field, not once per task.

Select by Today's DateFor this example, select all the sales records whose purchase date is today. Note the use of $today in the If command to indicate today's date.

>input saledata,reclen 70,nolf>define purch_date, 11,8>item purch_date,date,yyyymmdd>if purch_date = $today {select today's date}>output result>xeq

Other tricks with $today

>if purch_date = $today(-1) {yesterday}>if purch_date = $today(+1) {tomorrow}

Select by Particular DateTo specify a particular date, use the $date function in the If command. The $date function has the form $date(year /month /day). This example selects all the sales transactions for August 12, 2000.

>input saledata,reclen 70,nolf>define purch_date, 11,8>item purch_date,date,yyyymmdd>if purch_date = $date(2000/08/12)>output result>xeq

Select by YearSuppose we want to select all the sales transactions for 2000. Suprtool does not have a short-hand for specifying "everything in that year". To specify an entire year, use a date range from January 1st to December 31st.>input saledata,reclen 70,nolf>define purch_date, 11,8>item purch_date,date,yyyymmdd>if purch_date >= $date(2000/01/01) and & purch_date <= $date(2000/12/31)>output result>xeq

Select Prior MonthIn the $date function, use a * to indicate the current year, month, or day. Similarly, a *-1 means the previous year, month, or day. For this example, select all the sales

30 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 31: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

transactions for the prior month. Note the use of the special keywords "first" and "last" to indicate the first and last day of the month.

>input saledata,reclen 70,nolf>define purch_date, 11,8>select * from sales>item purch_date,date,yyyymmdd>if purch_date >= $date(*/*-1/first) and & purch_date <= $date(*/*-1/last)>output result>xeq

Selecting by Lists of ValuesSometimes you want to find records based on criteria contained in another file or table.

Finding Data Based on a ListSuppose we want to find all orders for the customers "1234", "9876", and "5555." We simply use a list of values after the equal sign in the If command. A match is made if a customer matches any one of the values in the list.

>select * from order_details>if cust_no = "1234", "9876", "5555">output orders>xeq

If we wanted to find orders for all customers except "1234", "9876", and "5555", we would simply change the equal sign in the If command to a not-equal sign. A match is made if a customer does not match any values in the list.

>select * from order_details>if cust_no <> "1234", "9876", "5555">output orders>xeq

Finding Data Based on a FileIf you have a large list of values in a file, you can load them into Suprtool and select data based on this list. First use the Table command to load values from an external file into a table. Then use the $lookup function of the If command to match data to the table.

Suppose our list is in a self-describing file called Custlist. We create a program-temporary table called cust_table. Note that this is not the same as an Oracle table.

>select * from order_details>table cust_table, cust_no, file, custlist>if $lookup(cust_table, cust_no)>output orders>xeq

If you want to find all customers not on the list, just negate the If condition by simply putting "not" in front of the $lookup.

Suprtool 5.2 for HP-UX Quick Start Guide for Suprtool · 31

Page 32: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>if not $lookup(cust_table, cust_no)

Finding Data Based on Another Table’s CriteriaSometimes you need to find data from one table based on conditions from another table. This is a typical example: you want to find all of the pending orders for those customers whose accounts receivable balance is 0.

First we find the customers with an AR balance of 0, and extract their customer numbers to a file.

>select * from receivables>if ar_balance = 0>ext cust_no>output custlist,link>xeq

Now we can find information by loading a file of customer numbers into a table and then applying the $lookup feature.

>select * from order_details>table cust_table, cust_no, file, custlist>if status="PENDING" and $lookup(cust_table,cust_no)>output orders>xeq

Finding Data in a Data FileSo far, the examples have looked up data from a table. If you want to look up information in a data file, you need to tell Suprtool about the fields. Use the Define command to do this.

The following example gives you some idea of the byte-size of one kind of record in a data file.

John Smith 12345678

Anna-May Richardson 98765432

12-bytes 16-bytes 8-bytes

If you want to look up customers based on a list of customer numbers in the self-describing file Custlist, use the following task. Notice how the start position and number of bytes is entered into the Define command. This defines the position within the input file, not the table file.

>input flatfile, reclen 36, nolf>define cust_no, 29, 8, byte>table cust_table, cust_no, file, custlist>if $lookup(cust_table, cust_no)>output result>xeq

Sorting Database Records

Sort RecordsTo tell Suprtool to sort table records, you can either use any valid SQL command (e.g., select, order by), or you can select the records and use a Sort command. Here are two examples where Suprtool extracts all records from the Sales table into a data

32 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 33: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

file called "result". The records are sorted by the field cust_account. Both tasks produce identical results, but one way may be faster than the other.

Sorting in the Select command:

>select * from sales order by cust_account>output result>xeq

Sorting in the Sort command:

>select * from sales>sort cust_account>output result>xeq

Sort Records in Descending OrderThis example extracts all records from the Sales table into a data file called "result". The records are sorted by the field sales_total in descending order (i.e., show highest totals first). Use the Desc option in the Sort command to do this.

>select * from sales>sort sales_total desc {descending order}>output result>xeq

Sort by Multiple KeysThis example extracts all records from the Sales table into a data file called "result". The records are sorted by the field cust_account, then by sales_total in descending order. Use two Sort commands to do this because the Sort command only accepts one field at a time.

>select * from sales {input}>sort cust_account {first sort key}>sort sales_total desc {second sort key}>output result {output}>xeq

Duplicate RecordsIn the following examples, the key field is in the first four bytes of the record. "Duplicate-ness" is based on records having the same key value. In any group of records with the same key value, the first record is considered to be the "original", and the rest are considered to be the "duplicates".

Report without Duplicate RecordsThis is an example of filtering out duplicated records (the original remains). This is done by using the None option of the Duplicate command.

Input Result

1111 a 1111 a

2222 b 2222 b

2222 c 3333 e

2222 d

Suprtool 5.2 for HP-UX Quick Start Guide for Suprtool · 33

Page 34: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

3333 e

>select * from table>sort keyfield>dup none keys>output result>xeq

Report Only the Duplicate RecordsThis is an example of keeping only the duplicated records (the original is not kept). This example is the opposite of the previous example. Use the Only option of the Duplicate command to do this.

Input Result

1111 a 2222 c

2222 b 2222 d

2222 c

2222 d

3333 e

>select * from table>sort keyfield>dup only keys>output result>xeq

Report Only the Unique RecordsThis example shows how to report only those records without duplicates. That is, if the records have duplicates, both the originals and their duplicates are omitted from the report.

Input Result

1111 a 1111 a

2222 b 3333 e

2222 c

2222 d

3333 e

You have to use two Suprtool tasks to accomplish this. The first task creates an intermediate file Dupfile that contains the keys of the duplicate records. The second task creates the desired output file Result that contains only the unique records.

34 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 35: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>select * from table>sort keyfield>extract keyfield>dup only keys>output dupfile>xeq

>get dataset>table dup-table, keyfield, sorted, dupfile>if not $lookup(dup-table, keyfield)>output result>xeq

Report Only the Duplicates and Their OriginalsThis performs the opposite function to the one outlined above. It keeps only the duplicates and their originals.

Input Result

1111 a 2222 b

2222 b 2222 c

2222 c 2222 d

2222 d

3333 e

Once again, you have to use two Suprtool tasks to accomplish this. The first task creates an intermediate file Dupfile that contains the keys of the duplicate records. The second task creates the output file Result that contains only duplicate files and their originals.

>select * from table>sort keyfield>extract keyfield>dup only keys>output dupfile, link>xeq

>select * from table>table dup_table, keyfield, sorted, dupfile>if $lookup(dup_table, keyfield)>output result>xeq

Deleting Duplicate Data File RecordsThe following tasks read the file Datafile and create two new files. The file named "result" does not have duplicate records. The other file named "archive" has only the duplicate records.

Task 1: Identify which records to delete.

Suprtool 5.2 for HP-UX Quick Start Guide for Suprtool · 35

Page 36: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>input datafile,reclen 38, nolf>define key1,1,8>define key2,13,12

>define rec,1,38 {length of the record}>ext rec>sort key1>sort key2>dup only keys>out dupfile, link>xeq

Task 2: Write records to archive.

>input datafile, reclen 38, nolf>table duptab, rec, sorted, dupfile, hold>if $lookup(duptab, rec)>output archive>xeq

Task 3: Delete the records.

>input datafile>if not $lookup(duptab, rec)>output result>xeq

Decimal PlacesData in disc files often has an implied number of decimal places. For example, dollar amounts usually have two implied decimal places for the cents. In this case, the number stored is scaled by a factor of one hundred (e.g., you would enter 10000 to represent $100.00).

>input saledata, reclen 70, nolf>def total_sales, 40, integer>if total_sales > 99900 {find sales > $999}>out result>xeq

You can use Suprtool's Item command to identify defined fields that have an implied number of decimal places. Once you do this, you can then enter regular, unscaled numbers. For example, to enter five cents, use 0.05; to enter $100.00, use 100. If a field is a dollar and cents amount scaled by 100, use the following to tell Suprtool about the decimal place:

>item total_sales, DECIMAL, 2

With the Item command, the previous example becomes more understandable:>input saledata, reclen 70, nolf>def total_sales, 40, integer>item total_sales, decimal, 2>if total_sales > 999 {find sales > $999}>out result>xeq

Converting NumbersThere are several ways to convert binary numbers (e.g. I2, P8) into human-readable ASCII form. You can use STExport's Output,ASCII or Output,DISPLAY if you want to convert all numbers.

36 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 37: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

If you want to convert only some of your numeric fields, you can use Suprtool's numeric conversion feature to convert the binary fields to display fields.

define mynumber,1,6,displayget datasetext some-fields...ext mynumber = binary-numberoutput filenamexeq

Note that this technique also works for converting a number from one numeric type to another numeric type.

You can also convert from binary numbers to a formatted byte field using the $edit function: >in mysdfile >def a,1,10,byte >def b,1,10,byte >ext a=$edit(int-field,"$$,$$$.99-") >ext b=$edit(int-field,"999999999-") >list >xeq >IN FILE1SD.NEIL.GREEN (0) >OUT $NULL (0) A = $11.11- B = 000001111-

Counts and Subtotals

Count and Subtotal on Sort KeysThis example counts the number of sales transactions for each customer and produces the total sales for each customer. We use the Count and Total options of the Duplicate command. Note that we made the output file self-describing so we can easily work with it later.>input transactions {self-describing file}>ext cust_account>sort cust_account {need to sort by key}>dup none keys count total sales_total>list standard>out result, link>xeq

The output file contains three fields. The first field is the cust_account that we extracted. Suprtool created two new fields at the end of each output record: st-count and st-total-1. St-count contains the number of times each cust_account occurred, while st-total-1 contains the total sales for each cust_account.

Sort by Count or SubtotalWhen Suprtool counts or subtotals, the output is sorted according to the key fields. If you want your output file to be sorted by the count or by a total, you must process the output file with a second task. The following example sorts the previous file of totals by ST-COUNT. We choose a descending sort sequence, so that we can see first the customers with the largest number of orders.

Suprtool 5.2 for HP-UX Quick Start Guide for Suprtool · 37

Page 38: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>input result {input from previous task}>sort st-count, desc {highest counts appear first}>list standard {produce a simple report}>xeq

Total by FieldIf you want to get a single total for a field, without caring about subtotals on sort breaks, you can use the Total command. Total prints out the result on $stdlist. For example, to compute the total sales value for 2000 transactions, use these commands:

>select * from sales>if purch_date>=000101 and purch_date<=001231>total sales_total>output $null>xeq

Running TotalsYou can get a running total on a field using the $total function.. The target data must be a packed field with 28 digits, in order to help avoid overflow issues. A sample use of the total function could be:

>def mytotal,1,14,packed >get orders >ext mytotal = $total(sales-amount) >xeq

Running SubTotalsSuprtool has the ability to keep a running subtotal for any numeric field based on a given sort key. The target data must be a packed field with 28 digits, in order to help avoid overflow issues.

A sample use of the $subtotal function could be:

>def mytotal,1,14,packed >get orders >sort order-number >ext order-number >ext part-number >ext description >ext sales-amount >ext mytotal = $subtotal(sales-amount,order-number) >out sales,link >xeq

This would result in a file containing a running subtotal in the field mytotal for a given order-number. You could then generate a simple report with the simple Suprtool commands: >in sales >list standard >xeq

The basic syntax for the $subtotal function in the extract command is:

extract targetfield = $subtotal(field,sort-field)

You must specify the sort command before referencing the sort-field in the $subtotal function. You can subtotal up to ten fields per task.

38 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 39: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Listing RecordsYou can print selected input records either formatted or with the Octal, Hex, Decimal, or Character representations. To dump all sales records with a negative amount, use these commands:

>select * from sales>if sales_total < 0>list lp>xeq

This finds the entries that meet the selection criteria and prints them to the default line printer, showing column names and column values converted to ASCII. If you suspect that your data is bad, you can dump the records in Octal/Char format instead:

>select * from sales>if sales_total < 0>list octal,char>xeq

If you want the listing in column format, use List Standard:

>select * from sales>if sales_total < 0>list standard lp>xeq

Since there are no file equations on HP-UX and symbolic link do not always function the way you would hope. We have added a new keyword to the List command to make it easier to have the list output go to a file and to also append to and existing file. The File option takes the next parameter as being the filename: >in test/file1sd >list stan file myslist >xeq

If the file myslist exists it will be over-written, unless you specify the Append option. If you specify the append option the new report will be added to the file.

So if you want to incorporate multiple reports you just need to do the following: >in test/file1sd >list stan file myslist >xeq >in test/file2sd >list stan file myslist append >xeq

Changing the Output Record FormatYou can change the output file record format by using the Extract command. The Extract command causes Suprtool to assemble Output records by stringing together fields extracted from Input records. You would use the following to extract two of the nine fields from the customer records:

>select * from customer {input from a table}>extract cust_account {extract the key value and}>extract credit_rating { one other field}>output out1 {output file will have two fields}>xeq

You can easily insert data into the middle of a record, again using the Extract command. Define the first and second halves of the record as two big chunks. Now Extract the first part, note the constant you wish to insert, then Extract the second part.

Suprtool 5.2 for HP-UX Quick Start Guide for Suprtool · 39

Page 40: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>input myfile, reclen 95, nolf {95 bytes wide}>define part1,1,60,byte {first 60 bytes}>define part2,61,35,byte {remaining 35}>extract part1, "constant", part2 {extract an 8-byte constant}>output newfile {103 bytes now}>xeq

Producing a Condensed Table ListingWhen debugging test databases, it is often desirable to produce a condensed listing of a table on $stdlist. The following example combines the Extract command with the ASCII output option (i.e., all binary and packed-decimal data is converted into readable ASCII characters). For readability, each data value is prefixed with an abbreviated column name. This listing is more compact than the one produced by the List command.

>select * from customer>extract "Account=",cust_account," ">extract "C/R=",credit_rating>output *,ascii {* implies $stdlist}>xeq

The output would look like:

Account=04598921 C/R= 500000Account=44657844 C/R= 2000000Account=98753198 C/R= 300000

Simple ReportsYou can produce simple reports with Suprtool's List command. You select the records for the report with the If command and the fields for the report with the Extract command. Reports can include running headings with the date, title, and page number and an optional line of column headings. Suprtool can produce default titles and headings.

>select * from customer>extract cust-account>extract credit-rating>list standard>xeq

The output would look like this:

Jan 17, 2000 11:59 Page 1

CUST_ACCO CREDIT_RATING

4598921 5000.0044657844 20000.0098753198 3000.00

Your First ReportOur report selects all customers in California, sorts the records by city, and reports on the city, account number, and name of each California customer:

40 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 41: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>select * from customer {input table}>if state = "CA" {California customers}>sort city {sort by city name}>extract city {city first on each line}>extract cust_account {followed by account#}>extract name_first {and first name}>extract name_last {and finally last name}>list standard {produce a quick report}>xeq

These commands produce a report with four columns. The title consists of the date and page number. The column headings are the name of each column that we extracted.

Column HeadingsColumn headings default to uppercase field names. The names are truncated if they are longer than the field itself. One space is inserted between fields.

Suprtool does not automatically align user-specified headings with the data columns. We suggest specifying heading strings with the same length as the fields they represent, while taking into account the space between the data columns.

In our example, we enter one column heading per line (using Suprtool's continuation character "&"):

>list standard,heading & {----+----1----+----2} "City " & {field is X12} "Account " & {field is Z8} "First Name " & {field is X10} "Last Name" {field is X16}

We included one space between fields. Note that an extra space was needed for the

Account

heading (it is an 8-digit field, but we used 10 characters). Because cust-account is a zoned-decimal field, an extra space is required for the sign.

Printing Mailing LabelsYou can print mailing labels by combining the Extract command with the List Oneperline command. We assume that each mailing label starts with two blank lines, followed by the customer name and address, followed by another blank line. The Suprtool commands to produce the labels are as follows:

>select * from customer {input customers}>extract " " {first field}>extract " " {second field}>extract customer_name {name first}>extract street_address(1) {three lines of address}>extract street_address(2)>extract street_address(3)>extract " " {last blank field}>list oneperline, noname, noskip, norec>xeq

The

extract " "

Suprtool 5.2 for HP-UX Quick Start Guide for Suprtool · 41

Page 42: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

line creates a single field that consists of a blank space. Each of these blank fields results in a blank line on our mailing labels, since the List command puts one field on each output line.

If you want to combine two fields on one line, you would first have to create an output file with the combined fields and use this file as input to List Oneperline.

42 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 43: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Running Suprtool under HP-UX

Running SuprtoolTo run Suprtool for HP-UX, type this command:

/opt/robelle/bin/suprtool

Suprtool. Copyright Robelle Solutions Technology Inc. 1981-2009.(Version 5.2) Type ? for help.>

Suprtool prints its version number and prompts with ">". Press Return after each command you type. For example, if you type

>help

Suprtool prints some Help text and a keyword list. Type a keyword for more specific information, or press Return to leave Help.

Configuring Different ShellsWhen you log in to HP-UX, a shell program is invoked. This program interprets commands, executes them, and controls command execution. To make configuration changes, you have to know which shell you are using and what files are automatically executed.

Bourne and Korn ShellsThe Bourne and Korn shells execute the file /etc/profile when you log in to HP-UX. Then they look for a .profile file in your home directory. If it exists, the file is executed. If you use SAM to add new users, the file /etc/d.profile is automatically copied to the home group of the new user. If you want to make global changes to the commands executed at login time, you should change two files:

/etc/profile {always executed at login time}/etc/d.profile {default .profile for new users}

C ShellThe C shell executes the file /etc/csh.login when you log in to HP-UX. First it looks for the .login file in your home directory. If the file exists, it is executed. Then the C shell executes the .cshrc file in your home directory (also executed any time you invoke a new copy of /bin/csh). If you use SAM to add new users, the files

Suprtool 5.2 for HP-UX Running Suprtool under HP-UX · 43

Page 44: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

/etc/d.login and /etc/d.cshrc are automatically copied to the home group of the new user. If you want to make global changes to the commands executed at login time, you should change these files:

/etc/csh.login {always executed at login time}/etc/d.login {default .login for new users}/etc/d.cshrc {default .cshrc for new users}

Setting Up a PATH for SuprtoolYou can invoke Suprtool with the command:

/opt/robelle/bin/suprtool

If you just type

suprtool

to invoke Suprtool/UX, you must either add /opt/robelle/bin to your PATH or copy /opt/robelle/bin/suprtool to a directory that is currently on your PATH. Similarly, the man pages for Suprtool are in /opt/robelle\/man\/man1\/suprtool.1. To make the man pages available to everyone, you can either add /opt/robelle/man to your MANPATH or you can copy the man pages to a directory that is currently on your MANPATH.

Bourne and Korn ShellsSee Configuring Different Shells (above) for a discussion on the files that are automatically executed by the Bourne and Korn shells. The easiest way to change the two PATHs for all the users on your HP-UX machine is to logon as root, and add these two lines to the file /etc/profile after any existing PATH or MANPATH statements:

PATH=$PATH:/opt/robelle/binMANPATH=$MANPATH:/opt/robelle/man

Remember to delete any PATH or MANPATH settings in /etc/d.profile so that new users do not override your changes. You also have to warn existing Bourne and Korn shell users to change the .profile file in their home directories.

C ShellSee Configuring Different Shells (above) for a discussion on the files that are automatically executed by the C shell. The easiest way to change the two PATHs for all the users on your HP-UX machine is to logon as root, and add these two lines to the file /etc/csh.login after any existing PATH or MANPATH statements:

set path ($path /opt/robelle/bin)setenv MANPATH "$MANPATH":/opt/robelle/man

Remember to delete any PATH or MANPATH settings in both /etc/d.login and /etc/d.cshrc so that new users do not override your changes. You also have to warn existing C shell users to change their .login and .cshrc files in their home directories.

44 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 45: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Dynamic LoadingSuprtool for HP-UX and AMXW dynamically loads the required Eloquence and Oracle routines on startup. Suprtool requires two Eloquence libraries, namely: libimage3k.sl and libeqdb.sl. and one from Oracle, typically libclntsh.sl. This library will have other dependencies, and this varies by version of Oracle. The Oracle library is only loaded if you have the Oracle option enabled. In this version if any of the dynamic loading of Eloquence or Oracle fails, Suprtool will continue.

The Suprtool Image Replacement version on HP-UX, which dynamically loads a third-parties Image Replacement intrinsics, will stop if the intrinsics fail to load.

See the Suprtool for HP-UX Roadmap section of this manual.

By default, Suprtool will first look at SHLIB_PATH and uses shl_load call on HP-UX to locate and load the libraries for Eloquence and Oracle.

PA_RISC and ItaniumThere are two types of machines that HP has that run HP-UX, the older machines are based on the PA_RISC chip and the new machines use the Itanium (and Itanium 2 chips). Any program that runs on Itanium must utilize libraries that match its own program type. Therefore if a PA_RISC program runs on Itanium and looks for a library, it must load the PA_RISC version of the libraries that it needs and conversely an Itanium program must load the libraries specific to its type.

How to Tell what Machine I am on?There are many ways to tell what kind of machine you are on, here are a couple:uname -mgetconf MACHINE_MODEL

In each case the Itanium machine will typically say ia64 somewhere in the result of the above two commands. PA_RISC machines typically say "9000" somewhere in the string.

What is the Program File?Since there are two types of machines there are also at least two types of program files. Suprtool is primarily either PA_RISC 1.1 or ELF-32 / IA64 which is also known as Itanium. To determine the type of program file you can use the file command:

Itaniumfile suprtoolsuprtool: ELF-32 executable object file - IA64

PA_RISCfile suprtoolsuprtool: PA-RISC1.1 executable dynamically linked -not stripped

The PA_RISC binary can run on both platforms but you need to have PA_RISC libraries for Eloquence or Oracle if you are using the Oracle module. An Itanium binary will not run on a PA_RISC machine and will fail with "cannot execute".

PA_RISC LoadingSuprtool by default looks in the libraries in any of the directories named in SHLIB_PATH. For example to insure that Suprtool resolves the library loads you

Suprtool 5.2 for HP-UX Running Suprtool under HP-UX · 45

Page 46: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

can set the SHLIB_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 variable set to a value where the libraries can be found, Suprtool will then try to load from their default names locations. For Eloquence the default location is :/opt/eloquence6/lib/pa11_32.

The Oracle interface will first try to load libclntsh.so and then attempt to load libclntsh.sl from $ORACLE_HOME/lib32/libclntsh.sl.

Itanium LoadingYou can change Suprtool to pay attention to LD_LIBRARY_PATH and use dlopen to load libraries, you can set the environment variable:

export ROBELLE_DYN_LOAD =Y.

It is generally advisable to use DLOPEN or the ROBELLE_DYN_LOAD option when using the Itanium version. The PA_RISC version of Suprtool can use either type of loading, the default or the dlopen method invoked with ROBELLE_DYN_LOAD.

Printing Loader WarningsWhen loading Oracle libraries Suprtool would report warnings on startup if it failed to load the Oracle libraries. Suprtool by default no longer prints these warnings. To check if your libraries were loaded you can run Suprtool with the –lw option: ./suprtool -lw

Control Characters and sttyMost HP-UX users have Control-D configured as the end-of-file character, and Control-C as the interrupt character. If you use Robelle-style modify, you must reassign Control-D to a different control character. If you are familiar with MPE, you may want to assign Control-Y as your interrupt character. A standard shell configuration file (.profile for Bourne and Korn shells, and .login for the C shell) usually contains a line like:

stty erase "^H" kill "^U" intr "^C" eof "^D" swtch "^Z"

To change both the end-of-file and interrupt characters, you should change the "intr" and "eof" control keys as follows:

stty erase "^H" kill "^U" intr "^Y" eof "^E" swtch "^Z"

Note that many programs require an end-of-file signal. Many introductory books on UNIX assume that Control-D signifies the end-of-file. Once you have changed the control character, remember to use Control-E for the end-of-file (at least Control-E is easy to remember since end-of-file starts with the letter "E").

Suprmgr Configuration FilesWhen you run Suprtool, it automatically "uses" this configuration files if it exists:

46 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 47: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

/opt/robelle/suprmgr

The system manager usually creates /opt/robelle/suprmgr, and puts Suprtool commands in it to set Suprtool options. To check the options for your site, examine this configuration file.

On-Line vs. Batch AccessYou normally run Suprtool as an on-line session. You type Suprtool commands on your terminal, and Suprtool prints responses on your terminal. If you redirect stdin or stdout, Suprtool assumes that it is in batch.

Suprtool in batch is almost identical to Suprtool on-line, except for answering questions. When Suprtool asks a question in batch, it does not expect an answer from stdin because no one is there to answer. Suprtool assumes that you want your batch task to complete, so it always selects the option that completes the command successfully. This is normally a "yes" answer, as in "yes, purge the file". Suprtool prints the question on stdout, as well as the answer that it has selected for you.

Command Line OptionsYou can invoke Suprtool/UX with various options. The syntax for invoking Suprtool/UX is

suprtool [-cv]

Initial Command Line: -ccmdstringYou can specify commands by using the -c option followed by the actual commands. There must be no space between the -c and the command list.

If there is a space within the command, the whole command must be enclosed in single or double quotation marks; otherwise, the quotation marks are optional. Here are some examples:

suprtool -c"use usefile"suprtool -c"set prompt $"

Default Outcount File Name: -ocIf you want to know how many records Suprtool has processed, use the -oc option. This option sets the file name for outcount to ".stoutcount". After a successful task, Suprtool writes the number of output records to the .stoutcount file. You can then use this file in shell scripts to check for specific record counts.

For example, suppose that you want to check for at least ten records from an Oracle database. You would write a shell script like:

Suprtool 5.2 for HP-UX Running Suprtool under HP-UX · 47

Page 48: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

#!/bin/sh## Select records from an Oracle table and check that there# are at least ten.

suprtool -oc << !EODopen oracle scott tigerselect * from empif sal > 1000.00output /dev/nullexit!EODif [ `cat .stoutcount` -ge 10 ]; then echo "More than 10 records found"fi

Exit with Verify: -vSome users inadvertently Exit from Suprtool by entering the Exit command instead of Xeq. To prompt for Exit approval, use the -v option.

suprtool -v>eOkay to exit [no]:>

Combining -c and -vYou can combine both the -c and -v options with the following command:

suprtool -c"use usefile" -v

Loader WarningsSuprtool by default does not print loader warnings. These are errors or problems when Suprtool starts up. Suprtool will attempt to find the Eloquence libraries and if configured, the Oracle libraries. You may use both, none or one of these libraries, so these warning/errors may be perfectly valid for your site. If you want to see the loader warnings you can run Suprtool with the –lw option:

suprtool -lw

HP-UX NotesThis section describes Suprtool/UX features that interact with the HP-UX environment.

Shell CommandsYou can execute shell commands by typing them anywhere you type a Suprtool command. If a command is both a shell and Suprtool command, you must precede the shell command by an exclamation mark (!) or a colon (:). Shell commands are executed by your default shell (the one configured in /etc/passwd for your user name).

48 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 49: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

$suprtool>whoami {these 3 commands are identical}>!whoami>:whoami

>set ... {does Suprtool's Set command}>!set ... {does HP-UX's Set command}

Shell commands are executed by a child copy of your shell. Child shells cannot change environment variables in the parent's environment. To change the value of an environment variable, you must first exit Suprtool.

Hardcoded File Names and ROBELLE VariableSome file names are hardcoded into Suprtool. This section describes the hardcoded file names that Suprtool/UX may need. Suprtool will normally look for files in the /opt/robelle directory unless you set the ROBELLE variable.

ROBELLE VariableNormally Suprtool looks files in the /opt/robelle directory. If you move Suprtool you must set the ROBELLE variable.

export ROBELLE="/users/robelle"

/opt/robelle/suprmgrThis is an optional file that is designed to contain configuration commands. You cannot change this file name. If you move Suprtool/UX to a different directory you must set the ROBELLE variable so Suprtool may find this file.

For example, if you move Suprtool to the /users/robelle directory you must set the ROBELLE variable in the following manner:

export ROBELLE="/users/robelle"

You can then put your suprmgr file in the /users/robelle directory.

/opt/robelle/help/suprtoolThis is the name of the Suprtool/UX Help file. You can override this name by using Set Filename Help or set the ROBELLE variable as outlined previously.

/set filename help /usr/local/help/suprtool

Outcount FileIf you want to automatically check the number of output records that Suprtool produced, you must produce an outcount file. This file contains a string with the number of output records that Suprtool processed.

By default, no outcount file is produced. If you invoke Suprtool/UX with the "-oc" option, Suprtool writes the number of output records to a file called ".stoutcount." Use Set Filename Outcount to specify your own file name for the output count.

If you add Set Filename Outcount to the Suprmgr file, every successful invocation of Suprtool/UX produces a file. While these files are small, they may clutter up a busy system so that is why the default file name is none.

Suprtool 5.2 for HP-UX Running Suprtool under HP-UX · 49

Page 50: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Differences Between MPE and HP-UXWe have tried to make the MPE and HP-UX versions of Suprtool as compatible as possible. This section describes how Suprtool/UX is different from Suprtool/MPE.

Record LengthOn MPE, Suprtool can obtain the record length of a file. There is no concept of record length on HP-UX because a file consists of a string of bytes. In Suprtool/UX, there are two ways to determine the record length.

1. Specify the record length with the Rec parameter of the Input command.

2. Use self-describing files.

If the specified record size is incorrect, Suprtool/UX cannot verify it. The most common symptom of an incorrect specification in size is an offset of one or more characters in each field.

Line FeedsIn MPE, there is no separator between records in a file. In HP-UX, there may not be a separator, or there may be a line feed between each record. For Suprtool to correctly read a data file, it must know whether the line feeds are present. You can specify whether or not a file has line feeds via the LF or NOLF options in the Input command.

Suprtool and STExport allow control over whether or not line feeds will be written to the output file or not. For details please see the Output Commands for both Suprtool and STExport.

Duplicate Output FilesIf the output file already exists (and you haven't requested the Erase or Append option), Suprtool has to decide what to do. This is how Suprtool/UX handles duplicate output files:

1. In Suprtool/UX, the duplicate output file processing takes place at the beginning of a task (in Suprtool/MPE it occurs at the end).

2. If Suprtool/UX is in batch, it purges any existing file with the same file name (Suprtool/MPE chooses a new output file name of the form OutputNN). If the Suprtool/UX task is on-line, it prompts the user to purge the file.

3. When Suprtool/UX purges a data file, it always deletes any associated .sd file, even if the output option is not Query or Link.

Classic RealsSuprtool/UX does not support Classic real numbers (real or long). If you are porting data files from MPE to HP-UX, you should first convert any Classic floating point numbers to their IEEE floating point equivalents. You can do this by using the Extract command on Suprtool/MPE.

50 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 51: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

:run suprtool.pub.robelle>base sample>get customer>define ieee-credit-rating,1,4,ieee>extract cust-no>extract name-first>extract name-last>extract ieee-credit-rating = credit-rating>out mpefile>xeq

The Classic and IEEE floating point formats are not identical. Be sure to check the IEEE values after converting them from Classic floating point.

Eloquence still allows for a schema to use “R” type items, but internally they are stored as IEEE. Suprtool and STExport will just map the real and long data types to their respective IEEE data types. Suprlink does not need to map these data items as it does not support Real, Long or IEEE key values. You can turn this mapping off with Set RealMap Off, but you should not need this option.

Define CommandSuprtool for HP-UX will not allow you to define a real type item. Although Suprtool can map “R” items in SD files and in Eloquence datasets, we do not allow the creation of real or longs using the define command.

Input from StdlistIn Suprtool/MPE, "input *" means read the input data from the stdin input device. This is usually a job stream, and data is terminated by an !EOD symbol.

Suprtool/UX does not support reading data from stdin (via Input * or any other method). If you need to create temporary data in the middle of a script, it is easy to use a temporary file. For example, the following script creates a temporary file, writes three lines of data to it, then uses this file as input to Suprtool/UX. At the end of the script we make sure that we remove the temporary file that we created.

#!/bin/sh

datafile=`mktemp`

echo "1234567 Line 1" >> $datafileecho "2345678 Line 2" >> $datafileecho "3456789 Line 3" >> $datafile

suprtool << !EODinput $datafile,rec 14,lfdefine key ,1,7define line ,8,7extract keyextract linelist standardexit!EOD

rm $datafile

Missing FeaturesThe following Suprtool features on MPE are currently not available in Suprtool/UX:

· Extracting a range of fields from an SQL database

Suprtool 5.2 for HP-UX Running Suprtool under HP-UX · 51

Page 52: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

· Export command (STExport exists as a separate program)

· Link command (Suprlink exists as a separate program)

· Table Command with the File option requires that the file being loaded is self-describing.

· Out= option of the Listredo command

· Output Ask, Num,Key, and Num,Query

· Output Temp (There are no temporary files in HP-UX)

52 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 53: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Suprtool and AMXW

What is AMXWAutomated Migration to uniX and Windows is a complete tool designed to migrate HP e3000 Cobol, SPL, C, FORTRAN, Pascal and Protos application environments to the HP9000, Integrity Itanium, Windows, Linux, Sun or AIX platforms. This product from Speedware is commonly referred to as AMXW.

What is Suprtool for AMXWSuprtool for AMXW is a hybrid of Suprtool for HP-UX that uses the AMXW file system intrinsics, shell commands and CI support such that customers applications require little or no changes as part of the migration process.

Currently Suprtool for AMXW is only available on HP-UX.

Running SuprtoolSuprtool for AMXW can be run from the standard HP-UX prompt but primarily it is meant to run under the AMXW shell.

Symbolic Links and running SupramxwFor AMXW version 8.05.01 Build5 and greater you can install Suprtool for AMXW in a more MPE like manner, the below instructions rely on the fact that you have installed the software in the usual Robelle location of /opt/robelle/bin.

You can change the location of this installation, but the path cannot exceed 40 characters or so. You will need to create a 'group' and 'account' called PUB and ROBELLE - just like on the 3000.

You will then need to add a link to all of the suprtool object files.

There are 3 objects...supamxw, stexamxw and linkamxw.

 1.  Position yourself in the PUB.ROBELLE directory.

     cd $NLROOTDIR/ROBELLE/PUB

2. Make the links.  Make sure that your umask is set accordingly so that others will have access to these links...with read / execute access.

Suprtool 5.2 for HP-UX Suprtool and AMXW · 53

Page 54: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

    ln -s /opt/robelle/bin/supramxw suprtool    ln -s /opt/robelle/bin/linkamxw suprlink    ln -s /opt/robelle/bin/stexamxw stexport    ln -s /opt/robelle/bin/supramxw SUPRTOOL    ln -s /opt/robelle/bin/linkamxw SUPRLINK    ln -s /opt/robelle/bin/stexamxw STEXPORT

3.  Make sure that your HPPATH variable contains a refererence to PUB.ROBELLE.

    SETVAR HPPATH "!HPPATH,PUB.ROBELLE" 

 You will be able to run suprtool through amxw using:

 suprtool

SUPRTOOL

RUN SUPRTOOL.PUB.ROBELLE

Suprtool/AMXWSuprtool for AMXW is based on the code for Suprtool for HP-UX. For the most part the areas of Suprtool for AMXW that uses the AMXW “MPE” intrinsics related to file operations. Following are some of the exceptions and improvements to make Suprtool for HP-UX more MPE like and some of the key exceptions that are not.

Form CommandThe Flimit and the Eof is now displayed at the end of the form command of a self-describing file:>form xyz File: xyz (SD Version B.00.00) Entry: Offset CUSTNO X6 1 MATCHCODE X10 7 NAME1 X32 17 NAME2 X32 49 NAME3 X32 81 STREET X32 113 ZIPCITY X32 145 PHONE X18 177 TURNOVER 3E4 195 SALESAREA X6 219 Limit: 1455 EOF: 1179 Entry Length: 224 Blocking: 1

Numrecs Command Since AMXW supports the concept of File Limits Suprtool for AMXW the NUMRECS command is supported.

Output CommandWhile the Output command parsing is the same for AMXW version as it is the HP-UX version, the lf option does not come into effect for files created by Suprtool for AMXW. The same applies to STExport and Suprlink as well.

54 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 55: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Temporary FilesSuprtool for AMXW supports temporary files in all of the necessary commands within Suprtool. It will open temporary files with the input command and generate temp files when created by the Output command and/or Total command. The same applies to STExport and Suprlink as well.

Appending RecordsSuprtool for AMXW will check to see if there is room in the file that you are appending to, just like the MPE version. Therefore you may see the error message: Error : No room to append records

Table operationsSuprtool for AMXW uses the HP-UX version of the code for memory mapped files. This means that Suprtool for AMXW currently has a limitation of a total of 500 Mb for files.

Variable SubstitutionSuprtool for AMXW supports two types of variable substitution. The first being the MPE-like variables that are availabe in the AMXW shell. Suprtool for AMXW will first attempt to resolve these variables first and then resolve an environment variables that are left set in the standard HP-UX manner. The same rules apply with Set Varsub on and Set VarsubCompat on.

There is one issue with Suprtool for AMXW variable substitution that is different than Variable Substitution on MPE. Varsub on MPE is done via a low-level MPE routine, however, since this is not available Suprtool must do something different that is as close to the MPE version as possible. So Suprtool surronds a given line in quotes and resolves the variable(s) by calling AMXW routines in a way that resolves the variables. The issue is however, that if you mix quotes (typically If command and Extract command), the variable substitution will fail and only part of the line will be parsed. Therefore it is advisable not to mix quotes in this situation.

Set CommandsSome Set commands that do not work in Suprtool for HP-UX do work in Suprtool for AMXW. These are documented in the following section along with some AMXW specific commands.

Suprtool 5.2 for HP-UX Suprtool and AMXW · 55

Page 56: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Command Details for AMXW

AMXWThe following section contains the details typically from the MPE manual that are specific to Suprtool for AMXW and not Suprtool for HP-UX.

56 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 57: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Numrecs Command [N]Specify the size of the input file (for tape files), output file (for datasets), and the sort scratch file.

NUMRECS size | percentage%

(default: size=10,000 or EOF of input source)

ParametersWhen you know that you are selecting a small subset of the entire input source, use the Numrecs command to reduce the size of the sort scratch file and, if required, the size of the output file. If you select more than size entries, Suprtool prints a warning message, and ignores the rest of the input records. However, the output file will have the records that were selected. Use a percent sign (%) to specify the Numrecs as a percentage of the input file size. The percentage can range from 1 to 500.

Using Numrecs for Tape FilesThe Numrecs command is required to read more than 10,000 records from a tape file. Suppose you want to read a tape file with 30,000 records. You would use the Numrecs command to increase the size of the output file:

>:file t;dev=tape {define tape file}>input *t {specify Suprtool input}>numrecs 30000 {make room for 30000 records}>output out2 {output file will have room for}>xeq { 30000 records}

Reducing File SizesSuppose that the d-sales dataset contains 100,000 entries, but you use the If command to select 15% of the entries. We would specify 15 as the percentage on the Numrecs command to reduce the size of the sort scratch file and the output file:

>get d-sales {specify input}>numrecs 15% {specify 15000 as file size}>if sales-qty<100 {select a subset of d-sales}>sort cust-account {sort using the dataset path}>output out2 {output file will have room for}>xeq { 15000 records}

MPE Files vs. DatasetsWhen you specify a source of records using the Input command (as opposed to reading a dataset using the Get or Chain command), Suprtool attempts to duplicate all of the input file's attributes in the output file. This includes the file limit. For this reason, the Numrecs value is ignored if the output file limit is smaller than the input file limit. Numrecs is still useful when reading MPE files to reduce the size of the sort scratch file.

Appending to FilesWhen you want to create a file that you can append to later, you need to use both the Numrecs command and the Set Squeeze Off command.

Suprtool 5.2 for HP-UX Command Details for AMXW · 57

Page 58: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>get d-sales>numrecs 200% {output file will have extra room}>set squeeze off {reserve room between EOF and LIMIT}>output dsale>xeq...>get d-history>output dsale,append {dsale has room for appending}>xeq

Set Commands

AMXW Externalsd SET AMXW External sd [ ON | OFF]

(Default: OFF)

Suprtool for AMXW now has an option to create the external self-describing file as well as updating the “label” information that AMXW keeps track of. This was done to help some other applications work in conjunction with AMXW and Suprtool. The setting you need to use is:

Set AMXW Externalsd on

The default for this setting is off.

While the External SD is written to in this case for the other Application Suprtool for AMXW will ignore the External SD file when reading these files.

AMXW PerfWriteSET AMXW PerfWrite [ ON | OFF ]

(Default: OFF)

Suprtool for AMXW now has an option to do multi-record writes to the output file, which has given as much as a 10 times performance increase.

Set AMXW PerfWrite On

The default for this setting is off. AMXW version 8.05.01 Build 13 or higher is required for this to work.

FilecodeSET FILECODE [ number ]

(Initially: 0; Default: no change)

When Suprtool writes to an old file (Output,Append and Output,Erase are the only cases), it leaves the filecode of the output file unchanged. When Suprtool creates a new file with the Output,Ask or Output,Query option, it gives the file a special filecode (1071 and 1084 respectively). When the input file has a nonzero filecode, Suprtool carries that filecode over to the new output file. See "Output Command [O]" on page 180 for details on Output options such as Ask, Erase, and Query. To convert a self-describing file into a non-SD file, see "Suprtool and Self-Describing Files" on page 66.

58 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 59: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

In all other cases, new files created by Suprtool have a default filecode of zero. You can specify an alternate default filecode using Set Filecode.

Specifying Set Filecode forces Suprtool to create the output file with a specific filecode whenever it was going to use zero. To be effective, this Set command should be added to the Suprmgr file. To configure Suprtool to use the filecode 222 on output files, you would add this line to your Suprmgr file:

set filecode 222

This feature is useful for MPEX users who wish to manage Suprtool output files. For example, to find all of the Suprtool output files you would do the following:

:run mpex.pub.vesoft%!listf @.@.@(code='222')%exit

Of course, you can still use a :File command explicitly to override the filecode of the output file.

SqueezeSET SQUEEZE [ ON | OFF ]

(Initial & Default: <neither>)

Turning Set Squeeze On forces Suprtool to always truncate the output file limit to the end-of-file when the output file is closed. Turning Set Squeeze Off forces Suprtool not to change the limit when closing the output file. By default or by specifying Set Squeeze (i.e., with no option) forces Suprtool to decide when to truncate the output limit to the end-of-file.

Suprtool will not squeeze a file limit if the input source is a file, the output file is not a new file, the output file is KSAM (CM, NM or KSAM64), or if the Ask or Num query output options were specified. In all other cases, Suprtool squeezes the file limit down to the EOF.

Set Squeeze Off can be combined with the Numrecs command to automate job streams in which data is appended to the output file. For example,

>get d-sales>numrecs 200% {output file will have extra room}>output dsale>set squeeze off {reserve room between EOF and LIMIT}>xeq>get d-history>output dsale,append {Dsale has room for appending}>xeq

Suprtool 5.2 for HP-UX Command Details for AMXW · 59

Page 60: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Suprtool Issues and Solutions

A Suprtool TaskSuprtool's primary function is to extract data quickly; its focus is batch extraction. The key principle is: the bigger the input data source and the smaller the subset of data selected, the more performance improves.

Your aim is to replace serial reads and selection with Suprtool. To do this, break your task into components: an input choice, some processing selections, and the output choice.

Input ChoicesSuprtool reads fixed-length data files. You can create self-describing files with Suprtool's Query or Link output options. It is easier to work with self-describing files because they have information about the fields in each input record.

Often you select a subset of the input records using the If command. Only selected records are passed to the processing stage and the output choice.

Processing SelectionsIf you do not specify any processing, the input records are quickly copied to the output choice. Some of your processing choices are

1. Sort the records into ascending or descending sequence (Sort or Key). No records are output until all of the selected input records have been sorted.

2. Total one or more input record fields (Total).

3. Remove or select duplicate records (Duplicate).

Output ChoicesUsually you wish to extract a subset of your records to feed into a report program, so the default output file is a data file. The default output file format matches the input file format, unless you use the Extract command. You can specify different formats for the output file by qualifying the Output command. To have readable ASCII output, use "output xxx,ascii". To produce "self-describing" files, use Output xxx,Link.

By default, every output record is identical to the corresponding input record. The Extract command assembles output records by stringing together fields extracted

60 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 61: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

from the input records. With the Extract command you can insert constant values into the output record.

Each output record is written to the output choice. You can also see a formatted listing of each record with the List command.

Large File SupportSuprtool can read, sort and write files greater than 2Gb on HP-UX 10.20 or higher. Suprtool is limited to processing files with 2.1 billion records or less.

Suprtool and AllbaseSpecify an Allbase database with the Open command. Once Suprtool has opened the database, use the Form command to obtain information about the tables in the database. Use the Select command to choose what data to read from your Allbase database. Allbase access is available as a separate add-on module to Suprtool.

Data-TypesWhen you specify a Select command, Suprtool figures out how to translate the Allbase internal data-types into ones that Suprtool can process. Not all Allbase data-types can be processed by Suprtool. The following table lists the Suprtool data-type that corresponds to the Allbase data-type:

Allbase Data-Type Suprtool Data-typeInteger DoubleSmallint IntegerBinary Not SupportedChar ByteVarchar ByteReal Ieee-32Float Ieee-64Decimal PackedNumeric PackedTID Not SupportedDate ByteTime ByteDatetime ByteInterval ByteVarbinary Not SupportedLong binary Not SupportedLong varbinary Not Supported

Suprtool 5.2 for HP-UX Suprtool Issues and Solutions · 61

Page 62: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Date and Time TypesAllbase has four types of fields that are associated with dates and times. These fields are converted to byte-type data and are returned with specific lengths.

The date and time fields are returned with the following byte lengths:

Data-Type LengthDate 10Time 8Datetime 23Interval 8

RestrictionsSuprtool cannot currently handle all Allbase database concepts. The current restrictions are:

1. Suprtool requires that the ownername be specified when selecting a particular table in the following manner:

>select * from purchdb.orders

In this example the owner is purchdb and the tablename is orders.

2. Suprtool does not currently handle the Allbase date format. You can convert the Allbase date format to something that Suprtool can handle with the TO_CHAR function in the Select statement. For example:

>select qty,TO_CHAR(date,'YYYYMMDD') from manufdb.testdata>def mydate,date[1],8 {redefine testdate }>item mydate,date,yyyymmdd {define the date format}>if mydate<=$today(-900)

Suprtool and OracleYou specify an Oracle database with the Open command. You can open any Oracle database to which you normally have access. If you cannot open your Oracle database, check with your system or database administrator so that your environment can be set up properly. Once Suprtool has opened the database, use the Form command to obtain information about the tables in the database. Use the Select command to choose what data to read from your Oracle databases.

Oracle access is available as a separate add-on module to Suprtool.

Data-TypesWhen you specify a Select command, Suprtool figures out how to translate the Oracle internal data-types so that Suprtool can process them. Not all Oracle data-types can be processed by Suprtool. The following table lists the Oracle data-type and the corresponding Suprtool data-type:

Oracle Data-Type Suprtool Data-Type

62 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 63: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Varchar2 Byte

Number Varies, see below

Long Not supported

Rowid Not supported

Date Oracle Date

Raw Not supported

Long raw Not supported

Char Byte

Mislabel Not supported

Number Data-TypeOracle numbers are translated into a variety of Suprtool data-types. The translation depends on the precision of the number and the number of decimal places. The following table describes the translation for each case:

Precision Decimal Places Suprtool Data-Type

None Any 8-byte IEEE

1-4 Zero 2-byte Integer

5-9 Zero 4-byte Integer

1-9 Non-zero Packed-decimal

10-27 Any Packed-decimal

28-38 Any 8-byte IEEE

In packed-decimal translations Suprtool uses the precision of the number to determine the size of a packed-decimal number.

Order By vs. SortOracle's Order By statement on the Select command does not always generate the same results. Specifically, sorted fields with null field values appear at the beginning when they are sorted by Suprtool's Sort command.

RestrictionsSuprtool/UX cannot handle all Oracle database concepts. The current restrictions are:

1. Suprtool/UX can handle varchar2, char, date, and number data-types. It cannot handle any other data-type.

2. Because any Oracle Select command can be used, it is possible to generate column names that are not compatible with Suprtool/UX. For example,

>select sal + comm from bonus

This example produces a column called "sal + comm". In some cases Suprtool/UX correctly uses this as the column name (e.g., the List command). You cannot refer to this column by name in any Suprtool/UX command that accepts field names as a parameter.

Suprtool 5.2 for HP-UX Suprtool Issues and Solutions · 63

Page 64: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

SDUnix UtilitySDUnix is an MPE program that takes self-describing file information and writes it out to an MPE flat file. This flat file can then be transferred to HP-UX together with the data file so that Suprtool/UX can reference the self-describing information about the fields.

To copy the SD file to the HP-UX machine, it must have an .sd extension and be in the same directory as the data file. For example, if the data filename is /usr/local/data/datafile, the SD file must have the name /usr/local/data /datafile.sd.

The SD file is written out to the same domain (permanent or temporary) as the input file. The SD file contains only one record with the necessary length to store all of the label information.

InstallationSDUnix has been included on your HP-UX tape and needs to be installed on your MPE system. You can do this with either FTP or DSCOPY.

Installing using FTP1) Log on as Mgr.Robelle

:hello mgr.robelle,pub

2) Remove the Sdunixnm file

:purge sdunixnm.pub

3) FTP the file from your Unix machine

ftp dopeybinarycd /opt/robelle/mpeget sdunixnm sdunixnm;rec=128,1,f,binary;code=nmprg;disc=1400

4) Remove any old versions of Sdunix

:purge sdunix

5) Rename the program file

:rename sdunixnm,sdunix

To install the CM version of SDUnix, specify Sdunixcm as the file name, ;disc=400,1,1 for the file size, and PROG for the filecode.

Installing with DSCOPY1) Log on as Mgr.Robelle

:hello mgr.robelle,pub

2) Remove the Sdunixnm file

:purge sdunixnm.pub

3) Specify file command for proper program file size

:file sdunixnm;disc=1400

4) DSCOPY the file from your Unix machine

64 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 65: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

dscopy /opt/robelle/mpe/sdunixnm:hpux[user:password] to *sdunixnm;bin;fcode=1030;rsize=256;fix;rep

5) Remove any old versions of Sdunix

:purge sdunix

6) Rename the program file

:rename sdunixnm,sdunix

To install the CM version of SDUnix, specify Sdunixcm as the file name, ;disc=400,1,1 for the file size, and 1029 for the filecode.

SDUnix ParametersAll SDUnix parameters are specified via Info = string. There are three parameters:

input-file sd-file LF | NOLF

The first parameter is the name of an MPE self-describing file. The second parameter is the name of the .sd file that SDUnix created.

LF vs. NOLFUse the third parameter to specify whether the data file has LF (line feed) as the record separator, or whether the file does not use a file separator. If you use FTP to copy the data file to your HP-UX machine, you should specify the NOLF option and be sure to use a binary mode transfer. If you are using DSCOPY (with its default options) to copy the data file, you should specify the LF option.

ExamplesThe following section contains examples of creating an SD file on MPE, converting the SD information, and finally copying the two files to an HP-UX machine.

First create an SD file with:

:run suprtool.pub.robelle>base store,5Database password [;]?

>get d-inventory>out dinv,link>exit

Now you can convert the label information to an .sd file using the SDUnix utility. Note that the data file is the first file passed in the info string.

Specify LF if you are using DSCOPY.

:run sdunix.pub.robelle;info="dinv dinvsd lf"

Now you can use DSCOPY to copy the files to the HP-UX machine.

:dscopy dinv to store.dinv :dopey[data:password]:dscopy dinvsd to store.dinv.sd:dopey[data:password]

Specify NOLF if you are using FTP.

:run sdunix.pub.robelle;info="dinv dinvsd nolf"

Use FTP to copy the files to the HP-UX machine.

Suprtool 5.2 for HP-UX Suprtool Issues and Solutions · 65

Page 66: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

:ftp dopeyftp> binaryftp> exitonerrorftp> put dinv /users/data/store.dinvftp> put dinvsd /users/data/store.dinv.sdftp> quit

Now you can use Suprtool/UX to read the SD file.

$ suprtool>input store.dinv>form File: store.dinv (SD Version B.00.00) No line feeds Entry: Offset BIN-NO I1 1 LAST-SHIP-DATE I2 3 ON-HAND-QTY I2 7 PRODUCT-NO Z8 11 SUPPLIER-NO Z8 19 UNIT-COST P8 27 ITEM-DESC1 X20 31 ITEM-DESC2 X20 51 ITEM-DESC3 X20 71 ITEM-DESC4 X20 91 Entry Length: 110 Blocking: 1>out dinvfile>xeq

Link vs. QuerySDUnix and Suprtool/UX can recognize files created with the ,Query option and from Query. However, they cannot recognize compound item details or any Item attributes, such as Decimal or Date type.

Suprtool and Self-Describing FilesA problem with data files is that there is no field information. Self-describing files solve this problem by providing field information about the file. Suprtool reads and writes SD files; Suprlink requires SD files as input and creates an SD file as output.

Create an SD File from a TableYou request an SD file using the Link option of the Output command. If you extract columns from the table, only the extracted columns appear in the SD file.

>select * from sales {input from a table}>output salefile,link {salefile has all of the columns from sales}>xeq

Create an SD File from a Data FileYou must Define and Extract the fields you want to have in the SD file. Use the Link option of the Output command to create the file as a self-describing file. Although Suprtool itself allows longer field names, SD files only store the first 16 characters of a field name.

66 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 67: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>input sales.data,reclen 16,nolf {input from a data file}>define cust_no,1,6,byte>define invoice_date,7,6,integer>define sales_qty,13,4,packed>extract cust_no,invoice_date,sales_qty>output salefile,link {salefile has all of the extracted columns}>xeq

SD Files as InputWhen you specify an SD file as input to Suprtool, all the field information becomes available. You can select, extract, and total fields without the Define command. In addition, the Input command no longer needs any Reclen or LF parameters.

>input salefile {self_describing file}>form {display the fields in the file}>if sales_total > 10000 {select based on a field}>extract cust_account {only extract a few fields}>extract sales_qty>extract sales_tax>extract sales_total>total sales_total {total a field from the file}>output newfile,link {create a new SD file}>xeq

Listing SD FilesSuprtool normally lists data files in an Octal/Char format. When listing an SD file, Suprtool produces a formatted listing with field names and field values converted into ASCII:

>input salefile {self-describing file}>list {produce a formatted listing}>xeq

Decimal Places and Date FormatsYou use the Item command to identify items with an implied number of decimal places or a date format. If you create a self-describing file, this information is retained. When you input such a file, all Suprtool commands are automatically informed about the decimal places and date formats. The Form command shows these extra attributes as comments at the end of each field description. For example,

>input salefile {self_describing file}>item deliv_date ,date ,yyyymmdd>item purch_date ,date ,yyyymmdd>item sales_tax ,decimal,2>item sales_total,decimal,2>output newfile,link {creates SD file with item attributes}>xeq>form newfile {shows decimal pts. and dates}

Extended Field NamesA few users have expressed interest in having the ability to have SD field names be greater than 16 characters. However, a large number of customers have software that relied on the SD format remaining the same. The compromise was to add Extended names to the end of the .sd file. The new Extended names will be written out and used inside Suprtool when you turn on this feature with Set SDExtname On. Suprtool will only use this information if this setting is turned on.

Suprtool 5.2 for HP-UX Suprtool Issues and Solutions · 67

Page 68: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Suprtool and Suprlink now have a new optional extended name format for Self-Describing files. Not all portions of Suprtool and Suprlink handle the new extended name format, however, not all portions of Suprtool and Suprlink support the extended name feature.

The Suprtool List command does not utilize the extended name.

Suprlink does not use the full extended names for key items, but rather uses the regular truncated name just as it did previously. Suprlink does however, carry on the Extended information and writes it to the output file.

Restrictions of SD FilesSo far in this section, we have shown how to create self-describing files using the Link option of the Output command. The Link option produces a special form of self-describing file. Not all software can read this form of self-describing file. You can use the Query option to create an old-style self-describing file. The Query option has the following restrictions.

Self-describing files were originally created by HP in MPE so that files could be fed into HPWORD and HP graphics packages. One problem with HP's definition was that no provision was made for compound fields (e.g., 10J2). When Suprtool creates an SD file with compound fields via the Query option, it uses a special data-type. When you input such a file to Suprtool, all compound fields are treated as byte arrays. Suprtool correctly copies and extracts these fields, but you cannot select with them. The Query option is not capable of retaining information about decimal places or date formats.

Suprtool and Sorting FilesWhen Suprtool sorts two records that have the same key value, the first record read by Suprtool is the first record on the output file. For data files, this means that input records with the same key values appear in the same order in the output file.

Suprtool and Personal ComputersYou can format files to be downloaded to your PC for use in spreadsheets or databases with the PRN option of the Output command. Suprtool formats your file as a PC structure (a comma-delimited file). Not all PC applications support the PRN format. For more precise data conversion, create a self-describing file then use STExport. See the STExport manual for details. You transfer the Suprtool output file to your PC and then import it into your PC application.

Downloading to the PCAfter you have created a PRN file using Suprtool, you can use FTP or any of the many terminal emulator programs available to download the file to the PC. This includes Reflection from Walker Richer & Quinn.

Decimal PlacesBe sure to specify which fields have decimal places when creating the PRN file. Suprtool reserves extra space for decimal points that appear in the PRN output.

68 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 69: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

When formatting numeric fields, Suprtool inserts the decimal point at the correct place. When you import your file into your PC application, numeric fields are automatically formatted correctly.

SpreadsheetsThe following procedure allows you to include literal headings in your spreadsheet using only one file, the size and shape of which is computed by STExport. We have tested this method with MS Excel; it should work with any spreadsheet that supports the importing of delimited files.

There are two steps. First, build a self-describing file with Suprtool, then use STExport to convert it to PRN and add the headings.

1. In Suprtool build a self-describing file:

>input ...>define items...>item items...>extract fields...>output sdfile,link>xeq

2. In STExport convert to PRN and add the header line:

$input sdfile$heading fieldnames$output pcdata$exit

The file Pcdata is a variable-length PRN file with both headings and data.

Suprtool and PowerHouse ApplicationsYou can use Suprtool to significantly speed serial extracts using Quiz and QTP from Cognos. In many cases the changes to existing applications are minor.

Suprtool with Quiz/QTPQuiz, QTP, and Quick are components of PowerHouse 4GL, a popular fourth generation language sold by Cognos. You can improve the performance of Quiz reports by using Suprtool to select and sort the records from a file or SQL table, and passing selected records to Quiz for final reporting. To do this, you need some way to tell Quiz about the record structure of Suprtool's output file. Quiz already has the capacity to do this without making any changes to the PowerHouse PDL dictionary.

In the following example, Suprtool extracts records from the Custmast file, sorts them, and writes them to the Cmasfile file. These are the records we need for the Quiz report.

Step 1: Create a Subfile with QuizThe first step is to use Quiz to extract one entry from the Custmast file and write it to a PowerHouse "subfile". Note that you could also use QTP to build the subfile.

Suprtool 5.2 for HP-UX Suprtool Issues and Solutions · 69

Page 70: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

$rm cmasfile.sf$rm cmasfile.sfd$quiz>access custmast>report summary all>set subfile name cmasfile keep>set report limit 1>go

This creates 2 files: Cmasfile.sf, containing the extracted data, and Cmasfile.sfd, containing the PowerHouse record definition for the data portion of the subfile. We use Suprtool to reload the Cmasfile.sf file with all the records required for the final report.

Step 2: Output Erase in SuprtoolOnce you have created the PowerHouse subfile, use the Erase option of the Output command in Suprtool to load the file. This overwrites any data in the data portion of the subfile, but it does not affect the "dictionary" for that file.

$suprtool>input custmast,reclen 80,nolf>if credit_limit>=1000000>sort custnum>output cmasfile.sf,erase>exit

Step 3: Report with QuizThe Cmasfile.sf file now contains the sorted records for the Quiz report. Quiz can access the file because the Cmasfile.sfd containsthe record definition. You can now use Quiz to generate the report:

$quiz>access *cmasfile>report ...>go

Using QTP to Create SubfilesYou can also use QTP instead of Quiz to create the PowerHouse subfile:$rm cmasfile.sf$rm cmasfile.sfd$qtp>access custmast>set input limit 0>subfile cmasfile keep include custmast>go

Creating Subfile with Script FileThe process of creating a subfile is essentially the same regardless of the input file being used. The only things that change are the subfile and input file names. Here is a script file for automating this task. This script can be executed before running Suprtool or from within Suprtool.

70 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 71: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

#!/bin/shrm usefileecho set report limit 1 >usefileecho access $2 >>usefileecho set subfile name $1 keep >>usefileecho report summary all >>usefileecho go >>usefileecho exit >>usefilequiz <usefile

This script accepts two parameters: the name of the subfile to be created and the name of the file whose structure it will duplicate.

Makesub can be invoked from within Suprtool, as shown below:

$suprtool>:makesub cmasfile, custmast>input custmast,reclen 80,nolf>if credit_limit>=1000000>sort custnum>output cmasfile.sf,erase>exit

Quiz: Generating Suprtool CommandsSuprtool does not have the ability to prompt users for selection criteria. You can easily create a short Quiz procedure to prompt for values and create a file of Suprtool commands.

> define D-PROMPT date format YYMMDD = &> parm prompt "Enter selection date: "> report &> "input custmast,reclen 80,nolf" &> skip "if DATEFIELD = " D-PROMPT pic "^^^^^^" &> skip "output OUTFILE" &> skip "xeq"> set nohead> set report device disc name STCODE> set page length 0> go

Quiz edits the user's input for a valid date. Note that there is no ACCESS statement, but Quiz still writes one record to the output file. Execute the resulting commands as a Suprtool usefile:

$suprtool < STCODE

Year 2000 Solutions with SuprtoolFor this discussion we'll ignore the fact that the twenty-first century really only started in 2001.

Suprtool often has to process dates in both the twentieth and twenty-first centuries. If you include the century in your dates, Suprtool should behave as most users expect. If you do not include the century in your dates, how Suprtool behaves will be dependent on your specific application and data.

What If I Have Four-Digit Years?If your dates have four-digit years, Suprtool should work as expected. Selection based on the $today or $date features will select dates in both the twentieth and twenty-first centuries. Dates that do not collate correctly (e.g., mmddccyy) will not be accepted by Suprtool's If command for relative selection (e.g., <, <=, >, or >=). If

Suprtool 5.2 for HP-UX Suprtool Issues and Solutions · 71

Page 72: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

you have these date formats you can use the $stddate function, converts any date format to a ccyymmdd type date.

Suprtool, as it has always done, will continue to sort dates based on their numeric value and not on any implied date order.

In Suprtool 4.0, we introduced some new command parsing features that let you control how Suprtool parses the year of the $date function. You can either use two-digit years by applying a cutoff rule or you can force all years to be specified as four digits.

What does Set Date Cutoff do?Date Cutoff tells Suprtool what century to use when Suprtool generates a constant date value from the $date function.

Before version 4.0, Suprtool would assume 19 for the century for any user-specified $date with a two-digit year. For example:

>item date-field,date,ccyymmdd>if date-field <= $date(40/12/26)

Previously the $date function would convert the user specified $date to 1940/12/26 in order for it to be compared to the date-field format of CCYYMMDD. Now with Set Date Cutoff xx, Suprtool assumes 20 for the century if the two-digit year specified in the $date function is less than the value of Set Date Cutoff. For example:

>set date cutoff 50>item date-field,date,ccyymmdd>if date-field <= $date(40/12/26)

Suprtool in this case assumes the full $date to be 2040/12/26, because the 40 in $date is less than the 50 in Set Date Cutoff.

The default value of Set Date Cutoff is 10.

Stddate and Set Date CutoffWhen $Stddate has to convert from a date with only a two-digit year, the conversion to the four-digit year will use the value of Set Date Cutoff when converting the date.

For example,

>get sales-detail>set date cutoff 15>def new-ship-date,1,4,double>item ship-date,date,mmddyy>ext order-no / sales-amount>ext new-ship-date = $stddate(ship-date)>out salesinfo,link>xeq

In this example, if any ship-date has a year of 14 or less, then the century applied to the new-ship-date field will be 20. Ship-dates with a year of 15 or more will have a century of 19 applied.

What does Set Date ForceCentury do?Set Date ForceCentury On will not allow a yy date to be entered in the $date function, it will force the user to enter a full ccyy date.

72 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 73: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>set date forcecentury on>item date-field,date,ccyymmdd>if date-field >= $date(98/12/10)

Error: You must specify the century or Set Date ForceCentury off

The default value for Set Date ForceCentury is off.

What If I Have Two-Digit Years?If you have dates with two-digit years, there are two main solutions to making your application ready for the Year 2000:

1. Convert all of your date data to use four-digit years and modify your programs to process four-digit years, or

2. Assume that certain dates are in the twentieth century and some in the twenty-first (this is usually called date windowing).

The first solution requires that you change all Suprtool Item commands for two-digit years to a four-digit year format. If you have not already done so, you may want to isolate all of these Item commands in a single file per input source (e.g., one file for every dataset in every database in your application or just one file for every database). You can nest use-files, making this approach even easier (e.g., having one database use-file that then includes each dataset use-file with a list of Item commands). You may also want to use Suprtool to assist you in changing your actual data from two-digit years to four. See "Can Suprtool Convert Two-Digit Years to Four Digits?" on page 75 for more details.

If you do not include the century in your dates (the second solution above), you will have the following problems:

1. Selecting dates in yymmdd format will not produce the expected results in relative operations (e.g., <, <=, >, or >=). You will need to change all of your If commands to use the $stddate function.

2. Sorting dates that include both 20th and 21st century dates, will not collate the way most users expect, whether with Suprtool, the COBOL sort verbs, or HPs sort tools. This is because Suprtool, and all HP-supplied tools, sort based on the numeric value of a date. To make this work correctly within Suprtool, you will need to use the $stddate function in an Extract command to generate a date with a four-digit year, then sort on this new date field with another Suprtool task.

What Is Wrong with Two-Digit Years?Currently the date format of yymmdd collates (sorts) correctly if the date is not beyond December 31, 1999. Given the current date of 981210, numerically this is less than next year whose date value is 991210.

At the turn of the century dates in the yymmdd format (or yymm) will no longer sort correctly because the value of December 10, 2000 (001210) is less than 981210.

Consequently, if we have a date beyond 1999, stored in yymmdd format, a relative operation such as:

>if date-field >= $date(98/12/10)

will not find the date of December 10, 2000. You will need to use the $stddate function to make this task work correctly.

>if $stddate(date-field) >= $date(98/12/10)

Suprtool 5.2 for HP-UX Suprtool Issues and Solutions · 73

Page 74: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

How Do $Today and $Date Work?Suprtool's date functions ($date and $today) are a short-hand method of generating a numeric constant. So a date selection like:

>item invoice-date,date,YYMMDD>if invoice-date < $today

is exactly the same as:

>if invoice-date < 980401 {on 1st April, 1998}

Suprtool does record selection on the numeric value of the field and not on the implied date value. If we move the calendar ahead to January 1, 2000 and do the same commands as above, the result would the same as if you had typed:

>if invoice-date < 000101 {on 1st January, 2000}

If you have some invoice dates from the previous century (e.g., 990101 for December 1st, 1999), they will not be selected.

Will Suprtool Generate an Error for Two-Digit Year Dates?Sometimes.

Because dates beyond 1999 will not collate properly for the YYMMDD and YYMM formats, starting in version 4.0.11 the If command produces an error if the year specified in a $date or $today function is greater than 1999 and the date format is YYMMDD or YYMM, and you are performing a relative operation (e.g., <, <=, >, or >=).

>item enddate, date, yymmdd>if enddate >= $date(*+4/*/*) {21st. century date} ^Error: Cannot use a date beyond 1999 for this format

Suprtool returns this error by default, but you can override it with the following set command:

>set date ifyy2000error off

This tells Suprtool to allow the previously described relative operations and suppress the error message. While you can override the error checking, the behavior of $today and $date is not changed.

How Do I Use $Today and $Date with yymmdd Dates?If you need to have Suprtool select dates in YYMMDD format with $Today or $Date, you need to use one of the following solutions:

1. Change the date storage format to include the century in all datasets and data files, so you can use the following item command:>item invoice-date,date,CCYYMMDD

2. Use the $stddate function that adds the century component to dates in a ccyymmdd format in a J2 container.

74 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 75: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Also see "Case 1: Converting a J2 Date from yymmdd to ccyymmdd" on page 76 and "Case 2: X6 yymmdd Data to X8 ccyymmdd" on page 77 for more specific details on converting two-digit-year date formats into four-digit-year date formats.

aammdd Date FormatThe aammdd date format was developed by James Overman of HP for use in the MM3000 product. This format is only available for the X6 data-type.

The aammdd format is similar to yymmdd, but the year portion of the date use a combination of numbers and letters of the alphabet to represent years beyond 1999.

By substituting a letter of the alphabet in the first position of the year, we can extend a six-digit date and also ensure that the dates collate correctly. For example,

YY of AAMMDD CCYYA0 - A9 2000 - 2009B0 - B9 2010 - 2019C0 - C9 2020 - 2029

Because letters are greater than numbers in the collating sequence we can ensure that aammdd dates beyond 1999 will order correctly.

Suprtool also supports other date formats with this two-digit year representation. These formats are aamm, mmddaa and ddmmaa.

Invalid DatesThe If command has a $invalid function to find all invalid dates for a particular field. An invalid date is any number of a particular date format whose date equivalent cannot be found on the calendar. For example, a date with a month of 99 will be considered invalid.

>base store.demoDatabase password [;]?>get d-sales>item deliv-date,date,ccyymmdd>if $invalid(deliv-date)>out baddates,link>xeq

Can Suprtool Convert Two-Digit Years to Four Digits?Suprtool is capable of converting dates from one format to another using a variety of Suprtool features. We will show how Suprtool can convert common dates without the century to those that have the century included. While Suprtool can convert your data, it is up to you to change your programs. Adager, a third-party program for changing Image database structures, has the ability to change date fields. Suprtool can convert data in Image databases, flat files, self-describing files and KSAM files.

Suprtool 5.2 for HP-UX Suprtool Issues and Solutions · 75

Page 76: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Case 1: Converting a J2 Date from yymmdd to ccyymmddThe $stddate function can convert six-digit date formats to ccyymmdd. But what if all the dates are not actually dates, but some dates are filled with 9s as a flag to an application?

Consider this dataset with two date fields, J2 items and in the date format yymmdd.

Database: STORE.DB.GREEN D-SALES Detail Set 5 Entry: Offset CUST-ACCOUNT Z8 1 (!M-CUSTOMER) DELIV-DATE J2 9 PRODUCT-NO Z8 13 (M-PRODUCT) PRODUCT_PRICE J2 21 PURCH_DATE J2 25 SALES-QTY J1 29 SALES-TAX J2 31 SALES_TOTAL J2 35 Capacity: 602 (14) Entries: 10 Highwater: 10 Bytes: 38

First, we need to know and understand our data. Are there any invalid dates? If so, does the value have some other logical meaning?

>get d-sales>item deliv-date,date,yymmdd>item purch_date,date,yymmdd>if $invalid(deliv-date) or $invalid(purch_date)>list>xeq>GET D-SALES (9) >OUT $NULL (0)CUST-ACCOUNT = 10010 DELIV-DATE = 999999PRODUCT-NO = 50513001 PRODUCT_PRICE = 19220PURCH_DATE = 999999 SALES-QTY = 2SALES-TAX = 2691 SALES_TOTAL = 21910

>GET D-SALES (10) >OUT $NULL (1)CUST-ACCOUNT = 10010 DELIV-DATE = 125213PRODUCT-NO = 50513001 PRODUCT_PRICE = 19220PURCH_DATE = 1 SALES-QTY = 2691SALES-TAX = 21910 SALES_TOTAL = 21910

IN=10, OUT=2. CPU-Sec=1. Wall-Sec=1.

In this example, we see two records that do not contain proper dates. The first record contains all 9s, which is probably used as some sort of flag. We may need to add 99 in front of these dates.

But the second record is obviously wrong. We can use Dbedit to correct this before converting the other dates. We need to know our data to properly convert to a new date format.

Once all the incorrect dates are fixed, we can start converting. We can add a prefix of 19 or 20 to all the appropriate dates by using the following Extract statement. Please note that we are updating this directly. In case we need to redo this task, we only convert those dates that have not yet been converted. In this example we set the cutoff year to 30 so any dates before 30 will have 20 as the century and the others will have 19.

76 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 77: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>get d-sales>set date cutoff 30>item purch_date,date,yymmdd>item deliv-date,date,yymmdd>if not $invalid(purch_date) and not $invalid(deliv-date)>update>ext purch_date = $stddate(purch_date)>ext deliv-date = $stddate(deliv-date)>xeq

We have now converted all the J2 yymmdd dates to a ccyymmdd format and added the correct century to the date.

Case 2: X6 yymmdd Data to X8 ccyymmddThe following Suprtool task shows how you can generate a new file to put into a new database with dates in a different format.

Consider the deliv-date and purch_date fields of the D-Sales dataset:

Database: STORE.DBOLD.ACCOUNT D-SALES Detail Set 5 Entry: Offset CUST-ACCOUNT Z8 1 (!M-CUSTOMER) DELIV-DATE X6 9 PRODUCT-NO Z8 15 (M-PRODUCT) PRODUCT_PRICE J2 23 PURCH_DATE X6 27 SALES-QTY J1 33 SALES-TAX J2 35 SALES_TOTAL J2 39 Capacity: 611 (13) Entries: 15 Highwater: 15 Bytes: 42

You want to convert to a date format with room for a cc at the beginning of the deliv-date and purch_date:

Database: STORE.DB.ACCOUNT D-SALES Detail Set 5 Entry: Offset CUST-ACCOUNT Z8 1 (!M-CUSTOMER) DELIV-DATE X8 9 PRODUCT-NO Z8 17 (M-PRODUCT) PRODUCT_PRICE J2 25 PURCH_DATE X8 29 SALES-QTY J1 37 SALES-TAX J2 39 SALES_TOTAL J2 43 Capacity: 608 (16) Entries: 0 Highwater: 0 Bytes: 46

In order to convert these dates you need to be able to put either a 19 or 20 in front of the yymmdd date, depending on the value of the year. Before you can do either of these you must confirm, once again, that you have no invalid dates.

>base store.dbold>get d-sales>item deliv-date,date,yymmdd>item purch_date,date,yymmdd>if $invalid(deliv-date) or $invalid(purch_date)>list>xeq

Once you have confirmed that there are no invalid dates you can start converting the dates that you have. Because there are two date fields in this dataset you must be careful to add the appropriate century for the proper field. For this example, assume that if a year is less than 1950 then the century should be 20.

Suprtool 5.2 for HP-UX Suprtool Issues and Solutions · 77

Page 78: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

You can easily convert each date by processing each field separately by using an intermediate self-describing file:

>base store.dbold,1Database password [;]?

>get d-sales>set squeeze off>item deliv-date,date,yymmdd>if deliv-date >= $date(1950/01/01)>out sales01,link>ext cust-account>ext "19">ext deliv-date / sales_total>xeqIN=15, OUT=14. CPU-Sec=1. Wall-Sec=5.

Now insert 20 to the century for the appropriate records:

>base store.dbold>get d-sales>if deliv-date < $date(1950/01/01)>ext cust-account>ext "20">ext deliv-date / sales_total>out sales01,link,append>xeq

Now you can convert the other field from the flat file, (sales01) and add a century to the purch_date field:

>reset>base {close the open database}>in sales01>item purch_date,date,yymmdd>if purch_date >= $date(1950/01/01)>set squeeze off>out sales02,link>ext cust-account / product_price>ext "19">ext purch_date / sales_total>xeqIN=15, OUT=15. CPU-Sec=1. Wall-Sec=1.

Because you extracted all 15 records you know you do not have any records with the purch_date field that need to be updated with a "20".

Now you can insert the records into the new database:

>base store.db>in sales02>put d-sales>xeq

Now you have converted two dates from an X6 format to an X8 format.

Case 3: Different Date Formats X6 MMDDYY Data to X6 YYMMDDThe following Suprtool task shows you how to convert a date in a self-describing file from mmddyy to yymmdd format.

Consider the following self-describing file with the deliv-date and purch_date fields:

78 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 79: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

File: SALES04.DATA.ACCOUNT (SD Version B.00.00) Entry: Offset CUST-ACCOUNT Z8 1 DELIV-DATE X6 9 <<MMDDYY>> PRODUCT-NO Z8 15 PRODUCT_PRICE I2 23 PURCH_DATE X6 27 <<MMDDYY>> SALES-QTY I1 33 SALES-TAX I2 35 SALES_TOTAL I2 39 Limit: 115 EOF: 15 Entry Length: 42 Blocking: 97

You want to convert these two dates to a data format of yymmdd before adding a century in front of the year. This can be easily accomplished by defining each sub part of the date and extracting those parts in the new order.

>in sales04>def deliv-date-mm,deliv-date[1],2>def deliv-date-dd,deliv-date[3],2>def deliv-date-yy,deliv-date[5],2>def purch_date-mm,purch_date[1],2>def purch_date-dd,purch_date[3],2>def purch_date-yy,purch_date[5],2>ext cust-account>ext deliv-date-yy>ext deliv-date-mm>ext deliv-date-dd>ext product-no / product_price>ext purch_date-yy>ext purch_date-mm>ext purch_date-dd>ext sales-qty / sales_total>out sales05,link>xeq

You now have a file with the dates in yymmdd order, but the self-describing information shows three separate fields.

File: SALES05.DATE.ACCOUNT (SD Version B.00.00) Entry: Offset CUST-ACCOUNT Z8 1 DELIV-DATE-YY X2 9 DELIV-DATE-MM X2 11 DELIV-DATE-DD X2 13 PRODUCT-NO Z8 15 PRODUCT_PRICE I2 23 PURCH_DATE-YY X2 27 PURCH_DATE-MM X2 29 PURCH_DATE-DD X2 31 SALES-QTY I1 33 SALES-TAX I2 35 SALES_TOTAL I2 39 Limit: 115 EOF: 15 Entry Length: 42 Blocking: 97

You can convert these several fields to one field with another extract task:

Suprtool 5.2 for HP-UX Suprtool Issues and Solutions · 79

Page 80: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>in sales05>def deliv-date,9,6,byte>def purch_date,27,6,byte>item deliv-date,date,yymmdd>item purch_date,date,yymmdd>ext cust-account>ext deliv-date>ext product-no>ext product_price>ext purch_date>ext sales-qty / sales_total>out sales06,link>xeqIN=15, OUT=15. CPU-Sec=1. Wall-Sec=1.

You now end up with a file that looks like this:

File: SALES06.DATA.ACCOUNT (SD Version B.00.00) Entry: Offset CUST-ACCOUNT Z8 1 DELIV-DATE X6 9 <<YYMMDD>> PRODUCT-NO Z8 15 PRODUCT_PRICE I2 23 PURCH_DATE X6 27 <<YYMMDD>> SALES-QTY I1 33 SALES-TAX I2 35 SALES_TOTAL I2 39 Limit: 115 EOF: 15 Entry Length: 42 Blocking: 97

You then add the century to these fields as described above.

Year 2000 TestingTesting software to see if it works in the year 2000 and beyond is difficult. Currently there are three software tools that change the software date for specific sessions or applications, making it easier to test software for year 2000 compliance. The four tools are:

1. Hourglass from Allegro Consultants, Inc.

2. Time Machine from SolutionSoft Systems, Inc.

3. Setdate from the HP Jazz machine on the Web

4. TimeWarp/3000 from Omnisolutions

All versions of Suprtool work with Hourglass, but versions previous to 4.0.13 did not work with Time Machine, Setdate, or TimeWarp. This version of Suprtool now works with all these tools. Note that this change only applies to non-expiring versions of Suprtool. Expiring versions of Suprtool (such as trials, pre-releases, and products obtained through VARs) do not work with Time Machine or Setdate.

Performance IssuesHP-UX sites use Suprtool because it provides access to their data many times faster than they are used to. Suprtool also enables them to perform time-consuming DP functions with only a few simple commands. The typical Suprtool task consists of extracting some data for a report, then feeding the Suprtool output file into the final report program. For example, you might fill a data file with the subset of data needed, then report that file with Microfocus COBOL.

80 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 81: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Eloquence PerformanceSuprtool/UX has high-speed dataset reads for Eloquence databases. Suprtool for HP-UX by default calls dbget to do serial reads, however, if you use Set FastRead On, you will efficient large reads. Testing has shown that the CPU time can be improved by anywhere from two to five times and Wall time has improved anywhere from two to six times faster. In order to turn this feature on for all accesses you can put the command: Set FastRead On

into the file /opt/robelle/suprmgr. This means that Suprtool will use the faster reads for all runs of Suprtool. Set FastRead On must be set prior to the Base command otherwise it will be ignored. Starting with Suprtool version 5.1, Fastread is now on by default in the “regular” version of Suprtool for HP-UX. The “regular” version of Suprtool for HP-UX/AMXW refers to the version that does NOT use the ROBELLELIB_IMAGE variable to find and load the IMAGE intrinsics.

Sort PerformanceSuprtool/UX uses its own set of sorting routines. These routines are generally faster than the sorting algorithms provided with software tools and SQL databases.

If you have the right data, Suprtool/UX can sort much faster than other HP-UX tools. Because sort performance varies a lot from application to application, we recommend that you test Suprtool/UX in your own environment.

You can improve the performance of sort operations by moving the sort workspace to a different physical disk drive than the input file uses.

You can move the sort scratch space by setting the TMPDIR environment variable to a directory that resides on another physical disk drive, provided you have read and write access to that directory.

export TMPDIR="/var/tmp/sortscratch"

Oracle PerformanceSuprtool/UX provides you with easy ways to let either Oracle or Suprtool do most of the work. Whether it is best to use Oracle or Suprtool depends on your specific machine, database, and application. You can use the Select command to force Oracle to do much of the processing or you can use Suprtool to do the work. In our testing, Suprtool consistently sorts two to four times faster than Oracle. Your performance improvements may be different from ours, so we recommend that you take some common tasks and try them with both tools. Here is an example of sorting with Oracle and then with Suprtool:

Oracle sorts data>select * from emp order by ename

Suprtool sorts data:>select * from emp>sort ename

For more information on Oracle performance, we recommend the book Oracle Performance Tuning by Peter Corrigan and Mark Gurry (published by O'Reilly and Associates).

Suprtool 5.2 for HP-UX Suprtool Issues and Solutions · 81

Page 82: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Analyzing Performance DataIt is better to test Suprtool with your own database and your own application needs, rather than trust a "generic" performance test. The ideal test is an actual production report whose bad performance is causing you a problem. If you obtain improvements by using Suprtool, you know that you can achieve better speed in practice as well as in tests.

Use Suprtool as a front end to your problem report, producing a small extract file that contains just the fields and records needed for your final program. Once you get that working, consider linking in data from other files or datasets using Suprlink. For comparison purposes, run the Suprtool test at the same time as you would normally run the original program. Comparing a standalone midnight run against a mid-day run does not give valid results, nor does comparing two runs in succession (the second run benefits on HP-UX because the files are already in memory at that time).

Variable SubstitutionSuprtool supports environment variable substitution. To use this enhancement you must do a:

>set varsub on

Due to how HP-UX processes work with environment variables any variables must be exported prior to running Suprtool, STExport or Suprlink. All of these modules support HP-UX variable Substitution.

export tablefile='abcdefghijklmnopqrstuvwxyzabcd' export infile='file1sd' ./suprtool -oc << \!EOD set varsub on in $infile table mytable,char-field,file, & /users/robdev/suprtool/test/$tablefile if $lookup(mytable,char-field) out file05,link exit !EOD

Suprtool examines a command line and looks for variables denoted by the "$" sign. Since Suprtool has some functions that begin with a $-sign, these will take precedence regardless of the value set in the variable of the same name.

82 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 83: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Suprtool Commands

General NotesDo not enter the > sign when typing commands.

When you run Suprtool, it prompts for commands with a ">" character and reads command lines from the standard input device. Suprtool commands contain a command name which may include one or more optional parameters that are each separated by commas.

In this chapter, we describe the Suprtool commands in alphabetic order. Each command name is followed by its minimal abbreviation in brackets. For example: [D] for Define and [DU] for Duplicate.

Most Suprtool commands work within the context of the input file. In general, the Base, Chain, Get, Open, Select and Input commands must be entered before other commands. Once the input source has been specified, commands can be entered in any order.

AbbreviatingYou may shorten the command name to any substring that uniquely defines the command. For example, Form can be abbreviated as FO or F, since there are no other commands that start with "F". Duplicate, however, can be abbreviated only to DU, since there is also a Define command in Suprtool.

>i sdfile {Input command}>l {List command}>x {Xeq command}

Uppercase or LowercaseYou can enter the letters in either uppercase or lowercase because Suprtool upshifts everything in the command line except literal strings within quotes (e.g., "abc") and disc file names. These two commands are identical:

>EXTRACT QTY>extract qty

Multiple Commands per LineYou can enter several commands on a single line, if you separate them with semicolons. An entire "task" can be placed on one input line.

Suprtool 5.2 for HP-UX Suprtool Commands · 83

Page 84: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>in sdfile;out new;xeq>in sdfile;if cust-status<>10,20,30;list;x

Caution: Suprtool cannot distinguish between several commands on one line and several commands entered on several lines. This is not a problem when using Suprtool in batch, as Suprtool stops executing when an error occurs. But when using Suprtool interactively, specifying multiple commands separated by a semicolon, Suprtool keeps on parsing the rest of the line after it finds an error. For example, if you misspell the "fldname" when you type the following,

>get dsetname; if fldname="value";delete;out filename;xeq

Suprtool sends you an error message with the typo, but continues with the rest of the command line. This has the effect of deleting all the entries in the dataset. It is risky to type Xeq on the same command line as any other command unless:

1. You are not concerned with the consequences if you make a mistake (e.g., any "extract" task should be safe).

2. You don't make any mistakes.

The usual reason for putting all the commands on one line, including the Xeq, is to permit repetition of the task by using the Before command. It is not necessary to type everything on one line because with the Listredo command, Suprtool allows you to pick and choose any of your last 1000 commands.

ContinuationThe maximum physical command line is 256 characters. You may enter commands on multiple input lines by putting an "&" continuation character at the end of the line. The maximum total command length is 256 characters. The separating comma in commands is not optional. Should your If command exceed 256 characters, use the Table command, or $read.

>in sdfile>if status="20" and & {continue the If command} state="AZ","CA","OR" {select several states}>output outfile

Comments on Command LinesYou may also use MPE's :COMMENT command to enter comment lines.

Comments may appear at the end of any command line, as long as they are surrounded by curly braces. Many of the examples in this manual show comments at the end of command lines. You can enter a comment as the only item in a Suprtool command line. When you enter continued command lines, the comment can appear before or after the continuation character:

84 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 85: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>{The following task extracts all customer records for}>{ the different customers we are interested in.}>in customer {input self-describing file}>if status = "10" or & {prepaid status} status = "20" or & {current status} status = "30" {arrears status}>output outfile {output to a disc file}>exit {execute the task and exit}

HP-UX CommandsIf Suprtool doesn't recognize the command you have entered, it tries to interpret it as an operating system command. Suprtool also interprets any command line beginning with an exclamation mark (!) or a colon (:) as an O/S command. For example:

>!# sort custfile by custnum {comment}>input custfile>key 1,10 {no '!' on the next command}>ls sort* {check for file name}>out sortcust>exit

CalculatorAny command line beginning with an equal sign (=) is treated as a calculator expression. This feature can be used to compute blocking factors and do other calculations without the need of an electronic calculator. For help, type =?.

Control-Y InterruptYou can interrupt a Suprtool task with the Control-Y key (hold down Control while striking Y). Suprtool responds by telling you how much work it has done (IN=,OUT=,etc.) and asks if you wish to stop. Hit the Return key to continue or type YES to stop the task. Even though you abort the task, your output file is saved (although it may be empty if you stop before the sort phase is over).

Many HP-UX sites use Control-C as the interrupt key instead of Control-Y. Use the HP-UX 'stty' command to display your 'intr' setting. You may see some Suprtool messages indicating Control-Y is the key combination to enter, when in fact you will need to use whatever you have defined in stty.

Suprtool 5.2 for HP-UX Suprtool Commands · 85

Page 86: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Add Command [Add]Specify an SQL table to which you wish to Add records.

Add tablename

Use the Add command to "insert" records into an Oracle table. You must specify the Oracle tablename and you must have opened the Oracle database to which you wish to add records.

The tablename specified must be a valid table and not a view. The fields from the input source, or the extracted names must be the same as the column names in the table to which you wish to add records.

You do not have to specify all columns in the table; unreferenced columns will be given default values depending on their data-type.

You cannot currently add records from another SQL table. However, you can extract the records you want into a file and then add from that file.

ExamplesThe first example shows a typical Add task. A self-describing file's records are added to the table called customer. This assumes that the self-describing file has the same structure and that the field names are the same as the column names.

>open oracle scott tiger {open SQL database}>in custrecs {input file you wish to add}>add customer {specify the Oracle table}>exit {execute the task}

Our next example shows how to add by redefining the fields from a self-describing file into a table. The names are redefined so that the field names being extracted will match those in the table of the SQL database.

>open oracle scott tiger {open SQL database}>in custrecs {input file you wish to add}>def cust_name,custname {redefine the items to match}>def cust_addr,address {the names in the table}>extract cust_name {extract data under the column name}>extract cust_addr>add customer {specify the Oracle table}>exit {execute the task}

Our final example shows input from a flat file.>open oracle scott tiger {open SQL database}>in salehist {input file you wish to add}>def cust_number,1,6,byte {redefine the items to match}>def item_no,7,10,byte {the names in the table}>def sales,18,4,double>extract cust_number {extract data under the column name}>extract item_no>extract sales>add customer {specify the Oracle table}>exit {execute the task}

Suprtool cannot currently support integers larger than two words.

86 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 87: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Base Command [BA]Opens a specified Eloquence database. Once you have it open, you can extract data from datasets, delete entries, load new entries into datasets and Update certain entries.

To close the current database, use Base without parameters.

BAse [[host][:service]/]database

Open an Eloquence database (close current base). Suprtool will open an Eloquence database, the syntax has been improved to allow you top optionally specify the hostname, and or service, to connect to a given database.

base sample,5 base :eloqdb/sample,5 base hostname.robelle.com:eloqdb/sample,5

Basename is the name of your database. Mode is the DBOPEN mode that you want (i.e., mode-1 for shared updates, mode-5 for shared read-only), and password is the DBOPEN database password. When the password is included in the Base command, it is always upshifted. Use the ? option to specify lowercase passwords.

Suprtool opens the Base, which remains open until you do another Base command, a Reset Base, or a Reset All, even if you do several extracts from the database.

ExamplesThe first example shows a typical Suprtool task. A dataset in the Store database is read and a subset of the entries are sorted into a disc file:

>base store,5,READER {open for read access only}>get d-sales {select an input dataset}>if sales-total>10000 {choose a subset of all entries}>sort cust-account {sort by account number}>output salesout {output has same structure}>exit { as the d-sales dataset}

Our next example opens the database with the Creator password (which is the default). No output file is produced; instead, we produce a formatted listing of the input dataset:

>base store {use the Creator password}>form sets {you cannot remember the names}>get d-inventory { of the datasets in Store}>list {print the dataset fields formatted.}>exit { no output file is created}

In session mode, this command would prompt for the database password. If none is entered, or Suprtool is not running interactively, the Creator password is used by default (;). Because the open mode was not specified, the database is opened in mode-1.

Database Passwords in BatchIn batch mode, it is necessary to specify a database password without the password being echoed on the job stream listing. A special database password is provided to allow for this. When a question mark "?" is used as the database password, Suprtool prompts for the password on the next physical input line without echoing. This occurs in batch mode or in session mode. For example:

Suprtool 5.2 for HP-UX Suprtool Commands · 87

Page 88: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>base store,5,? {Suprtool prompts for the password.}Password > {Password is on this line, but it won't}>get d-inventory {show on job stream listing or terminal.}>exit

Open ModesBase does not allow mode-7 for exclusive read access, but it does allow mode-4 for exclusive update while others read. Mode-4 disallows changes while you are extracting from the database. Mode-3 for fully exclusive access is tolerated, but causes Suprtool to use slow DBGETs to extract from datasets.

Suprtool allows you to open a second database in the Put command when you are copying from one database to another.

Eloquence Libraries If the Eloquence libraries have not been loaded Suprtool will print an error on the Base command. To find out specific error messages as to why the libraries have not been loaded then just run Suprtool with the –lw option, which means print loader warnings.

88 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 89: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Before Command [C]Repeat any combination of the previous 1000 command lines, with or without editing.

BEFORE [ start [ / stop ] ]

[ string ]

[ ALL | @ ]

(Default: redo previous line)

(BQ=redo without change)

The Before command allows you to modify the commands before it executes them. If you don't need to change them, use BQ or Do.

The Before command uses Qedit-style Control characters for modifying the commands. The default mode is to replace characters. To delete use Control-D, and to insert use Control-B. If you prefer HP-style modify (D, R, I, and U), use the Redo command instead of Before.

Examples>ll *.fd {".sd" is not spelled right}*.fd not found>Before {redo most recent command}ll *.fd {last command is printed} s {you enter changes to it}ll *.sd {the edited command is shown} {you press Return}

>listredo -10/>before 5 {redo 5th command in stack}>bef 8/10 {redo 8th through 10th}>b ls {redo last ls command}>b ls * {redo "ls *" command}>b @* {redo last containing "*"}>before -2 {redo command before previous}>before -5/-2 {redo by relative lines}

Modify OperatorsIf you wish to change any characters within the line, the modify operators are the regular Control Codes used in Qedit:

Characters ActionAny printing characters replace the ones above. (This assumes your

EOF key has been altered from the HP-UX default.)

Control-D plus spaces deletes columns above.Control-B puts you into "insert before" mode.Control-A starts appending characters at the end of line.Control-A, Control-D, plus spaces deletes from the end.Control-T ends Insert Mode, allowing movement to a

new column.Control-G recovers the original line.

Suprtool 5.2 for HP-UX Suprtool Commands · 89

Page 90: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Control-O specifies "overwrite" mode (needed for spaces).

Persistent RedoRedo commands can be saved in a permanent file and can therefore be used from another session. You can use the Set redo command to specify a filename to save your redo commands. Please see "Redo" on page 209 for details.

90 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 91: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Chain Command [C]Selects an Eloquence dataset and a search path as the input source for the next extract. For detail datasets, the Chain command does a DBFIND on the specified search path and uses DBGET mode-5 to read the records. For master datasets, the Chain command uses DBGET mode-7. You must have read access to all fields in the dataset entry. Only one Chain, Get, or Input command is allowed per extract task.

CHAIN setname,search-field=value [,...]

CHAIN setname,search-field=table-name

When using Chain, the size of the output file defaults to the size of the Chain dataset. If the dataset is large and the selected subset is small, you should use the Numrecs command to reduce the size of the output file.

Selection by Individual ValuesSuppose you want to find all the sales records for customer account "1234". Assuming that cust-account is a search field in the d-sales dataset, you would use this:

>base store,5,READER {open for read access only}>chain d-sales,cust-account="1234" {read the sales records for customer 1234}>out out1>xeq

If you want to select sales records for more than one customer, you would use:

>chain d-sales,cust-account="12345","67890","39201">out out2>xeq

Values with Decimal PlacesYou can specify values with decimal places for search fields with implied decimal places. For example,

>item unit-cost,decimal,2 {two implied decimal points}>chain d-inventory,unit-cost=10,10.5,10.75>out out3 {select records for 1000, 1050, and 1075}>xeq

Selection with a TableYou can specify the records to read using a table. The Table command may appear before or after the Chain command. Use this option when you have a file of key values to search for:

>{select the sales records that match the values in custfile}>chain d-sales,cust-account=sales-table>table sales-table,cust-account,file,custfile>out out4 >xeq

Combining Chain with IfThe Chain command selects an input dataset and a set of key values to search for. To specify additional selection criteria, use the Chain command to specify the key values and the If command for the additional selection criteria:

Suprtool 5.2 for HP-UX Suprtool Commands · 91

Page 92: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>{select records for customer 1234 where the sales-qty is }>{ greater than 100}>chain d-sales,cust-account="1234">if sales-qty > 100 >out out5 >xeq

NotesThe Chain command is intended to replace a Get and If combination where the primary selection is by key value. In many cases, it is still faster to use the Get command to read the entire dataset than it is to use the Chain command to use search-paths. Use Set Stat On to compare the performance of the Chain and Get commands.

The Chain command always reads the chain values in sorted order by ascending search-value. You do not need to specify a Sort command to have the output file sorted by the search field.

92 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 93: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Clean Command [CL]Specifies what characters to clean when using the $Clean function.

CLEAN [ SPECIAL | <string> <range> ]

(Default: None)

Suprtool will "clean" or replace all of the characters specified in the Clean command from a byte type field when invoked by the $Clean function. To define what characters that need to be replaced you use the clean command with the character you want to clean in quotes. Since most of the characters that you will need to clean are unprintable, you can enter the decimal equivalent of the character. This is denoted by entering the "^" character in quotes preceding the decimal number of the character you wish to clean.

An example of how easy it would be to clean your database of certain "bad" characters in byte-type fields would be as follows:

>base mydb,1,; >get customer >clean "^9","^10","^0","^7" >update >ext address(1) = $clean(address(1)) >ext address(2) = $clean(address(2)) >ext address(3) = $clean(address(3)) >xeq

The SPECIAL keyword automatically defines Clean characters of Decimal 0 thru to Decimal 31.

>base mydb,1,; >get customer >clean special

>update >ext address(1) = $clean(address(1)) >ext address(2) = $clean(address(2)) >ext address(3) = $clean(address(3)) >xeq

You can also specify a range of characters with the following syntax:

>base mydb,1,; >get customer >clean "^0:^10"

>update >ext address(1) = $clean(address(1)) >ext address(2) = $clean(address(2)) >ext address(3) = $clean(address(3)) >xeq

The above task would clean all byte type fields of any characters from Decimal 0 (Null) to Decimal 10. (Line Feed)

Removing Bad CharactersYou can have the Clean function clean the field, and instead of replacing with a space, the $clean function will essentially shift characters to the left by Setting the CleanChar in the following manner:

Suprtool 5.2 for HP-UX Suprtool Commands · 93

Page 94: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>Set Cleanchar “<null>”

Suprtool will pad the field that was cleaned with the appropriate amount of characters with a space at the end of the field.

94 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 95: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Define Command [D]Defines fields that can be used in the Duplicate, Extract, If, Item, Sort, Table, and Total commands. With Define, you can do selection on ordinary data files using the same kind of readable "expression" that you use with databases. You can also access data fields that are not actually structured as defined in the database (e.g., implicit subfields within an IMAGE field).

DEFINE field, definition

field is an identifier up to 32 characters long, must begin with a letter, and can consist of letters A through Z, digits 0 through 9, or the following symbols:

+ - * / ? # % & @ _ $ '

In the case where the field name is written to a self-describing file, only the first 16 characters are used.

definition can be in two different forms: absolute or relative.

Absolute DefinitionsDEFINE field, byteposition,sublen [,type] [,subcount]

(Default: type=BYTE, subcount=1)

The byteposition is a positive integer giving the byte index where the field starts. The first byte is always number 1, not 0. The sublen is the number of bytes in the field. When the subcount is 1 (default), the sublen is the total number of bytes in the field. When you specify a subcount, the sublen is the byte-length of each subfield.

See Data-Types below for the definition of type.

>input uxfile,reclen 40, lf {input from a disc file}>def qty,14,4,double {double integer (PIC S9(9) COMP)}>def name,5,6 {character string of 6 bytes}>sort name {sort using the field "name"}>total qty {total all the values of the field "QTY"}>exit

Relative DefinitionsDEFINE field, fieldname [ (subscript) ] [ [offset] ] [,sublen] [,type]

[,subcount]

(Default: sublen/type=same as fieldname)

The fieldname is a field from an Eloquence dataset specified in Get or Chain, or a column from a table specified in Select, or a field from a self-describing file, or another Defined field. Relative definitions are similar to COBOL's Redefine verb.

The sublen and type are optional. They default to the total byte length and type of the fieldname. The (subscript) parameter is an optional sub-item index for arrays such as Eloquence compound items like 5J2 or 4X20. The first sub-item is number 1, and if no subscript is provided, Suprtool uses the first sub-item. The [offset] parameter is optional and specifies a byte offset from the position that would otherwise be used. This allows you to define fields relative to other fields. The [offset] starts at 1 and not at 0 (i.e., FIELD[1] is the first byte of the field).

To define a field that corresponds to the second index of the address array of the customer file, you would use:

Suprtool 5.2 for HP-UX Suprtool Commands · 95

Page 96: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>in customer {self-describing file}>define city,address(2)>if city="Vancouver">list>xeq

Data-TypesHere are the valid types:

Type DescriptionBYTE printable ASCII charactersINT/INTEGER two's complementDOUBLE two's complementIEEE IEEE floating-pointPACKED packed-decimalPACKED* packed-decimal, last nibble unusedDISPLAY zoned-decimal numeric fieldLOGICAL unsigned integerCHARACTER for Native Language Support

The Define command also accepts Fpoint as the data-type for IEEE numbers.

The following table shows the Suprtool definitions for the IMAGE data-types:

IMAGE Type Number of Bytes COBOL Declaration

SUPRTOOL Definition

I1 2 S9(4) COMP >define a,1,2,integerI2 4 S9(9) COMP >define a,1,4,doubleI4 8 S9(18) COMP >define a,1,8,integerJ1 2 S9(4) COMP >define a,1,2,integerJ2 4 S9(9) COMP >define a,1,4,doubleJ4 8 S9(18) COMP >define a,1,8,integerUn n A(n) >define a,1,n,byteXn n X(n) >define a,1,n,byteZn n 9(n) >define a,1,n,displayPn n/2 S9(n-1) COMP-3 >define

a,1,n/2,packedK1 2 >define a,1,2,logicalK2 4 >define a,1,4,logicalE2 4 >define a,1,4,ieeeE4 8 >define a,1,8,ieee

Data-type Display may have a trailing overpunch sign.

96 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 97: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Packed-Decimal FieldsWhen defining packed-decimal fields, you must convert the number of decimal digits into a byte count. The last digit of a decimal field is always used for the sign. There are two data-types for decimal fields: PACKED for those that end on a byte boundary and PACKED* for those that end in the middle of a byte. Here are some example definitions of packed-decimal fields:

Suprtool Definition Description>define m,1,2,packed s9(3) COMP-3, P4 in IMAGE, 2 bytes, 4

nibbles, last is sign digit>define n,1,2,packed* s9(2) COMP-3, P4 in IMAGE, 2 bytes, 4

nibbles, last digit is unused>define p,1,6,packed s9(11) COMP-3, P12 in IMAGE, 6 bytes, 3

words, 11 digits

Data-Type WarningThe Define command accepts field definitions of any combination of byte-length and data-type. However, many combinations have limited usefulness in Suprtool. In these cases, Suprtool prints a warning. For example:

>def field,1,1,integerWarning: Length of 1 is of limited use for the data-type INTEGER

ExamplesThe following examples show the various data-types and combinations that are available with the Define command:

>define a,11,4,double {J2 or I2, S9(9) COMP}>define b,21,2,int {J1 or I1, S9(4) COMP}>define e,21,8 {character string}>define f,address(5) {fifth occurrence of address}>define g,address(5)[3],4 {relative offset}>define h,address(5)[4],2,byte {middle of the address}>define i,x[6],4 {starts at sixth byte of X}>define j,invoice,6,byte {redefine field as Byte}

Absolute ExampleThe following example shows the most basic use of the Define command to create a new field definition at an absolute location in the input record.

{"amt" is an integer that starts at the 11th byte of file}>def amt,11,2,int>if amt > 1000 {"amt" is now a field we can select on}>output outfile

Absolute Example with SubcountIMAGE and Suprtool allow fields to be repeated. In the next example, we define an amount field that repeats twelve times (e.g., once for each month of the year). We use a subscript when we want to refer to a specific month.

Suprtool 5.2 for HP-UX Suprtool Commands · 97

Page 98: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>def amt,11,2,int,12 {"amt" is an integer that repeats 12 times}>if amt(5) > 1000 {we select on the 5th subfield}>output outfile

Relative ExamplesUse the simplest form of relative definitions to rename existing fields.

>def quantity,qty {"quantity" is a more readable name}>if quantity = "100 " {selection on the new field}

The Define command copies the byteposition, sublength, and type to the new field, but it does not copy the subcount. Define assumes that you want the first subfield:

>def amount,amt {amt is 12J2}>if amount > 1000 {amount is 1J2 and is the same as amt(1)}

Relative Example with SubcountBecause Suprtool defaults the subcount to one, you might want to specify an explicit subcount when giving a new name to an existing field.

>def amount,amt,,,12 {amt is 12J2; same length and type}>if amount(5) > 1000 {amount is 12J2; we are selecting for May}

Relative Example with SubscriptUse subscripts to define a new field that corresponds to a specific subfield.

>def may,amt(5) {amt is 12J2}>if may > 1000 {may is the fifth subfield}

Relative Example with OffsetMany applications define subfields within a larger character field. A common example is a part-number where the first four digits are the warehouse location, the second four digits are the bin number, and the last four digits are a serially assigned number. Use the offset parameter to define new fields that are relative to the start of the part number. The file INVOICES is a self-describing file.

>in invoices {part is 12 bytes}>def warehouse,part,4 {warehouse starts at part}>def bin,part[5],4 {bin is second four bytes}>def release,part[9],4 {release is the last four bytes}>if bin = "100" {use any field for selection}

Note that redefining the digits of a larger numeric field only works when the field is a character field (type X, U, or A).

Relative Example Combining Subscripts and OffsetsIf we have ten part numbers combined into one field (e.g., 10X12) we can still define a single field that corresponds to the bin number of one of the parts.

>in invoices {allparts is 10X12}>def bin3,allparts(3)[5],4 {we are checking starting at the fifth byte …}>if bin3 = "100" {… of the third part}

NotesThe purpose of the Define command is to tell Suprtool to look at a portion of the input record in a certain way. For example, if the record contains ASCII digits in the

98 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 99: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

first ten bytes, Define could be used to assign a field definition to the first six bytes. In this case, the field must be defined as data-type Byte, Char or Display.

The Extract command may be used for data conversion. See the Data Conversion section of the Extract command for details.

The Define command cannot be used to convert data from one format to another. Using the same example, the Define command could not be used to treat the first six digits of the ten digit ASCII field as Integer, Packed, Real, or any other numeric data format. If the input record contains ASCII digits, Define cannot change them to another data-type.

It may be helpful to think of the Suprtool Define command as similar to a COBOL REDEFINES clause, or a FORTRAN EQUIVALENCE statement.

Suprtool 5.2 for HP-UX Suprtool Commands · 99

Page 100: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Delete Command [DEL]Deletes all entries selected from the input Eloquence dataset.

DELETE

Delete has no parameters, and can be entered only after the source of input records has been specified using Get or Chain. Delete causes Suprtool to "delete" the input records after they have been read, either all of the input records, or a subset defined by the If command. Delete is not supported for SQL or disc files, only for Eloquence datasets.

Examples>:comment Delete and sort old transactions, write to file.>base store>get d-sales {dataset to delete from}>if purch-date<980101 {select which records to delete}>delete {ask for deletion}>sort cust-account {sort by account and sort}>sort purch-date { by date}>output oldsales {output file with deleted and sorted records}>exit

Losing RecordsDelete can be combined with other operations, such as select, sort, write to output file, and even a Put to another dataset. Care must be used when combining operations, because such combinations cannot be restarted if the Suprtool "run" is aborted for any reason (including hitting Control-Y and answering "yes"). See "Suprtool and " on page 62 for more details on using the Delete and Put commands in combination.

Suprtool deletes records during the input phase. This means that records are deleted before they are sorted. All of the selected input records are deleted before the first output record is written when sorting the input. If you press Control-Y and answer "yes" before a delete task has completed, there may be no way to recover your deleted records.

Warning MessageWhen deleting records from the input dataset, Suprtool asks for permission to delete all records if there is no If command to select the records to be deleted:

Delete all records from the D-SALES dataset [no]:

Respond Yes for the task to continue.

In batch mode, Suprtool assumes Yes and keep processing.

Note that if there is no If command, but there is some other command to limit the number of records deleted (e.g., the Numrecs command or a record-range on the Get command), Suprtool still asks the question, implying that all records in the dataset will be deleted. In these cases, only the records that are read, based on the limiting factor, will be deleted.

For interactive approval of each deletion, see the Delete command of Dbedit.

100 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 101: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

NotesFor Eloquence manual master datasets, a DBDELETE call fails if the entry to be deleted is a "chain-head" with related detail entries still linked to it. When this happens, Suprtool, by default, prints an error and stops processing the input data. If Set Dumponerror On, the record is printed on $stdlist. If Set Ignore On has been entered, Suprtool continues processing and prints a count of "chain-heads" at the end. Records that cannot be deleted are not included in the output file.

Suprtool 5.2 for HP-UX Suprtool Commands · 101

Page 102: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Do Command [DO]The Do command repeats (without changes) any of the previous 1000 commands.

DO [ start [ / stop ] ]

[ string ]

[ ALL | @ ]

(Default: repeat the previous command)

Commands are numbered sequentially from 1 as entered and the last 1000 of them are retained. Use the Listredo command to display the previous commands. You can repeat a single command (do 5), a range of commands (do 5/10) or the most recent command whose name matches a string (do list). If you want to modify the commands before executing them, use Redo or Before.

Examples>listredo {see the previous 20 commands}>do {do previous command again}>do 39 {do command line 39 again}>do 5/8 {do command lines 5 to 8 again}>do list {do most recent List command}>do grep {do last starting with "grep"}>do grep job * {do last "grep job *" command}>do @job {do last containing "job"}>do -2 {do command before previous one}>do -7/-5 {do by relative line number}>do 5/ {do command lines 5 to "last"}

NotesThe Do command can be abbreviated to ,., as in MPEX . You cannot use ";" to combine commands on the same line.

102 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 103: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Duplicate Command [DU]By default, Suprtool copies all selected input records to the output file. The Duplicate command determines what to do with duplicate output records. Duplicate records can be discarded, producing an output file without duplicates. Alternatively, you may be interested in seeing the duplicate records, so you can create an output file consisting solely of the duplicate records. When deciding whether an output record is a duplicate, Suprtool either compares the keys only or the entire output record.

DUPLICATE NONE | ONLY

RECORD | KEYS [num]

[ COUNT ] [ TOTAL ... ]

NoneThe None option removes duplicate records from the output file. Suprtool compares each output record with the previous output record. If they are not the same, the record is added to the output file. This option corresponds to the former Nodup and Nodupkey options of the Output command.

>key 1,4>duplicate none keys

Input Output

1111 10 1111 102222 25 2222 252222 35 3333 483333 48

OnlyThe Only option is the exact opposite of None. Only selects all output records that would not be written by the None option. When the Only option finds a record that duplicates a record already in the set, it writes that duplicate to the output file. Note that the first record is not written to the output file. Here are two examples:

>key 1,4>duplicate only keys

Input Output Input Output

1111 10 2222 35 1111 10 2222 352222 25 2222 25 2222 422222 35 2222 353333 48 2222 42

RecordSuprtool has two methods for comparing output records: Record and Keys. The Record option compares the entire output record. This option can be specified without a sort, but in that case the input file must already be sorted. Note that there are two data fields in the records in the following example, so that a comparison of the entire record yields no duplicates.

Suprtool 5.2 for HP-UX Suprtool Commands · 103

Page 104: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>duplicate none record Input Output

1111 10 1111 102222 25 2222 252222 35 2222 353333 48 3333 48

KeysThe Keys option compares only the sort keys to determine whether an output record is a duplicate. This option requires that at least one sort key be specified.

>sort agent {sort by agent}>duplicate none keys>output agents {create roster of agents}

The Keys Num option determines the level at which Suprtool compares sort keys. This option controls which duplicate records get included in (or excluded from) the output file.

In the following example we sort by agent and by bill-date (in descending order), but only check for duplicates at the agent level.

>sort agent {sort by agent}>sort bill-date,desc {sort by date}>duplicate none keys 1 {only check for duplicate agents}>output agents {create roster of agents}

CountThe Count option causes Suprtool to produce a new field in the output record with the number of occurrences of each key value. The count field is called st-count, and is an I2-type field. The Count option can only be used with Duplicate None Keys.

>key 1,4>duplicate none keys count

Input Output

1111 10 1111 10 12222 25 2222 25 2 {two records for key value 2222}2222 35 3333 48 13333 48

TotalThe Total option allows up to 15 fields to be subtotaled for each duplicate key. Separate the fields with spaces, not commas. The Total option can only be used with Duplicate None Keys. A new field is created at the end of the output record for each total. Each field is called st-total-n:

>sort customer-no>extract customer-no>duplicate none keys total sales-qty sales-amt

The above commands will create a self-describing file with the field customer-no and the total by each customer of the sales-qty in the field st-total-1. Similarly the field st-total-2 will contain the total sales-amt by customer number.

The following data-types are chosen for each total based on the data-type of the field:

Data-Type Total Data-Type

104 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 105: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

IEEE E4all others P28

Please see the P28 Fields section on how to define these fields in Cobol and PowerHouse programs.

Note that for byte fields, there can be only digits in the field. If there are other characters such as "+", "-", or ".", then Suprtool reports an error.

You can use the Link output option to easily see the fields that Suprtool creates. For repeated fields (e.g., 6I2), the first subfield is subtotaled if you don't provide a subscript. You can combine the Count and Total options, but the Count option must appear before the Total option. You cannot combine the Total command with the Total option of the Duplicate command.

>key 1,4>def field,5,2,integer>duplicate none keys total field

Input Output

1111 10 1111 1 102222 25 2222 2 60 {25 + 35 = 60}2222 35 3333 4 483333 48

Deleting Duplicate RecordsThere is no direct way to delete duplicate records. Specifying both the Delete and Duplicate commands does not delete all duplicate output records. This is because the Delete command occurs in the input phase, as records are read and selected, but the Duplicate command occurs in the output phase after the sort has taken place. The Duplicate command is not part of the selection process; it is the If command that determines what records are deleted. A common mistake is to specify the Duplicate and Delete commands without an If command. In this case, Suprtool asks your permission to delete all input records. Answer "No" to this question to abort the task.

It may be possible to remove duplicates from an input dataset using Suprtool, but only through roundabout methods. These are too case-specific to document here. If you need to do this, call Robelle technical support for assistance.

Self-Describing FilesWhen you are using the Count or Total options, the sort information is not retained in the output file. This means that if your output file is in LINK format, there are no sort keys. If you are going to use this file from Suprlink, use the BY-clause of the LINK command to manually specify the sort keys.

Non-Self-Describing FilesIf the input file is not a self-describing file and you are using Count or Total, you also need to extract all the fields from the file. You can quickly extract the fields by defining a new field that contains the entire record. For example, if your records are 56 bytes long, then you do the following to extract all the fields:

Suprtool 5.2 for HP-UX Suprtool Commands · 105

Page 106: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>define entire,1,56,byte>extract entire

Output RestrictionsWhen you are using the Count and Total options, the only Output formats that you can use are Data, Data-Num, Query, and Link. If you want to quickly see the Count or Total results without using a second pass, use the List Standard command.

>select * from table>sort key_field>duplicate none keys count total data_field>output result,link>list standard>xeq

NotesThe option of Only or None must be specified before the option of Record or Keys. Reversing the order causes a syntax error in the Duplicate command.

You cannot combine the Total command with the Total option of the Duplicate command.

It is important to note that if the field being sorted is the result of a $function, then you may not be sorting on the value of the field after the function has transformed the field. For example the following task may not give you the result you expect:

>base store,5>get d-sales >def cust-accountx,1,6,byte>ext cust-accountx = $edit(cust-accout,"zzzz99" >sort cust-accountx {sorting on transformed field before it has value from function}>dup none keys>output dsales>exit

In this instance you will not be sorting on cust-accountx as transformed by the $edit function, but rather the first six bytes of d-sales. Therefore it is important to note when you are using extract to transform a field, you will not be sorting on that transformed value.

Therefore the way to do the transformation would be to either divide into two tasks or if you can logically sort on the field before the transformation in order to achieve the result, so the task could be:

>base store,5>get d-sales >def cust-accountx,1,6,byte>ext cust-accountx = $edit(cust-accout,"zzzz99" >sort cust-account {Note sorting on source field}>dup none keys>output dsales>exit

or if two tasks are necessary:

106 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 107: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>base store,5>get d-sales >def cust-accountx,1,6,byte>ext cust-accountx = $edit(cust-accout,"zzzz99" >output tempsales>xeq>in tempsales>sort cust-acctx>dup none keys>output dsales>exit

Suprtool 5.2 for HP-UX Suprtool Commands · 107

Page 108: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Edit Command [ED]Edits an Eloquence database.

EDIT

The Edit command of Suprtool invokes an independent module of Suprtool called Dbedit. This module permits the user to add, change, list, or delete individual records or "chains" of records from an Eloquence database. This module should be useful for debugging systems, doing data entry on simple systems, and quickly prototyping systems. The Edit command uses the database opened previously by the Base command. Where Suprtool is primarily a serial tool, the Edit module is primarily a tool for chained or keyed access.

Examples>:comment Edit the STORE database.>base store,1,writer {open for write access}>edit {switch to Dbedit}#list d-inventory {Dbedit prompts with "#"}#exit {returns control to Suprtool}> {Suprtool prompts again}

NotesAn entire user manual has been provided to describe how to use the Edit feature of Suprtool. See See the Dbedit section in the manual for all the details.

108 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 109: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Exit Command [E]Exit Suprtool in one of two ways.

EXIT [ ABORT | XEQ ]

(Default: XEQ)

Users are often frustrated when they exit Suprtool after specifying only part of a task because Suprtool starts processing the task. To exit Suprtool without executing the current task, use the Abort option.

Typing Exit with no parameters means Exit Xeq. Suprtool recognizes special command names which specify both the Exit command and an exit option (e.g., EA means Exit ABORT).

Exit Abort [EA]Cancels the current operation and terminates Suprtool. The Exit command without parameters always attempts to perform the task currently specified, while Exit Abort cancels the task and terminates immediately. Thus, Exit Abort is similar to Reset All;Exit.

ExamplesYou began to specify a sort, stopped for coffee, and decided to cancel the task on your return:

>!# You began to specify a sort, stopped for

>!# coffee, and decided to cancel the task

>!# upon your return.

>open oracle demo reader

>select * from customer

>sort name_last; sort name_first

...coffee break ...

>exit abort {cancel the sort and terminate}

End Of Program

Exit Xeq [EX]Signal the end of command input and the start of an extract operation. After the Suprtool task completes, Suprtool terminates. Exit Xeq is the default option (i.e., specifying Exit starts execution of the current task).

Suprtool 5.2 for HP-UX Suprtool Commands · 109

Page 110: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Examples$/opt/robelle/bin/suprtool>exit {no input was specified}No action taken.

$/opt/robelle/bin/suprtool>input rep23.newdata>out rep23.data>xeq {copy one file}>input rep24.newdata>out rep24.data>exit {copy and stop}

Notes on Exit XeqIf you have entered neither sort keys nor an input source, Exit terminates Suprtool without performing any task. If you have defined an input source but without any sort keys, Suprtool does a copy operation prior to stopping.

110 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 111: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Export Command [EXP]You cannot use Suprtool's Export command to invoke STExport/UX, but you can run STExport/UX by itself.

/opt/robelle/bin/stexport

STExport/UX/Copyright Robelle Solutions Technology Inc. 1988-2009(Version 5.2)$

STExport/UX only accepts self-describing files created by Suprtool/UX or the MPE SDUnix program.

Suprtool 5.2 for HP-UX Suprtool Commands · 111

Page 112: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Extract Command [EXT]Assembles output records by stringing together fields extracted from input records. There can be up to 255 extracted fields, and the same field may be extracted more than once. Constant values may be used instead of the value of the field from the Input record.

EXTRACT field [(subscript)] [=value |=field2 ] [,...]

EXTRACT field1 [(subscript1)] \ field2 [(subscript2)]

EXTRACT target-field [=expression]

(Default: subscript=entire field)

Field ParameterEach extracted field must be an Eloquence field name, an SQL database table column, or a field in an SD file, or a Defined field. If the field requires an Item definition, then the Item command must precede the Extract command. Extract specifies a rearrangement of the Input data fields to produce the Output data record; there is no data conversion, unless "output xxx, ascii" is specified.

The subscript parameter is valid only for compound items. The total item is extracted if it is compound and no subscript is specified.

>extract account {extract the key value and}>extract rating { one other field}>output out1 {output file has two fields}

Cumulative ExtractsThe Extract command is cumulative. If two Extracts are specified in one run, all fields of the two Extract commands are used.

>extract status,balance,account,purchased

is equivalent to

>extract status,balance>extract account,purchased

Constants

Extracting ConstantsThe value part of the Extract command is used to place a constant in each record of the output file. In this case, the field defines the type and length that the value occupies. The value portion must match the type of the field. String values will be extended with blanks to fill the entire field. If the input data does not have a field of the correct size and type, you can create one using the Define command.

>ext account {key value}>ext rating=0 {place the value "0" in the "rating" field}>output out2

The total number of bytes that you can extract for all constants is 5,100 bytes for MPE/iX and HP-UX, and 1,275 bytes for MPE/V.

112 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 113: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Packed and Display ConstantsWhen extracting non-negative packed and display constants, Suprtool extracts them as unsigned unless you use a leading plus sign. For the value zero, you can use a leading plus or minus sign to get a positive or negative 0.

>def field,1,6,packed>ext field = 1 {unsigned 1}>ext field = +1 {signed 1}>ext field = +0 {positive 0}>ext field = 0 {unsigned 0}>ext field = -0 {negative 0}

Decimal PlacesIf a field has implied decimal places, Suprtool scales the input values according to the number of decimal places. For example,

>item tax ,decimal,2 {two implied decimal pts.}>item total,decimal,2 {same}>extract tax = 1.02 {specified decimal pts.}>extract total = 100 {value stored as 10000}>output out3

Blank FillIf you want to create an output record that consists of fifty blanks followed by the customer name, use:

>define filler,1,50>ext filler=" ">ext name

String ConstantsYou can specify a string constant without referring to a field. For example, to leave a space between fields, you must do the following:

>extract account," ",rating>output *,ascii

Suprtool uses the length of the string to determine the size of the field. The following example extracts the same fields as the previous example, but each output record identifies the field:

>extract "Customer Account=",account," ">extract "Credit Rating=",rating>output *,ascii

The output would look like:

Customer Account=04598921 Credit Rating= 5000Customer Account=44657844 Credit Rating= 20000Customer Account=98753198 Credit Rating= 3000

The spaces after "Credit Rating=", before the rating value, is due to the numeric field Rating being extracted with blanks for its leading zeros. This is the result of the Ascii option of the Output command.

Repeated FieldsIf the field is an IMAGE repeated field (e.g., 10J1), the Extract command places the value in each of the repeated fields when you do not specify the subscript. If you specify a subscript, only that one repeated field will have the new constant value.

Suprtool 5.2 for HP-UX Suprtool Commands · 113

Page 114: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

In this example, Address is a repeated field (2X20). We wish to extract the data as it exists in the input record rather than forcing it to a constant value.

>ext account {extract key value}>ext address {take both of the repeated fields}

In the next example, we assume that the Balance field is a repeated field (12J2). We wish to make each of the 12 repeated fields in the output record equal to 100:

>extract name>extract balance=100

If we only wanted to extract the sixth field of BALANCE and set it to 100 we would do the following:

>extract name>extract balance(6)=100

Character ConstantsUse the ^-character to specify any ASCII character. The number (the actual ASCII value), or letter (^A means control A), must follow immediately after the ^-character. Suprtool treats character constants as strings. When you extract the constant to a field longer than one byte, Suprtool pads it with spaces.

>define field,1,1 {byte field}>ext field = ^0 {binary zero}>ext field = ^G {Control-G (bell)}>ext field = ^27 {escape}>ext field = ^252 {Roman-8 box}>ext field = ^186 {Euro currency symbol €}

You can also extract the constant directly without referring to a defined field. This always produces a one-byte constant with no blank padding.

>ext ^0 {binary zero}>ext ^13,^10 {Carriage Return, Line Feed}>ext ^M,^J {CR, LF again}>ext ^27,"&dB" {escape sequence}

Dates

Extracting Today's DateTo extract today's date, use the following:

>item field,date,ccyymmdd {identify date format of field}>extract field=$today {today's date}>extract field=$today(-1) {yesterday's date}>extract field=$today(+1) {tomorrow's date}

Use the Item command to qualify the field as a date. Suprtool uses the date format to determine the output format of the date. The $today function accepts one optional argument which is the number of days before or after today. The maximum number of days in either direction is 9999.

Oracle dates include both the date and the time. If you extract an Oracle date using $today, the time is always 00:00 (i.e., midnight).

Extracting Relative DatesThe Extract command provides the same relative date features as the If command (see "Date Selection" on page 151 for a complete description of the options of

114 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 115: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

$date). You must first use the Item command to identify the field name as a date. Suprtool uses the field type and length along with the date format to determine the output format of the date. Note that the three parts of $DATE are always specified in (year/month/day) order, regardless of the date format of the field.

>item field,date,mmddyy>extract field=$date(*/*/*) {today's date}>extract field=$date(*/*-1/01) {start of last month}>extract field=$date(*/*-1/last) {end of last month}

Oracle dates include both the date and the time. If you extract an Oracle date using $date, the time is always 00:00 (i.e., midnight).

$StddateSimilar to the If command, the Extract command is also capable of utilizing the $stddate function. This will allow for conversion of any of the supported Suprtool date formats to be converted to a date in the ccyymmdd date format in a double integer container.

For example,

>in sdfile {a self describing file}>def new_ship_date,1,4,double>item ship_date,date,mmddyyyy>ext order_no / sales_amount>ext new_ship_date = $stddate(ship_date)>out salesinfo,link>xeq

Invalid Dates

Because the $stddate must have a valid date in order to properly convert the date to the ccyymmdd format, a value of 0 will be returned for any invalid dates. An invalid date is any number of a particular date format whose date equivalent cannot be found on the calendar.

This means that if you attempt to extract use the $stddate function against a value that is not a valid date then the extracted value will be 0.

$DaysAs with the $stddate function, the $days function is also available to the Extract command. You can convert any supported date to a Julian Day number in the following manner:

>in ordfile>def ship-days,1,4,double>def order-days,1,4,double>def delay,1,4,double>ext order-no>ext ship-days=$days(ship-date)>ext order-days=$days(order-date)>ext delay=$days(ship-date)-$days(order-date)>out neword,link>xeqIN=15, OUT=15. CPU-Sec=1. Wall-Sec=1.

Invalid Dates

If an invalid date is encountered, the extracted value will be zero. Therefore in the example above, if the order has not yet been shipped (ship-date does not contain a valid date) the resulting delay value will be negative.

Suprtool 5.2 for HP-UX Suprtool Commands · 115

Page 116: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Add and Subtract DatesWith the $days function, you can generate a date that is n days before or after any date. In the following example, we show you how to get the previous day's date.>input YOURFILE>def origdate,1,8>def yesterday,1,8>item origdate,date,yyyymmdd>item yesterday,date,yyyymmdd>ext origdate>ext yesterday = $stddate($days(origdate) – 1) {or +7 for next week}>out tmpfile,link>xeq

Sample output:

ORIGDATE YESTERDAY

19990101 1998123119991231 1999123019990301 19990228

Date LimitsThe $date function in Suprtool can generate dates between the years 1583 and 2583. Some date formats have limits based on their particular format, such as 2027 for a Calendar date and 2259 for the aammdd aamm, mmddaa, ddmmaa dates.

Range of Fields

Extracting a Range of FieldsYou can specify a range of fields to extract using the following:

Extract Field1 \ Field4

This feature only works with Eloquence fields, input files "equated" to an Eloquence dataset and for self-describing files. If you specify a range, Suprtool extracts all 4 of the field names between field1 and field4 inclusive. When specifying a range of a self-describing file that has been equated to an Eloquence dataset, the Eloquence dataset definition takes precedence.

>get d-sales {a self-describing file}>ext product-no\sales-qty>out dsales>xeq

is exactly the same as:

>get d-sales {a self-describing file}>ext product-no {first field in the range}>ext product-price>ext purch-date>ext sales-qty {last field in the range}>out dsales>xeq

Extracting a Range of Subscripted FieldsSuprtool accepts a subscript on either field in a range. You can even use this feature to extract a range from a single field. For example, if sales_amt is a 12J2 field:

116 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 117: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>in sales {a self-describing file}>ext sales_amt(4)\sales_amt(6)>out dsales>xeq

is equivalent to:

>in sales {a self-describing file}>ext sales_amt(4) {first subscripted field}>ext sales_amt(5) {intermediate subfield}>ext sales_amt(6) {last subscripted field}>out dsales>xeq

Alternate Syntax for Extracting a RangeSuprtool accepts a slash "/" in place of the backslash "\" to specify a range. Use the slash with care, because it is a valid character in field names. For example,

>extract a/b

would produce the error message:

Error: Field "A/B" does not exist

To use a slash in an extract range, surround it with spaces:

>extract a / b

Numeric ExpressionsYou can specify arithmetic expressions for any numeric data-type in the Extract command. Arithmetic expressions involve the operators +, -, *, / and mod. Extract arithmetic expressions work exactly as If command arithmetic expressions. To extract an expression, use this syntax,

EXTRACT target-field = expression

Target-FieldThe target-field determines the byte-length, data-type, and repeat-count for the expression. The expression is extracted during the output phase and cannot be used by other Suprtool commands that accept fields (e.g., sort). To avoid confusion, it is best to define a new field name for the target-field instead of using an existing field name.

Examples>extract budget99 = actual98 + 1000

>extract total = cost * qty

>extract day = ccyymmdd-date mod 100

In the following example, the field total is used twice. In the first case, it is used to tell Suprtool how to format the arithmetic expression. In the second case, it is used in the sort command. Warning: In this example, the output file is sorted by the value of total as it appears in the input record. It is not be sorted by cost * qty.

Suprtool 5.2 for HP-UX Suprtool Commands · 117

Page 118: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>extract total = cost * qty>sort total {sort by input total}

RestrictionsYou can only use one expression in each Extract command, and the expression must be the last item. If you want to extract several expressions or more fields after an expression, you need to use several Extract commands.

Incorrect

>extract name, i=sales + tips, c=cost + expense, dept

Correct

>extract name, i=sales + tips>extract c=cost + expense>extract dept

Constants vs. ExpressionsIf you have an arithmetic expression that starts with a constant, Suprtool assumes that you are attempting to extract a single constant value and not an arithmetic expression. To specify an arithmetic expression that starts with a constant, surround the expression with parentheses. For example,

Incorrect

>extract c = 6000 - costError: Missing comma or invalid arithmetic expression

Correct

>extract c = (6000 - cost)

Numeric TruncationThe accuracy of arithmetic computations is limited to approximately sixteen digits. Suprtool may truncate four-word integers (quad), or large packed-decimal numbers, or display numbers when they are converted to floating-point. Suprtool does not produce any error or warning in this case.

$Abs functionSuprtool supports an $abs function, which returns the absolute value of a number. For example, if a field called Credit contains the value -547.83, the $abs function returns 547.83.

This function will work on a field or even on an expression such as:

>def newcredit,1,4,double>ext newcredit = $abs(credit / 100 * 1.07)

This function will also work in the If command:

>if $abs(credit / 100 * 1.07) > 500.00

$Truncate functionSuprtool supports a $truncate function which returns the number to the left of a decimal place. For example if the field stddev contains the value 547.83, the $truncate function will return 547. Note that there is no rounding.

This function will work on fields and expressions. For example,

118 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 119: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>def newdev,1,4,double>ext newdev = $truncate(stddev / 100 * 1.07)

This function will also work in the If command:

>if $truncate(stddev / 100 * 1.07) > 200

$SubTotal FunctionSuprtool has the ability to keep a running subtotal for any numeric field based on a given sort key. The target data must be a packed field with 28 digits, in order to avoid overflow issues.

A sample use of the $subtotal function could be:

>def mytotal,1,14,packed >get orders >sort order-number >ext order-number >ext part-number >ext description >ext sales-amount >ext mytotal = $subtotal(sales-amount,order-number) >out sales,link >xeq

This would result in a file containing a running subtotal in the field mytotal for a given order-number. You could then generate a simple report with the simple Suprtool commands:

>in sales >list standard >xeq

The basic syntax for the $subtotal function in the extract command is:

extract targetfield = $subtotal(field,sort-field)

You must specify the sort command before referencing the sort-field in the $subtotal function. You can subtotal up to ten fields per pass and the $subtotal function is also available in the if command, however, by nature it is of limited use.

$Total FunctionSuprtool has the ability to keep a running total for any numeric field. The target data must be a packed field with 28 digits, in order to help avoid overflow issues. A sample use of the total function could be:

>def mytotal,1,14,packed >get orders >ext mytotal = $total(sales-amount) >xeq

You can total up to ten fields per pass and the $total function is also available in the if command, however, is of limited use.

$Counter FunctionFor years Suprtool has had the ability to output a record number to an output file with the num option of the output command:

Suprtool 5.2 for HP-UX Suprtool Commands · 119

Page 120: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>in mysdfile >out myfile,num,data

The above could would generate an output file called myfile, however, you would lose the SD information and you can only put the number at the beginning or the end of the data. Suprtool now has a counter function that allows you to place a $counter at any spot as well as preserve the SD information.

>in mysdfile >def mycount,1,4,double >ext field1 >ext field2 >ext mycount=$counter >out myfile,link >xeq

The file myfile will be self-describing and contain the fields field1, field2 and mycount. The field mycount is defined as a double integer, since this is the only field type that the $counter function can use. Each record will have a unique ascending number starting with one.

String ExpressionsYou can combine byte-type fields together and use the built-in string functions to create new fields out of existing ones. This can reduce the number of tasks required to provide a solution. String expressions may involve the + operator and $upper, $lower, $trim, $ltrim or $rtrim. To extract a string expression, use this syntax:

EXTRACT target-field = expression

Target-FieldThe target-field determines the byte-length for the expression. The data-type must be Byte or Char. The expression is extracted during the output phase and cannot be used by other Suprtool commands that accept fields (e.g., Sort).

Examples>extract id-no = warehouse-no + bin-no>extract full-name = first-name + last-name

Constants vs. ExpressionsIf you have an string expression that starts with a string, Suprtool assumes that you are attempting to extract a single string value and not an string expression. To specify a string expression that starts with a constant, surround the expression with parentheses. For example,

Incorrect

>extract name = " " + product-descError: Missing comma or invalid arithmetic expression

Correct

>extract name = (" " + product-desc)

Variable Length StringsString expressions use variable-length strings. Suprtool keeps track of the length of every string, and all operations are done using the actual string length. For fields, the

120 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 121: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

length of the string is the length of the field. If you do not want to retain all the spaces in a field, use one of the built-in trimming functions.

String constants are created with the exact length of the constant. For example, the string "abc" is three characters long and the string "a" is one.

When assigning the string expression to the target field, Suprtool pads the final string value with spaces to fill out the target field. String expressions longer than the target field generate an error.

>in testfile>def a,1,10,byte>ext a="I'm too long for this container"

Error: String is too long for the specified item

String TruncationSuprtool produces an error if the string expression is longer than the target field. You cannot override this error with Set Ignore On. To help avoid the error, you may want to trim the expression of trailing spaces before assigning it to the target field. For example,

>extract new-field = $trim(a + b + c)

Upshifting Strings ($Upper)Use the built-in function $upper to upshift all the characters of a string expression into uppercase characters. This function can be used to upshift a single field, a complicated string expression, or any subpart of an expression. Both ASCII and Roman-8 characters are upshifted by $upper. For example,

>extract city-up = $upper(city)>extract full-name = $upper(first + last)

Downshifting Strings ($Lower)If you want to downshift all characters of a string expression to lowercase, use the built-in function $lower. This function can be used to downshift a single field, a complicated string expression, or any subpart of an expression. Both ASCII and Roman-8 characters are downshifted by $lower. For example,

>extract city-lower-case = $lower(city)>extract city-state = $lower(city + state)

Trimming Spaces Using $Trim, $LTrim, $RTrimUse one of three built-in string functions to remove leading or trailing spaces from a string expression. The three functions are:$Trim: Remove leading and trailing spaces from the string expression.$LTrim: Remove leading spaces.$RTrim: Remove trailing spaces.

Splitting Variable Length StringsSuprtool can extract portions of a byte field based on the occurence of certain characters.

Consider the following Data:

Suprtool 5.2 for HP-UX Suprtool Commands · 121

Page 122: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Armstrong/ Neil/ Patrick Green/ Bob/ Miller Edwards/ Janine/ Armstrong/Arthur/Derek

The $split function can extract each token into separate fields. The syntax for the $split function is:

$split(Field,Start Character,Occurence,End Character,Occurence)

The following task will $split the data in the wholefield into three separate fields.

>in namefile >define lastname,1,30 >define firstname,1,20 >define middlename,1,20 >extract lastname = $split(wholename,first,"/") >extract firstname=$trim($split(wholename,"/","/")) >extract middlename=$trim($split(wholename,"/",2," ",2)) >out names,link >xeq

The first extract statement tells Suprtool extract the bytes from the field wholename, starting at the beginning (first keyword), and stopping at the "/" character. The second extract statement, tells Suprtool to extract the bytes between the first occurence of the "/" character to the next occurence of the "/" character, and then that string is trimmed of spaces as it is nested within the $trim function.

The third and final extract statement tells Suprtool to extract the bytes beginning with the second occurence of the "/" character to the second occurrence of the space character.

If the target field is not long enough to hold the data Suprtool will abort with an error. You can easily prevent this from happening on blank fields by nesting the $split statement within a $trim or $rtrim function.

First/LastThe $split function also has a Last keyword, whereby you can split the field from a given occurrence of a character to the end of the field. So in the given example from above the extracting out of the middlename could be coded as such: >extract middlename=$trim($split(wholename,"/",2,last))

The above means to extract out all the data from the second occurrence of the "/", to the end of the field and trim all spaces. Naturally as noted above we also have the First keyword, which indicates the start of the field.

UnprintablesYou can specify an unprintable character for Suprtool to use as the character to $split on, using the following syntax:

>extract middlename=$split(wholename,^9,2,last)

which means that the split would start at the second occurrence of Decimal Nine, or the Tab character. Please note that for specifying unprintable characters you do not put in quotes.

Cleaning your DataIn this day and age of migrations we were looking at issues that customers have run into when importing data into new databases. What came from this investigation where ways to Clean up your data in any given byte type field.

122 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 123: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

We have added two methods to clean your data, you can use Suprtool to clean an individual byte type field, or STExport to clean all of the byte-type fields for a given file that you are exporting.

Un-printablesSometimes un-printable or extraneous characters get stored in files or databases that have no business being there. This may be some tab characters in an address field or perhaps and embedded carriage return or line-feed. Suprtool now supports the clean function which will replace individual characters for a given byte field.

There are three things that Suprtool needs to know in order to "clean" a field. Suprtool needs to know which characters it needs to clean, what character it needs to change the "bad" characters to, and also what field does it need to clean.

Clean Command SyntaxYou can specify special characters Decimal 0 thru Decimal 31 via the command:

Clean special

You can also specify a range or characters by using the following syntax:

Clean "^0:^31","^240:^255"

The Clean command is used to tell Suprtool what characters it needs to look for in a given byte type field. For example:

clean "^9","^10","."

will tell Suprtool to replace the tab character (Decimal 9), Line Feed (Decimal 10), and a period to whatever the Clean character is set to. The CLean command takes both, decimal notation and the character itself, however, it is probably most convenient to use the Decimal notation for the characters that you wish to clean. The Decimal notation is indicated by the "^" character.

Setting the Clean CharacterBy default, Suprtool will replace any of the characters specified in the clean command with a space. You can specify what character to use to replace any of the characters that qualify with the following set command:

>set CleanChar "."

This will set the character to replace any of the qualifying "to be cleaned" characters to be a period.

Cleaning a FieldYou call the clean function, the same way you normally use other functions available to if and extract. For example:

ext address1=$clean(address1)

shows how to clean the field address1. You do not necessarily need to have the target field be the same as the source field.

Suprtool 5.2 for HP-UX Suprtool Commands · 123

Page 124: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

def new-address,1,30 ext new-address=$clean(address1)

Cleaning your dataAn example of how easy it would be to clean your database of certain "bad" characters in byte-type fields would be as follows:

>base mydb,1,; >get customer >clean "^9","^10","^0","^7" >set cleanchar " " >update >ext address(1) = $clean(address(1)) >ext address(2) = $clean(address(2)) >ext address(3) = $clean(address(3)) >xeq

The above task will look at the three instances of address and replace the tab, linefeed, null and bell characters with a space.

If you want to just remove the characters all you need to do is set the CleanChar in the following manner:

>Set CleanChar “<null>”

This means that the $clean function will remove the characters specified in the clean command, but not replace with any character, which effectively shifts the text to the left and pad the equivalent amount of spaces at the end.

Extract from a TableSuprtool has the ability to load data into a table via the Table command, and extract that data out of the table using the Extract command. The Extract command can utilize the $lookup function to return data. The syntax for the $lookup function would look as follows:

>extract target = $lookup(table-name,key-field,data-field)

The Table name, key-field and data-field are all defined by the Table command, which must be input before the Extract command. A classic example: your boss comes to you with a list of new prices for certain parts and asks you to update the Part-Master dataset.

Just load the new prices into a Table, index by the product number (prodno), then Extract the price field from each record and replace it with a $lookup on the table. Here is the code:

>table newprices,prodno,file,bosslist,data(price) >get part-master >if $lookup(newprices,prodno) >update >extract price = $lookup(newprices,prodno,price) >xeq

We do the If $lookup to select only the parts which have new prices, then do Extract with $lookup to replace the existing price with a new one. The Update command forces a database update on each selected record and must come before the Extract command.

Now let's see how a Table can be used to add additional useful information to a record. Let's say we build this table of Canadian provinces (The file prov-file is

124 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 125: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

assumed to be a Link, or self-describing, file, created by a previous pass of Suprtool.)

>table provtab,prov-code,file,provfile,data(prov-name)

At this point the key into the Table is the prov-code item and for each entry in the Table there is one associated prov-name. To append prov-name to each output record, we read the customer dataset, extracting the customer name. We also Define prov-name as a new field and extract it for the output record, but we fill it with a value that is based on the prov-code for each customer entry:

>get customers >ext cust-name >def full-prov-name,1,30 >ext full-prov-name=$lookup(provtab,cust-prov-code,prov-name) >out somefile >xeq

To update a dataset, you do the same commands, but you insert an Update command prior to the Extract from a Table. Below is an example that shows how to update an Eloquence record using data values from a Table.

Let's assume that we have new unit cost information for each product:

>form newcosts File: NEWCOSTS.NEIL.GREEN (SD Version B.00.00) Entry: Offset PRODNO Z8 1 UNIT-COST P8 9 Limit: 13 EOF: 13 Entry Length: 12 Blocking: 64

We load a table with the product number key value (prod-no)and the new unit cost data value (unit-cost):

>table prodcost-table,prodno,file,newcosts,data(unit-cost)

We can then select that unit-cost field from the prodcost-table using the Extract command:

>extract unit-cost = $lookup(prodcost-table,prodno,unit-cost)

Here is the entire task, keeping in mind that Update must be specified before the Extract command.

>base store.suprtpis Database password [;]? >get d-inventory >table prodtable,prodno,file,newcosts,data(unit-cost) >update >if $lookup(prodtable,prodno) >extract unit-cost = $lookup(prodtable,prodno,unit-cost) >xeq

If you did not specify the If $lookup, then records that did not qualify under the $lookup function in the extract field, will result in zeroes for any numeric field and spaces for any byte type fields.

Data ConversionYou can convert numeric fields from one data-type to another. Any nonbyte field type is considered to be numeric. You can also lengthen or truncate character fields. The general syntax for doing conversions is:

EXTRACT target-field = source-field

Suprtool 5.2 for HP-UX Suprtool Commands · 125

Page 126: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Target-FieldThe target-field determines the byte-length, data-type, and repeat-count for the expression. The expression is extracted during the output phase and cannot be used by other Suprtool commands that accept fields (e.g., Sort). To avoid confusion, it is best to define a new field name for the target-field instead of using an existing field name.

The following example shows defining a new target-field as a double integer. The Extract command target-field then takes the definition from the Define command and extracts data from the source-field (display-field).

>in oldfile>def salesqty,1,4,double>ext order-no / order-date>ext salesqty = display-field

Packed and Display FieldsWhen the target of an extract conversion is a packed- or display-type field, Suprtool always converts positive values to a neutral packed- or display-value. To ensure that expressions with positive values have a positive result, use the $signed function:

>extract packed_field = $signed(int_field)>extract display_field = $signed(dbl_field / 10)

Truncation errors can occur when Suprtool converts from nonfloating-point to floating-point. See the discussion under Numeric Truncation above.

Byte FieldsUse the Extract command to shorten or lengthen byte-type fields.

If the target-field is longer than the source-field, Suprtool fills the trailing space in the target-field with spaces.

Byte to Numeric ConversionSuprtool cannot explicitly convert from a byte field to a numeric field such as a double integer. The Extract command, however, does allow conversion from a display field to a double integer (or any other numeric field).

You can define a byte field to be a display field if all of the characters in the field contain a number. For example if you have a six-character byte field that looks like this:

012345

you can define it in the following manner:

>def display-field,1,6,display

This field can then be converted to any of the other numeric types that Suprtool supports.

If the field is six characters and contains blanks, decimal, currency or a sign symbol in the data then you can utilize the $number function.

$Number FunctionSuprtool now has the ability to accept free-form "numbers" as display data types. This means numbers in the form:

126 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 127: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

1234.45- -12345 -123.2134 12343 $123.45

can now be accepted and converted to any other numeric data type. Consider the following data:

Item-number New-Price 12345 +123.45 34563 + 27.5 21312 + 1.545

Suprtool can now read and convert the data in New-Price using the number function. Let's say we want New-Price to be a double integer and currently occupies eight bytes starting in position six. Here is the task you would use to convert the New-Price free-format number into a double integer.

>in mynums >def item-number,1,5,byte >def new-price-ascii,6,8,display >def new-price,1,4,double >item new-price-ascii,dec,2 >item new-price,dec,2 >ext item-number >ext new-price=$number(new-price-ascii) >out somefile,link >xeq

The $number function take the free-format number and make it a valid display number. It will determine the decimal, sign and add leading zeroes. It will round the number to the defined number of decimal places.

In the case of 1.545 number, Suprtool will round the value to be 1.55, since the given number of decimal places is two and the preceding value is five or greater. If you have a whole number such as 54, with no decimal point the value becomes 54.00.

Suprtool will not accept data that has:

More than one sign. More than one decimal place. Spaces in between numbers. Signs that are in between numbers. Characters that are not over punch characters. Fields that when edited do not fit in the defined space for the display field.

You can control the character that defines the currency, thousand and decimal symbol for other currencies and formats using the following commands:

>set decimalsymbol "." >set thousandsymbol "," >set currencysymbol "$"

Suprtool in the above case will strip the currency and thousand symbols and use the decimal symbol to determine the number of decimal places. You can set these characters to any values you want but the defaults for each are used in the above set commands. The Decimal and thousand symbols are only single characters. The currency symbol allows for four characters.

Numeric to Byte ConversionSuprtool has several ways to convert binary numbers (e.g., J4, I2, P8) into human-readable ASCII form. You can use STExport or Suprtool's Output,Ascii or Output,Display commands.

Suprtool 5.2 for HP-UX Suprtool Commands · 127

Page 128: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

If you want to convert only some of your numeric fields, you can use Suprtool's numeric conversion to convert binary fields to display fields. For example, here is a conversion of a J4 field to an Z18 field:

define mynumber 1,18,display

get dataset

extract some-fields...

extract mynumber = binary-number

output filename

xeq

You can also use the $Edit function to format and directly convert to byte format.

$Edit FunctionSuprtool can format fields using edit-mask features similar to edit-mask features of Cobol. Suprtool employs two distinct types of edit-masks: one for byte type fields and the other for numeric fields.

The type of mask utilized depends on the source type of the field. If the source field is numeric, then the numeric edit-mask logic is applied, if the source field is byte type, then the byte edit-mask logic and characters apply.

The target field must always be a byte type field.

Placeholders and Format CharactersAn edit-mask consists of "placeholder" characters, such as "9" for a numeric column, and "format" characters, such as "." for the decimal place. Sometimes an edit-mask character acts as both a placeholder and a format character, such as the "$" in floating dollar signs.

Byte-Type FormattingFor Byte type fields there are two placeholder characters. These are:

X ~ place the data in the matching column for the X in the edit-mask

Z ~ place the data in the matching column unless the data is a zero; if the data is a zero, then replace with a space

The format characters are as follows:

B (space) / (slash) , (comma) . (period) + (plus) - (minus) * (asterisk)

and a Space. Please note that you can denote a space using two methods, either by putting a "B" in the mask or a space itself. For example, suppose you have data that is in ccyymmdd format in an X8 field. Here is how you would use a "xxxx/xx/xx" mask to format the data:

128 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 129: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>in mydate >form File: MYDATE.TEST.NEIL (SD Version B.00.00) Entry: Offset A X8 1 <CCYYMMDD> Limit: 10000 EOF: 2 Entry Length: 8 >def formatdate,1,10 >ext formatdate=$edit(a,"xxxx/xx/xx") >list >xeq >IN MYDATE.NEIL.GREEN (0) >;OUT $NULL (0) FORMATDATE = 2003/09/24

>IN MYDATE.NEIL.GREEN (1) >;OUT $NULL (1) FORMATDATE = 2003/09/24

As you see in the example above, the placeholder character is the "x" and the "/" is the format character. You insert a space either by specifying a "B" or by putting an actual Space character in the edit-mask. An example of inserting a space might be the formatting of Canadian postal codes (e.g., V3R 7K1):

>in postal >form File: POSTAL.NEIL.GREEN Entry: Offset POSTAL-CODE X6 1 Limit: 10000 EOF: 2 Entry Length: 6 >def post1,1,7,byte >def post2,1,7,byte >ext post1=$edit(postal-code,"xxx xxx") >ext post2=$edit(postal-code,"xxxbxxx") >list >xeq

>IN POSTAL.NEIL.GREEN (0) >OUT $NULL (0) POST1 = L2H 1L2 POST2 = L2H 1L2

>IN POSTAL.NEIL.GREEN (1) >OUT $NULL (1) POST1 = L2H 1L2 POST2 = L2H 1L2

Z-placeholder for byte-fieldsThe Z-placeholder character works differently for byte-fields than for numeric fields. For byte type fields, if the Z placeholder and the corresponding data is "0", then the zero is suppressed, regardless of the position. This is primarily for suppression of zeroes in byte type date fields: ext a=$edit(date-field,"xxxx/zx/zx")

The above edit mask would then edit a byte type date of 20031005, to be: 2003/10/ 5

Overflow and limitsAn edit mask is limited to 32 characters in total for both numeric and byte type fields. If data overflows the edit-mask, by default Suprtool will fill that field with asterisks. There is an option to have Suprtool stop when it encounters a formatting overflow:

Suprtool 5.2 for HP-UX Suprtool Commands · 129

Page 130: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>set editstoperror on

will force Suprtool to stop if there is data left over after applying the edit-mask. With byte-type fields, leading spaces do not cause overflow. Therefore if your data consists of: " L2H1L2"

and your edit mask is: "xxxBxxx"

It is not an overflow since there are only spaces to the left of the "L". If the data was: " JL2H1L2"

an overflow exception would occur.

Numeric field edit-masksOur edit-masks for numeric fields are patterned after those in COBOL. We provide four placeholder characters, each with a slightly different effect:

"9" - insert a digit from 0 to 9 in this position

"$" - if you specify more than one dollar sign, you get a floating dollar sign. This means that there can be as many numeric positions as there are dollar signs, but if some positions are not needed because the value is small, the $ floats to the right next to the first digit and the preceding positions are blank.

"*" - if there are enough digits in the value, the * position is replaced by a numeric digit; if not, an asterisk is printed. Leading asterisks are often used for check writing, so that no one can insert a different value.

"z" - insert a numeric digit at this position; if the rest of the data to the left is a zero then a space will be placed at this position. For example: >ext a=$edit(int-field,"$$,$$$.99-") >ext b=$edit(int-field,"99,999.99-") >ext c=$edit(int-field,"cr99999.99") >ext d=$edit(int-field,"-$9999.99") >ext e=$edit(int-field,"**,***.99+") >ext f=$edit(int-field,"zz,zzz.99+") >list >xeq >IN FILE1SD.NEIL.GREEN (0) >OUT $NULL (0) A = $11.11- B = 00,011.11- C = CR00011.11 D = -$0011.11 E = ****11.11- F = 11.11-

>IN FILE1SD.NEIL.GREEN (1) >OUT $NULL (1) A = $22.22- B = 00,022.22- C = CR00022.22 D = -$0022.22 E = ****22.22- F = 22.22-

SignsAs shown in the example above, there are also numerous format characters for numeric edits, including four ways to specify the sign. You can specify a sign, with +, -, or the typical accounting specification of "CR" and "DB". You will note in the example above that the "cr" in the mask was up-shifted to be "CR". This is because the entire mask is up-shifted as the mask is being parsed.

You can specify more than one sign in a numeric field edit, although Suprtool will give you a warning that having two sign edit-mask characters does not really make

130 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 131: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

sense. Cobol gives a Questionable warning when compiling an edit-mask with two sign characters. Suprtool, will apply the sign in both places.

Keep in mind that most data has three states:

1) Postive

2) Negative

3) Neutral

Any neutral data will not display the sign. If you specify a "+" sign in the edit-mask and the data is negative, it will of course display a "-" sign.

Decimal PlacesFor numeric-type edits, Suprtool attempts to adjust the data according to the number of decimal places in the edit-mask, when compared to the number of decimal places defined in the field.

For example if the data field has one decimal place, and the edit mask has two decimal places, then the data is adjusted:

Data and Edit mask: 102.3 ZZZZ.99

will result in the final data being: 102.30

Similarly, if the data has three decimal places and the edit-mask only has two, then the data will be rounded appropriately with the same rules as outlined in the $number function.

You can specify more than one decimal place in an edit-mask. However, Suprtool will print a warning and it will utilize the right-most decimal place for data alignment. The decimal place character is defined by a set command: >set decimalsymbol "."

If you define another character as the decimal symbol, Suprtool will use that character as the point to align the decimals. If you define a decimal symbol that is not an allowed edit-mask character with Set Decimalsymbol, Suprtool will assume that the field has zero decimal places and adjust the data accordingly.

Currency and Dollar signsSuprtool edit-masks support both fixed and floating dollar signs. Logic for floating dollar-signs will be invoked if more than two dollar signs are defined in the edit-mask.

A floating-dollar edit mask attempts to put the dollar sign at the left most position of the significant data. For example if you have the following data and edit mask:0001234.54 $$$$$$.$$

the data would end up as: $1234.54

Suprtool will not however, put the dollar sign to the right of the decimal place. If you had the same edit mask and the data was, .09, the data would end up being formatted as:

Suprtool 5.2 for HP-UX Suprtool Commands · 131

Page 132: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

$.09

Similarily, the $edit function will attempt to place the dollar sign correctly in most cases. For example Suprtool will not format data in the form of: $,123.50

Suprtool, does attempt to fixup these cases and would format the data in the following manner: $123.50

Overflow and floating dollarIf the number of digits in the data is equal to the number of placeholder dollar signs, then the dollar sign is dropped and not added to the edited field.12345.50 $$$$$.99

would result in:12345.50

Set CurrencySymbolIf Set CurrencySymbol is not equal to "$", then after the formatting has been applied, whatever symbol(s) are defined within the set command, are used to replace the "$" symbol in the data. For example, if you have the Currency symbol set as "CDN". >set currencysymbol "CDN"

Suprtool will replace the "$" after the edit-mask has been applied with CDN, provided there is room to the left of the dollar-sign.It is recommended that if you are using multiple characters for the dollar symbol that you leave enough characters to the left of the symbol.

For example if the CurrencySymbol is defined as CDN, then you should leave two spaces to the left of a fixed dollar sign definition. If there is not enough room, to put in the currency symbol, then the dollar symbol is blank.

Overflow and limitsAn edit mask is limited to 32 characters in total for both numeric and byte type fields. If data overflows the edit-mask, by default Suprtool will fill that field with asterisks. There is an option to have Suprtool stop when it encounters a formatting overflow: >set editstoperror on

will force Suprtool to stop if there is data left over to place when applying the edit-mask. With numeric-type fields, leading zeroes do not cause overflow.

RestrictionsYou can only use one expression in each Extract command, and the expression must be the last item. If you want to extract several expressions or more fields after an expression, you need to use several Extract commands.

Incorrect

>extract name, i=sales + tips, c=cost, dept

Correct

132 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 133: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>extract name, i=sales + commission>extract c=cost>extract dept

Extracting BitsThe Extract command can be used to define individual bits from one data item as separate fields.

>def order-shipped,1,2,int>def order-paid ,1,2,int>ext order-shipped=status-field.(0:1)>ext order-paid=status-field.(1:1)

This makes it easier to check the status of certain bits within a given field.

EBCDIC ConversionsUse the $etoa or $atoe functions to convert specific fields from EBCDIC to ASCII or vice versa. Each of these functions accepts a single parameter that is a byte-type field:

Extract $ETOA(char-field)

Extract $ATOE(char-field)

There are several restrictions on the $etoa and $atoe functions:

· They do not work with either the ASCII or PRN output options.

· You cannot extract an EBCDIC constant. The following example would produce an error message:>extract $etoa(char-field) = 'abcdef'

· You cannot extract a range of fields using $etoa or $atoe.

NotesThe Extract command is valid only with

· Output xxx,data

· Output xxx,data,num

· Output xxx,query

· Output xxx,link

· Output xxx,ascii

· Output xxx,prn

The Extract occurs logically after the sort phase, if any, but prior to the final Output, Put, or List. An If command can refer to fields of the input record that are not included in the extracted output record. The sort keys can be fields that are not among those extracted.

If the extracted record length is shorter than the input record length, Suprtool attempts to speed up sorts by doing the extract before sorting. Suprtool can only do the extract before sorting if the output option is DATA (the default), QUERY, or LINK, and all of the sort keys are included in the Extracted fields.

One advantage of not using the Extract command is that the output file from Suprtool has exactly the same format as the input dataset which created the file. You can then use the =setname option of the Input command to define all of the fields in

Suprtool 5.2 for HP-UX Suprtool Commands · 133

Page 134: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

the output file. Even if you change your database structure, many of your job streams that use Suprtool and the =setname option will not have to be changed.

134 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 135: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Form Command [F]The Form command displays information about an Eloquence or SQL database, or the current Select command, or the fields in a self-describing file. The Form command is similar to the Form command of QUERY on the HP e3000.

FORM [ SETS | ITEMS | PATHS | dataset | data-item | filename ]

(Default: depends)

The Form command displays the structure of a database, dataset, table or self-describing file.

When showing the form of an Eloquence dataset or a self-describing file, Suprtool shows the byte offset of each field after the subcount, type, and sublength. The first field always appears at offset one. If you have specified a date format or the number of implied decimal places with the Item command, these attributes appear as part of the form listing.

Dataset List>ba sampleDatabase: sample TPI: Eloquence B.07.00 B.07.00.11

Set Item Entry Load EntrySets: Num Type Count Capacity Count Factor Length B/F CUSTOMERS 1 MDX 10 1355 1177 87 % 112 0 PARTS 2 MDX 10 524 182 35 % 53 0 ID 3 MDX 1 2259 47 2 % 2 0 ORDERS 4 DDX 7 1008 47 5 % 21 0 LINEITEMS 5 DDX 7 1008 272 27 % 22 0

Suprtool shows the type of each dataset (e.g., "M" for Manual master, "A" for Automatic master, "D" for Detail). If you have enabled dynamic dataset expansion, Suprtool adds "DX" to the type of the dataset (e.g., "MDX", "DDX"). Since Eloquence has these features available by default the Type of Dataset will always be either MDX or DDX.

Detail DatasetsIf you request information about a specific detail dataset, Suprtool prints the path information in DBSCHEMA format. The path shows the related master dataset and the sort item-name. When displying the form of an Eloquence dataset, Suprtool shows the capacity in a format similar to the one in DBSCHEMA.

Suprtool 5.2 for HP-UX Suprtool Commands · 135

Page 136: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>form orders

Database: SAMPLE

ORDERS Detail Set# 4 Entry: Offset ORDERNO X16 1 ORDERID I2 17 (!ID) ORDERDATE I2 21 CUSTNO X6 25 (CUSTOMERS) ORDERSTAT I1 31 ORDERTYPE X2 33 ORDERVALUE E4 35 Capacity: 1008 (0), 0, 0, 0 Entries: 47 Highwater: 0 Bytes: 42

Master DatasetsThe Form Sets command indicates which datasets have MDX enabled. A Form command on these datasets shows details of their expansion setting.

>form parts

Database: SAMPLE

PARTS Master Set# 2 Entry: Offset PARTNO X16 1 <<Search Field>> PARTLOOKUP X10 17 DESCRIPA X20 27 DESCRIPB X20 47 PARTUNIT X2 67 PROFITGROUP X4 69 MATNUMBER X16 73 PRICEUNIT X2 89 PRICE1 E4 91 PRICE2 E4 99 Capacity: 524 (0), 0, 0, 0 Entries: 182 Bytes: 106

SQL SelectWhen showing the form of an SQL select, Suprtool shows the column's name, the SQL type and the Suprtool type. When showing the form of a self-describing file, Suprtool shows the byte offset of each field after the subcount, type, and sublength. The first field always appears at offset one.>open oracle scott tiger>select * from emp>form Column Name: Oracle Type: Nulls: Suprtool Type:

EMPNO Number (4) N Integer ENAME Varchar2 (10) Y Byte JOB Varchar2 (9) Y Byte MGR Number (4) Y Integer HIREDATE Date Y Oracle Date SAL Number (7,2) Y Packed COMM Number (7,2) Y Packed DEPTNO Number (2) Y Integer

SQL DatabaseIf an Allbase database is open and no input file has been specified, the default Form command shows all of the tables in the database. If a Select command has been specified, the default Form command shows the columns in the Select command. The exact format of the Form command is different for each SQL database.

136 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 137: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Third-Party IndexingIf the database is enabled for indexing, the Form command shows any third-party index that corresponds to an IMAGE/Eloquence field. When doing a Form dataset, each field is checked to see if it is a byte-type or Z-type third-party index. If it is, the comment "<<TPI>>" is shown. Indexes that have a name other than an Image-item name are shown at the end of the form listing. The Form command only shows those indexes that can be referenced by the Chain command.

For example,>form m-customer M-CUSTOMER Master Set# 1 Entry: Offset CITY X12 1 <<TPI>> CREDIT-RATING J2 13 CUST-ACCOUNT Z8 17 <<Search Field>> <<TPI>> CUST-STATUS X2 25 NAME-FIRST X10 27 <<TPI>> NAME-LAST X16 37 <<TPI>> STATE-CODE X2 53 <<TPI>> STREET-ADDRESS 2X25 55 <<TPI>> POSTAL-CODE X6 105 Capacity: 211 (7) Entries: 20 Bytes: 110

Additional Third-Party Indexes: SI-LAST-NAME X16 B

Self-Describing FilesThe Link output option produces an SD file with information about how the file was sorted, what fields are compound, and the date format or the number of implied decimal places for any fields. The Form command shows all of this information:

File: custfile (SD Version B.00.00) Has line feeds Entry: Offset CHAR_FIELD X5 1 <<Sort #1>> REPEATED_I1 3I1 6 {compound field} DATE_FIELD J2 12 <<YYYYMMDD>> COST_FIELD J2 16 << .2 >>Entry Length: 20 Blocking: 1

Default FormIf a Chain, Get, Select, or Input command of a self-describing file has been entered, a Form command without parameters shows the fields in the current input source. If a Base command has been specified, but no input source, a Form command without parameters does a Form Sets. If an Open command has been specified, but no input source, a Form command without parameters shows the tables in the SQL database.

Form KeywordsThe Form command shows items, paths, and sets before it searches for a dataset or file with these names. Use a string (e.g., "sets") to display the form of a dataset or file that matches one of the Form keywords.

>form "paths" {paths is the name of a dataset}

Suprtool 5.2 for HP-UX Suprtool Commands · 137

Page 138: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Get Command [G]Selects an Eloquence dataset from a previously opened Base as the input source for the next extract. You must have read access to all fields in the dataset entry. Only one Chain, Get, or Input command is allowed per extract task. Get always reads the dataset serially.

GET setname [(startrecord/[endrecord]) | (#count)]

(Default: all records)

Dataset InputThe first example shows the most common use of the Get command. An input dataset is specified as input to Suprtool. We select a subset of the entire input dataset using the If command:

>base store>get d-inventory {serially read dataset}>if unit-cost<10000 {the UNIT-COST field is}>output out1 { automatically defined by Get}>xeq

FastReadSuprtool for HP-UX can read Eloquence datasets in two modes, one is with dbget mode-2 serially and the other is a large “blocked” fast read method. The default method used depends on your version of Suprtool. Suprtool has two flavours in terms of which set of “Image” intrinsics it uses. The first or regular version loads the Eloquence libraries by using the SHLIB_PATH or looks for the Eloquence libraries in their default location. This “regular” version of Suprtool for HP-UX has the FastRead option turned on by default. The version of Suprtool that uses the ROBELLELIB_IMAGE variable to find the Image libraries has the FastRead option off by default. This setting must be turned on prior to the Base command. See the Set command for details

Selection by Record NumberThe (startrecord/endrecord) parameter permits selection of input records on the basis of the Eloquence record numbers. These numbers always start with 1, and the endrecord parameter is assumed to be the last record in the dataset if it isn't specified.

Note that you should use extreme care when you are using the record number selection option on master datasets. This is because the record numbers of master dataset entries can be changed as entries are added or deleted from the dataset. For example, if there are deleted entries in the master dataset, then you could get fewer records than expected.

Numrecs is another way to select only a few records.

When debugging software, it is convenient to scan the first few records of a dataset. Specifying a startrecord/endrecord parameter makes this easy:

>get m-product(1/20) {first twenty records}>list {produce a formatted list of each …}>xeq {… record with no output file}

This example gets any records that are in the first twenty IMAGE locations. This may be fewer than twenty records, if there were deleted or unused entries in the first twenty record numbers.

138 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 139: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Random SelectionThe #count parameter selects every "nth" record from the dataset, where "n" is equal to count. This option is designed to allow "random" selection from the dataset. It cannot be combined with the (startrecord/endrecord) option.

Test databases can be constructed from random samplings of production databases. Using the #count parameter and the Put command we build a test dataset:

>base store>get d-inventory(#15) {every 15th record is read}>put d-inventory,test {put to the d-inventory dataset in …}>exit {… Test database}

Suprtool 5.2 for HP-UX Suprtool Commands · 139

Page 140: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Help Command [H]Show what commands and options are available in Suprtool.

HELP [ command | keyword [ ,option ] ]

(Default: browse through the entire help file)

Command HelpIf you specify any parameters, Help first assumes that you want help on a Suprtool command. If you know the structure of the help file, you can additionally specify one of the keywords under the command name.

>help ext {help on the Extract command}>help ext,notes {Notes section of the Extract command}

Keyword HelpIf Suprtool cannot find any help in the "Commands" section of the help file, it assumes that you specified one of the outer-level keywords in the help file. To see this list of keywords, type help with no parameters. You see a short introduction to Suprtool and then a list of keywords. You can specify any of these keywords on the Help command. You can also specify a subkeyword.

>help start {Quick Start section}>help start,task {Task section of Quick Start}

Quick Help - HQHQ asks Suprtool to look under the keyword Quick in the help file. Quick contains the text from the Suprtool Quick Reference Guide, offering the experienced user a quick review of the syntax of any command.

>hq input {quick description of Input}>hq commands {quick list of command names}

NotesIf no parameters are specified, Help allows you to browse through the "help" file. The Help Command uses the QHELP subsystem to allow you to look at the material in the file /opt/robelle/help/suprtool (which contains most of the user manual). For "help in help", type "?" when you see the QHELP prompt character ("?"). The help file is organized into levels. To go back to the previous level, press Return instead of a key name. If you press F8, you will exit the QHELP subsystem and return to Suprtool.

140 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 141: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

If Command [IF]Specifies a subset of records to select from the input source during the next extract task. The If command supports full logical expressions, with comparisons between all data-types, between data fields and constant values, or between one data field and another. The If command also provides partial string compares, bit field extracts, subscripted IMAGE fields, AND-OR-NOT operators, and parentheses to override precedence. You can use arithmetic expressions involving any numeric data-types.

IF expression

Note: The examples below show multiple If commands. These are for illustrative purposes only. Suprtool does not permit multiple If commands in a single task. Instead you can combine multiple conditions using AND and OR.

Alternatives to the If commandThere are a few selection criteria that the If command cannot perform. In these cases, you need to use other Suprtool commands. If you wish to select by record numbers, use the record number options in the Input command. If you wish to limit the number of records selected, use the Numrecs command.

There Is No Else ClauseThe If command in Suprtool does not have an Else clause. To select the records that do not match the If criteria, use a second task with the same criteria negated by a NOT.

>input myfile {this task is the "If … then"}>if expression>output file1>xeq

>input myfile {this task is the "else"}>if not (expression)>output file2>xeq

ExpressionsAn expression specifies the logical criteria that Suprtool uses to select records from the input source.

Simple ExpressionsThe simplest expression is a single comparison between two fields (e.g., A=B) or a field and a constant (e.g., A="XX"):

field relation field

field relation constant

FieldsA field can be a temporary, Defined field, or a field from a self-describing file, or an Eloquence field, or a column from a database table. Each field has a type (see "Key Command [K]" on page 167 for further details). The constant must match the type of the field. If the field has a byte-type, you must surround the constant with quotes.

Suprtool 5.2 for HP-UX Suprtool Commands · 141

Page 142: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>if name="TAMMY ROSCOE" {name is byte}>if rating>10000 {rating is integer}>if balance=arrears {compare two fields}

ConstantsA constant is a value that matches the data-type of field. Constants are either a string constant in quotes, a numeric constant, or a date constant specified with $date or $today. See the next section about Constants for more details.

Constant Type"NATHAN ARMSTRONG" string constant12345 numeric constant$date(00/07/09) date constant July 9, 2000

RelationsA relation is one of the size comparison symbols (Suprtool does not use words like "EQUALS" as in QUERY):

Relational operator Means= equal to> greater than< less than>= greater than or equal to<= less than or equal to<> not equal to

Complex ExpressionsComplex expressions can be made by combining the AND, OR, and NOT operators, arithmetic operators (+, -, *, / and mod), and parentheses. The order of precedence of operators, from highest to lowest, is

Operator Precedence( ... ) Highest.NOT Take the opposite.AND Both must be true.OR One or the other must be true.- Unary minus.* / Higher than addition and subtraction.+ - Lowest.

Use parentheses where necessary to change the order of evaluation.

142 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 143: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>if status="1" and amount>100 or purchased="000115">if (status="1" or status="2") and amount>100

Multiple ValuesYou can check a data field for several test values without using the AND and OR operators. After the equals or not-equals sign, list the alternate values separated by commas.

The OR operator is = (equal sign). Instead of "IF A=5 OR A=6 OR A=7", use "IF A=5,6,7". This selects a record if A is equal to 5, 6, or 7.

The AND operator is <>. Instead of "IF A<>5 AND A<>6 AND A<>7", use "IF A<>5,6,7". This selects a record if A is anything but 5, 6, or 7.

>if field = 5,6,7>if part = "12345","67890","39201","92308","14892">if delivered <> 981231,990101

This method works well if you are searching for a small number of values. Use the $lookup function to check a data field for many test values.

IF $LOOKUP(tablename, fieldname)

The $lookup function returns TRUE, if the specified field name contains a value from the specified table. You can also look for values that are not in a table.

IF NOT $LOOKUP(tablename,fieldname)

See the Table command for a complete description of how to combine tables and the $lookup function. (Note: Suprtool's Table command is not related to tables in databases.)

$lookup parameter functiontablename The name of a table specified in the Table command.fieldname A field from the input record. This field must be exactly

the same length as the item used in the Table command.

Multiple Values and Table DataSuprtools can use the “data” loaded into a Table in a comparison operation. The $lookup function will return the data value from the table to compare against another field or literal.In file1sdTable mytable,char-field,data,tabfile,data(id-field)If $lookup(mytable,char-field,id-field) = int-field

So what Suprtool will do in this case is read a record, lookup the record in the table and retrieve the data item in the table. If Suprtool does NOT find an entry in the table, a zero will be returned if the data type is numeric and spaces will be returned if it is a byte type.

So using the case above, if no entry is found in the table, zero is returned, and if int-field is equal to zero, then the record will qualify.

If you don’t want to have any values returned from the table lookup, you just preface the if with a standard lookup.

Suprtool 5.2 for HP-UX Suprtool Commands · 143

Page 144: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>get ord-details>table cust-table, cust-no, file, custlist,data(state-code)>if $lookup(cust-table,cust-no) and & $lookup(cust-table, cust-no, state-code) = state-code>output orders>xeq

When using $lookup to return data, the $lookup must always be on then left side of the expression. If not Suprtool will stop with an error:>if id-field=$lookup(mytable,char-field,id-field)Error: $lookup in this context (data comparison) must be on left side

Performance of $LookupShort-circuit evaluation means that the If command does not always need to evaluate all the parts of the command.

Due to the nature of the $lookup function, it can be, at times CPU intensive, however, since the If command uses short-circuit evaluation, $lookup should be specified as the last part of the If command. For example,

>if status = "10" and $lookup(cust-table,account)

is faster than

>if $lookup(cust-table,account) and status = "10"

because Suprtool can evaluate status = "10" faster than $lookup. When the status is not "10" Suprtool knows the record will not be selected, therefore there is no need to do the $lookup.

$Null(fieldname)The If $null(fieldname) command selects any rows that have null values in them. This feature is available only for SQL databases and only on columns that allow null values:

>if $null(SALESTOTAL)

If you want to find only those values that are not null, you can add the NOT keyword in front of $null:

>if not $null(SALESTOTAL)

ConstantsThis section describes numeric and string constants. See also Date Selection.

Numeric ConstantsNumeric constants are not enclosed in quotes. Numeric constants may be just simple whole numbers (e.g., 5, 0, -56, 10004) or they may have a decimal point (e.g., 5., 0.0, -.56, 99.9, 1.4). IEEE numbers may also have a scale factor (e.g., 5E-5, 0.01E+4). "Over-punches" for the sign are not required, or recognized, in Suprtool. Always enter -11 as -11, not 1J for a DISPLAY field.

String ConstantsString constants are delimited with double- or single-quote marks. That is, either "VANC" or 'VANC'. Any characters within quotes are not upshifted. If the constant is shorter than the field to which it is being compared, the constant is padded with blanks. String constants are expected for fields of type BYTE, U, or X, but numeric constants are expected for fields of type Z (zoned decimal).

144 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 145: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>if field = " " {check for all blanks}>if field = "XX" {double-quotes are okay}>if field = 'XX' {so are single-quotes}

If you want to compare for a quote itself, you include two quotes in the string for each quote you want.

>if field = "AB""CD" {look for AB"CD}

Character ConstantsUse the ^-character to specify any ASCII character. The number (the actual ASCII value), or letter (^A means control A), must follow immediately after the ^-character. Suprtool treats character constants as strings. When you compare the constant to a field longer than one byte, Suprtool pads the constant with spaces.

>define field,1,1 {byte field}>if field = ^0 {binary zero}>if field = ^G {Control-G (bell)}>if field = ^27 {escape}>if field = ^252 {Roman-8 box}

To look for "null values" or "low values" in byte-fields, it is usually sufficient to check the first byte for a binary zero:

>define first-byte,bigfield,1,byte>if first-byte = ^0

SubscriptsUse subscripts to access individual items in repeated fields, or to access substrings.

Numeric SubscriptsFor repeated numeric fields only one index is allowed.

If Table has the form 10J2, it holds ten double integers.

· Table(1) is the first sub-item.

· Table is the same as Table(1).

· Table(5) is the fifth sub-item.

>if table(5) = 23>if table(2) = 20 or table(4) = 30>if table(8) = 31 and table(9) = 28

Character SubscriptsCharacter string fields may have 1, 2, or 3 subscripts after them. Character string fields are allowed more than one subscript value.

If ADDR has the form 5X30, it consists of 5 substrings of 30 characters each.

· ADDR(1) is the first 30-character sub-item of ADDR.

· ADDR without subscript is the same as ADDR(1).

· ADDR(2) is the second 30-character sub-item of ADDR.

· ADDR(2,4) is the second sub-item, starting with the 4th byte and extending for the remainder of the sub-item, 27 bytes.

· ADDR(2,4,6) starts at the same location, but extends for only 6 bytes.

Suprtool 5.2 for HP-UX Suprtool Commands · 145

Page 146: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

If NAME has the form X50, it is not a repeated field.

· NAME is the same as NAME(1).

· NAME(1,4,6) is the first (and only) sub-item, starting at the 4th byte and extending for 6 bytes.

· NAME(1,10) is a field that starts at the 10th byte and implicitly extends to the end of the field (for the remaining 41 bytes).

>if name(1,4,6) = "HAWAII">if addr(3) = "VANCOUVER, B.C.">if addr(3,11,20) == "@B.C.@" {pattern matching}

Numeric Expressions

Bit SelectionsThe If command can extract and test any series of one or more contiguous bits in a field. Suprtool allows bit extracts only on Integer or Logical fields of two bytes in length (one 16-bit word). To do a bit extract from another type of field, first use Define to redefine the data as a two-byte Logical field.

Once Suprtool extracts a bit string, it always treats it as an Unsigned Integer, a Logical, and never interprets it as negative. The format for bit extracts calls for a starting bit number and a bit count. The 16 bits in a computer word are numbered from the left, 0 to 15. The two bytes to extract from need not be on a "word boundary" (i.e., they can start in any byte position). See "Define Command [D]" on page 95 for how to define a two-byte logical field.

field . (startbit : bitcount)

>define bitfield,name,2,logical>if bitfield.(4:2)=3

How to Check a Byte for a Numeric ValueBecause Suprtool does not have one-byte integers, it can be difficult to check a single byte for a specific numeric value. Use a two-byte integer Define field and the bit-extract operator to solve this problem:

>define word,transcode,2,integer>if word.(0:8)=13

See "Character Constants" on page 145 for an alternate method.

Decimal PlacesUse the Item command to specify the number of implied decimal places in an item. If you do not do this, you must scale all numbers in the If command. For example, let's assume that you want to find all inventory records with a cost equal to $80.59. If you do not use the Item command, your If command would look like this:

>if cost = 8059 {no decimal places}

By telling Suprtool about the number of decimal places in the cost item, your If command looks more natural (which usually means you will make fewer mistakes):

146 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 147: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>item cost,decimal,2>if cost = 80.59 {decimal places included}

Numeric ConversionThe If command can compare two numeric fields to each other (not just one field to a constant). All relation operators are supported: <, <=, =, <>, >, and >=. However, you cannot compare a byte-field to a numeric-type field.

Suprtool usually converts the field on the left side of a relational operator to floating-point. Then the floating-point number is converted into the type of the field on the right side of a relational operator and the comparison is done. The exceptions to this rule are integer-to-double, packed-to-packed, and display-to-display comparisons, which use a direct comparison algorithm.

Truncation errors can occur when Suprtool converts from one field type to floating-point. See also Accuracy and Numeric Truncation.

Arithmetic ExpressionsYou can specify arithmetic expressions for any numeric data-type in the If command. Arithmetic expressions involve the operators +, -, *, / and mod. The Mod operator returns the remainder between a dividend and a divisor. Arithmetic expressions cannot start with a numeric constant (e.g., if 2 + a = 10 is invalid). Arithmetic is not allowed on byte-type fields. If you have a byte-type field that consists entirely of numeric digits, redefine the field as display type and use the redefined field name in the If command.

Examples>if field + 10 = 1115 {numeric field}>if cost * qty > 10000>if total < qty * price + tax>if yymmdd-date / 100 mod 100 <= 03 {first quarter}

Missing FeaturesArithmetic overflow in computations will cause Suprtool to abort.

AccuracyBy default, Suprtool uses floating-point arithmetic to compute. In some cases, there can be slight inaccuracies due to rounding errors.

Numeric TruncationThe accuracy of arithmetic computations is limited to approximately sixteen digits. Suprtool may truncate four-word integers (quad) or large packed-decimal or display numbers when they are converted to floating-point. Suprtool does not produce any error or warning in this case.

$Abs functionSuprtool supports an $abs function, which returns the absolute value of a number. For example, if a field called Credit contains the value -547.83, the $abs function returns 547.83.

This function will work on a field or even on an expression such as:

Suprtool 5.2 for HP-UX Suprtool Commands · 147

Page 148: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>if $abs(credit / 100 * 1.07) > 500.00

This function will also work in the Extract command:

>def newcredit,1,4,double>ext newcredit = $abs(credit / 100 * 1.07)

$Truncate functionSuprtool supports a $truncate function which returns the number to the left of a decimal place. For example if the field stddev contains the value 547.83, the $truncate function will return 547. Note that there is no rounding.

This function will work fields and expressions:

>if $truncate(stddev / 100 * 1.07) > 200

This function will also work in the Extract command:

>def newdev,1,4,double>ext newdev = $truncate(stddev / 100 * 1.07)

String ExpressionsYou can do comparisons with byte-type fields in numerous ways using Suprtool. These powerful features minimize the number of tasks you must execute in order to select the data you need. The fewer the number of tasks, the faster your data is delivered to the users and applications that need it.

You can combine byte-type fields together and use the built-in string functions to create string expressions. String expressions involve the + operator and the other string functions such as $lower, $upper, $trim, $ltrim and $rtrim.

Fixed vs. Variable Length StringsString comparisons are done using fixed- and variable-length strings. For most users, there should be no difference between the two types of strings. When doing string comparisons, Suprtool always pads shorter strings with spaces, with the one exception of comparing two fixed-length fields (see "Byte Fields" below).

String expressions involving the + operator or the $upper, $lower, $trim, $ltrim and $rtrim built-in functions are done using variable-length strings. Suprtool keeps track of the length of every string, and all operations are done using the actual string length. For fields, the length of the string is the length of the field. If you do not want to retain all of the spaces in a field, use one of the built-in trimming functions.

When creating string expressions, string constants are created with the exact length of the constant. For example, the string constant "abc" is three characters long and the string "a" is one.

Byte FieldsFor historical reasons, comparing two byte-type fields to each other is a special case. If the two fields are exactly the same length, Suprtool compares them completely. If one field is shorter, the comparison is done for the length of the shortest field. Suprtool does not check for spaces in the trailing characters of the longer field. For example,

148 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 149: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>define short, 1,10 {ten character field}>define long ,11,15 {fifteen character field}>if short = long

In this example, Suprtool compares the ten bytes in the short field with the first ten bytes of the long field, but ignores the last five bytes of the long field. If the expression on either side of the equal sign consisted of more than one field (using the + operator) or involved any of the string functions, ($upper, $lower, $trim, $ltrim or $rtrim), Suprtool would have compared both sides of the equal sign by padding the shorter field with spaces. It is only the case where you are directly comparing one byte-type field to another that Suprtool uses the length of the shortest field for the comparison.

You cannot compare a byte-field to a numeric-type field. If you have a byte-field that consists entirely of numeric digits, redefine the field as a display-type and use the redefined field name in the If command.

Character TypeByte-type fields can also be checked to see whether they contain only Alpha, Numeric, Alphanumeric, or Special characters. The complete field is compared against the specified character types.

Type CharactersAlpha A-Z, a-z (52 characters)Numeric 0-9 (10 characters)Special anything else (194 characters, including

spaces, punctuation, Roman-8 letters, binary junk)

Alphanumeric A-Z, a-z, 0-9 (62 characters)

For the test result to be true, all the characters in the field must be of the specified character type. To test a substring, use the Define command to define a subfield.

>if field = alpha>if field <> numeric

Examples:

String Class"1234" numeric"12.3" no class, contains both numeric and special"ABCD" alpha"B JONES" no class, contains both alpha and special" " special"A1B2" alphanumeric

Pattern MatchingSuprtool can also select records based on a pattern of characters, rather than an exact string of characters. For example, use the following to select all records with "CONNOR" anywhere in the Name field,

Suprtool 5.2 for HP-UX Suprtool Commands · 149

Page 150: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>if name == "@CONNOR@"

The double equals (==) is the operator for pattern matching. The at signs (@) means anything before or after "CONNOR" is acceptable, including nothing.

For character fields, there are two comparison operators for patterns: "==" (matches), and "><" (does not match). The pattern is specified as a quoted string, using the special characters listed below. Embedded spaces are allowed in the pattern and must be matched in the target field.

These are the special characters:

Character Meaning@ Zero, or more, characters of any type.# A single numeric character.? A single alphabetic or numeric character.~ Zero, or more, blank characters.& Escape character to match the next character

explicitly (&@ looks for the @ character).^ Reserved for future use.! Reserved for future use.

Any other character must be matched, one for one.

>if name=="@ZANDER@" {does name contain ZANDER anywhere?}>if name=='@ZANDER@ARMSTRONG@' {does name contain ZANDER perhaps …} {… other characters, then ARMSTRONG?}>if name><"@#@" {does name not contain numerics?}>if name=='@qedit@','@suprtool@' {qedit or suprtool?}

For more information, see Special Characters in the Glossary.

Finding Special CharactersWith the $Clean function you can clean "bad" characters inside of text fields, however the $Clean function does not report back what records were "cleaned". For this reason we have the $FindClean function. $FindClean will return true if it finds a character defined using the Clean command. This makes it extremely easy to find a set of Special characters that you can define. >in cleansd >clean "^9","^10" >if $findclean(nonprint) >list

The above task will list the record if the field nonprint has a Tab (Decimal 9) or a Line Feed (Decimal 10) anywhere in the field. You can Find and clean the "bad" characters from a field at the same time: >in cleansd >clean "^9:^10" >if $findclean(nonprint) >extract nonprint=$clean(nonprint) >list

Trimming Spaces ($Trim, $Ltrim, $Rtrim)Use one of three built-in string functions to remove leading or trailing spaces from a string expression. The three functions are:

150 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 151: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

$Trim: Remove leading and trailing spaces from the string expression.$LTrim: Remove leading spaces.$RTrim: Remove trailing spaces.

Because Suprtool pads shorter strings with spaces when doing comparisons, trimming spaces is most useful when creating a combined string with several fields. For example, you might want to combine a person's first and last name (including a space between the two):

>if $trim(first) + " " + $trim(last) = "Joe Smith"

Mixed Case ($Upper and $Lower)By default, Suprtool does an exact match when comparing two string expressions. If the expressions vary in the capitalization of characters, Suprtool finds them to be different. To do caseless string comparisons or pattern matches, use the $upper or $lower functions. Both ASCII and Roman-8 characters are shifted by $upper and $lower. For example,

>if $upper(city) = "VANCOUVER">if $lower(city) = "edmonton"

Note that if you use the $upper or $lower functions, Suprtool does not upshift or downshift any constants used in the comparison. You must explicitly specify the constants in the correct case or you can use $upper or $lower with the constant:

>if $upper(city) = $upper("vancouver")

Use the $upper or $lower functions for caseless pattern matching. As with other comparison operators, you must specify constants in the correct case when doing pattern matching:

>if $upper(city) == "VAN@">if $lower(city) == "ed@"

You can use $upper and $lower with string expressions that combine many fields and string functions as shown in the following example:

>if $read- $upper($trim(first) +- " " +- $trim(last))- = "JOE SMITH"- //

Date SelectionThe If command has four functions to help select records based on dates: $date, $today, $days and $stddate. The $date function works for any date. The $today function works for the current date and dates relative to today. The $stddate and $days functions work for almost any date. To use these date functions, you must first identify the date format of an item by using the Item command.

The $date function makes it easier to specify a target date for certain date formats (e.g., PHdate or ASK). To select records based on a specific date, use this feature:

>if field=$date(year/month/day)

Suprtool checks the date's validity. To select the transactions for January 1999, you would do the following:

Suprtool 5.2 for HP-UX Suprtool Commands · 151

Page 152: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>item trans_date,date,phdate>if trans_date >= $date(1999/01/01) and & trans_date <= $date(1999/01/31)

Relative DatesYou can specify a relative date using the $date function. Then you can create job streams that don't rely on hard-coded dates. The general syntax of the $date function is:

$date(year/month/day)

The year can be a specific number (e.g., 2000) or an asterisk "*" for the current year. To specify a relative year, you add or subtract years from the one you specified:

>if field=$date(2000/01/01) {January 1, 2000}>if field=$date(2000-1/01/01) {January 1, 1999}>if field=$date(*-1/01/01) {January 1, last year}

The month can be a specific number (e.g., 6 for June) or an asterisk "*" for the current month. To specify a relative month, you add or subtract months from the one you specified:

>if field=$date(2000/06-1/01) {May 1, 2000}>if field=$date(*/*/01) {start of current year and month}>if field=$date(*/*-1/01) {start of last month}>if field=$date(*/*-18/*) {exactly eighteen months ago}

The day can be a specific number (e.g., 15), an asterisk "*" for the current day, the word "first" for the first day of the month, or the word "last" for the last day of the month. You cannot add or subtract relative days; use $today instead.

>if field=$date(2004/01/first) {January 1, 2004}>if field=$date(*/*/*) {today's date}>if field=$date(*/*-1/last) {last day of previous month}

Combining these features makes it possible to generate batch jobs that require no operator input. For example, to select all of the transactions for last month you would use:

>item trans_date,date,phdate>if trans_date >= $date(*/*-1/first) and & trans_date <= $date(*/*-1/last)

Month EndSuprtool is always expecting a valid date. Suppose that you have a month-end job that contains the following If command:

>if field = $date(*/*-1/*)

When you run the job on May 31, 2000, if Suprtool were to use the literal interpretation of $date(*/*-1/*), it would use the date April 31, 2000. In fact, there is no such date; April has only 30 days. Whenever you specify * for the day, and the day is greater than the last day of the month you specified, Suprtool uses the actual last day of the month instead of the current day of the month. In our example, Suprtool would use April 30, 2000. Suprtool will take leap years into account when calculating the last day of February.

Today's DateTo select records based on today's date, use the following:

152 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 153: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>if field=$today {today's date}>if field=$today(-1) {yesterday's date}>if field=$today(+1) {tomorrow's date}

Use the Item command to qualify the field as a date. The $today function accepts one optional argument which is the number of days before or after today. The maximum number of days in either direction is 9999.

yymmdd and Beyond 1999Because dates spanning the turn of the century will not collate properly for the yymmdd form, you need to use $stddate to compare these dates.

>item ship-date,date,yymmdd>if ship-date < $date(2000/12/31) {will not work}>if $stddate(ship-date) < $date(2000/12/31) {will work}

Finding Invalid DatesUse the $invalid function to find invalid dates. An invalid date is a number in a date format whose date equivalent cannot be found on a calendar. For example, a month value of 99 would be considered invalid.

>input sdfile {a self-describing file}>item deliv-date,date,ccyymmdd>if $invalid(deliv-date)>out baddates,link>xeq

$Stddate FunctionThe $stddate function converts any date format in nearly any data-type container and internally converts it to the ccyymmdd format in a double integer container.

This allows you to compare dates with dissimilar formats and data-types. For example,

>in orddets>item order-date,date,ccyymmdd>item bill-date,date,mmddyyyy>if $stddate(bill-date) <= order-date>output badords,link>xeq

This feature is also available for dates that have two-digit years. The century portion of the date will be generated by $stddate, which uses the normal cutoff rules specified by Set Date Cutoff.

>in invdets>set date cutoff 20>item invoice-date,date,yymmdd>item close-date,date,mmddyyyy>if $stddate(close-date) <= $stddate(invoice-date)>out badinvs,link>xeq

In this case all invoice-date values with a yy portion between 20 and 99 will have a 19 for the century. All invoice date values with a yy portion of less than 20 will have 20 for the date generated by the $stddate function.

Invalid DatesA date must be valid before $stddate can convert it to the ccyymmdd format. Otherwise, a value of 0 will be returned for any invalid dates. An invalid date is a

Suprtool 5.2 for HP-UX Suprtool Commands · 153

Page 154: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

number in a date format whose date equivalent cannot be found on a calendar. This includes dates selected by the $invalid function. We can eliminate the invalid dates from the above task by changing the If command slightly.

>input sdfile>set date cutoff 20>item invoice-date,date,yymmdd>item close-date,date,mmddyyyy>if (not $invalid(close-date) & or not $invalid(invoice-date)) & and $stddate(close-date) <= $stddate(invoice-date)>out badinvs,link>xeq

In this example, if either the close-date or the invoice-date are invalid, then they will not be evaluated by the $stddate function and will not be selected. Although your requirements may be different, you need to remember that invalid dates evaluated by the $stddate function will return a 0 value.

$Days FunctionSuprtool supports a $days function, which converts any supported date to a Julian Day number (the number of days since 4713 BC). This allows for Date arithmetic, in which you can calculate the difference between two dates, even if they have dissimilar formats.

For example you could find all orders that were not shipped within 30 days of being ordered.

>form ordfile File: ORDFILE.SALES.MFG (SD Version B.00.00) Entry: Offset ORDER-DATE X8 1 <<CCYYMMDD>> SHIP-DATE X8 9 <<MMDDYYYY>> ORDER-NUMBER X6 17 Limit: 10000 EOF: 15 Entry Length: 22 Blocking: 16

>in ordfile>if $days(SHIP-DATE) - $days(ORDER-DATE) >=30>list>xeq

Invalid DatesAs with the $stddate function, if a date is not a valid date, then the result of the $days function will be zero. In the example above, if the order has not yet been shipped, then the SHIP-DATE will likely be blank, or zero, or some other special value. $Days(SHIP-DATE) will be zero, and the resulting calculation will be a negative number.

Notes on Relative DatesThe $date and $today functions always generate a constant from the date, just as if you had typed it. For example, when run on February 13, 2004, the follwing task:

>item field,date,yymmdd>if field > $today

is the same as:

>if field > 010213

Suprtool normally does no date conversion of the actual dates. Dates that do not start with the year do not collate correctly, so Suprtool does not allow relative

154 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 155: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

comparisons with them (<, <=, >, and >=), although you may still compare for strict equality or inequality. The following examples will be rejected by Suprtool:

>item trans_date,date,ddmmyy>if trans_date >= $date(*/*-1/first) and & trans_date <= $date(*/*-1/last) Error: Invalid date format for the comparison

>input myfile,reclen 80, nolf>define mydate,1,6>item mydate,date,ddmmyy {e.g., 301100}>define ....>if mydate > $date(00/11/01) Error: Invalid date format for the comparison>if mydate > $date(01/11/00) Error: Invalid date: Year = 1 Month = 11 Day = 00

If the date format does not allow the specification of a certain day, such as yymm, ccyymm, yyyymm, aamm, ccyy and mmyyyy, then you do not need to specify the entire date format, although Suprtool will allow either format for $date.

>item trans_month,date,yymm>item purch_date,date,yymm>if trans_month <= $date(*/*/*) and & purch_date >= $date(00/01)

Because dates beyond 1999 in the yymmdd and yymm date types do not collate correctly, relative comparisons are no longer valid. Suprtool produces an error in the following case:

>item trans_date,date,yymmdd>if trans_date >= $date(2004/01/01)Error: Cannot use a date beyond 1999 for this date format.

You can override this setting by entering the Set Date Ifyy2000error command:

>set date ifyy2000error off>item trans_date,date,yymmdd>if trans_date >= $date(2004/01/01)

Century and $DateSuprtool needs to generate a $date or $today date in the ccyymmdd format. If you specify a two-digit year in the $date function, Suprtool needs to assume a century for the given date:

>item trans-date,date,ccyymmdd>if trans-date >= $date(01/01/01)

Suprtool assumes 20 for the century if the specified year is less than the Set Date Cutoff value, and 19 if the specified two-digit year is greater than or equal to this value.

Oracle DatesOracle dates contain both the date and the time. The $date and $today functions check the date, but ignore the time.

Date LimitsThe $date function in Suprtool can generate dates between the years 1583 and 2583. Some date formats have limits based on their particular format, such as 2027 for a Calendar date and 2259 for the aammdd aamm, mmddaa, ddmmaa dates.

Suprtool 5.2 for HP-UX Suprtool Commands · 155

Page 156: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Non-Collating Date TypesYou can use the $stddate function to convert the non-collating date format to a J2 data item with a date format of ccyymmdd.

For example, to select the purchases by the field purch_date for November 2000 in a ddmmyy X6 field, you would use the $stddate function as follows:

>item purch_date,date,ddmmyy>if $stddate(purch_date) >= $date(2000/11/first) and & $stddate(purch_date) <= $date(2000/11/last)

Dynamic Date SelectionUsing a first pass to generate a Suprtool command dynamically, then using that command in a second pass, is a powerful technique.

You can use the If command for dynamic date selection. Suppose you have a control file that maintains the start and end of a range of dates in which you are interested. You can use the control file to select records from another file or dataset, based on this date range. This is a two-step process, in which the first Suprtool pass creates the If command with your dates, and the second pass does the actual selection from the dataset.

>input datecntl, reclen 12, nolf {read the one_line control file}>define start_date,1,6,byte {start date is the first six bytes}>define end_date,7,6,byte {end date is the next six bytes}>extract "if sales_date >= '" {assemble the If command}>extract start_date>extract "' and sales_date <= '">extract end_date>extract "'">output seldate,temp {write the If command to a file}>xeq

This task produces a usefile that looks like this:

if sales_date >= '001101' and sales_date <= '001231'

Now you can use this file named seldate to do the actual selection:

>open oracle demo reader>select * from sales>use seldate {use the file that has the If command}>output sdetail>exit

Long ExpressionsLong If commands can use an ampersand to continue the command over several lines:

>if status = "20" and & >> state = "AZ", &>> "CA", &>> "OR" {no ampersand on the last line}

This is awkward to use and, for internal reasons, the maximum length is restricted to 256 characters. The $read function makes it easier to enter long If commands. Its maximum length is based on the complexity of the expression, not on the number of characters.

$Read FunctionThe $read function reads the If expression from $stdinx, or from the usefile if the If command is in a usefile. $Read continues to prompt for input lines until you press Return or enter "//." You must remember to enter all the necessary parts of the If

156 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 157: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

expression, including connectors like AND and OR and commas. You do not use an ampersand (&) to continue from one line to the next when using $read.

>if $read {prompt for the expression}-status = "20" and {$read prompts with "-"}-state = "AZ", {the comma is still needed}- "CA",- "OR" {no comma on the last line}- {blank line to terminate $read}

Redoing $ReadWhen prompting for an expression, $read saves each line in the redo stack and accepts the Before, Do, Listredo, and Redo commands. This provides an easy way to specify all or part of a previous $read expression.

Error: Data OverflowWhile the $read function permits long expressions, there are other internal limits within the If command. The first is a limit on the amount of space for constants. Suprtool must blank-fill all string constants to their full length. The following example overflows the data space:

>define char-256,1,256>if char-256 = "a","b","c"Error: Data Overflow

In this example, Suprtool attempted to create three 256-byte constants. There wasn't enough room for the last constant. Solutions to this problem include:

1. If possible, define short fields. If you have long field names, you may want to use the Define command to define shorter subfields.

2. Use tables and $lookup for many values.

3. Split the extract task into multiple passes. On the first pass, use an If expression that results in the fewest possible number of output records. Use the output file from the first pass as input to the second. Apply the remainder of your If expression during the second pass.

Error: Code OverflowSuprtool translates If commands to an internal machine representation. There is a limit on the size of this code. When an error occurs, there is little you can do except use tables and $lookup wherever possible, and when this fails use multiple passes.

$Read in UsefilesWhen you specify $read in a usefile, Suprtool expects the If expression to appear in the usefile. This provides a method for storing and executing complicated If commands.

You can also manipulate Suprtool into prompting for portions of an If command. When the If command with $read is the last command in a usefile, Suprtool satisfies the $read from $stdinx. The $read function can appear anywhere in which a space can appear, so you can use this to prompt the user for values.

Suprtool 5.2 for HP-UX Suprtool Commands · 157

Page 158: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>use prompt.use>in sdfile {first line of usefile}>if status=$read and & {continue the If command} state = $read {last line of the usefile}-"10" {prompt for status}-// {end of prompt for status}-"AZ", {prompt for state}-"CA", {user must remember comma}-"OR" {user also enters quotes}-// {end of the second read}

$-functionsSome $-functions were originally designed for if command and some are more suited for the extract command. Because of this some $-functions don’t work in the if command, such as $edit, and others such as $number have interesting side effects.

Specifically with $number, when you work on byte type fields, they will be updated internally to be treated as display:Get datasetDef display-field,byte-field,displayIf $number(display-field) > 10000Out somefile,linkxeq

The field byte-field will have leading zeroes and treated as a display.

158 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 159: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Input Command [I]Opens the file that will be the input source for the next extract task. The file must contain fixed-length records with or without a line feed separator. If you are selecting records, the selection parameters must appear after any Reclen, LF, or NOLF parameters. The record length is the length of the data portion of each record, not including the line feed. If you specify LF, Suprtool/UX includes the line feed as part of the data by increasing the record length by one character.

If you have an input file with 80-byte records, and each record is separated with a line feed, you would use:

>input uxfile,reclen 80,lf>list char>xeq

Since Uxfile has line feeds, the List command shows a dot (.) as the 81st character of each record. This dot corresponds to the line feed character. To read every fifth record in Uxfile, you would use:

>input uxfile,reclen 80,lf, (#5)>list char>xeq

To examine a file which has no line feeds between records (e.g., the Suprtool object code), you would use:

>input /opt/robelle/bin/suprtool,rec 256,nolf>num 10>list hex,char>xeq

Suprtool executes the Input command immediately – it does not wait for an Xeq command before opening the Input file.

INPUT file [,RECLEN length] [, LF | NOLF]

[(startrecord/[endrecord])]

[(#count)]

(Default: all input records)

Input FileThe first example shows the most common use of the Input command. An input file is specified as the input source to Suprtool. We select a subset of the input data with the If command. Before using the If command, we must define a field within the input record:

>input invent, r 80, nolf {input is from a disc file}>define a,11,2,int {"A" is an integer that starts…}>output outfile { at the 11th byte of Invent}>if a<10000 {records with field "A" less than…}>xeq { 10000 are written to Outfile}

Selection by Record NumberThe (startrecord/endrecord) parameter specifies a range of input records by record number. The default value for endrecord is the highest record in the file. The first record number is 0 for disc files.

Suprtool 5.2 for HP-UX Suprtool Commands · 159

Page 160: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

The (startrecord/endrecord) parameter must come after the reclen and LF/NOLF parameters, if it is present. You can check your record selections with the Verify command.

When debugging software, it is convenient to scan the first few records of a file. The startrecord/endrecord parameter makes it easy to scan these records:

>input invent,r 80,nolf, (0/19) {first twenty records}>list {produce a list of each record}>xeq { in "OCTAL,CHAR" format}

Random SelectionThe (#count) parameter specifies that every "nth" record in the input file should be selected. This option is designed for random sampling of the input file. The (startrecord/endrecord) parameter cannot be used with this parameter. Like (startrecord/endrecord), (#count) must come after the =setname, if present.

Test files can be constructed from random samplings of production files. We can build a test file with the #count parameter:

>input dinvent(#15) {every 15th record is read}>output dtest {create an output file with every}>xeq { 15th record from Dinvent}

NotesOnly one Input, Chain, Get, or Select command is allowed per extract task. The Input command opens the specified file immediately. The file is held open until the input is reset or the current task completes.

160 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 161: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Item Command [IT]Use the Item command to specify the number of implied decimal points or the date format for an item. The $date and $today functions of the If command work only with dates. The Item command must precede any If or Extract commands.

ITEM itemname,DATE | DECIMAL,attribute

ItemnameThe itemname must be an Eloquence itemname, a Defined field, an SD (self-describing) field, or a column name. If the itemname exists both as an Eloquence itemname and as a Defined field, the attribute is associated with the Eloquence itemname and the Defined field is deleted. If the itemname exists both as an Eloquence itemname and as an SD field, the attribute is only associated with the Eloquence itemname and a warning is produced. The itemname cannot be qualified with a subscript.

Date FormatsFor dates, the attribute must be one of the following:

Attribute AttributeASK ccyymmCalendar ccyyddmmyy aammddddmmyyyy aammmmddyy mmddaammddyyyy ddmmaaOracle SRNChronosPHdate mmyyyyyymm yydddyymmdd ccyydddyyyymm HPCalendaryyymmdd JulianDayyyyymmdd EDSDateccyymmdd PHDate8

AbbreviationsWhen specifying the Date keyword, you can use a leading subset for the date attribute. For example, if you want to specify the Calendar date type, you can specify only CA.

>item cal-date,date,ca

If you do not like this feature, you can turn it off by specifying the following command in your Suprmgr file:

Suprtool 5.2 for HP-UX Suprtool Commands · 161

Page 162: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>set itemabbreviatedate off

Data-Types for DatesEach date attribute is compatible with certain data-types. For more information, see the table on data-types in the Define command. The following table shows the compatibilities:

Date-Attribute Data-Type CompatibilityASK J1 and K1Calendar J1 and K1ddmmyy X6, Z6, J2, K2, and P8 or greaterddmmyyyy X8, Z8, J2, K2, and P10 or greatermmddyy X6, Z6, J2, K2, and P8 or greatermmddyyyy X8, Z8, J2, K2, and P10 or greaterOracle X7PHdate J1, K1, J2, and K2yymm X4, Z4, J1, and K1yymmdd X6, Z6, J2, K2, and P8 or greateryyymmdd J2, P8yyyymmdd X8, Z8, J2, K2, and P10 or greaterccyymmdd X8, Z8, J2, K2, and P10 or greaterccyymm X6, Z6, J2, K2, and P8 or greateryyyymm X6, Z6, J2, K2, and P8 or greateraammdd X6aamm X4mmddaa X6ddmmaa X6ccyy X4, Z4, J1, and K1SRNChronos X6mmyyyy X6, Z6, J2, K2, and P8 or greateryyddd X5, Z5, J2, K2, and P8 or greaterccyyddd X7, Z7, J2, K2, and P10 or greaterHPCalendar J2, K2EDSDate J2, P8JulianDay J2PHdate8 J1, K1, J2, and K2

Date LimitsThe $date function in Suprtool can generate dates between the years 1583 and 2583. Some date formats have limits based on their particular format, such as 2027 for a Calendar date and 2259 for the aammdd aamm, mmddaa, ddmmaa dates.

162 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 163: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

CalendarThe Calendar attribute is provided for users who have fields containing the 16-bit MPE Calendar date format as an unsigned, logical value with seven bits for the year of the century (bits 0-6), followed by nine bits for the day of the year (bits 7-15). The Calendar date format only supports dates up to the end of the year 2027.

PHdate and PHdate8The PHdate and PHdate8 attributes are compatible with the COGNOS PowerHouse date format. If the data-type is J1 or K1, the date is stored as a LOGICAL value with seven bits for the year of the century (bits 0-6), four bits for the month (bits 7-10), and five bits for the day (bits 11-15). If the data-type is J2 or K2, the date is stored as yyyymmdd.

PHDate and PHDate8 date formats are similar, however PHDate values for the year range from 0 - 99, whereas PHDate8 year values are from 0 - 127. A year of 0 in PHDate could mean either 1900 or 2000 depending on user applications. A year of 0 in PHDate8 means 1900, and 100 means 2000. The PHDate8 date format is found in PowerHouse version 8.19 and higher.

ASKThe ASK attribute is compatible with the ASK manufacturing software. ASK uses a special date format stored as a single integer or a single logical (i.e., J1 or K1 in IMAGE). This date is relative to January 1, 1973.

yyymmddThe yyymmdd attribute is similar to yymmdd, except that the first digit denotes the century. If the first digit is a 1 (one) then the century is 19, and if the first digit is a 2 (two) then the century is 20. Only data-types of P8 and J2 are supported for this date attribute.

This date format is used by some third-party software packages such as MACS and APS.

EDSDATEThe EDSDATE date format is similar to the yyymmdd format, in which the first digit represents the century. The first digit in the EDSDATE is either 0 or 1: a 0 represents a century of 19 and a 1 represents a century of 20.

JulianDayThe JulianDay number is the absolute count of the days that have elapsed since January 1, 4713 BC on the Julian calendar.

Typically "Julian Day numbers" refer to an integer number corresponding to whole days, while the "Julian Date" may mean an integer plus a decimal value that resolves the Julian count to precise parts of a day. Suprtool supports the "JulianDay" number and does not attempt to support an hour or point in the day.

aammdd and Related Date FormatsThe aammdd attribute is similar to yymmdd, except the aa portion of the date uses a combination of letters and numbers in order to represent dates beyond 1999.

The aammdd date format was developed by James Overman of HP for use in their MM3000 product. This format is available only for X6 data-type.

Suprtool 5.2 for HP-UX Suprtool Commands · 163

Page 164: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

By substituting a letter of the alphabet in the first position of the year, we can extend a six-digit date and also ensure that the dates collate correctly. For example:

YY of AAMMDD CCYY00 - 09 1900 - 190990 - 99 1990 - 1999A0 - A9 2000 - 2009B0 - B9 2010 - 2019C0 - C9 2020 - 2029

Because letters are greater than numbers in the collating sequence you can ensure that aammdd dates beyond 1999 will order correctly.

Suprtool also supports other date formats with this two-character year representation. These formats are aamm, mmddaa and ddmmaa.

OracleOracle dates include both the date and the time. The $date and $today functions only apply to the date part of Oracle dates.

SRN ChronosThe Srnchronos date format is used in applications from Software Research Northwest. Like Oracle dates, this format includes the date and time, but the time portion is ignored by the $date and $today functions.

DDD DatesDates consisting of ddd in the format name use the ddd to represent the nth day in the current year. This means that January 1 will be day 001, and Dec 31 will be day 365 on non-leap years. Some people refer to these type of dates as Julian dates.

HPCalendarThe HPCalendar date format is supported by HP's new HPCalendar intrinsic and consists of a 32-bit integer number, whereby the first 23 bits represent the year and the last nine bits represent the day of the year.

Decimal PlacesThe decimal attribute is the number of implied decimal places in an item. The minimum number of implied decimal places is 0. The maximum is based on the data-type of the item:

Data-Type Maximum Implied Decimal PlacesI1 5I2 10I3 15I4 19K1 5K2 10

164 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 165: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Pn n-1Zn n

You cannot specify implied decimal places for byte-, char-, or IEEE-type items.

Once you define a decimal place, almost every command in Suprtool is affected. Suprtool accepts numeric values with decimal points or scales integers according to the number of implied decimal places (e.g., specify two implied decimal places, then enter 1,000 to represent 1,000.00). All formatting commands format fields with a decimal point when appropriate.

Constant ValuesWhen specifying numeric constants for a field with implied decimal places, there are different formats that you can use. For example, assume that we use the Item command to specify two implied decimal places for an amount field. The following are examples of constant values for this item:

Constant Interpretation0 zero value padded as necessary1 $1.000.01 $0.01.01 also acceptable for $0.01

Notes

SQL ColumnsYou must redefine any SQL columns before you can use the Item command.

>sel * from emp>def salary,sal>item salary,decimal,3 {correct scale}>if salary > 15.275

Compound ItemsWhen you specify a compound item, the attribute applies to all elements of the compound item.

>item monthly_totals,decimal,2 {12 occurrences}>if monthly_totals(5) > 1000.00

You cannot apply an attribute to only one sub-item of a compound item:

>item monthly_totals(5),decimal,2Error: Missing attribute for the Item Command

When to Specify the Item CommandThe Item command affects almost all other Suprtool commands. It should be used as follows:

· For databases, specify it immediately after the Select command, but before any Extract or If commands.

Suprtool 5.2 for HP-UX Suprtool Commands · 165

Page 166: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

· For disc files, it is best to specify the Define and Item commands immediately after the Input command.

UsefilesYou can use a usefile as a mini data dictionary for Suprtool. For databases, it is a good idea to put all the Item commands associated with a database into a usefile. After the Base command has been specified, the usefile can describe the items in the database to Suprtool. For disc files, you can put both the Define and Item commands in a usefile and execute them right after specifying the file with the Input command. If you use the Link output option, both date formats and implied decimal places are saved in the self-describing file so they never need to be specified again.

base storeuse store.usefile

166 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 167: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Key Command [K]Specifies the next sort field for an extract task, using an explicit byte position in the record, not a field name. See the Sort command for specifying sort fields by table column name or Defined field, or by field name in an SD file. Up to 20 Sort and Key commands may be specified per extract task; the first is the major sort field.

[KEY] byteposition,bytelen [,type] [,DESC]

(Default: type=BYTE, ASCENDING order).

ParametersDesc specifies that the field is to be sorted in Descending order.

The byteposition is a number between 1 and the length of the input records, specifying where the sort field begins. The bytelen parameter is a number from 1 to the length of the record, specifying how long the sort field is.

The type is a word that gives the desired data-type of the field for sorting purposes:

Type DescriptionBYTE (unsigned, straight compare)INT/INTEGER (two's complement)DOUBLE (two's complement)IEEE (IEEE floating-point)PACKED (packed-decimal)PACKED* (packed-decimal, last nibble unused)DISPLAY (zoned-decimal numeric field)LOGICAL (unsigned, like BYTE, 2 characters)CHARACTER (for Native Language Support)

The Key command also accepts FPOINT as the data-type for IEEE numbers.

ExamplesThe first example sorts an integer (PIC S9(4) COMP) field which starts on the 11th byte of the input record. We sort the entire input file based on one key:

>input bigfile,r 40,lf {input from a disc file}>key 11,2,int {key is an integer that starts}>output outfile { at the 11th byte of Bigfile}>xeq {create Outfile and prompt for} { more Suprtool commands}

>input discfile,r 40,lf {another input file}>key 14,4,double,desc {double integer (PIC S9(9) COMP)}>output ofile2 {sort input in descending order}>exit

The following examples show the various data-types and combinations that are available with the Key command:

Suprtool 5.2 for HP-UX Suprtool Commands · 167

Page 168: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>key 1,10 {byte data-type}>key 1,10,desc {descending sort sequence}>key 11,4,double {I2 or J2, S9(9) COMP}>key 1,6;11,4,ieee {X6 string and an E2 field at byte 11}>key 21,6,packed {P12, S9(11) COMP-3}>key 21,6,packed* {P12, S9(10) COMP-3, wasted byte}

NotesThe command name, Key, is optional. Any command that starts with a numeric character is assumed to be a Key command. The Verify command shows all of the current key fields, and the Reset command cancels them. If no sort fields are defined prior to the Xeq or Exit command, Suprtool performs a copy, not a sort.

168 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 169: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Link Command [LIN]You cannot use Suprtool's Link command to invoke Suprlink/UX, but you can run Suprlink/UX by itself.

/opt/robelle/bin/suprlink

Suprlink/UX/Copyright Robelle Solutions Technology Inc. 1988-2009(Version 5.2)+

Suprlink/UX provides high-speed data file linking based on a sort key. Suprlink/UX only accepts self-describing files created by Suprtool/UX or the MPE SDUnix program.

Suprtool 5.2 for HP-UX Suprtool Commands · 169

Page 170: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

List Command [L]The List command is used to produce formatted listings of the selected records. You may specify the List command, or the Output command, or both, or neither. If List is used instead of Output, Suprtool sets the Output to $null, so that only a listing is produced.

LIST [ OCTAL|HEX|DECIMAL ] [ CHAR ] [ NOREC ] [ LABELS ]

[ RECORD ] [ DUPLEX ] [ ONEPERLINE ] [ LP ]

[ NONAME ] [ NOSKIP ] [ STANDARD ] [ DEVICE name ]

[ DATE format ] [ TIME format ] [ PCL format ]

[ LEFTJUSTNUM ] [ RIGHTJUSTNUM ]

[ TITLE "string" ] [ HEADING "string" ["string" ...]]

[FILE filename | APPEND | RECLEN number]

(Default: Octal/Char or "Formatted")

If Suprtool knows about the fields in the input source (e.g., because you have used the Extract command), the list records are formatted with field names, and internal binary data-types (e.g., integer) are converted to ASCII. You cannot combine the Ask or Query,Num output-options with the List command.

Here is a typical use of List: to find any entries in the Customer table that do not have a valid value for "status".

>open oracle demo reader {input from a database}>select * from customer {read this table}>if status<>10,20,30,40 {the only valid values}>list {print bad entries}>xeq

FormatYou can override the defaults with a specification in the List command (e.g., List Hex,Char). If the input source is not self-describing and no Extract command is specified, the default output format is Octal,Char, which also shows both input and output record numbers.

Decimal PlacesThe List command formats numbers using the implied number of decimal places. For example, the following Suprtool commands format the unit cost with two decimal points. We specify the Rightjustnum keyword, because numbers with decimal points are hard to read if they are left justified:

>item cost,decimal,2 {two implied decimal points}>list rightjustnum {numbers right justified}>xeq { with decimal points}

Listing Record NumbersThe Norec keyword prevents the printing of the input and output record numbers. The input record numbers are not printed if Output xxx,Data is used and the file is sorted.

170 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 171: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Listing One Field per LineSuprtool normally attempts to list more than one field on every line of list output. The Oneperline keyword causes every field to be shown on a different line.

Listing without Field Names (Noname)When Suprtool knows the record structure of the output file, it shows the name of each output field. The Noname keyword causes the field names to be suppressed. By only extracting a few fields, it is possible to fit the listed output for each record on one line.

Suppressing Blank Lines Between RecordsBy default, Suprtool prints a blank line between each record. The Noskip keyword removes this blank line. If you combine the Noskip, Norec, Noname, and Title options when extracting a few fields, Suprtool can produce a simple report.

Numeric Justification (Leftjustnum and Rightjustnum)The List command normally left justifies all numeric fields. Specifying List Standard causes all numeric fields to be right-justified, unless you override the default with the Leftjustnum keyword.

Use the Leftjustnum or Rightjustnum keyword to specify the alignment of the numbers. The two keywords are mutually exclusive. The last one that appears on the command line is the one that is applied.

LaserJet ListingsThere are two methods to select different printing options for a LaserJet and other PCL-compatible printers. You can permanently set the PCL option for all listings by using Set List PCL, or you can use the List command to select the PCL option for just one task. PCL stands for Printer Command Language, which is an HP standard for printers. The following is a summary of the PCL values:PCL Font Orientation Dimensions1 Lineprinter landscape 175 cols/60 lines2 Courier landscape 100 cols/45 lines3 Courier "standard" portrait 80 cols/60 lines4 Lineprinter portrait 132 cols/80 lines5 Courier A4 "tight" portrait 80 cols/60 lines6 Lineprinter legal landscape 223 cols/60 lines

See the Set command for a complete description of the PCL options. By default, Suprtool assumes that the List output device is not PCL-compatible (List PCL 0).

If you use the List command to your terminal with a global Set List PCL value other than zero, your terminal screen may be cleared. To avoid this situation, you can explicitly specify the PCL setting along with the device:

Suprtool 5.2 for HP-UX Suprtool Commands · 171

Page 172: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>get d-sales>list serialp,pcl 2>xeq

A4-Size PaperMost of the PCL options, with the exception of PCL 5, were designed and tested with North American letter-size paper. This is especially true with PCL 5 for A4 paper: it reduces the horizontal spacing between characters so that 80 columns of Courier output fits on a single line. In addition, if you add 2000 to a PCL code, Suprtool adjusts the number of rows and columns for that option to match A4 paper. For example, to print Landscape on A4 paper, use PCL 2004 instead of PCL 1.

In general, selecting A4 paper gives you more space along the long side of the paper and less space along the short side. If you are happy with the way letter-size rows and columns work on A4 paper, simply do not add 2000 to the PCL code.

Roman-8 vs. ASCIIThe PCL option requests a Roman-8 character set, but some combination font cartridges only supply the ASCII character set (half as many characters means twice as many fonts in a single cartridge). If you ask for Landscape Lineprinter and get Landscape Courier instead, your Lineprinter font probably has the ASCII character set instead of the Roman-8 character set. To request an ASCII font, add 1000 to the PCL code. For example, if you have a Super Cartridge (55 fonts in one!), use PCL 1001, 1004, and 1006. To select both ASCII and A4 paper, add 3000.

Double-Sided Printing on LaserJetsThe LaserJet IID and IIID can print on both sides of the paper. The Duplex keyword enables double-sided printing on these printers.

>list duplex

Headings in ListingsSpecifying a Title in the List command forces Suprtool to produce a formatted listing with page-headings, page-numbers, today's date and the current time. If you want just the date and page numbers, use an empty string. For example,

>list title " "

The following example prints a report on a LaserJet in Landscape (sideways) mode, using the tiny Lineprinter font, including a page heading with the title. The physical command line limit is 256 characters. As a result, the maximum size of the heading is less than 256 characters because the List command and heading options need to be included in the command line.

>in custs {self-describing file}>if status<>10,20,30,40 {the only valid values}>set list pcl 1 {select LaserJet option}>list title "Invalid CUSTOMER Records">xeq {include title on listing}

Changing the Date FormatWhen you select page headings by specifying a title, each page includes today's date. By default, this date is formatted as mmm dd, ccyy (e.g., Mar 20, 2000). You can override this format with the Date keyword. Use the Set command to specify a

172 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 173: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

different default date format for future List commands (e.g., Set List Date 2). The valid date formats are as follows:

Value Format Example0 (default) mmm dd, ccyy Mar 20, 20001 yy/mm/dd 00/03/202 mm/dd/yy 03/20/003 dd/mm/yy 20/03/004 dd mmmyy 20 Mar00

>list title "Example Report" date 3>xeq {heading date is in dd/mm/yy format}

Changing the Time FormatWhen you select page headings by specifying a title, each page includes the current time. By default, the time is in 24-hour format (e.g., 23:02). You can override this format with the Time keyword. Use the Set command to specify a different default time format for future List commands (e.g., Set List Time 2). The valid time formats are as follows:

Value Format Example0 none1 (default) 24-hour 23:022 AM/PM 11:02PM

>list title "Example Report" time 2>xeq {time will be in AM/PM format}

Simple Reports

A Fast Method for Producing Simple ReportsFor self-describing files, datasets, and database tables, the Standard keyword is equivalent to List Noname,Noskip,Norec,Rightjustnum with default column headings. For data files, the Standard keyword is equivalent to List Octal,Char. In either case, the Standard keyword provides a default title that describes the input source. You can override the title, date format, time format, or any other option selected by the Standard keyword, by specifying them in addition to the Standard keyword. For example,

Suprtool 5.2 for HP-UX Suprtool Commands · 173

Page 174: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>select * from customer>list standard {use all Suprtool defaults}>xeq

>select * from customer>list standard,date 3 {override the date format}>xeq

>input uxfile,reclen 80,nolf>list standard,char {override the format options}>xeq

>input uxfile,reclen 80,nolf>list standard,leftjustnum {left justify numbers}>xeq

>get m-customer>list standard,title "Customer List" {override title}>xeq

>get m-customer>list standard,heading " " {no column headings}>xeq

Listings with SubheadingsWhen using the Title or Standard keywords, you can also include subheadings with the Heading keyword. You can specify multiple columns by repeating the string after the Heading option (e.g., List Heading "First " "Second") or specify the Heading option multiple times (e.g., List Heading "First ", Heading "Second"). Being able to specify multiple columns makes it easier to align column headings when using the Standard keyword. If you specify the Heading keyword without the Title keyword, a default title is produced.

>select * from customer {read this table}>extract account {Z8 }>extract firstname {X10}>extract lastname {X16}>extract rating {J2 }>extract status {X2 }>sort lastname>sort firstname>list standard,title "Customer List", & heading "Account " " First and Last Names" & " " "Credit " "Status">xeq

List DeviceBy default, the List command lists lines to $stdlist. You can also redirect output to an attached printer. To redirect to a file on HP-UX we have added the file option.

List FileThe File keyword allows for the output from the List command to be directed to a file. The List command also has a new option to Append to an existing file, so you can have multiple reports in a single file. The File option takes the next parameter as being the filename:

174 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 175: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>in test/file1sd >list stan file myslist >xeq

If the file myslist exists it will be over-written, unless you specify the Append option. If you specify the append option the new report will be added to the file.

So if you want to incorporate multiple reports you just need to do the following: >in test/file1sd >list stan file myslist >xeq >in test/file2sd >list stan file myslist append >xeq

Although the concept of record size is not the same on HP-UX as it is on MPE it is still important in some areas within Suprtool.

In this case the RECLEN parm merely tells the List command where to fold the lines. The Reclen parm can be a value from 56 to 256 and defaults to 80 bytes.

>List FILE myreport RECLEN 132

Device LPUse the LP option to send listings to the lp command. The LP option assumes the list device is 80 columns wide.

>list lp

User Specified DeviceUse the Device option to specify a specific logical device for the listing. The device name must appear after the Device option. The device name is case-sensitive so that the device "SHIPPING" is different than the device "shipping". The Device option assumes that the list device is 80 columns wide.

>list device LP {same as List LP}>list device serialp {send to device serialp}

Listing to Attached PrinterIf you wish to list to a printer that is attached to your terminal, use List Record. Suprtool uses Record mode on your terminal or PC to print on the attached printer. To use this option, you must be using an HP terminal or HP terminal emulator and your data communication settings must be setup correctly.

You can combine this option with other listing options. You cannot interrupt Record mode with Control-Y, but you can do a Soft Reset. This unlocks the keyboard and causes the rest of the output to appear on the screen. You can then stop it with Control-Y. List record may not return complete control to your PC when running Reflection. The report printed and the keyboard unlocks, but control is not passed to your terminal. You can get control back by doing a Soft Reset (Alt-S). You can prevent this problem by setting DISABLE-COMP-CODES to yes.

If you are listing to an attached printer from a terminal, your terminal may remain locked after the printout is completed. This generally happens when you have handshaking enabled. (G-H straps set to No). You can do a soft reset to unlock your terminal.

Suprtool 5.2 for HP-UX Suprtool Commands · 175

Page 176: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

If handshaking is disabled (G-H straps set to Yes), the List command works and returns control to the terminal but two "S" characters will be printed on the terminal. There is currently no known workaround to these problems.

ROBELLE_LPTypically when printing with the list command inside Suprtool, (or Qedit for that matter), and you are sending the output to a printer device, the “lp” program is used to accept the data from a pipe. In some cases third party spoolers employ their own “lp” program.

If the ROBELLE_LP variable is set to the name of the third-party lp program, Suprtool (and Qedit) will use that program if the output is not to a file. This variable must be set before Suprtool is run.

export ROBELLE_LP=/opt/thirdpartyspooler/llp./suprtoolin somefilelist device LPexit

If the variable is not set then Suprtool uses /usr/bin/lp as it has previously.

NotesThe List operation occurs logically after the sort phase, if any, and after any Extract, but before the final Output or Put operation. A Reset turns off the current List options.

For more examples of the List command, see Suprtool Issues and Solutions.

176 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 177: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Listredo Command [LISTREDO]The Listredo command displays any of the previous 1000 commands.

LISTREDO [ start [ / stop ] ] [;ABS] [;OUT=file]

[ string ] [;REL]

[ ALL | @ ] [;UNN]

(Default: display previous 20 commands)

(BJ and ,, are short for LISTREDO)

Commands are numbered sequentially from 1 as entered and the last 1000 are retained. You can display a single command, a range of commands, all 1000, or all the commands whose name matches the string. You can display the commands with ABSolute line numbers (the default), RELative line numbers (-5/-4), or UNNumbered. If you want to redo any of these commands, see Do, Redo, and Before.

Examples>listredo 5>listredo 5/10>listredo help {print all Help commands}>listredo -10 {print last ten commands}>listredo ALL {print entire redo stack}>listredo rm {print all rm commands}>listredo rm xx {print all "rm xx" commands}>listredo @rm {print all with "rm" anywhere}>listredo @;rel {print ALL, relative numbers}

Saving to a FileSaving the Listredo commands to a file is not supported in Suprtool/UX.

NotesThe :Listredo command can be abbreviated to BJ as in Qedit, or to ,, (comma comma) as in MPEX. You cannot use a semi-colon (;) to combine commands on the same line.

Persistent RedoRedo commands can be saved in a permanent file and can therefore be used from another session. You can use the Set redo command to specify a filename to save your redo commands. Please see the Set Redo command ("Redo" on page 209) for details.

Suprtool 5.2 for HP-UX Suprtool Commands · 177

Page 178: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Numrecs Command [N]Limits the number of records selected and the size of the sort scratch file.

NUMRECS size | percentage%

(default: size=10,000 or EOF of input source)

ParametersTo limit the number of records selected from the input source and to reduce the size of the sort scratch file, use the Numrecs command. If you select more than |2size| entries, Suprtool prints a warning message, and ignores the rest of the input records. However, the output file will have the records that were selected. Use a percent sign (%) to specify the Numrecs as a percentage of the input file size. The percentage can range from 1 to 500, but values over 100 have no effect on HP-UX.

Reducing File SizesSuppose that the d-sales dataset contains 100,000 entries, but you use the If command to select 15% of the entries. We would specify 15 as the percentage on the Numrecs command to reduce the size of the sort scratch file and the output file:

>get d-sales {specify input}>numrecs 15% {specify 15000 as file size}>if sales-qty<100 {select a subset of d-sales}>sort cust-account {sort using the dataset path}>output out2 {output file will have room for}>xeq { 15000 records}

Disc Files vs. DatasetsWhen you specify a source of records using the Input command (as opposed to reading a dataset using the Get or Chain command), Suprtool attempts to duplicate all of the input file's attributes in the output file. This includes the file limit. For this reason, the Numrecs value is ignored if the output file limit is smaller than the input file limit. Numrecs is still useful when reading disc files to reduce the size of the sort scratch file.

178 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 179: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Open Command [OP]Specify an SQL database to open. Only one database can be open at a time.

OPEN ORACLE username [password][remotedb@instance]

OPEN ALLBASE dbename owner

Oracle DatabaseUse the Open command to connect to an Oracle database. You must specify your Oracle username and password. If you do not specify the password in the Open command, Suprtool prompts for your password (without echoing it on the screen). To read data from an Oracle table or view, use the Select command. Use Set Oracle Rows to specify how many rows for Suprtool to fetch when it is reading Oracle data.

>open oracle scott tiger

Allbase DatabaseUse the Open command to connect to an Allbase database. You must specify your Allbase dbename and owner. To read data from an Allbase table or view, use the Select command. Use Set Allbase Rows to specify how many rows for Suprtool to fetch when it is reading Allbase data.

>open allbase inventory anne

Remote Databases and Oracle IssuesIn order to connect to the remote database using Suprtool, you need to specify the connection parameters as follows: >open oracle username/password@machine

Oracle Libraries If the Oracle libraries have not been loaded Suprtool will print an error on the Open command. To find out specific error messages as to why the libraries have not been loaded then just run Suprtool with the –lw option, which means print loader warnings.

Suprtool 5.2 for HP-UX Suprtool Commands · 179

Page 180: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Output Command [O]Define the name of the output file as one of these: a new disc file (default), an existing file (Append or Erase option), or * for $stdlist. If you use List, Put, Update or Total, Output defaults to $null. Output produces the same record format as the input source (adjusted by Extract commands), unless you override it with format keywords.

OUTPUT filename format [ERASE | APPEND]

(Default: DATA only, "new" file)

New FilesThe filename is the name of a new disc file to be built by Suprtool (Output xxx). If Suprtool cannot Save the new file because of a duplicate file name, you may purge the old file or give the new file a different name. If Suprtool is running in batch mode, it renames the new file as Outputnn, where nn is the lowest number between 00 and 20 that makes a valid new file name. The Outputnn file is built in the same directory as the duplicate output file and not in your current directory.

Existing FilesThe filename is the name of an old disc file to erase (Output xxx,erase) or to append to (Output xxx,append). Output xxx,erase does not purge the existing file; it simply overwrites the contents of the file.

$StdlistSpecify output to $stdlist by a single asterisk (Output *). Use this filename with the ASCII option for a quick listing of a file or database table.

Format OptionsThe format and length of the output records is determined by which of the following format keywords is selected:

Keyword(s) FormatDATA DefaultKEY Sort keys onlyNUM J2 record numbers onlyNUM,KEY J2 record numbers plus sort keysNUM,DATA J2 record numbers plus data recordQUERY Self-describing fileLINK New format self-describing fileNUM,QUERY Query "numbers" formatASK COGELOG ASK select fileASCII Convert numeric to ASCIIDISPLAY Convert numeric to display (zoned-decimal)PRN Personal computer formatNOLF Do not write out Line Feeds to the end of the

record

180 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 181: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

LF Write out Line Feeds to the end of the record

DATA

DATA is the default; output records are the same length and format as the input records.

KEY

KEY creates output records containing only the sort keys, concatenated from left to right (major key to minor key).

NUM

NUM creates output records of four bytes in length, containing the double-integer record number of each input record. The record number of the first record is 1 for database tables and 0 for disc files.

NUM,KEY

NUM,KEY creates output records containing the four-byte record number, followed by the sort key values, concatenated from left to right (major key to minor key).

NUM,DATA

NUM,DATA creates output records containing the four-byte record number, followed by the full data record. This can be useful to create "transaction" files from detail datasets that will later be updated back to the database after a processing stage.

QUERY

QUERY creates a self-describing output file. A self-describing file is a data file plus an extra file which contains information about the structure of each record in the data file. This extra file is created with the output file name plus the extension ".sd". This ".sd" file contains the name, type, length, and offset of each field in the data file.

QUERY self-describing files have no provision for repeated fields. These fields appear with an "unknown" type in the .sd file. See the LINK option for a better self-describing file format. The QUERY option produces a file that is similar to the file produced by the SAVE command in the MPE QUERY program.

LINK

The QUERY output option has some major drawbacks. Compound fields are not handled, date and decimal point information is not saved, and sort information is not part of the file description. The LINK option produces a self-describing file that solves all these problems. This option is the recommended way to generate files for Suprlink. We are also encouraging third-party software vendors to accept this format.

To convert a self-describing file back into a non-SD file, simply purge the corresponding ".sd" file.

NUM,QUERY

NUM,QUERY creates output records in QUERY "numbers" format. This is an undocumented feature of QUERY that is used by some application packages.

Suprtool 5.2 for HP-UX Suprtool Commands · 181

Page 182: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Records in a "numbers" file contain the dataset number and the record number in ASCII format. A QUERY "numbers" file is usually used as input to a report program. Substituting Suprtool for QUERY in these batch jobs should improve the speed.

ASK

ASK is a QUERY-replacement tool from COGELOG. ASK creates output records in ASK select-file format. Suprtool can be used to scan and select records quickly from a dataset. ASK Version C can produce reports from the resulting select-file. This option cannot be used with any other Output option.

Recent versions of ASK read self-describing files. For these versions use the Link option instead of the Ask option.

ASCII

ASCII converts all binary input fields into their equivalent ASCII values. All binary fields are right-justified in their fields with a trailing sign. The sign can be a blank, "+", or "-". Byte fields are not affected by this option. The size of the ASCII field depends on the format of the binary field:Field Format Output SizeI1, J1 6 bytesI2, J2 11 bytesI3, J3 16 bytesI4, J4 20 bytesK1 5 bytesK2 10 bytesE2 12 bytesE4 23 bytesZn n+1 bytesPn n bytes

Any fields with implied decimal places (see the Item command) are formatted with a decimal point in the correct position. Suprtool reserves two additional positions for each output field that has an implied decimal point.

DISPLAY

DISPLAY converts all binary input fields into their equivalent display values (also known as zoned-decimal). The size of the display field depends on the format of the binary field:Field Format Output SizeI1, J1 5 bytesI2, J2 10 bytesI3, J3 15 bytesI4, J4 19 bytesK1 5 bytesK2 10 bytesPn n-1 bytes

182 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 183: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

P*n n-2 bytes

The last digit of the number is replaced with a letter corresponding to positive or negative values. See the following table.Units Digit Positive Negative No Sign0 { } 01 A J 12 B K 23 C L 34 D M 45 E N 56 F O 67 G P 78 H Q 89 I R 9

Positive values for I- and J-type fields are converted into neutral (i.e., no sign) display values. The sign is preserved when converting packed fields to display.

DISPLAY is not supported for Real or IEEE fields. Byte fields are not affected by this option. Display fields in the input record are not converted into display.

PRN

Many PC software packages import PRN files (these files are also called delimited in some PC documentation). A PRN file has quotes around character-fields and a comma between each field. Binary values are output in ASCII with an optional leading sign. Not all applications accept PRN files; for more precise conversion of data, use STExport.

PRN converts each input-field to a fixed-width output-field, filling with trailing spaces where necessary. All binary values are converted into their equivalent ASCII value, left-justified in their fields. The sign precedes the ASCII value for the number and can be missing, "+", or "-". See the ASCII output-option for the field width of each data-type.

Output fields with implied decimal places (see "Decimal Places" on page 164) are formatted with a decimal point in the correct position. Like the ASCII option, Suprtool reserves two extra columns for each output field with implied decimal places.

Lotus 1-2-3 accepts records only up to 240 bytes long. Because the PRN option leaves room for the maximum value of any field, you may need to restrict the number of output fields using the Extract command.

While some PC software allows alternate characters to be used to delimit character fields, Lotus 1-2-3 accepts double quotes only. Since Lotus 1-2-3 rejects character fields that contains a double quote, Suprtool removes all double quotes from character fields when generating the PRN format. Suprtool removes quotes by replacing them with a space.

See STExport for a method of including header lines in the file to be down-loaded.

NOLF

Suprtool 5.2 for HP-UX Suprtool Commands · 183

Page 184: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

If you need to ensure that line feeds are not written to the end of each record, then you should specify the NOLF option. It is usually preferable to specify the LF option.

LF

If you need to ensure that line feeds are written to the end of each record, then you should specify the LF option. When extracting from SQL databases, Suprtool writes out records without line feeds. Files with line feeds are usually processed more easily by most other applications or import programs, so it is advisable to use the LF option if you are uncertain.

By default, whether Suprtool writes out a line feed depends on the input source. For example, if the input source has line feeds, then line feeds will be written out at the end of each record.

When filling up PowerHouse subfiles, some versions of Quiz will abort if no line feeds are found at the end of the record. It is recommended that when you write to a PowerHouse subfile, you should always use the LF option on the Output command.

ExamplesOne reason to use $stdlist as the output file is to obtain a quick listing of the ASCII fields in the input source. The following example lists the Account, Lastname, and Firstname columns of the Customer table and separates them by two spaces:

>open ora demo reader {input from a database}>select * from customer {use the Customer table}>extract account {account number will be first}>extract " " {two spaces}>extract lastname {the customer's last name}>extract " " {two more spaces}>extract firstname {the customer's first name}>output * {output the records to $stdlist}>sort account {sorted by the account number}>exit

The following examples demonstrate other combinations of options on the Output command. The entire Issues chapter of the manual should be reviewed for extended examples using the Output command. Many Output options were intended for specific application areas.

>output newfile>output accum,append>output keyfile,key>output transf,num,data>output querynum,num,query>output $null

If you want to find out how many records are qualified by some selection criteria, without producing an output file, send the output to $null. The Out= count on $stdlist displays the number of qualifying records.

NotesThe output file must be an "old", existing file if the Append or Erase option has been specified.

184 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 185: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Put Command [P]Directs output records to be DBPUT into an Eloquence dataset. Put can be combined with Output to a file, but if no Output command is entered, Suprtool defaults the output file to $null. It is your responsibility to ensure that the output records match the format of the target dataset. The DATA option of the Output command is the only valid output option when Put is specified.

PUT setname [,[host][:service]/]database]]

(Default: database=Base)

ParametersIf database is not specified, setname must be a valid dataset of the Base previously opened. You must have write access to the dataset selected.

If database is included, the specified database is opened. This Put database is closed after the task is completed, unlike the database opened with Base. It is possible to copy records from one database to another with Suprtool.

ExamplesFor the first example, we assume that the D-SALES dataset is designed to contain a week's worth of transactions. Each night, the transactions from a week ago are moved to the monthly dataset: D-SALES-MON. The D-SALES and D-SALES-MON datasets have exactly the same field declarations. The following Suprtool task would move one day's transactions from D-SALES to D-SALES-MON.

>base store>get d-sales {read the weekly dataset}>if purge-date=000401 {select one day's transactions}>put d-sales-mon {adding them to the monthly dataset}>exit

For the next example, we assume that the D-SALES-MON dataset is in a different database.

>base store>get d-sales>if purch-date=000401 {select one day's transactions}>put d-sales-mon,ostore {add to OSTORE database}>exit {the output file defaults to $null}

This example shows how Suprtool can read a disc file and Put each record in a database:

>input dsales {"dsales" has exactly the same format}>put d-sales,store { as the d-sales dataset}>exit

NotesIf the dataset selected for output is a master dataset, it is possible that some of the output records may be duplicate key values. If this happens, Suprtool prints an error message and terminates the task, unless you have enabled Set Ignore, in which case the duplicates are counted and reported at the end of the task. Duplicate records are not written to the output file.

Suprtool 5.2 for HP-UX Suprtool Commands · 185

Page 186: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Q Command [Q]Prints a message on $stdlist.

Q [ "string" ]

(Default: print a blank line)

The string of up to 253 characters is printed on $stdlist. The string is truncated to the record width of $stdlist.

The string must be embedded in quotes. Either single-quotes (') or double-quotes (") are permitted. The quotes are not printed on $stdlist.

ExamplesThe Q command is often combined with the Userpause command. The example is a usefile that provides an explanation of how long a task takes:

>q>q "We will select all transactions over $10,000. Since">q "there are many transactions, this task will take">q "some time (usually more than fifteen minutes).">q>userpause "Press any key when you are ready to start."

186 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 187: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Redo Command [REDO]Enables you to modify and repeat any of the previous 1000 command lines.

REDO [ start [ / stop ] ]

[ string ]

[ ALL | @ ]

(Default: redo the previous command)

(Comma "," is short for REDO)

The Redo command allows you to modify the commands before it executes them. If you don't need to change them, use the Do command. Commands are numbered sequentially from 1 as entered and the last 1000 are retained. Use the :Listredo command to display the previous commands. You can redo a single command, a range of commands, or the most recent command whose name matches a string.

The Redo command uses MPE-style editing logic (D, I, R, U and >). The default mode is to replace characters. To delete, type DDDD under the characters to be removed. To insert, type I under the insertion spot, then the new characters. To undo your changes, type U. To append to the end of the line, use >xxx. To delete from the end of the line, use >DD. To replace at the end of the line, use >Rxxx. And to erase the rest of the line, use D>. If you prefer Qedit-style editing (Control-D, etc.), use the Before command instead of the Redo command.

Examples>ll *.fd {".sd" is not spelled right}*.fd not found>redo {redo most recent command}ll *.fd {last command is printed} s {you enter changes to it}ll *.sd {the edited command is shown} {you press Return}

>listredo all>redo 5 {redo 5th command in stack}>redo {redo previous command}>redo -2 {redo command before previous}>redo 8/10 {redo 8th through 10th}>redo -10/ {redo -10 through last}>redo rm {redo last "rm" command}>redo rm temp {redo last "rm temp"}>redo @temp {redo last containing "temp"}

NotesThe Redo command can be abbreviated to a comma, as in MPEX. You cannot use ";" to combine commands on the same line.

Hpmodify Keys – ReferenceHere are the MPE-style REDO sub-commands:

Directive Effecti INSERT. If text follows the i, this text is inserted in the current line

starting at the i position.

Suprtool 5.2 for HP-UX Suprtool Commands · 187

Page 188: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

r REPLACE. If text follows the r, this text replaces the same number of characters in the current line beginning at the r position.

d DELETE. Deletes a character from the current line for each d specified in the edit line. Note that "d d" does not specify a range as it does in MPE V but simply deletes one character above each d. Multiple d's may be followed by an INSERT or REPLACE operation.

d> DELETE. Deletes to the end of the current line from the position specified by d>. May be followed by an INSERT or REPLACE operation.

> APPEND. If text follows the >, this text is appended to the end of the current line. If a > without text is positioned beyond the end of the current line, then a simple replacement is performed instead.

>d DELETE. Deletes from the end of the current line, right-to-left. Multiple d's and INSERT and REPLACE strings may be specified after >.

>r REPLACE. Replaces characters at the end of the command line. The last (rightmost) character of the replacement string is at the end of the line.

c CHANGE. Changes all occurrences of one string to another in the current line starting at the c. The search string and replace string must be properly delimited. A proper delimiter is a non-alphabetic character (such as ' " or /). The substitution is specified as cdelim search-string delim [replace-string [delim]]. Omitting the replace-string causes occurrences of search-string to be deleted, with no substitution.

u UNDO. A single u in column one cancels the most recent edit of the current line. Using the Undo command twice in a row cancels all edits for the current line and re-establishes the original, unedited line. If u is placed anywhere other than column one of the current line, then a simple replacement is performed. Undo makes sense only if you have a line on which you have performed some editing that can be "undone."

other Simple replacement. Any other character (not i, r, d, d>, >, >d, >r, c, or u) will be put into the current line at the position above where it is placed, replacing any existing character. Simple replacement also occurs for the editing characters i, r, c, or > if they are not followed by text; or if > appears at or beyond the current end of line.

Hpmodify ExamplesHere are examples of the MPE-style REDO sub-commands in action:

Edit Actionu First occurrence undoes the previous edits. The u must be in column

one.u Second occurrence undoes all edits on the current line. The u must be in

column one.rxyz Replaces the current text with xyz starting at the position of r.xyz Replaces the current text with xyz starting at the position of x.ixyz Inserts xyz into the current line, starting at the position of the i.ddd Deletes three characters, one above each d.d xyz Deletes a single character above the d, skips one space, then replaces the

current text with xyz starting at the position of x.ddixyz Deletes two characters, then inserts xyz in the current line starting at the

position of the i.

188 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 189: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

d d Deletes one character above the first d, skips two spaces and deletes a second character above the second d. It does not delete a range of characters, making it unlike the MPE V version of Redo.

d d>xyz Deletes a single character above the first d, skips two spaces and deletes to the end of the line beginning at the second d, and then places xyz at the end of the line.

>xyz Appends xyz to the end of the current line.>ddxyz Deletes the last two characters from the end of the current line and then

places xyz at the end of the line.>rxyz Replaces the last three characters in the current line with xyz.>ixyz Appends xyz to the end of the line. In this case, the i command is

superfluous, because > accomplishes the same result. Using >xyz would be sufficient.

c/ab/def Changes all occurrences of ab to def.c"ab" Deletes all occurrences of "ab".cxyz Replaces the current text with cxyz, starting at c. Because delimiters

have not been specified (as they were in the previous two examples), this is a simple replacement with the four characters.

Persistent RedoRedo commands can be saved in a permanent file and can therefore be used from another session. You can use the Set redo command to specify a filename to save your redo commands. See "Redo" on page 209 for details.

Suprtool 5.2 for HP-UX Suprtool Commands · 189

Page 190: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Reset Command [R]Resets aspects of the current task.

RESET [ ALL | @ | command [...] ]

(Default: Delete/Sort/Key/If/List)

ParametersMore than one command can be Reset at once by entering several commands separated by a space or a comma. If no parameters are specified, Suprtool cancels the previous Sort, Key, If, Delete, and List commands. The other commands remain unchanged.

If ALL is specified, all of the Input and Output commands are canceled and database/files are closed. In fact, the only options that are not reset to the initial condition are Define, Item, Open, and Set options.

ExamplesYou began to specify a sort, but then you discovered that you specified the wrong database so you decided to start all over:

>base ostore>get d-sales>sort cust-account>reset all {oops, wrong database}>base store {now we have correct one}

In the next example, you entered an incorrect If command:

>if delivered>000401 {wrong field used}>reset if {only reset the If command}>if purchased>000401 { and specify it again}

This time both the If command and the Extract commands are incorrect:

>if delivered>000401 {wrong field used}>extract delivered { in both commands}>reset if,extract {only reset the If and Extract}>if purchased>000401 { commands and start again}>extract purchased,account

NotesBy resetting certain commands, other commands are also reset. For example, resetting the Base command resets almost all other commands, except the Define and Output commands. Resetting the Put command closes the output database when the database for the Put command is different from the input database. Resetting the Chain, Get, or Input command resets everything except the Base, Define and Table commands. Resetting the Table command resets everything except the Base and Define commands. Resetting either the Define or Item command resets both Define and Item settings.

190 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 191: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Select Command [SEL]Specify a select statement for the currently open SQL database. The select command supports all of the features of the select command of the open SQL database. Only one select command can be specified at a time.

SELECT select-command

Allbase sorts data:>select * from user.account@emp order by ename

Suprtool sorts data:>select * from user.account@emp>sort ename

The select-command can contain any expression or clause that is supported by the SQL database. Some features (e.g., ORDER BY) may be done faster by Suprtool (e.g., the Sort command).

Some Select commands can exceed the 256-character command line limitation. The Select command, however, can be considerably larger if you use the $read feature of the Select command. This feature is similar to the If command $read feature and is invoked by entering the Select command on a line by itself (unlike If, you do not specify $read explicitly).

>select-ename,salary,tax_paid-from scott.employee-order by ename-//>

The Suprtool prompt changes from ">" to "-" after entering the Select command by itself on a line. The entire command gets sent to the Select command parser after terminating with two slash marks (//) or a blank line.

You might realize greater performance gains with the Select command if you specify only the columns that you need in your output file for either tables with many items or when you need only a couple of items from a given table.

The following Select command

>select col1,col2,col3 from user.account@emp

may be faster than

>select * from user.account@emp

Your mileage may vary.

Suprtool 5.2 for HP-UX Suprtool Commands · 191

Page 192: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Set Command [S]Enables or disables certain operating options within Suprtool. These options are not reset by Xeq or Reset commands.

SET ALLBASE ROWS number

SET ARITHMETIC CLASSIC|IEEE (has no effect in Suprtool/UX)

SET BASECLOSE ON|OFF (not supported in Suprtool/UX)

SET BLOCKSIZE [size] (has no effect in Suprtool/UX)

SET BUFFER [size]

SET CLEANCHAR <string>

SET CURRENCYSYMBOL <string>

SET DATE CUTOFF [number]

SET DATE FORCECENTURY ON|OFF

SET DATE IFYY2000ERROR ON|OFF

SET DATE MAPTOPHDATE8 ON|OFF

SET DECIMALSYMBOL <string>

SET DEFER ON|OFF (has no effect in Suprtool/UX)

SET DUMPONERROR ON|OFF

SET EDITSTOPERROR ON|OFF

SET EOFREAD ON|OFF (has no effect in Suprtool/UX)

SET FASTREAD ON|OFF

SET FILECODE number (not supported in Suprtool/UX)

SET FILENAME Help|Link|Edit|Hint|Export|Outcount filename

SET FIRSTREC [0|1] (has no effect in Suprtool/UX)

SET HINTS ON|OFF (has no effect in Suprtool/UX)

SET HPUXCmdErr <string>

SET IFCHECK ON|OFF

SET IGNORE ON|OFF (has some effect in Suprtool/UX)

SET ITEMABBREVIATEDATE ON|OFF]

SET ITEMLOCK <fieldname>

SET INTERACTIVE ON|OFF

SET LABELLEDTAPEREWIND ON|OFF

(has no effect in Suprtool/UX)

SET LIMITS [Mpe ON|OFF] [ReadOnly ON|OFF] [Tablesize size]

SET LIST DATE number

SET LIST PCL [0|1|2|3|4|5|6]

SET LIST TIME number

192 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 193: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

SET LOCK [number] (has no effect in Suprtool/UX)

SET MAKEABSENT ON|OFF (has no effect in Suprtool/UX)

SET NLS [number]

SET NUMBUG ON | OFF

SET OPENMODE [number] (has no effect in Suprtool/UX)

SET ORACLE ROWS number (not supported in Suprtool/MPE)

SET ORACLE INTEGER ON | OFF (not supported in Suprtool/MPE)

SET ORACLE OPENFIX ON|OFF (not supported in Suprtool/MPE)

SET ORACE ZERONULL ON | OFF (not supported in Suprtool/MPE)

SET PATTERN NEW|OLD

SET PREFETCH [number] (not supported in Suprtool/UX)

SET PRIVMODE ON|OFF (has no effect in Suprtool/UX)

SET PROGRESS Percent [number] Minimum [number]

SET PROMPT character

SET REALMAP ON|OFF

SET RECOVER ON|OFF (has no effect in Suprtool/UX)

SET REDO filename

SET SDEXTNAME ON|OFF

SET SORTFAST ON|OFF (has no effect in Suprtool/UX)

SET SQUEEZE [ON|OFF] (has no effect in Suprtool/UX)

SET STATISTICS ON|OFF

SET SUBSYSTEM ON|OFF (has no effect in Suprtool/UX)

SET SUSPEND ON|OFF (has no effect in Suprtool/UX)

SET THOUSANDSYMBOL <string>

SET USERLABELS ON|OFF (has no effect in Suprtool/UX)

SET VARSUB ON|OFF

SET VARSUBCOMPAT ON | OFF

SET VARSUBDEBUG ON | OFF

SET WARNINGS ON|OFF

Each option is its own Set command. That is, you cannot specify multiple options in the same command. Instead, use multiple Set commands. For example, to Set Statistics On and to define a PCL format for the List command, you would specify two Set commands:

>set stat on>set list pcl 1

or

Suprtool 5.2 for HP-UX Suprtool Commands · 193

Page 194: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>set stat on;set list pcl 1

Add system-wide Set commands to the /opt/robelle/suprmgr configuration file.

When Suprtool starts running, all the options are set to initial "factory settings". The Suprmgr file may contain Set commands to override the initial values. Set commands remain set until the end of the Suprtool run, or until changed by another Set command.

Some commands have optional parameters (e.g., the numeric value of Set Date Cutoff). If the command is specified without a value, the default that Suprtool uses may be different from the program's initial value. When that is the case, the command description will show the initial value and the default-when-omitted value.

AllbaseSET ALLBASE ROWS number

(Initially: 100)

If you open an Allbase database, Suprtool reads more than one row at a time when processing the input source. By default, Suprtool fetches 100 rows at a time. You can vary the number of rows that Suprtool fetches with Set Allbase Rows. The minimum number of rows is 1 and the maximum number is 990. You must specify Set Allbase Rows before entering the Select command.

ArithmeticSET ARITHMETIC Classic | IEEE

This command has no effect in Suprtool/UX.

BasecloseSET BASECLOSE ON | OFF

This command is not supported in Suprtool/UX.

BlocksizeSET BLOCKSIZE [size]

This command has no effect in Suprtool/UX.

BufferSET BUFFER [ size ]

(Initially: depends; Default: no change)

Set Buffer varies the maximum number of words that Suprtool allocates for input and output buffers. This buffer size limits the number of data blocks that Suprtool reads at a time.

Suprtool overrides the maximum buffer size specified, if that is necessary to get the task done. For example, when the blocks size of the file is greater than buffer maximum specified.

The maximum value is 14,336 words in Suprtool/V and 18,432 words in Suprtool/iX. The default value used by Suprtool is the largest size that fits in the available data structures and still allows Suprtool to get the job done. Using Set

194 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 195: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Buffer to reduce the size of the buffer reduces the size of the stack that Suprtool uses for copy operations. Suprtool/V always uses a buffer size of 4096 words when sorting. This leaves the maximum amount of room in the stack for the sorting operation.

CleanCharSET CleanChar " "

(Default: space)

By default, Suprtool will replace any of the characters specified in the clean command with a space. You can specify what character to use to replace any of the characters that qualify with the following set command:

>set CleanChar "."

This will set the character to replace any of the qualifying "to be cleaned" characters to be a period.

If you want to Clean a field and not replace with any character you just need to set the clean character in the following manner:

>set CleanChar “<null>”

CurrencySymbolSET CurrencySymbol "$"

(Default: period)

This setting is used to change the Currency character which is used to edit the data in a field used by the $Number function. The defined currency symbol(s) is stripped from the field prior to converting to number, in the $number function. The CurrencySymbol can be up to our characters.

>set CurrencySymbol "$"

The default character for the Currency Symbol is the Dollar sign.

Date CutoffSET DATE CUTOFF [ number ]

(Initially: 10; Default: 00)

Date Cutoff tells Suprtool what century to use when Suprtool generates the date value from the $date and $stddate functions. This setting only affects the date values generated by the $date and $stddate function in the If and Extract commands. This does not affect user data.

Versions of Suprtool without Set Date Cutoff would assume 19 for the century for any user-specified $date with a two-digit year.

Now with Set Date Cutoff xx, Suprtool assumes the following: a value of 20 for the century if the two-digit year specified in the $date or $stddate functions is less than the value of Set Date Cutoff; a value of 19 for the century if the two-digit year is greater than or equal to Set Date Cutoff.

The initial value of Set Date Cutoff is 10. Therefore the default behavior in $date and $stddate is to treat the two-digit years with values of 00..09 as 2000..2009, and the two-digit years with values of 10..99 as 1910..1999.

Suprtool 5.2 for HP-UX Suprtool Commands · 195

Page 196: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

yy Value in $date With Cutoff 10 With Cutoff 2500 2000 2000… … …09 2009 200910 1910 201011 1911 2011… … …24 1924 202425 1925 192526 1926 1926… … …99 1999 1999

We recommend that you always provide a four-digit year when using $date. However, for reasons of backward compatibility, we introduced Set Date Cutoff. See "Date ForceCentury" on page 196 for more information.

$Stddate and Set Date CutoffWhen $stddate has to convert from a date in only a two-digit format, the conversion to the four-digit date will use the value in Set Date Cutoff.

For example,

>input salesdetail {a self-describing file}>set date cutoff 15 {range is 1915-2014}>def new-ship-date,1,4,double>item ship-date,date,mmddyy>ext order-no / sales-amount>ext new-ship-date = $stddate(ship-date)>out salesinfo,link>xeq

In this example, if any ship-date has a year of 14 or less, then the century applied to the new-ship-date field will be 20. Ship-dates with a year of 15 or more will have a century of 19 applied.

Date ForceCenturySET DATE FORCECENTURY ON | OFF

(Initially: OFF)

Set Date ForceCentury On will not allow a yy date to be entered in the $date function; it will force the user to enter a full ccyy date.

>set date forcecentury on>item date-field,date,ccyymmdd>if date-field >= $date(00/12/10)

Error:You must specify the century or Set Date ForceCentury off

The default value for Set Date ForceCentury is off.

Date IfYY2000ErrorSET DATE IFYY2000ERROR ON | OFF

196 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 197: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

(Initially: ON)

By default Suprtool considers dates with a two-digit century component from the $date and $today functions to be invalid when the dates resolve to be greater than 1999 and the If operation is a relative operation (e.g., greater than or equal to). You can control whether Suprtool considers this condition an error by using the following Set command:

>set Date Ifyy2000Error Off

The following example shows what is considered to be an error by the If command and how the Set command can turn off the error check:

>def a,1,6>item a,date,yymmdd>if a >= $today ^Error: Cannot use a date beyond 1999 for this format>set date ifyy2000error off>if a >= $date(2000/01/03)

We have chosen this condition to be an error by default because when the $date function in the If command resolves a date in a yymmdd format to a value beyond 1999, the result is not always a useful value. For example, a December 10, 2000 date in a yymmdd format would have a value of 001210, and comparisons to this value could be logically incorrect.

If you would have included a Delete command in a dataset selection task, you could have removed all of your records.

Date MapToPHDate8SET DATE MAPTOPHDATE8 ON | OFF

(Initially: OFF)

This set command will change any item command reference to phdate to mean phdate8, for assistance in converting to the newer phdate format found in PowerHouse version 8.19 and higher.

The set command:

>set date MapToPhdate8 on

changes only the reference to phdate8 in the Item command. It does not change references that already exist in self-describing files nor does it change the data.

With this setting enabled, any Item command reference, such as:

>item mydate,date,phdate

will actually mean phdate8.

DecimalSymbolSET DecimalSymbol " "

+30(Default: period)

This setting is used to change the Decimal character which is used to edit the data in a field used by the $Number function. >set DecimalSymbol "."

The default character for the Decimal Symbol is a period.

Suprtool 5.2 for HP-UX Suprtool Commands · 197

Page 198: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

DeferSET DEFER ON | OFF

This command has no effect in Suprtool.UX.

DumpOnErrorSET DUMPONERROR ON | OFF

(Initially: ON)

With DUMPONERROR, Suprtool attempts to produce a formatted listing of records that cause a database error. The information printed may include the input record number, the output record number and the data values of the record. Suprtool uses current options of the List command to print the data values. If no List command is specified, Suprtool uses the List defaults.

EditStopErrorSET EDITSTOPERROR ON | OFF

(Initially: OFF)

An edit mask is limited to 32 characters in total for both numeric and byte type fields. If data overflows the edit-mask, by default Suprtool will fill that field with asterisks. To have Suprtool stop when it encounters an overflow when applying the edit-mask, just turn on editstoperror: >set editstoperror on

This will force Suprtool to stop if there is data left over to place when applying the edit-mask. With numeric-type fields, leading zeroes do not cause overflow. With byte-type fields, spaces do not cause overflow.

EofreadSET EOFREAD ON | OFF

This command has no effect in Suprtool/UX.

FastReadSET FASTREAD [ ON | OFF ]

(Initially: ON (some versions))

Regular Suprtool for HP-UX (version without Dynamic Image Loading) will initially have the Fastread option on. The Dynamic Loading version has the Fastread option initially off.

Testing has shown that the CPU time can be improved by anywhere from two to five times and Wall time has improved anywhere from two to six times faster. You can enable or disable this feature for all runs of Suprtool on your system by putting the command: Set FastRead On

Or

198 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 199: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Set Fastread Off

into the file /opt/robelle/suprmgr. This means that Suprtool will use the faster reads for all runs of Suprtool.

FilecodeSET FILECODE [ number ]

This command is not supported in Suprtool/UX.

FilenameSET FILENAME Help | Link | Edit | Hint | Export | Outcount filename

On HP-UX it is really only necessary to alter the Help filename, since Hints, Export and Link are not applicable under HP-UX when installing under a different directory.

/opt/robelle/help/suprtoolThis is the name of the Suprtool/UX Help file. You can override this name by using Set Filename Help or set the ROBELLE variable as outlined previously.

/set filename help /usr/local/help/suprtool

FirstrecSET FIRSTREC [ 0 | 1 ]

This command has no effect in Suprtool/UX.

HintsSET HINTS ON | OFF

This command has no effect in Suprtool/UX.

HPUXCmdErr “<string>”SET HPUXCmdErr “<string>”

(Initially: Spaces)

HP-UX and MPE are different in terms of whether or not a file operation is an error or a warning. With file operations such as rm or mv, the shell that executes these commands returns an error condition to Suprtool which impacts scripts that are converted from MPE. For example, on MPE a purge command on a file that does not exist was only considered a warning. On HP-UX, an rm command on a file that does not exist is considered an error, which halts Suprtool when run in batch .

For example the ksh returns an error code of 2 if you attempt to remove a file that does not exist.

Suprtool 5.2 for HP-UX Suprtool Commands · 199

Page 200: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

rm file1x

rm: file1x non-existent

echo $?

2

We have added Set HPUXCmdErr command which will tell Suprtool to ignore errors from certain OS commands. Please note that this does not impact Suprtool’s internal checking of Suprtool commands.

For example if you want Suprtool to ignore the common occurrence of stopping a script when an “error” occurs you just need to set the string in HPUXCmdErr as follows:/opt/robelle/bin/suprtool << \!EODset hpuxcmderrs "rm,:rm,!rm":rm file1xrm file1y!rm file1yexit!EOD

If the command returns an error Suprtool will check to see if it was an rm,:rm or !rm command and ignore the error.

IfcheckSET IFCHECK ON | OFF

(Initially: ON)

With Set Ifcheck On, the If command produces an error if any field used in the If command is not contained entirely within the input file record. For compatibility reasons, users may wish to disable this error checking by turning Set Ifcheck Off.

IgnoreSET IGNORE ON | OFF

(Initially: OFF)

This command has some effect in Suprtool for HP-UX and Suprtool for AMXW. IGNORE tells Suprtool to continue processing if there are errors in these situations: "duplicate-key" errors in writing to an IMAGE master dataset, "chain-head" errors in deleting entries from an input dataset or putting records to a detail dataset, a record changed before Suprtool could delete it. Traps on divide by zero or bad numeric data are not available as yet

InitExtentsSET INITEXTENTS ON | OFF

(Initially: OFF)

Set InitExtents has no effect on Suprtool for HP-UX.

ItemAbbreviateDateSET ITEMABBREVIATEDATE ON | OFF

(Initially: ON)

200 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 201: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

The specification of the Date format within the Item command by default expects the entire keyword. For example for the date format of Calendar, you would have to specify the entire token of Calendar. If you Set ItemAbbreviateDate On, you would only have to specify CAL for the Calendar date format.

ItemLockSET ITEMLOCK <fieldname>

(Initially: Spaces)

Item Level locking on Deletes and Updates can be invoked during a task with the Set itemlock command. For example !run suprtool.pub.robelle base order,1,; get dline set itemlock item-num del out save,link exit

The Set command must be specified after the Base and Get/Chain have been specified. This field/setting is reset after each task. Item-Level locking is not invoked for PUT operations.

There are some cases where Suprtool needs to use the "@" lock descriptor, when doing a dblock-mode 5 which is an unconditional Item Level lock, however it may appear as if it is doing a set level lock, however, since Suprtool for HP-UX could be working against different Image call "interpreters".

InteractiveSET INTERACTIVE ON | OFF

(Initially: depends)

If you run Suprtool from a session, Set Interactive is On. If you run Suprtool from a batch job or with Stdin or Stdlist re-directed, Set Interactive is Off. When it is On, Suprtool waits for answers to questions and continues processing even if there are errors. When it is Off, Suprtool aborts on any error, assumes the "correct" answer to any question, and generally acts as if there is not an intelligent being typing in the command. Suprtool chooses the "correct" answer, which allows the task to continue. In most cases, this is the default answer. However, there are cases where Suprtool picks a different answer from the default. For example, an "output filename,erase" command has a default answer of "no," but with Interactive Off, Suprtool uses the answer "yes."

However, if you run Suprtool on a Remote Session that was created from a batch job, Set Interactive is On even though you are NOT interactive. If you wish to have proper batch error processing, your first command after starting Suprtool should be Set Interactive Off. Set Interactive Off is also useful when automating on-line tasks with usefiles:

Suprtool –c"set interactive off;use usefile"

LabelledTapeRewindSET LABELLEDTAPEREWIND ON | OFF

Suprtool 5.2 for HP-UX Suprtool Commands · 201

Page 202: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

This command has no effect in Suprtool/UX.

LimitsSET LIMITS [MPE ON|OFF] [READONLY ON|OFF] [Tablesize size]

(Initially: MPE ON, ReadOnly OFF, Tablesize 1 megabyte)

When Set Limits MPE is Off, you cannot execute any HP-UX command (e.g., !rm). This is an irreversible option -- once disabled, it cannot be enabled again by the user.

Table Size

On HP-UX you can control the size of a table with the Set Limits TableSize command. By default an individual Table will be 50 Megabytes in size and you can have up to 10 tables. The Global limit for all tables is up to 500 Megabytes. You can control the size of a given table with the command:

>Set Limits TableSize n

If you enter the command Set Limits TableSize 100 and the next table command that you build will have a limit of 100 Megabytes.

Read Only

Suprtool normally allows any user with the proper access capabilities to add records to a database. To prevent users from accidentally updating their database, we provide the following setting within Suprtool:

>set limits ReadOnly On

The ReadOnly setting, once turned on, cannot be turned off for the current run of Suprtool. This disables all commands that potentially change data for the specified database.

If Set Limits ReadOnly is enabled, then the Add command in Suprtool will return an appropriate error message.

You can Set Limits Readonly on the command line using the -c option. For example the following command file can be used to restrict who has write access to a given database. In this example only the root user is allowed write access:

if [ $USER = "root" ]then /opt/robelle/bin/suprtoolelse /opt/robelle/bin/suprtool -c'set limits readonly on'fi

ListSET LIST option value

Use Set List to configure default values for the List command. You can configure the default date, time, and format for LaserJet listings.

List DateSET LIST Date number

(Initially: 0)

202 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 203: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

When you select page headings with the List command by specifying a title, each page includes today's date. By default, this date is formatted as mmm dd, ccyy (e.g., Mar 20, 2000). Use Set List Date to specify a different default date format for future List commands (e.g., Set List Date 2). The valid date formats are as follows:

Value Format Example0 (default) mmm dd, ccyy Mar 20, 20001 yy/mm/dd 00/03/202 mm/dd/yy 03/20/003 dd/mm/yy 20/03/004 dd mmmyy 20 Mar00

List PCLSET LIST PCL [ 0|1|2|3|4|5|6 ]

(Initial & Default: 0)

Use Set List PCL to configure the default format for LaserJet listings. This option defines the List device as a PCL device and indicates the orientation and font for the report. Set List PCL affects only the List command; it is ignored by the Output command. PCL stands for Printer Command Language, which is an HP standard for printers. The LaserJet is one of the first PCL devices to be released by HP.

By default, Suprtool assumes that your List output device is not PCL-compatible (List PCL 0).

PCL 1. To print the Suprtool List output in Landscape mode (across the wide part of the paper) with the tiny Lineprinter font (16.66 pitch or 8 lines per inch), you should do the following (this setting prints 175 columns per line):

>:comment Maximum of 175 columns with this font>set list pcl 1>:comment You will need LaserJet with proper font cartridge>list device laser123

PCL 2. To print the listing in Courier font, Landscape mode, 6 lines per inch, and 100 columns wide, use:

>set list pcl 2>list device laserjet

PCL 3. This option selects the "standard" Portrait orientation with the Courier font of the LaserJet (80 columns across by 60 lines). You would use Set List PCL 3 when you insert a Font cartridge that overrides the default font (e.g., 92286F cartridge).

PCL 4. Selects Portrait orientation and Lineprinter font of the L cartridge (and others). This option prints 132 columns across the page by 80 lines.

PCL 5. Prints 80 columns on A4 paper by slightly narrowing the space between columns.

PCL 6. Prints tiny letters in Landscape mode on legal-size paper. This gives you 223 columns per line.

The PCL options, with the exception of PCL 5, were designed and tested with North American letter-size paper. Suprtool can adjust the number of rows and columns for each option to match A4 if you add 2000 to the PCL code. You can also select the

Suprtool 5.2 for HP-UX Suprtool Commands · 203

Page 204: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

ASCII character set (instead of the default Roman-8 character set) by adding 1000 to the PCL code. See "List Command [L]" on page 170 for more details.

Here is a complete table of the PCL codes:

PCL L/P Font A4 paper Rows x Columns

Letter-size Rows x Columns

Notes

1 L lp 58 x 188 60 x 1752 L courier 43 x 110 45 x 1003 P courier 64 x 77 60 x 80 "standard"4 P lp 85 x 128 80 x 1325 P courier 64 x 80 60 x 80 A4-squeeze6 L lp 60 x 223 60 x 223 legal-size

L and P mean Landscape or Portrait orientation.

List TimeSET LIST Time number

(Initially: 1)

When you select page headings with the List command by specifying a title, each page includes the current time. By default, the time is in 24-hour format (e.g., 23:02). Use Set List Time to specify a different default time format for future List commands (e.g., Set List Time 2). The valid time formats are as follows:

Value Format Example0 none1 (default) 24-hour 23:022 AM/PM 11:02PM

List FormFeedSET LIST Time On | Off

(Initially: Off)

The command Set List FormFeed On, will enable Suprtool to write a form feed to the list file at the end of each task. This way if you append an additional report to the list file, the next report and ist listed out the next report will start on a page break. This only occures when using the File keyword, on the list command.set list formfeed onin myfilelist file myreptxeqin newdatalist file myrept appendxeq

This set List command is the ONLY Set command that does not get reset between each task.

204 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 205: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

LockSET LOCK [ number ]

This command has no effect in Suprtool/UX.

MakeAbsentSET MakeAbsent [ On|Off ]

This command has no effect in Suprtool/UX.

NLSSET NLS [number]

(Initially: 0 or NLDATALANG JCW)

Use Set NLS with files from MPE systems to specify the language to be used for sorting Character-type fields (see Native Language Support). The number corresponds to an NLS language; you cannot use the NLS language name. The common language numbers are:

Number Language00 Native-3000

01 American

02 Canadian-French

03 Danish

04 Dutch

05 English

06 Finnish

07 French

08 German

09 Italian

10 Norwegian

11 Portuguese

12 Spanish

13 Swedish

NumBugSET Numbug [ On|Off ]

The $number function had a bug whereby it would add on two zeroes and or bad data if the input number did not have a decimal point. We have fixed the bug so that the number function no longer adds the two digits on the end in error.

However, some users worked around this issue by doing the following:

Suprtool 5.2 for HP-UX Suprtool Commands · 205

Page 206: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>extract target = $truncate($number(conv-field) / 100)

Since some users, used this work around, the fix to the $number function will then return incorrect results. Therefore, we added the set numbug command to have Suprtool revert from the correct behaviour to continue to have the bug.

By default, Suprtool will just convert the number and not add on the data at the end, however, if you have used the work around then you can add the command: >set numbug on

to the script directly or globally in your suprmgr file.

OpenmodeSET OPENMODE [ number ]

This command has no effect in Suprtool/UX.

Oracle RowsSET ORACLE ROWS number

(Initially: 100)

If you open an Oracle database, Suprtool reads more than one row at a time when processing the input source. By default, Suprtool fetches 100 rows at a time. You can vary the number of rows that Suprtool fetches by using Set Oracle Rows. The minimum number of rows is 1 and the maximum is 990. You must specify Set Oracle Rows before entering the Select command.

Oracle IntegerSET ORACLE INTEGER ON|OFF

(Initially: OFF)

Suprtool by default maps certain numeric fields into packed-decimal data types when they have more than one decimal place:

Precision Decimal Places Suprtool Data-Type

None Any 8-byte IEEE

1-4 Zero 2-byte Integer

5-9 Zero 4-byte Integer

1-9 Non-zero Packed-decimal

10-27 Any Packed-decimal

28-38 Any 8-byte IEEE

The new setting:Set Oracle Integer on

changes the Suprtool format from packed-decimal to Integer based on the size of the Number:

Precision Decimal Places Suprtool Data-Type

1-4 Any 2-byte Integer

5-9 Any 4-byte Integer

10-27 Any 8-byte Integer

206 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 207: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Oracle OpenFixSET ORACLE OPENFIX ON|OFF

(Initially: OFF)

In order to fix a problem introduced by a patch to Oracle 9, we had to change to a new Oracle call interface call. You can invoke this new call in one of two methods, the first is to use the following Set command: >Set Oracle OpenFix On

The second method is to specify the username/password in the following manner: >open oracle scott/tiger

However, this option should not be needed any longer due to how we load the Oracle routines and utilize them.

Oracle PassShiftSET ORACLE PASSSHIFT ON|OFF

(Initially: ON)

Oracle 11 now allows for case sensitive passwords. Normally Suprtool upshifts all characters in an Oracle password, this can be changed with Set Oracle PassShift Off, which stops Suprtool from upshifting the Oracle password.

Oracle ZeroNullSET ORACLE ZERONULL ON|OFF

(Initially: OFF)

Set Oracle ZeroNull On will change any fields that are "null" (in the SQL sense of the word), will become zeroes for the appropriate number type.

In order to turn this feature on for all accesses you can put the command: >Set Oracle ZeroNull On

into the file /opt/robelle/suprmgr.

Previous to version 4.6 in Suprtool used to return nulls, but Suprtool 4.6 and Suprtool 4.7 would return zeroes. We have decided to make this optional and make the default to return Nulls, due to problems when using the to_char function in the select statement.

PatternSET PATTERN NEW | OLD

(Initially: NEW)

Prior to Suprtool for MPE version 3.1, there was no method of checking for the "@", "#", "?", or "~" characters in a pattern. Version 3.1 introduced a new pattern-matching routine, adding an escape character "&", and two new reserved characters

Suprtool 5.2 for HP-UX Suprtool Commands · 207

Page 208: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

"^" and "!". Old Suprtool tasks that look for the specific characters &, ^, or ! will not work with the new pattern-matching routine. Users who are concerned about this can add the following command to their /opt/robelle/suprmgr file:

set pattern old

PrefetchSET PREFETCH [ number ]

This command is not supported in Suprtool/UX.

PrivmodeSET PRIVMODE ON | OFF

This command has no effect in Suprtool/UX.

ProgressSET PROGRESS Percent [ number ] Minimum [ number ]

(Initial & Defaults: Percent 5, Minimum 50000)

The Set Progress command is used to turn the Suprtool progress report feature on or off. The PERCENT value specified tells Suprtool by which percentage increment to report the progress messages of any given input or output phase. The allowed range for set progress is from 0 to 25, the default is every 5 percent. If the PERCENT parameter is not specified, then the next parameter is considered to be the PERCENT value. This is to remain compatible with some earlier versions of Suprtool.

The MINIMUM value is the minimum number of records that an input file must have in order for the progress reports to be printed out. If the MINIMUM value is set to 15000, then the input file must have at least 15000 records or else progress messages are not printed out for the entire task. This value allows the user to turn off progress messages when reading smaller files. The default value is 50000 records. To always print progress messages, just set the minimum value to 0.

Suprtool does not produce any progress messages under the following conditions:

1. Set Progress is zero.

2. Output is to $stdlist via the Output * or List commands.

3. The input source is an SQL database.

4. The number of records from the input source is less than the minimum value.

Suprtool checks whether or not to print a progress message at the end of each buffer. Consequently, not all progress increments are reported for small files or datasets.

Suprtool reports the phase that it is in: whether input phase, sort phase, output phase or combined input/output phase (not sort).

The content of the progress messages is as follows:

· Percentage complete

· Phase and the total number of records processed

· Delta-Sec(Min) - the time elapsed from the previous message

208 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 209: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

· Wall-Sec(Min) - the total elapsed time

· CPU-Sec - the total CPU-Seconds at this point

When using the record selection feature of the Input command, Suprtool cannot be absolutely certain of the total number of records. Therefore, the percentage calculation is estimated.

PromptSET PROMPT character

(Initially: > )

PROMPT tells Suprtool which character to use for prompting. Any special character can be used as the prompt character. For example:

/opt/robelle/bin/suprtool>set prompt %%open oracle demo reader

RealMapSET RealMap ON| OFF

(Initially: ON)

Previously, Suprtool would treat an “R” type field in an Eloquence database as an R type while the data inside Eloquence was stored and treated as IEEE therefore incorrect results would occur with coercions and arithmetic operations. Suprtool now by default maps all Real and Long fields to their respective IEEE fields. You can change Suprtool back to the previous behaviour with Set RealMap Off.

A form command will still show the fields as being “R2” or “R4”, but internally Suprtool will treat as IEEE, which is how Eloquence stores and treats the numbers.

This will also include Self-Describing files as being the input source. Suprtool will still not allow the definition of a Real or Long datatype.

Consequently STExport will now support items in SD files that are condidered R type, however it correctly will map them to IEEE.

RecoverSET RECOVER ON | OFF

This command has no effect in Suprtool/UX.

RedoSET REDO filename

(Initially: none)

Commands that you enter at the Suprtool prompt are saved in something called the redo stack. You can recall commands from the redo stack using other commands such as Before, Do and Redo. By default, the redo stack is stored in a temporary file and discarded as soon as you exit Suprtool. This temporary stack is not preserved across Suprtool invocations.

Suprtool 5.2 for HP-UX Suprtool Commands · 209

Page 210: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Set Redo allows you to assign a permanent file as the redo stack. The redo stack is then available for future Suprtool invocations. To assign the Myredo file as a persistent redo stack, enter:

>set redo myredo

If the file does not exist, Suprtool creates it. If it already exists, Suprtool uses it. All subsequent commands are written to the persistent redo stack. The setting is valid for the duration of the Suprtool session. As soon as you exit Suprtool, the setting is discarded. Next time you run Suprtool, you will get the temporary stack.

If the filename is not qualified, the redo stack is created in the current working directory. This may be desirable if you wish to have separate stacks. If you wish to always use the same persistent stacks, you should qualify the name.

The Verify command shows which stack is currently in use. If it shows <temporary>, it means Suprtool is using the default stack. Anything else is the name of the file used on the Set Redo command.

ConcurrencyWhen Suprtool uses the default temporary stack, it is only accessible to that particular instance of Suprtool. You can run as many Suprtool instances as you need and each one gets its own redo stack. With temporary stacks, you will never get into concurrency problems.

If you start using a persistent redo stack, you might start running into concurrency problems. A persistent redo stack can only be used by one Suprtool instance at any one point in time. If you try to use a persistent redo stack that is already in use, you will get the following message:

>set redo myredoThe redo file is already in use.Unable to open file for REDO stack

In this situation, Suprtool continues to use the redo stack active at the time and lets you continue to work as normal.

Qedit can also have permanent redo stacks. To prevent products from writing to each other's redo stack, it is advisable to have separate stacks for each product by giving them different file names. For example if you use

>set redo myredo

you will have a redo stack called myredo for your Suprtool commands. If you exit Suprtool and run Qedit and supply the same Set Redo command, your Qedit commands will be written to the same file that was used for your Suprtool commands.

SDExtnameSET SDExtname ON | OFF

Suprtool can create SD files with “extended names” when you set SDEXtname on. By default Suprtool for HP-UX will behave as normal and truncate field names at 16 characters. If SDEXtname is on, Suprtool will write out the fully defined field name or if the input source is Oracle the full field name, (up to 32 characters), to the end of the .sd file. Suprtool will use the “extended” names whereever possible.

The Suprtool List command does not take advantage of the new extended names at this time.

210 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 211: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Suprlink will merge the extended names and create the proper information in the output SD file, but will not use the extended name when linking two files.

SortfastSET SORTFAST ON | OFF

This command has no effect in Suprtool/UX.

SqueezeSET SQUEEZE [ ON | OFF ]

This command has no effect in Suprtool/UX.

StatisticsSET STATISTICS ON | OFF

(Initially: OFF)

STATISTICS causes Suprtool to print statistics at the end of each task. This can be useful for determining the effectiveness of Suprtool's If and Sort command versus similar options on the Select command.

SubsystemSET SUBSYSTEM ON | OFF

This command has no effect in Suprtool/UX.

SuspendSET SUSPEND ON | OFF

This command has no effect in Suprtool/UX.

ThousandSymbolSET ThousandSymbol " "

(Default: comma)

This setting is used to change the Thousand character which is used to edit the data in a field used by the $Number function. >set ThousandSymbol ","

The default character for the Thousand Symbol is a comma.

UserlabelsSET USERLABELS ON | OFF

This command has no effect in Suprtool/UX.

Suprtool 5.2 for HP-UX Suprtool Commands · 211

Page 212: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

VarsubSET VARSUB ON | OFF

(Initially: OFF)

This option tells Suprtool to resolve any environment variables in any command. The default value for VarSub is Off for backward compatibility. Please note that Suprtool will not resolve any of its internal $options, such as $LOOKUP, $DATE etc. If you are using Suprtool for AMXW, Suprtool will try to resolve CI variables with “!” and then any environment variables left over.

VarsubCompatSET VARSUBCOMPAT ON | OFF

(Initially: OFF)

The Set VarsubCompat flag has been added to have variable substitution be more flexible. On MPE variable substitution would pass the name of the variable thru to be parsed even if the variable was not set. On HP-UX the default behaviour was to return spaces if the environment variable was not set. This is still the default behaviour, however if you set varsubcompat on, Suprtool will return the environment variable name similar to how MPE works with unresolved variables.

VarsubDebugSET VARSUBDEBUG ON | OFF

(Initially: OFF)

Suprtool, now has a setting called Set VarsubDebug on which will print out the line after the variable substitution has occurred. This setting only works if Set Varsub is on and Set VarsubDebug is on.

export outfile &:"/GREEN/SUPRTEST/filename90123456789012345678901234567890123456789012345678901"/opt/robelle/bin/suprtoolSUPRTOOL/UX/Copyright Robelle Solutions Technology Inc. 1981-2007.(Version 5.2 Internal) TUE, OCT 30, 2007, 2:58 PM Type H for he>set varsub on>set varsubdebug on>in file1sd.suprtestvd:in file1sd.suprtest>output !outfile,link,tempvd:output /GREEN/SUPRTEST/filename90123456789012345678901234567890123vd:2345678901,link,temp

The output is formatted into 74 byte chunks and printed with a preceding “vd:” so the “substituted” line is clear.

WarningsSET WARNINGS ON | OFF

(Initially: ON)

Suprtool normally prints warning messages out to $stdlist. You can turn off these messages when you are running from batch by issuing a Set Warnings off command.

212 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 213: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

If you are simulating batch mode with the Set Interactive Off command, you must do the Set Warnings off after the Set Interactive Off.

The default for this setting is On.

Suprtool 5.2 for HP-UX Suprtool Commands · 213

Page 214: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Sort Command [SO]Specifies the next sort key via an Eloquence field, a table column name, or a field in a self-describing file, or a Defined field. See "Key Command [K]" on page 167 for sort keys specified by explicit byte position. Up to 20 Sort and Key commands can be specified per extract task. The first key entered is the major sort key.

SORT field [(subscript)] [DESCENDING]

(Default: Ascending order)

FieldThe field specified must be an Eloquence data item that is a field of the input source, a selected item from the selected table, or a defined field, or a field from a self-describing file.

SubscriptIf the field is a compound item (e.g., 2X25), the first sub-item is the default if no subscript is specified. You can sort on any sub-item by specifying the subscript. For example,

>sort address(2) {sorts on 2nd sub-item}

Descending vs. Ascending OrderBy default, sorts are done in ascending order. Descending specifies that the field is to be sorted in descending order.

ExamplesThe most common use of the Sort command is to specify a sort field of a database field. You may use the Key command to specify all sorts. We recommend that the Sort command be used wherever possible. If the structure of your database changes, your Suprtool tasks still work if sort fields are specified with the Sort command:

>open oracle demo reader>select * from sales {input from a table}>sort account {primary sort field}>sort purchased,desc {newest transactions first}>output dsales {write the sorted records to a disc file}>exit

In the next example we sort a disc file. We create a field using the Define command. Rather than using the Key command, we use the Sort command to specify the sort field. If the disc file changes, only the Define command must be changed:

>input invent {input is from a disc file}>define a,11,2,int {"A" is an integer that starts…}>output outfile { at the 11th byte of Invent}>sort a {sort the input records by the "A" field}>exit

With the =dataset form of the Input command, we can have even greater flexibility to use the Sort command. We assume that the MPE file Mcust has the same structure as the m-customer dataset. We sort the file using the first of the two street addresses in m-customer:

214 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 215: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>base store>input mcust=m-customer {same format as m-customer}>sort street-address {a repeated field, but only}>exit { the first address is used}

NotesThe Verify command shows all of the current command values and the Reset command cancels them. If you have not defined any sort fields before the Xeq or Exit command, Suprtool performs a copy only, no sort.

Suprtool uses some temporary files during a sort. It creates the files in the directory specified by the TMPDIR environment. The size of the files will be equal to the size of the output file. If Suprtool runs out of disc space during a sort, you can try to specify another directory for TMPDIR.

It is important to note that if the field being sorted is the result of a $function, then you may not be sorting on the value of the field after the function has transformed the field. For example the following task may not give you the result you expect:

>base store,5>get d-sales >def cust-accountx,1,6,byte>ext cust-accountx = $edit(cust-accout,"zzzz99" >sort cust-accountx {sorting on transformed field before it has value from function}>dup none keys>output dsales>exit

In this instance you will not be sorting on cust-accountx as transformed by the $edit function, but rather the first six bytes of d-sales. Therefore it is important to note when you are using extract to transform a field, you will not be sorting on that transformed value.

Therefore the way to do the transformation would be to either divide into two tasks or if you can logically sort on the field before the transformation in order to achieve the result, so the task could be:

>base store,5>get d-sales >def cust-accountx,1,6,byte>ext cust-accountx = $edit(cust-accout,"zzzz99" >sort cust-account {Note sorting on source field}>dup none keys>output dsales>exit

or if two tasks are necessary:

>base store,5>get d-sales >def cust-accountx,1,6,byte>ext cust-accountx = $edit(cust-accout,"zzzz99" >output tempsales>xeq>in tempsales>sort cust-acctx>dup none keys>output dsales>exit

Suprtool 5.2 for HP-UX Suprtool Commands · 215

Page 216: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Table Command [TA]Builds a table of values for testing in the If or Chain command. There can be up to ten different tables.

TABLE tablename, itemname, table-keyword, table-values [,HOLD][,DATA(field,…)

Tables are used by the $lookup function of the If command and as input to the Chain command. The table keywords are Item, File, and Sorted. The total amount of table space is restricted by Set Limits Tablesize. Use the following scheme to select input records based on many data values:

1. Load a table with the values you are interested in.

2. Use the $lookup function of the If command to search the table.

3. Or, use the table with the Chain command to read a selected set of key values.

Adding Individual Values to a TableTo add a value for an item to a table, use:

TABLE tablename, itemname, ITEM, value [,value]

When you start entering the values for a table, you must enter all the values for that table before starting another table. Once you switch to another table, the previous table is "closed" and you cannot enter anymore values into it.

Parameterstablename

Any identifier name up to sixteen characters long. This name can be the same as the name of a Define field or database itemname, but we recommend that you choose a unique name.

itemname

An item from the database specified in the Base or Open command or a Define field. This cannot be a real-type item.

value

A specific value that must match the type of the item. String values are extended with blanks to the length of the item.

ExamplesSuppose that you wanted to look for several part numbers. You could use the following If command:

>if part = "12345","67890","39201","92308","14892"

You could also load a table with the part numbers:

216 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 217: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>table part-table,part,item,"12345">table part-table,part,item,"67890">table part-table,part,item,"39201">table part-table,part,item,"92308">table part-table,part,item,"14892"

and use a different If command:

>if $lookup(part-table,part)

Sometimes you need to look for all records that do not have any of a set of values,

>if part <> "12345","67890","39201","92308","14892"

You would use the same Table commands, but a slightly different If command,

>if not $lookup(part-table,part)

Values with Decimal PlacesIf the itemname for the table has implied decimal places, the Table command accepts decimal points and scales input values. For example,

>item cost,decimal,2 {two implied decimal points}>table cost-table,cost,item,10,10.5,10.75>if $lookup(cost-table,cost)>out out3 {select records for 1000, 1050, and 1075}>xeq

Adding Values from a FileYou may need to look for hundreds of part numbers. The Table command accepts the table values from a file. The file must contain lookup values in exactly the same format as the itemname which describes the data. Duplicates are eliminated as they are loaded into the table. For a table consisting of values from a file use:

TABLE tablename, itemname, FILE | SORTED, filename [,HOLD][,DATA(field1,field2,field3…)]

Parametersitemname

The item determines the data-type and length of the key values in the table. You can only load a table from a self-describing file. Suprtool first checks for the field in the self-describing file.

FILE vs. SORTED

The File option assumes that the file of table values is not sorted. Sorting a large file of values is slow. If the file is already sorted, use the Sorted option: Suprtool checks the records to make sure they are in ascending order.

filename

A valid HP-UX file name; the file must be self-describing.

Hold

By default, the Xeq command resets all tables. Use the Hold option when using the same table in more than one extract task. When Hold is specified, the Xeq command does not reset the table. Hold applies to individual tables, not all tables.

Suprtool 5.2 for HP-UX Suprtool Commands · 217

Page 218: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>table part-table,part,file,partin,hold

DataThe Table allows for data to be loaded along with matching key values.

>table partab,part,file,partin,data(cost,desc)

You can specify up to 20 data fields as long as the total size of the key fields and data does not exceed 256 bytes. The Table file must be Self-Describing to use the data option.

When loading data into a table, Suprtool will eliminate the duplicate entries based on the key value, so some data values may not be loaded into the table.

For information on how to retrieve data from the table, please see the Extract command, or the Examples section of the Table command.

Examples If all of your part numbers are in the file Partin, you use:

>table part-table,part,file,partin>if $lookup(part-table,part)

The following example uses Suprtool to create a file of sales orders for customers in arrears. The orders data is in the database, but the customer information is in a disc file. Suprtool reads the disc file and creates a new self-describing file of customer numbers that are in arrears. This SD file is then used to select the orders for these customers from the orders table in the database. The account item occurs in both the disc file and the database. When the Suprtool table is loaded, the account field information is obtained from the self-describing arrears file.

>input customers,r 60,nolf {disc file}>def account,1,8,display>def status,40,2>if status="30" {customers in arrears}>extract account, status>out arrears,link {self-describing output}>xeq {for the Table command}>open oracle demo reader>select * from orders {sales orders}>table cust-table,account,file,arrears>if $lookup(cust-table,account)>output badorders>xeq

In this next example, low inventory items from the Inventory table are saved in the SD file Invent. We use this file to load a Suprtool table and select the records from the Product database table. On the table command, we use the "sorted" table-keyword instead of "file" because the Invent file is already sorted. We then create a new file Lowprods with all the product information of the low inventory items.

218 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 219: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>select * from inventory>if on_hand_qty < 10 {select records}>sort product_no {sort by key value}>out invent,link {later, use this file}>xeq {in the Table command}>sel * from product {contains product description}>table product-table,product_no,sorted,invent>if $lookup(product-table,product_no)>sort product_no>output lowprods>xeq

Suprtool can load up to ten tables, either from separate files or the same file. The following example assumes that the files are self-describing.

>input customer>table cust-table,custno,file,custfile>table zip-table,zipcode,file,custfile>if $lookup(cust-table,custno) and $lookup(zip-table,zipcode)>output newcust,link>xeq

Keep in mind that using multiple tables may be more memory intensive and require more resources.

Data ExampleYour boss comes to you with a list of new prices for certain parts and asks you to update the Part-Master dataset.

Just load the new prices into a Table, index by the product number (prodno),then Extract the price field from each record and replace it with a $lookup on the table. Here is the code:

>table newprices,prodno,file,bosslist,data(price) >get part-master >if $lookup(newprices,prodno) >update >extract price = $lookup(newprices,prodno,price) >xeq

We do the If $lookup to select only the parts which have new prices, then do Extract with $lookup to replace the existing price with a new one. The Update command forces a database update on each selected record and must come before the Extract command.

If you did not do the If $lookup then the price field would contain zeroes for those fields that did not have a matching record.

NotesThe Xeq command clears any tables that are not held. Set Limits Tablesize restricts the maximum size of tables, so you can limit the total amount of table space to a specified number of megabytes. There is a total of 500 megabytes available for all tables. To control the size of the table, you can issue the Set Limits Tablesize command. The default Table limit is 50 megabytes for each Table.

Suprtool 5.2 for HP-UX Suprtool Commands · 219

Page 220: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Total Command [T]Totals specified fields in the selected input records.

TOTAL field [(subscript)] [decimal-places]

$file filename [ APPEND | ERASE | TEMP ]

$file $list

(Default: subscript=first sub-item, decimal-places=0)

ParametersEach totaled field must be an Eloquence field, a database column name, or a field from a self-describing file, or a Defined field. Total specifies that a total value for the field be printed after processing the records. There does not have to be any output file (i.e., it can be $null) for a total to be printed. There can be up to 15 totaled fields.

The subscript is valid only for compound items. If no subscript is specified, the first field of a compound item is totaled. The decimal-places provides a decimal point when the final total is printed. If the Item command specifies the number of implied decimal places, the decimal-places parameter is not needed. The values within each field are assumed to be aligned.

$File OptionsBy default, totals are written to $stdlist. Use the $file option to have the totals written to a file or to the List device. When writing to a file, the default is to create a new file. If Suprtool cannot save the file, it produces an error. The Append, Erase, and Temp options are the same as in the Output command, although the TEMP option on HP-UX is simply ignored and a new file is created.

If you want the totals written to the end of the List device (the output of the List command), specify $list as the $file file name. All other options are ignored when $list is specified.

To write totals to the output file, use Total $file xxx,Append, where xxx is the name of your output file. Appending totals to the output file only works if the output file is a disc file.

ExamplesThe first example prints the totals for a single field.

>in file1, r 40, nolf>def amount,1,5>total amount>xeqTotals (TUE, OCT 10, 2000, 4:30 PM):AMOUNT 611105+

The next example is identical to the previous one, except that we qualify the total with the number of decimal places.

220 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 221: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>in file1, r40, nolf>total amount,2>xeqTotals (TUE, OCT 10, 2000, 4:31 PM):AMOUNT 6111.05

The previous example specified the number of decimal places by using the Total command. The next example is the preferred way to specify decimal places because it qualifies the balance field with two decimal places for all Suprtool commands. This example also totals two fields.

>input file1, r 40, nolf>def balance,11,4,integer>def overdue,21,4,integer>item balance,decimal,2>item overdue,decimal,2>total balance>total overdue>xeqTotals (TUE, OCT 10, 2000, 4:32 PM):BALANCE 143598.16OVERDUE 17399.73

Reading Total FilesThe default size for the file created by TOTAL $file needs to be opened with 48 bytes wide and with linefeeds: >in file1sd >tot int-field >total $file file82a >xeq >in file82a,rec 48,lf

You can also send the totals to a list file for simple reports: >in file1sd >tot int-field >list standard file file82a >total $file $list >xeq

Sort Break TotalsPlease refer to the Duplicate command on how to generate sort break totals.

NotesYou cannot combine the Total command with the Total option of the Duplicate command.

The Total command prints out a date and time stamp on the title line. This is for audit purposes.

Suprtool 5.2 for HP-UX Suprtool Commands · 221

Page 222: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Update Command [UP]Update one or more noncritical fields in an Eloquence dataset.

UPDATE [ CIUPDATE ]

Specify the fields to be updated and their new values with the Extract command. The Update command must be specified after the Chain or Get command, but before the Extract command(s). You can update part of an Eloquence field by defining the part you are interested in updating and then using the defined field name in the Extract command.

The Update command can change values in critical fields (Eloquence search or sort fields). To update critical fields, you must specify the Ciupdate option, and CIUPDATE must be On or Allowed in the database.

ExampleThis example selects all inventory items with a unit-cost less than $10.00 and increases the unit-cost by five percent.

>get d-inventory {input dataset}>item unit-cost,decimal,2 {implied decimal places}>if unit-cost < 10.00 {selection criteria}>update {Update must come before Extract}>extract unit-cost = & {calculate the new …} unit-cost * 1.05 {… unit-cost value}>xeq

This next example selects all inventory items with a part number of 12345677 and changes it to 12345678.

>get d-inventory {input dataset}>if product-no = 12345677 {selection criteria}>update ciupdate>extract product-no = 12345678 {new unit-cost value}>xeq

You can set CIUPDATE by using the DBUTIL Utility. To set CIUPDATE on just run Dbutil and use the Set command:

:run dbutil.pub.sys>>set dbname ciupdate=on>>exit

NotesThe only commands that can be combined with Update are selection commands (e.g., the If command). The following commands are not allowed: Delete, Duplicate, Key, List, Output, Put, Sort, or Total. You cannot update critical fields in master datasets. Update does not work with disc files or SQL databases.

If you are updating a packed or display field, remember that Suprtool uses unsigned values for non-negative numbers unless you add a leading plus sign to the number. See "Packed and Display Constants" on page 113 for more details.

222 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 223: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Use Command [U]Specifies a file of commands to be executed as a group.

USE[Q] filename

Database Date ItemsA usefile makes your task easier by allowing common commands to be specified once in an external file. A common reason for usefiles is to isolate Define and Item commands for a database in one place. This makes future changes easier and prevents mistakes. In this example, we isolate all Item commands for dates from our database in a Suprtool usefile.

>use store.suprtooldefine delivered,deliv_datedefine purchased,purch_dateitem delivered ,date ,yymmdditem purchased ,date ,yymmdd

Dataset Field DefinitionsIn the store database, the street-address is a 2X25 item. Suppose that you always wanted to refer to the first and second part of the address with different names. The following usefile would access the m-customer dataset and define the two necessary fields:

>use mcust.suprtoolget m-customerdefine street-address-1,street-address(1)define street-address-2,street-address(2)

Quiet ExecutionBy default, Suprtool displays the commands in a usefile as they are executed. The quiet option is not used in the examples above so that you could see the actual commands inside each usefile. Suprtool can execute commands quietly using the Useq command:

>useq store.use {no commands are listed}

Nested UsefilesUsefiles may be nested. In other words, a usefile may use another usefile to a depth of ten files. For example if the contents of the Usedef usefile has a references to Useext, both usefiles would be executed:

Suprtool 5.2 for HP-UX Suprtool Commands · 223

Page 224: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>in dsales>use usedefdefine delivered,deliv_datedefine purchased,purch_dateitem delivered ,date ,yymmdditem purchased ,date ,yymmdduse useextext cust-accountext deliv-dateext product-noext product_priceext purch_dateext sales-qtyext sales-taxext sales_total>xeq

Care must be taken when entering Use commands with a stacked command after a usefile reference. For example, if you enter

use usedef;def j,1,6,byte

the Define command will not be executed until after the Usedef and any other nested Use commands are finished.

NotesThe usefile may be an unnumbered, fixed-length file or a Qedit workfile, but no more than 256 characters per record will be processed. For compatibility with Qedit, Useq can be abbreviated to UQ.

If a Use file ends with an ampersand, Suprtool will assume that you are continuing the current command on the next line, outside of the use file.

224 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 225: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Userpause Command [USER]The Userpause command prints a prompt message on the screen and waits for the user to press a key.

USERPAUSE [ "string" ]

(Default: read without a prompt)

Prints the string and waits for any key. Leading spaces in the string are printed.

ExamplesIn this example, we have a usefile that displays a message and then waits for the user before starting the task.

>q>q "We will select all transactions over $10,000. Since">q "there are many transactions, this task will take">q "some time (usually more than fifteen minutes).">q>userpause "Press any key when you are ready to start."

Suprtool 5.2 for HP-UX Suprtool Commands · 225

Page 226: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Verify Command [V]Displays the specifications that you have entered so far.

VERIFY [ ALL | @ | VERSION | command [...] ]

(Default: Input, Output, Sort, Numrecs, changed Set values)

ParametersMore than one command can be verified at once by entering several command names separated by a comma or a space. The format of the Verify output is organized into columns wherever possible.

For Verify All, Suprtool prints all of the information concerning the current invocation of Suprtool, including the value of the Set options and the Suprtool version number.

For Verify Version, Suprtool prints out the version information.

Verify with no parameters prints the current values for Chain, Get, Input, Output, and Key or Sort commands. It also prints those Set options which are not currently at their default setting.

Examples>v>verify>verify input {current input file}>verify if {selection criteria}>verify all {all current options}>verify version {version number of Suprtool}

226 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 227: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Xeq Command [X]Suspends entry of commands and begins the extract from the input source.

XEQ

NotesAfter the Xeq, Suprtool processes the task and accepts commands to specify another task. Compare this with the Exit command, which stops Suprtool after processing the input. After an Xeq command, all parameters of Suprtool are reset to their initial values, except any database that is left open, the Set options, and the Defined fields even though their calculated offsets are not guaranteed to be correct for the next file processed.

Examples>open oracle demo reader>select * from customer>output mcstfile>xeq {copies Customer to Mcstfile}>select * from orders>output allorders>xeq {copies Orders to Allorders}>exit {terminate, no task to do} {last Xeq could have been Exit}

Suprtool 5.2 for HP-UX Suprtool Commands · 227

Page 228: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Calculator Command [=]Evaluates an expression and prints the result in one of several formats.

=expression [,O | D | B | H | A | # | % | $]

Any command that begins with an equal sign (=) is treated as an expression to be evaluated. An expression consists of numbers and operators, followed by an optional display format.

The operators can be addition (+), subtraction (-), multiplication (*), division (/), or exponentiation (**). The value of the expression is printed immediately on $stdlist.

=20+15 {add two numbers together}Result=35.0=20*15 {multiply the same numbers}Result=300.0=20-15 {subtraction}Result=5.0=20/15 {divide, print precise result}Result=1.33333333333=20**15 {20 raised to the 15th power}Result=.327680000000E+20

Order of EvaluationUnlike most programming languages, the calculator always evaluates the calculation from left to right. This is similar to an electronic calculator, where each keystroke is operated on immediately. You can use parentheses to force the calculator to evaluate the expression in a different order.

=14+16+15/3 {compute an average}Result=15.0=14+16+(15/3) {add 14, 16, and the result of 15/3}Result=35.0=14+((16+15)/3) {add 16 + 15, divide by 3, then add to 14}Result=24.3333333333

PercentagesA number in the calculator expression may be followed by a percent sign (%). The calculator assumes that you want to qualify the number as a percentage.

=125*5% {what is 5% of 125}Result=6.25=125+125*5% {add 5% of 125 to 125}Result=12.5=125+(125*5%) {oops, we needed to change the order}Result=131.25 {this looks like the answer we wanted}

The last two examples show the importance of the order in which calculator evaluates the expression. We needed to use parentheses to force calculator to evaluate our expression in the correct order.

Display FormatsA calculator expression may be followed by a comma and a display letter. The default is decimal (#) and the options are hex ($ or H), octal (% or O), double (D), ASCII (A) and binary (B). With these options, the result is treated as a 32-bit integer.

228 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 229: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

=10,o {standard octal format}Result=%000012=-10,o {negative number in octal}Result=%37777777766=100,h {hexadecimal}Result=$0064

In Double format, calculator prints the double result as two octal numbers (the way they appear in DEBUG). The first number represents the high-order 16-bits and the second number represents the low-order 16-bits.

=10,d {treat result as two 16-bit octal words}Result=%000000 %000012=1000000000,d {high-order 16-bits are no-zero}Result=%035632 %145000=-10,d {note negative value, 2's complement}Result= %177777 %177766

In ASCII format, up to four characters are printed in Hex, Decimal, and ASCII display format.

=$2020,aResult=$2020: 32,32 :" "=%20161 %72145,aResult=$2071: 32,113:" q" $7465:116,101:"te"

In binary format, the high-order 16-bits are examined. If these bits are not zero, they are printed as two groups of eight bits. A one (1) means that the bit is on and a zero (0) means that the bit is off. The low-order 16-bits are always printed as two groups of eight bits.

=10,b {high-order 16-bits suppressed}Result=%(2)00000000 00001010=-10,b {note negative value, 2's complement}Result=%(2)11111111 11111111 %(2)11111111 11110110=1000000000,b {high-order 16-bits are non-zero}Result=%(2)00111011 10011010 %(2)11001010 00000000

Input FormatThe calculator supports different input formats for numbers. Octal values are prefixed with a percent sign (%) and hex values with a dollar sign ($). An ASCII string of up to 4 characters is entered in quotes. The result of the last calculation is referred to using #.

=%12 {octal 12 or decimal 10}Result=10.0=%12,o {octal input and octal display format}Result=%000012=$10Result=16.0=%177766 {octal number that is really negative}Result=-10.0="abcd",hResult=$61626364=#,a {use result of last calculation}Result=$6162: 97,98 :"ab" $6364: 99,100:"cd"

Programmers who make use of the MPE DEBUG software are often frustrated with the format that Double Integer numbers are printed. DEBUG prints them as two octal numbers. Calculator accepts two octal numbers as input and prints the result in standard decimal format.

Suprtool 5.2 for HP-UX Suprtool Commands · 229

Page 230: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

=%35632 %145000 {treat as one double integer value}Result=1000000000.0=%177777 %177766 {negative double integer value}Result=-10.0

Calculator HelpIt may be difficult to remember all of the various options that the calculator offers. For this reason, you can obtain a short description of the calculator by entering the following:

=? {? gives help} {prints a summary of = functions}

230 · Suprtool Commands Suprtool 5.2 for HP-UX

Page 231: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Suprtool Errors and Warnings

Two Types Of MessagesSuprtool prints two types of messages: errors and warnings. In both cases Suprtool is letting you know that it has encountered a condition of which you may want to be aware.

This appendix describes both kinds of messages and gives a partial list of warning messages.

ErrorsErrors are defined as conditions which immediately prevent Suprtool from continuing, or which allow it to complete a task and then stop, because continuing would likely cause undesirable or erroneous results.

When Suprtool detects a serious error condition such as a syntax error in a command, a file system error, or a sort error, it prints an error message. For example,

Error: Unknown command name, try HELPError: Unable to open >OUTPUT file

Finding Errors Automatically

If you have software that scans spool files for error conditions, have it look for

"Error: ".

File System Errors

When a file system error occurs, Suprtool prints the HP-UX error message.

An error during processing terminates the current task (exceptions: bad data with an If command when Set Ignore is On).

Arithmetic Trap Abort

If Suprtool should Abort with Parm=99x, an error has been detected in the Arithmetic Trap Routine. This should never happen, so please report it to Robelle Solutions Technology Inc.

NUMRECS exceeded; some records not processed.

Suprtool 5.2 for HP-UX User Manual Suprtool Errors and Warnings · 231

Page 232: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

You specified a Numrecs and have reached it. This condition is considered an error if the input is from a source other than disc.

Command entered is not a valid Suprtool command.

and

MPE access has been disabled. See Set Limits command.

Normally, commands that are not valid Suprtool commands are passed off to the operating system. If access to the O/S has been disabled via the Set Limits command, these commands are no longer passed off. If the user does not precede the command with a colon, we assume that the invalid command was meant for Suprtool. If a colon precedes the command, we assume that the command was meant for the operating system. On HP-UX systems an exclamation mark can be used in place of a colon.

Output-ASCII not allowed with Duplicate None Keys

Not all processing options are allowed in all combinations. The ASCII option of the Output command, which reformats the output record, does not work with Duplicate None Keys. Dup None Keys assumes that the output record has the same data definitions as the input record.

Xxxx is not the search field of Yyyy

This message is issued by the Chain command when the search field specified (Xxxx) is not an index into the dataset (Yyyy). The field specified must be an Eloquence search field.

WarningsWhen Suprtool detects an unusual situation that it should bring to your attention, it prints a nonfatal warning message. For example,

Warning: No input data specifiedWarning: DATABASE must be RESTORED if System Crashes

The following list explains the most common warnings.

Not all sort fields were extracted. The sort information will not be written to the output Link file.

This warning occurs when you >output filename,link and are sorting by a field, but the field is not included in the list of extracted fields. Suprlink cannot use the file, but it may be a perfectly valid file for other applications.

NUMRECS exceeded; some records not processed.

You specified a Numrecs and have reached it.

Record selection in effect, percentage calculation is estimated.

You specified a Get or an Input with record number selection and the percentage complete is estimated.

232 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 233: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Welcome to STExport

Welcome to STExportWelcome to STExport for HP-UX Version 5.2. STExport converts fields in a self-describing input file into an output file that can be imported into different applications.

Summary of the STExport commands:Before FLoating Quote VerifCLean Form REDO XeqColumns HEAding Reset XMLDAte HElp Set ZeroDElimiter HTML Sign =expressioDO Input Spaces :OS commandEscape LISTREDO SPacesExit Output Use

The minimum abbreviation of each command is shown in capital letters.

Installing STExportSTExport is installed as part of the Suprtool installation process. See the "Installing Suprtool" chapter of the Suprtool User Manual for more details on how to install both Suprtool and STExport.

Suprtool 5.2 for HP-UX User Manual Welcome to STExport · 233

Page 234: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Accessing STExport

How To Run STExportTo access STExport, type the following command:

/opt/robelle/bin/stexportSTExport/Copyright Robelle Solutions Technology Inc. 1999-2009(Version 5.2)$

After a short pause, STExport takes over your terminal and prints out some identifying information. You will notice that your command prompt has changed to "$", telling you that you have made it into STExport. STExport expects you to type command lines, ending each one with Return.

How to Xeq an STExport TaskNormally, you enter a series of commands. These commands specify the Input file, the Output file, and the formatting options. Finally, you enter an Xeq or an Exit command. This begins the actual STExport task.

If you entered the Exit command, STExport finishes the current task, then returns you to the operating system or the program that ran STExport.

$EXIT

If you entered the Xeq command, STExport finishes the current task, then prompts you for another task. This continues until you enter the Exit command. If you wish to terminate STExport immediately (perhaps you are confused), enter Exit Abort. This terminates the STExport program immediately, without attempting any task.

Hardcoded File Names and ROBELLE VariableSome file names are hardcoded into STExport. This section describes the hardcoded file names that STExport/UX may need. STExport will normally look for files in the /opt/robelle directory unless you set the ROBELLE variable.

ROBELLE VariableNormally STExport looks files in the /opt/robelle directory. If you move STExport you must set the ROBELLE variable. For example, if you move STExport to the /users/robelle directory you must set ROBELLE variable in the following manner:

Suprtool 5.2 for HP-UX User Manual Accessing STExport · 235

Page 235: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

export ROBELLE="/users/robelle"

Using STExport in BatchYou normally run STExport as an on-line session. You type STExport commands on your terminal and STExport prints responses on your terminal. If you redirect stdin or stdlist, STExport assumes that it is in batch. STExport in batch is almost identical to STExport on-line, except for answering questions. When STExport asks a question in batch, no one is there to answer it. Therefore, STExport does not expect an answer from stdin. STExport assumes that you want your batch task to complete, so it always selects the option that will complete the command successfully. This is normally a "YES" answer, as in "yes, purge the file". STExport prints the question on stdlist, as well as the answer that it has selected for you.

Command Line OptionsSTExport has command line options which help control certain features.

Default Outcount File Name: -ocIf you want to know how many records Stexport has processed, use the -oc option. This option sets the file name for outcount to ".sxoutcount". After a successful task, Stexport writes the number of output records to the .sxoutcount file. You can then use this file in shell scripts to check for specific record counts. For example, suppose that you want to check for at least ten records from a Stexport operation. You would write a shell script in the following manner:

Stexport -oc << !EOD in orders heading fieldnames out ordprn exit !EOD if [ `cat .sxoutcount` -ge 10 ]; then echo "More than 10 records found" fi

Variable Substitution -vA second command line option allows you to turn on variable substitution. You must note that the environment variable must be set prior to running STExport.

stexport -v << !EOD in $myvariable out ordcomb exit !EOD

236 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 236: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Introduction to STExport

Importing DataUse STExport to produce a formatted output file that can be used to import data into databases and applications. Other databases have different requirements for the format of input data. You will have to experiment with the various STExport formatting options to find a format that your particular database tool accepts.

Input FileSTExport reads one input file and formats each input record into one record in the output file. The Input file must be a self-describing file (use the Output-Link option in Suprtool).

Dates and Decimal PlacesUse Suprtool's Item command to specify date formats and the number of implied decimal places when you create the self-describing file. STExport uses this information to correctly format the information in the output file. See Appendix A for a complete example of how to use Suprtool's Item command and Output-Link option to create an input file for STExport.

Data-TypesEach STExport formatting command applies to all fields of a specific data-type (i.e., you cannot specify formatting field by field, only by type). For example, all numeric-type fields can be formatted the same.

The main data-types that STExport identifies areByte-Type: STExport assumes that character information is stored in byte-type

fields. By default, all byte-type fields are surrounded by quotes and trailing spaces are removed.

Numeric-Type: The numeric data-types are integer, logical, floating-point, packed, and display. STExport converts the internal representation of each data-type into a string of ASCII digits. By default, all numeric-type fields have a leading sign and are variable length. Where appropriate, numeric-type fields are converted with a decimal point.

Floating-Type: All commands that affect numeric-type fields also affect floating-type fields. In addition, you can use the Floating command to specify the format and decimal places for floating-type fields (i.e., Classic or IEEE floating-point numbers).

Suprtool 5.2 for HP-UX User Manual Introduction to STExport · 237

Page 237: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Date-Type: If a field has a date format, STExport does extra formatting. By default, dates are formatted into yyyymmdd (e.g., 20001125).

Formatting CommandsUse the following table to determine which command applies to which data-type:Command Data-TypeDate date-type

Floating floating-type

Quote byte-type

Sign numeric-type

Spaces byte-type

Zero numeric-type

CommandsMany of STExport's commands, such as the formatting commands above, once set will retain their settings between tasks. Several other non-formatting commands will also retain their settings:

Command

Columns

DElimiter

HEAding

HTML

Each command and its options will remain in effect between any STExport task, unless specifically turned off.

For example, if a previous task has had custom Headings set with the Heading and Heading Add options, the Headings will remain in effect for each subsequent task until a new Heading option is entered.

Performance ConsiderationsOn average, STExport is three-to-five times slower than Suprtool. This is the price we pay for having all of STExport's formatting features.

You can make STExport faster by doing the following:

1. Pre-select only the records you need with Suprtool. The fewer records STExport has to process, the faster it runs.

2. Use Suprtool's Extract command to select only the fields that you need to import in your final application. The fewer the number of fields in the input file, the faster STExport can format each record.

238 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 238: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

STExport Commands

General NotesWhen you run STExport, it prompts for commands on stdlist with a "$" character and reads command lines from stdin. STExport commands contain a command name followed by one or more parameters, and are patterned after the same commands in Suprtool.

In this chapter, we describe the STExport commands in alphabetical order. Following each command name in brackets is the minimal abbreviation for the command. For example: [I] for Input and [O] for Output.

AbbreviatingYou may shorten the command to the first letter of the command name.

$v {verify}$x {xeq}

Uppercase or LowercaseYou may enter the letters in either uppercase or lowercase, because STExport upshifts everything in the command line except literal strings within quotes ("abc") and file names. These two commands are identical:

$EXIT$exit

Comments on Command LinesComments may appear at the end of any command line, when they are surrounded by braces. Many of the examples in this manual show comments at the end of each command line. You can enter a comment as the only item in a STExport command line. When continuing command lines, the comment can appear before or after the continuation character.

${ format reals with two decimal places. }$input invoices$floating fixed 2 {Floating option}$output invfile {produces the file we want}$exit

HP-UX CommandsSTExport accepts HP-UX commands, with or without an exclam.

Suprtool 5.2 for HP-UX User Manual STExport Commands · 239

Page 239: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

$!ls$ls

For commands that are the same in both STExport and HP-UX, STExport executes the HP-UX command only if you type the exclam. For example:

$set {you get STExport set command}$!set {you get HP-UX set command (ksh)}

STExport/UX executes any HP-UX command (e.g., ll), or script file.

File NamesSTExport's Input and Output commands accept any valid HP-UX file name. File names are currently limited to 240 characters.

CalculatorAny command line beginning with an equal sign (=) is treated as a calculator expression. This feature can be used to do other calculations without the need of an electronic calculator.

You can obtain a short description of the calculator by entering the following:

=? {? gives a summary of = functions}

For a detailed description of the calculator and its options, see the Suprtool manual.

Control-YYou can interrupt a STExport task with the Control-Y key (hold down Control while striking Y). STExport responds by telling you how far it has gotten (IN=, OUT=, etc.), and asking if you wish to stop. Hit the Return key to continue or type YES to stop the task.

Many HP-UX sites use Control-C as the interrupt key instead of Control-Y. Use the HP-UX "stty" command to display your 'intr' setting.

240 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 240: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Before Command [B]Repeat any combination of the previous 1000 command lines, with or without editing.

BEFORE [ start [ / stop ] ]

[ string ]

[ ALL | @ ]

(Default: redo previous line)

(BQ=redo without change)

The Before command allows you to modify the commands before it executes them. If you don't need to change them, use BQ or Do.

The Before command uses Qedit-style control characters for modifying the commands. The default mode is to replace characters. To delete, use Control-D; to insert, use Control-B. If you prefer HP-style modify (D, R, I, and U), use the Redo command instead of Before.

Examples$ll *.fd {".sd" is not spelled right}*.fd not found$Before {redo most recent command}ll *.fd {last command is printed} s {you enter changes to it}ll *.sd {the edited command is shown} {you press Return}$listredo -10/$before 5 {redo 5th command in stack}$bef 8/10 {redo 8th through 10th}$b ls {redo last ls command}$b ls * {redo "ls *" command}$b @* {redo last containing "*"}$before -2 {redo command before previous}$before -5/-2 {redo by relative lines}

Modify OperatorsIf you wish to change any characters within the line, the modify operators are the regular Control Codes used in Qedit:

· Any printing characters replace the ones above.

· Control-D plus spaces deletes columns above.

· Control-B puts you into "insert before" mode.

· Control-A starts appending characters at the end of line.

· Control-A, Control-D, plus spaces, deletes from the end.

· Control-T ends Insert Mode, allowing movement to a new column.

· Control-G recovers the original line.

· Control-O specifies "overwrite" mode (needed for spaces).

Suprtool 5.2 for HP-UX User Manual STExport Commands · 241

Page 241: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Persistent RedoRedo commands can be saved in a permanent file and can therefore be used from another session. You can use the Set redo command to specify a filename to save your redo commands. Please see the Set Redo command for details.

242 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 242: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Clean Command [CL]Specifies what characters to clean from a byte type field.

CLEAN [ SPECIAL | <string> <range> ]

(Default: None)

STExport will automatically clean all the byte type fields for a given SD file. To define what characters that need to be replaced you use the clean command with the character you want to clean in quotes. Since most of the characters that you will need to clean are unprintable, you can enter the decimal equivalent of the character. This is denoted by entering the "^" character in quotes preceding the decimal number of the character you wish to clean.

You can set the character with the command set cleanchar as shown below.

$ in mysdfile $set cleanchar " " $out myexport $xeq

Since the Cleanchar is by default set to space, the above task could simply be:

$in mysdfile $clean "^9","^10","^0","^7" $out myexport $xeq

The SPECIAL keyword automatically defines Clean characters of Decimal 0 thru to Decimal 31.

$in mysdfile $clean special $out myexport $exit

You can also specify a range of characters with the following syntax:

$in mysdfile $clean "^0:^10" $out myexport $exit

The above task would clean all byte type fields of any characters from Decimal 0 (Null) to Decimal 10. (Line Feed)

Removing Bad CharactersYou can have the Clean function clean the field, and instead of replacing with a space, STExport will essentially shift characters to the left by Setting the CleanChar in the following manner:

>Set Cleanchar “<null>”

STExport will pad the field that was cleaned with the appropriate amount of characters with a space at the end of the field.

Suprtool 5.2 for HP-UX User Manual STExport Commands · 243

Page 243: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Columns Command [C]Specify whether fields are formatted into variable- or fixed-length columns.

COLUMNS FIXED | NONE

(Default: None)

Most PC software expects imported data to be in variable-length columns. Other database systems prefer data to be aligned in fixed columns. Use the Columns command to specify whether the output file has variable- or fixed-length columns.

Output FileThe Columns command also affects the format of the Output file. If you specify Columns None, the output file will have variable-length records. If you specify Columns Fixed, the output file will have fixed-length records.

244 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 244: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Date Command [DA]Specify a specific date-format for all dates.

DATE NONE | date-format [ "separator" ]

INVALID ASTERISKS | NULL | "string"

(Default: yyyymmdd Invalid Asterisks)

Use the Date command to specify an output format for dates. Use the Invalid option to specify how invalid dates should be formatted in the output file. The advantage of the None option is that it formats all dates, whether they are valid or not. If you select a date-format, the default Invalid option replaces invalid dates with asterisks "*".

STExport must know which fields are dates and the format of each date. Use Suprtool's Item command and Output,Link option to specify the date information.

Date FormatThe date-format can be one of:

· ccyymmdd

· yyyymmdd

· ddmmyyyy

· mmddyyyy

· yymmdd

· ddmmyy

· mmddyy

· aammdd

STExport converts each date field from its internal date format into the format that you specify.

Separator CharacterBy default, STExport formats all dates without a separator between the day, month, and year. Specify your own separator by enclosing it inside quotes after you specify the date format. The separator must be one character long. For example, to specify dates in ddmmyyyy format with a slash separator, use

$date ddmmyyyy "/"

To specify dates in yymmdd format with a dash separator, use

$date yymmdd "-"

Oracle DatesOracle dates contain both the date and the time. STExport formats the date, but not the time. If you specify Date None, Oracle dates will be treated as byte-type fields. Since Oracle dates actually contain binary data, the output is often unusable by other applications, unless you specify a specific date-format.

Suprtool 5.2 for HP-UX User Manual STExport Commands · 245

Page 245: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Invalid DatesBy default, all invalid dates are formatted as asterisks. STExport treats any date that does not have a valid century, year, month, or combination (e.g., February 29, 2000) as invalid. You can specify how you want STExport to format invalid dates by using the Invalid option of the Date command.

If you specify,

$date invalid null

STExport will produce a zero-length field if you specify Column Variable and spaces if you specify Column Fixed. If you want to specify an explicit string for all invalid dates, do so after the Invalid option. For example,

$date invalid "%%%%%"

will cause STExport to produce a string of five percent signs for any invalid date.

ExampleFirst, use Suprtool to create the input file with the appropriate date attributes:

>get d-sales>item deliv-date,date,mmddyyyy>item purch-date,date,mmddyyyy>output dsales,link>xeq

Then use STExport to read the dsales file. Specify Date ddmmyyyy "-" which causes all valid dates to be formatted in day-month-year format with a dash as the separator:

$input dsales$date ddmmyyyy "-"$output dexport$xeq

246 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 246: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Decimal Command [DEC]Specify the format for the decimal place in numeric fields.

DECIMAL PERIOD | COMMA

(Default: Period)

The fields in the input file must have been created with decimal places, using Suprtool's Item command.

The Decimal command specifies what separator will be used to indicate the decimal place in numeric fields. In North America, the custom is to indicate the decimal place in numbers with a period (.). Outside North America, the custom is to indicate the decimal place with a comma (,). If the decimal place indicator is incorrect, it is harder to import files into other applications.

The Decimal command does not apply to floating-point fields.

Suprtool 5.2 for HP-UX User Manual STExport Commands · 247

Page 247: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Delimiter Command [DE]Specify a delimiter, if any, that appears between each field in the output record.

DELIMITER NONE | COMMA | TAB | SPACE | "string"

(Default: Comma)

Use Delimiter Comma to create an output file in "comma-delimited" format (this is common for PC database applications). Use Delimiter Tab to tell STExport to insert the tab character between fields, instead of a comma.

If you have selected Columns Fixed, you will likely want to remove the delimiter by specifying Delimiter None. If you want some white space between fixed-length columns, specify Delimiter Space instead.

String ParameterYou can put anything inside quote characters to specify your own Delimiter. For example, Delimiter " , " would insert a space, a comma, and another space between each field in the output record. You can use either single- or double-quote characters to specify the delimiter (e.g., Delimiter " " and Delimiter ' ' are the same). The maximum length of the delimiter string is three characters.

248 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 248: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Do Command [DO]The Do command repeats (without changes) any of the previous 1000 commands.

DO [ start [ / stop ] ]

[ string ]

[ ALL | @ ]

(Default: repeat the previous command)

Commands are numbered sequentially from one as entered; the last 1000 of them are retained. Use the :Listredo command to display the previous commands. You can repeat a single command (do 5), a range of commands (do 5/10) or the most recent command whose name matches a string (do list). If you want to modify the commands before executing them, use Redo or Before.

Examples$listredo$do {do previous command again}$do 39 {do command line 39 again}$do 5/8 {do command lines 5 to 8 again}$do input {do most recent Input command}$do -2 {do command before previous}$do -7/-5 {do by relative line number}$do 5/ {do command lines 5 to "last"}

NotesThe Do command cannot be abbreviated.

Persistent RedoRedo commands can be saved in a permanent file and can therefore be used from another session. You can use the Set redo command to specify a filename to save your redo commands. Please see the Set Redo command for details.

Suprtool 5.2 for HP-UX User Manual STExport Commands · 249

Page 249: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Escape Command [ES]Specifies what character to escape the defined Delimiter, Quote or End of Line character.

ESCAPE DELIM | QUOTE | EOL |"string"|

(Default: None)

Many SQL importers allow you to add an escape character in front of characters that may mean something else to the import program. For example if the import program thinks that the delimiter character is a comma, the importer may treat a comma in an address field as an indication to move to the next field, which will throw of the import.

Some import programs, will treat the next character as data as opposed to a delimeter if the character is preceded by an escape character, such as a slash. Thus when the field is analyzed by STExport the data that originally started as:

"Niagara Falls,Ontario, Canada"

would be transformed to be:

"Niagara Falls/,Ontario/, Canada"

This function will not work on fixed columns and can be invoked with the escape command:

escape delimeter quote eol "/"

The above command will take the defined delimeter, quote and Eol and escape with a "/", if found in any byte type field.

250 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 250: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Exit Command [E]Exit STExport in one of three ways. By default, perform the current task, if any, then leave STExport. Users are often frustrated when they exit STExport after specifying part of a task and STExport starts processing the task. To avoid this situation, use the Abort or Suspend options to exit STExport conveniently without executing the current task.

EXIT [ ABORT | SUSPEND | XEQ ]

(Default: Xeq)

Typing Exit with no parameters means Exit Xeq. STExport recognizes special command names which specify both the Exit command and an exit option (e.g., ES means Exit Suspend).

Exit Abort [EA]Cancels the current operation and terminates STExport. The Exit command without parameters always attempts to perform the task currently specified, while Exit Abort cancels the task and terminates immediately. Should STExport be executed as a son process, Exit only suspends STExport, while Exit Abort actually terminates the process.

Examples$:comment. You began to specify an input file, stopped for$:comment. coffee, and decided to cancel the task$:comment. upon your return.$input invoices... coffee break ...$exit abort {cancel the task and terminate}End Of Program

Exit Suspend [ES]This feature is not currently available in STExport/UX.

Exit Xeq [EX]To perform the current task, you can either use Xeq (which leaves you inside STExport, ready to define another task) or Exit Xeq (which leaves STExport when done with the task).

Exit Xeq is the default option (i.e., specifying exit starts execution of the current task).

Suprtool 5.2 for HP-UX User Manual STExport Commands · 251

Page 251: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Examples/opt/robelle/bin/stexport$exit {no input was specified}

/opt/robelle/bin/stexport$input invoices$floating fixed 2$output invdata$exit {format and stop}

252 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 252: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Floating Command [FL]Specify the format and the number of decimal-places for floating-point fields.

FLOATING DEFAULT |

FIXED decimal-places |

SCIENTIFIC decimal-places

(Default: Default)

By default, STExport formats floating-point fields into either a fixed number or into scientific notation. Which notation STExport chooses, depends on the value of each field in each input record. You can force STExport to choose either scientific or fixed notation and the number of decimal places for all floating-point numbers. You cannot specify these options for a specific field or make them different for 32-bit versus 64-bit floating-point numbers.

Fixed FormatUse Floating Fixed to force all floating-point numbers to appear in a fixed format. You specify the maximum number of digits to the right of the decimal point. If you specify Floating Fixed, STExport does not remove trailing zeros from the formatted numbers. If you specify Columns Fixed, all floating-point values will be aligned along the decimal point.

Scientific FormatUse Floating Scientific to force all floating-point numbers to appear in scientific notation. You must specify the number of digits to the right of the decimal point. The Scientific option formats the number with all significant digits to the right of the decimal-point followed by the exponent (e.g., "0.47832E-10").

NotesBoth the Fixed and Scientific options attempt to round the number to the specified number of decimal-places within the maximum width for each floating-point data-type. If STExport cannot format a floating-point field in the specified number of decimal-places, the number appears as asterisks "****".

Suprtool 5.2 for HP-UX User Manual STExport Commands · 253

Page 253: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Form Command [F]Display the fields in a self-describing file.

FORM [filename]

If no file name is specified, the fields in the input file are displayed. The display shows the field type and field length in IMAGE notation. An I1-field is a single integer. Packed-fields show the number of nibbles (subtract one to obtain the number of digits). Byte and zoned-decimal fields show the byte length.

When showing the form of a self-describing file, STExport shows the byte offset of each field after the subcount, type, and sublength. The first field always appears at offset one.

There are two types of self-describing files. One type is produced with Suprtool's Query output option. You produce the other type with the Link output option. The Form command shows the internal self-describing version number, enabling you to tell the difference.

A.00.00 - Query Output OptionCompound fields have a question mark for the type, and the length is the number of bytes in the field. Sort information about the file is missing. Here is an example form listing:

$form custfileFile: custfile (SD Version A.00.00) Has linefeeds Entry: Offset CHARACTER X5 1 {length is five bytes} ZONED Z5 6 {room for five digits} INTEGER I1 11 {single integer} DOUBLE I2 13 {double integer} PACKED P6 17 {room for five digits} QUAD I4 20 {eight-byte integer} REPEATINT ?6 28 {compound field} LOGICAL K1 34 {single logical} DBLLOG K2 36 {double logical}Entry Length: 44 Blocking: 1

B.00.00 - Link Output OptionThese self-describing files contain information about how the file was sorted. Compound fields are handled correctly, so the Form command shows compound fields just as you would see them in IMAGE. The Item command in Suprtool identifies the date format or the number of decimal places of an item. The Link output option saves the date and decimal attributes as part of the field description:

$form custfileFile: datafile (SD Version B.00.00) Has Linefeeds Entry: Offset CHARACTER X5 1 <<Sort #1 >> REPEATINT 3I1 6 {compound field} DATE J2 12 <<YYYYMMDD>> DOLLAR P6 16 << .2 >>Entry Length: 16 Blocking: 1

254 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 254: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Heading Command [HEA]Specify a heading, if any, that appears as the first record of the output file.

HEADING NONE | FIELDNAMES |

string | ADD string | COLUMN string

(Default: None)

When importing data into other applications the first line of the import file is often treated as field names or headings. Use the Heading command to specify what STExport should write as the first line of the output file.

Field NamesIf you specify Heading Fieldnames, STExport creates a default heading. This heading is constructed by using the field name of each field in the input file. The Fieldname option uses the formatting options that apply to byte-type fields to determine the final format (e.g., the Quote command).

STExport produces multiple field names for compound fields. For compound fields, the repeat count is used to determine the number of field names. The repeat count is appended to the field name, starting with one, until all the field names have been generated.

User Specified HeadingYou can specify your own heading line by doing:

>heading "your heading"

Because the maximum length of an STExport input line is 256 characters, you may not be able to specify a long heading with a single Heading command. Use Heading Add to add additional strings to your heading:

Heading "Account" {Note no Add in first string}Heading Add "First Name "Heading Add "Last Name "Heading Add "City "Heading Add "State "

If you specify your own heading, STExport does not attempt to apply any formatting options. If you need each field in the heading line to be surrounded by quotes and separated by commas, you have to supply these yourself. For example,

Heading '"Account"' {Note no Add in first string}Heading Add ','Heading Add '"First Name"'Heading Add ','Heading Add '"Last Name"'Heading Add ','Heading Add '"City"'Heading Add ','Heading Add '"State"'

Column HeadingsIt is difficult to get headings right when you have to specify all the quotes and delimiters with the Heading Add option. Instead, use Heading Column to specify individual column headings without having to type formatting information. STExport then uses the current quote and delimiter settings in the heading.

Suprtool 5.2 for HP-UX User Manual STExport Commands · 255

Page 255: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

For example, if you specify:

Heading Column 'Account'Heading Column 'First Name'Heading Column 'Last Name'Heading Column 'City'Heading Column 'State'

and Quote Double and Delimiter Comma are in effect, then the heading STExport produces will be:

"Account","First Name","Last Name","City","State"

NotesYou cannot combine the Add and Column options. You must specify one or the other. If you start with Heading Add and then later specify Heading Column, STExport erases the heading you created with Heading Add and starts over with the first column that you specify with Heading Column. Similarly, if you start with Heading Column, a Heading string or Heading Add will start over with a new heading.

256 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 256: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Help Command [H]Show what commands and options are available in STExport.

HELP [ command | keyword [ ,section ] ]

(Default: browse through the entire help file)

Command HelpIf you specify any parameters, Help first assumes that you want help on a specific STExport command. If you know the structure of the help file, you can specify one of the keywords under the command name.

$help sign {help on the Sign command}$help sign,trailing {trailing section of the Sign command}

Keyword HelpIf we cannot find any help in the "Commands" section of the help file, we assume that you specified one of the outer-level keywords in the help file. To see this list of keywords, type help with no parameters. You see a short introduction to STExport and then a list of keywords. You can specify any of these keywords on the Help command. You can also specify a subkeyword.

$help intro,input {input section of Introduction}

Quick Help - HQHQ asks STExport to look under the keyword Quick in the help file. Quick contains the text from the STExport Quick Reference Guide, offering the experienced user a quick review of the syntax of any command.

$hq input {quick description of Input}

NotesIf no parameters are specified, Help allows you to browse through the help file, /opt/robelle/help/stexport. The Help command uses the Qhelp subsystem from the QLIB. For "help in help", type "?" when you see the Qhelp prompt character ("?"). The help file is organized into levels. To go back to the previous level, press Return. Press F8 to exit the Qhelp subsystem and return to STExport.

Suprtool 5.2 for HP-UX User Manual STExport Commands · 257

Page 257: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

HTML Command [HT]Use HTML to produce Web pages for either Internet or Intranet applications.

HTML NONE | PREFORMATTED | TABLE |

TITLE "string" |

HEADING "string"

(Default: None)

Web applications expect data in a special format called the Hypertext Markup Language (HTML). Use the HTML option to request that STExport format the input file into HTML format.

Example$html table title "Product Listing"

Maximum Size of HTML FilesWeb browsers often cannot process large documents. The maximum size depends on the browser, the version of that browser, the operating system it is working on, and how much physical memory is present on the client machine. We suggest that you limit your Web pages to less than 1,000 lines and restrict the number of columns, unless you are certain that your users can handle larger files. This advice reflects not so much a limitation of STExport, but a limitation of how Web browsers work.

Preformatted FormatTo preserve the columns and spacing of each output line, use the HTML Preformatted option. This option puts an HTML <pre> tag around all the data in the input file. Most Web browsers will display preformatted text in a fixed-width font such as Courier. Therefore, if you specify HTML Preformatted, you should also select Columns Fixed.

Table FormatUse HTML Table to create output in HTML table format. STExport creates tables with a border between each column and row. Tables make it easier to read tabular information, but some older browers do not support tables.

If you specify HTML Table, all byte-type fields are left-justified and all other fields are right-justified. If you use Heading Column or Fieldnames, the column headings are specified with HTML table heading tags. Most browsers highlight the column headings in some way, such as bold text centered over the column.

TitleAll HTML documents must have a title. By default, STExport uses the title "This is the Title". You should specify your own title using the Title option.

HeadingThe heading appears before the column headings and data from your input file. By default, there is no heading. Use the Heading option to specify your own heading.

258 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 258: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Column HeadingsIf you specify HTML Table, use the Heading command to specify column headings for HTML output. The Heading Fieldnames option will produce acceptable column headings, but it is better to use Heading Column to specify a string for each of the fields in your input file.

Roman-8 CharactersHP e3000 and HP 9000 computers use the Roman-8 character set. Web pages must use the ISO-8859-1 character set. The characters in the Roman-8 set are similar to, but not identical with, the ISO-8859-1 character set.

When formatting byte-type fields, STExport attempts to convert any Roman-8 input character into the corresponding ISO-8859-1 character.

STExport also tries to make reasonable conversions such as:

Symbol Converted To

> &gt;

< &lt;

& &amp;

Those characters that cannot be converted are dropped from the output. The following characters cannot be converted:

Symbol Roman-8 value name

` 169 grave mark

^ 170 circumflex

~ 172 tilde

ƒ 190 function symbol

ß 222 beta symbol

Š 235 capital-S, Icelandic

š 236 small-S, Icelandic

Ÿ 238 capital-Y, umlaut

NotesIf you specify HTML Table, STExport sets:

· Quotes None

· Delimiters None

If you specify HTML Preformatted, STExport sets:

· Quotes None

· Delimiters Space

· Columns None

In either case, any changes cause STExport to print a warning to let you know that these options have changed. If you do want quotes around byte-type fields or delimiters between fields, specify those options after selecting the HTML option.

Suprtool 5.2 for HP-UX User Manual STExport Commands · 259

Page 259: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Dynamic Web PagesThe Common Gateway Interface (CGI) feature of your Web server allows you to execute custom programs or scripts, and to dynamically generate, then display Web pages. These custom programs and scripts can be written in almost any programming language. Perl is probably the most commonly used language, but you could use C or C++, Applescript on Macintosh, or Visual Basic.

Web ServerFirst, your Web server software must be configured to allow CGI scripts. On the NCSA server, you need to change the srm.conf file to

include

ScriptAlias /cgi-bin/ /usr/local/httpd/server/cgi-bin

This indicates to the server where the CGI scripts are located. If a user enters "cgi-bin" in the Uniform Resource Locator (URL), the Web server executes the program specified out of the directory specified, e.g.,

http://www.mycompany.com/cgi-bin/myscript.pl

will actually execute

/usr/local/httpd/server/cgi-bin/myscript.pl

On the CERN Web server, you need to enter the following in the httpd.conf configuration file:

Exec /cgi-bin/* /usr/local/httpd/server/cgi-bin

Of course, the alias name and directory can be anything you want them to be.

A script can be coded to perform the same task every time it is run. There are different ways you can pass parameters to a script so that it can do different things. We will try to keep it simple and focus our attention on a specialized program.

Our application will display a list of all sales records created yesterday. The information is stored in an Allbase database. The table is called demo.sales and has the following columns:

Column Name Allbase Type Nulls Suprtool Type:

CUSTOMERNUM Decimal (8) N Packed

DELIVERYDATE Decimal (8) Y Packed

PRODUCTNUM Decimal (8) N Packed

PRICE Decimal (8) Y Packed

PURCHASEDATE Decimal (8) N Packed

SALESQTY Decimal (4) Y Packed

SALESTAX Decimal (8) Y Packed

SALESTOTAL Decimal (8) Y Packed

DeliveryDate and PurchaseDate are in yyyymmdd format. Price, SalesTax and SalesTotal have two implied decimals.

Before you go any further, you will have to decide where the new HTML file will reside. When someone connects to your Web site, the server software spawns child processes using a userid and groupid defined in the srm.conf (NCSA) or httpd.conf (CERN) configuration file. This user must have read and write access to the

260 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 260: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

directory specified in STExport's Output command. This directory must also be accessible by the server software as defined in the configuration file. For security reasons, it is not recommended that you create these files in the server's root directory.

You can configure a default html directory (for example, userdir entry in CERN) for individual users. When the URL contains a user construct, the server knows it has to look for the default directory under the user's home directory. Let us assume the default is public_html.

You could create a public_html directory under the home directory for the userid specified in the configuration file.

Another option is to create a new user on your system with the same directory structure, whose sole purpose would be to hold these dynamic HTML files. For example, create a user called htmluser whose home directory would be /users/htmluser. Create a /users/htmluser/public_html directory. Directory permissions should be read/write for user, group and others. The URL to read these would then be:

http://www.mycompany.com/~htmluser/filename.html

Shell ScriptSuprtool and STExport will be executed from a Korn shell script. Let us call it sx_orders.ksh. It can reside in any directory that has appropriate permissions to execute. Do not forget to assign eXecute permission to the file (chmod +x sx_orders.ksh). You can run this script manually from the $ prompt to see if there are any problems.

Suprtool 5.2 for HP-UX User Manual STExport Commands · 261

Page 261: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

#!/bin/ksh## Make sure the PATH variable includes /opt/robelle/bin# where Suprtool and STExport usually reside.#PATH=$PATH:/opt/robelle/bin

## Create a temporary logfile# and get a file name for the temporary extract file#temp_sxlog=`mktemp`touch $temp_sxlogtemp_sxdata=`mktemp`

## Run Suprtool and extract the data.# - Read commands using "here-is"# - write messages to temporary logfile#suprtool <<!EOD >> $temp_sxlogOpen Allbase /users/orders/db/OrdersDBE clerkSelect * From clerk.salesItem purchasedate, date, yyyymmddItem deliverydate, date, yyyymmddItem price, decimal, 2Item salestax, decimal, 2Item salestotal, decimal, 2If purchasedate = \$today(-1)Sort customernumOutput $temp_sxdata,LinkExit!EOD

## Check return code in case Suprtool had a problem# If so, send the "failed" return string to the CGI script# including the name of the logfile#if [ $? -eq 1 ]then echo failed=$temp_sxlog exit 1else

## Suprtool task worked correctly.# Can go on with STExport.## Must go to the target directory# because of file name limit in STExport# and get a file name to store HTML output# cd /users/htmluser/public_html > /dev/null temp_stexpdata=`mktemp -d .`

## Execute STExport to create the html file# stexport <<!EOD >> $temp_sxlog Input $temp_sxdata HTML Table Title "Orders Created Yesterday" \ Heading "Orders Created Yesterday (sorted by customer)" Heading Fieldnames Date YYYYMMDD "/" Output $temp_stexpdata.html Exit!EOD

## Check return code in case STExport had a problem.

262 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 262: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

# If so, send the "failed" return string to the CGI script# including the name of the logfile# if [ $? -eq 1 ] then echo failed=$temp_sxlog exit 1 else

## Everything worked fine.# Send the "OK" return string to the CGI script# including the name of the HTML file name.# echo OK=$temp_stexpdata.html rm $temp_sxlog > /dev/null rm $temp_sxdata > /dev/null exit 0 fifi

Perl ScriptWith such a simple example, we could have written the shell script a bit differently and then used it as a CGI script. However, shell scripts do not have enough features to easily handle parameters or complex forms.

Instead, it is typical to use another language as an intermediate step. One of the most popular CGI scripting languages is Perl. Perl has a full set of string handling functions and can be combined with graphics libraries available from various sources.

Let us call this one sx_orders.pl. It must reside in the directory defined in the server configuration file.

Suprtool 5.2 for HP-UX User Manual STExport Commands · 263

Page 263: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

#!/usr/local/bin/perl

## Execute shell script and capture returned string#$return_string = `/users/orders/scripts/sx_orders.ksh`;

## Return string can be OK=html file name# or failed=log file name# Split function separates return_string's 2 components#($status_word, $html_file) = split (/=/, $return_string);

if ($status_word eq "failed") {## If the script failed, print an HTML error page# including the logfile# error_page }

else {## If the script is successful, display the HTML file# created by STExport.# This URL automatically looks for the configured directory# under htmluser's home directory.#print "Location: http://www.hp.com/~htmluser/$html_file", "\n\n" }

# Format an error message for the usersub error_page { print "Content-type: text/html\n\n"; print "<HTML>\n"; print "<HEAD>\n"; print "<TITLE>Comment Form Error</TITLE>\n"; print "</HEAD>\n"; print "<BODY>\n"; print "<H1>Comment Form Error</H1>\n"; print "<HR>\n"; print "<P>\n"; print "Form input was not proccessed. Please mail your "; print "remarks to <b>$webmaster</b>"; print "<P>\n"; print "<b>Content of the Suprtool/STExport logfile</b>"; print "<pre>"; print `cat $html_file`, "\n"; print "</pre>", "\n"; print "</BODY>\n"; print "</HTML>\n";}

CGI ScriptThe CGI script can be invoked explicitly when you type the URL in your browser:

http://www.mycompany.com/cgi-bin/sx_orders.pl

The script is executed either from an input form,

<FORM METHOD="POST" ACTION="/cgi-bin/sx_orders.pl">

or invoked through a link in a regular Web page

Just click <a href="/cgi-bin/sx_orders.pl">run script</a>

264 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 264: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

If you enter the URL, choose the "submit" button on a form, or click on a link, the server will start execution of the Perl script. In turn, Perl will run the shell script. Suprtool and STExport will finally be executed. A status code and a file name will be returned to Perl. It will print either an error page or the extracted information, depending on the status code.

There is a lot more you can do with CGI scripting and Suprtool. You could pass parameters to extract information out of different tables in Oracle and Allbase, or specify the sort sequence and the selection criteria.

Suprtool 5.2 for HP-UX User Manual STExport Commands · 265

Page 265: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Input Command [I]Specifies the primary input file.

INPUT filename

There can be only one Input file per task. The Input file must be a self-describing file, which should be created by Suprtool using the Output-Query or Output-Link option. If you want STExport to format date-fields and implied decimal places, you must use the Output-Link option of Suprtool when you create the file for input to STExport.

Every record in the input file is formatted into a corresponding record in the output file. It is best to have Suprtool Extract only the fields you actually need. Only those fields needed for import into the final application should be present in the Input file.

266 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 266: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Listredo Command [LISTREDO]The Listredo command displays any of the previous 1000 commands.

LISTREDO [ start [ / stop ] ] [;ABS] [;OUT=file]

[ string ][;REL]

[ ALL | @ ] [;UNN]

(Default: display previous 20 commands)

(BJ and ,, are short for LISTREDO)

Commands are numbered sequentially from one as entered; the last 1000 are retained. You can display a single command, a range of commands, all 1000, or all the commands whose name matches the string. You can print the commands with ABSolute line numbers (the default), RELative line numbers (-5/-4), or UNNumbered. You can write the commands to your terminal. The Out option is not currently supported on STExport/UX. If you want to redo any of these commands, see Do, Redo, and Before.

Examples$listredo 5$listredo 5/10$listredo help {print all Help commands}$listredo -10 {print last ten commands}$listredo ALL {print entire redo stack}$listredo @;rel {print ALL, relative numbers}$listredo rm {print all rm commands}$listredo rm xx {print all "rm xx" commands}$listredo @rm {print all with "rm" anywhere}

NotesThe Listredo command cannot be abbreviated, but BJ and ,, (comma comma) are accepted as a short forms.

Persistent RedoRedo commands can be saved in a permanent file and can therefore be used from another session. You can use the Set redo command to specify a filename to save your redo commands. Please see the Set Redo command for details.

Suprtool 5.2 for HP-UX User Manual STExport Commands · 267

Page 267: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Output Command [O]Specifies the Output file.

OUTPUT * | filename [ERASE] [LF] [NOLF]

By default, the Output file is named "Output". If you specify Columns None, the output file will have variable-length records. When Columns Fixed is specified, STExport creates the output file with fixed-length records.

Line FeedsSTExport's Output command allows the user to specify whether the output file has line feeds. Normally STExport determines whether to write out line feeds from the self-describing file. If the self-describing file does not have line feeds, then the resulting file from the STExport task will not have line feeds. This caused problems for some programs that import the file or for some browsers that use the HTML option. You can now explicitly specify line feeds in the output file by using the LF option.

$in ora.customer$out file1ex,lf$exit

To specify that line feeds are not written out to the file, you can use the NOLF option.

$in ora.customer$out file1ex,nolf$exit

StdlistIf the output file name is *, each output record is written to stdlist. This is useful for trying out different formatting combinations until you find the one that best fits the application that you want to import data into. For example,

$input sdfile$output *$xeq$floating fixed 2 {change one option}$input sdfile$output *$xeq {view the result}$sign none {change a different option}$input sdfile$output *$xeq {and so on}

268 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 268: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Quote Command [Q]Specify which quote character, if any, is to be used around byte-type fields.

QUOTE NONE | DOUBLE | SINGLE

(Default: Double)

Most software packages expect byte-type fields to be in one of two formats:

1. Fixed-column (see the Column command).

2. Surrounded by single- or double-quotes. In this case, you may also need to remove trailing spaces (see the Spaces command).

No Quotes for Fixed ColumnsUse Quote None to cause byte-type fields to be output as a group of characters. In many cases, you would combine this option with Columns Fixed.

Single or Double QuotesBy default, all byte type fields are surrounded by double quotes. Specify single quotes using the Single option. If a byte type field contains the quote character specified in the quote command, it is replaced with a space. For example, if the input was:

customer's

and Quote Single had been specified, then the output would be:

customer s

Suprtool 5.2 for HP-UX User Manual STExport Commands · 269

Page 269: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Redo Command [REDO]Enables you to modify and repeat any of the previous 1000 command lines.

REDO [ start [ / stop ] ]

[ string ]

[ ALL | @ ]

(Default: redo the previous command)

The Redo command allows you to modify the commands before it executes them. If you do not need to change them, use the Do command. Commands are numbered sequentially from one as entered; the last 1000 are retained. Use the :Listredo command to display the previous commands. You can Redo a single command, a range of commands, or the most recent command whose name matches a string.

The Redo command uses MPE-style editing logic (D, I, R, U and >). The default mode is to replace characters. To delete, type DDDD under the characters to be removed. To insert, type I under the insertion spot, then the new characters. To undo your changes, type U. To append to the end of the line, use >xxx. To delete from the end of the line, use >DD. To replace at the end of the line, use >Rxxx. And to erase the rest of the line, use D>. If you prefer Qedit-style editing (Control-D, etc.), use the Before command instead of the Redo command.

Examples$ll fille {'fille' is a typo}fille not found$redo {redo most recent command}ll fille {last command is printed} d {you enter changes to it}ll file {edited command is shown} {you press <return> }

$listredo all$redo 5 {redo 5th command in stack}$redo {redo previous command}$redo -2 {redo command before previous}$redo 8/10 {redo 8th through 10th}$redo -10/ {redo -10 through last}$redo rm {redo last rm command}$redo rm temp {redo last "rm temp"}$redo @temp {redo last containing "temp"}

270 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 270: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Reset Command [R]Cancel the current task.

RESET

Reset closes the current Input file, then resets the Output file name to "Output". Formatting options are not reset, only the task-related commands are reset. If you try to reset an individual command, STExport prints a warning.

Suprtool 5.2 for HP-UX User Manual STExport Commands · 271

Page 271: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Set Command [S]Enables or disables certain operating options within STExport. These options are not reset by Xeq or Reset commands.

SET [CLEANCHAR <string> ]

[MAPPED ON|OFF]

[REDO filename]

[STATISTICS ON|OFF]

[VARSUB ON|OFF]

[VARSUBCOMPAT ON|OFF]

[VARSUBDEBUG ON|OFF]

[WARNINGS ON|OFF ]

[XMLTAGCHAR ] "." | "_" | "-"

[ZONEDFIX ON|OFF]

CleanCharSET CleanChar <string>

(Initially: set to space)

Sets what character is used to replace a Clean character. If you just want to clean the fields and replace the “bad” character with no character then you need to set the CleanChar in the following manner:

>Set CleanChar “<null>”

See the Clean command for more details.

MappedSET MAPPED ON | OFF

Mapped has no effect within STExport/UX.

RedoSET REDO filename

(Initially: unnamed temporary file)

Commands entered at the STExport prompt are saved in something called the redo stack. You can recall commands from the redo stack by using other commands such as Before, Do and Redo. By default, the redo stack is stored in a temporary file and discarded as soon as you exit. This temporary stack is not preserved across STExport invocations.

272 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 272: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

The new Set Redo command assigns a permanent file as the redo stack, allowing the stack to become available for future STExport invocations. For example, to assign the Myredo file as a persistent redo stack, enter

$Set Redo Myredo

If the file does not exist, STExport creates it. Otherwise, STExport uses the existing file. All subsequent commands are written to the persistent redo stack. The setting is valid for the duration of the STExport session. As soon as you exit STExport, the setting is discarded. Next time you run STExport, you will get the temporary stack.

If the file name is not qualified, the redo stack is created in the current working directory. This may be desirable if you want to have separate stacks. If you want to always use the same persistent stacks, you should qualify the name.

The Verify command shows which stack is currently in use. If it shows <temporary>, then STExport is using the default stack. Anything else is the name of the file used on the Set Redo command.

ConcurrencyWhen STExport uses the default temporary stack, it is only accessible to that particular instance of STExport. You can run as many STExport instances as you need and each one gets its own redo stack. With temporary stacks you will never get into concurrency problems.

If you start using a persistent redo stack, however, you might start running into concurrency problems. A persistent redo stack can only be used by one STExport instance at a time. If you try to use a persistent redo stack that is already in use, you will get the following message:

$Set Redo MyredoThe redo file is already in useUnable to open file for REDO stack

In this situation, STExport continues to use the redo stack active at the time and lets you continue working as normal.

Qedit can also have permanent redo stacks. To prevent products from writing to each other's redo stack, it is advisable to have separate stacks for each product by giving them different file names. For example, if you use the command

set redo myredo

you will have a redo stack called Myredo for your STExport commands. If you exit STExport, then run Qedit and supply the same command Set Redo command, your Qedit commands will be written to the same file that was used for your STExport commands.

StatisticsSET STATISTICS ON | OFF

(Initially: OFF)

Statistics causes STExport to print statistics at the end of each task.

VarsubSET VARSUB ON | OFF

Suprtool 5.2 for HP-UX User Manual STExport Commands · 273

Page 273: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Setting Variable Substitution causes STExport to resolve any variables in a command before processing.

VarsubCompatSet VarsubCompat On | Off

The Set VarsubCompat flag has been added to STExport for HP-UX to have variable substitution be more flexible. On MPE variable substitution would pass the name of the variable thru to be parsed even if the variable was not set. On HP-UX the default behaviour was to return spaces if the environment variable was not set. This is still the default behaviour, however if you set varsubcompat on, Suprtool will return the environment variable name similar to how MPE works with unresolved variables. You can invoke this option from the command line with the –cv option.

VarsubDebugSET VARSUBDEBUG ON | OFF

(Initially: OFF)

Suprtool and STExport and Suprlink, now has a setting called Set VarsubDebug on which will print out the line after the variable substitution has occurred. This setting only works if Set Varsub is on and Set VarsubDebug is on.

export outfile &:"/GREEN/SUPRTEST/filename90123456789012345678901234567890123456789012345678901"/opt/robelle/bin/suprtoolSUPRTOOL/UX/Copyright Robelle Solutions Technology Inc. 1981-2007.(Version 5.2 Internal) TUE, OCT 30, 2007, 2:58 PM Type H for he>set varsub on>set varsubdebug on>in file1sd.suprtestvd:in file1sd.suprtest>output !outfile,link,tempvd:output /GREEN/SUPRTEST/filename90123456789012345678901234567890123vd:2345678901,link,temp

The output is formatted into 74 byte chunks and printed with a preceding “vd:” so the “substituted” line is clear. The above example shows Suprtool, however the same commands apply in STExport and Suprlink.

WarningsSET WARNINGS OFF

(Initially: ON)

Suprtool normally prints warning messages out to $stdlist. You can turn off these messages when you are running from batch by issuing a Set Warnings off command. If you are simulating batch mode with the Set Interactive Off command, you must do the Set Warnings off after the Set Interactive Off.

The default for this setting is On.

274 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 274: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

XmltagcharSET XMLTAGCHAR "." | "-" |"_"

(Initially: ".")

In XML the tags that surrounded the data can not have any special characters other than hyphen, underscore and period ("-","_", "."). So STExport replaces any of the invalid special characters with a "." by default. You can change the default character To be something else with the following set command:

$Set xmltagchar "_"

STExport will only allow the hyphen, underscore and period to be set with this command.

ZonedFixSET ZONEDFIX OFF

(Initially: OFF)

Set ZonedFix has been added to fix a zoned field that when converted to byte, results in "?", meaning that the source field has some characters that were not expected in a Zoned field. If Set ZonedFix is On STExport zeroes out the field after an attempted conversion of the field yields characters that cannot be converted.

The default for this setting is Off.

Suprtool 5.2 for HP-UX User Manual STExport Commands · 275

Page 275: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Sign Command [SI]Specify what should be done with the sign character for numeric-fields.

SIGN NONE | FLOATING | LEADING | TRAILING

(Default: Floating)

All numeric-type fields, except logical fields, have a sign. Integer and floating-point fields can have either a space " " (for positive values) or a negative sign "-". Packed- and display-type fields can have a space " " (neutral), a plus sign "+" (for positive values), or a negative sign "-".

Specify Sign None to cause STExport to completely ignore the sign. If you specify Sign None, no error or warning message appears if any numeric-types have a negative value.

Leading vs. FloatingIf you specify Columns Fixed, it is easy to see the difference between a leading versus a floating sign. A leading sign always appears in the same column whereas a floating sign always appears before the first digit of a number. For example,

Sign Leading Sign Floating- 22415 -22415- 207 -207- 16600 -16600- 21910 -21910- 8411 -8411- 42 -42- 16713 -16713- 7970 -7970

Trailing SignSpecify Sign Trailing to cause the sign character to appear after each formatted number. Remember that for many numeric-types the sign for positive numbers is a space. STExport always leaves room for the sign, even if it is a space.

276 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 276: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Spaces Command [SP]Specify whether trailing spaces are to appear in byte-type fields.

SPACES NONE | TRAILING

(Default: None)

If byte-type fields are surrounded with quotes (see the Quote command), the Spaces command determines whether trailing spaces in byte-type fields appear within the quotes. Use Spaces Trailing if you want to retain all of the spaces in a byte-type field.

Software packages that store variable-length character data treat trailing spaces as data. Use Spaces None to remove trailing spaces for data that is imported into these applications.

Suprtool 5.2 for HP-UX User Manual STExport Commands · 277

Page 277: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Use Command [U]Specifies a file of commands to be executed as a group.

USE[Q] filename

ExamplesA usefile makes your task easier by allowing common commands to be specified once in an external file. For example, the following usefile contains all the commands for creating the Invcust file:

$use invuseinput invoices {input file to format}floating fixed 2 {formatting option}output invdata {produces the file we want}exit

STExport prints the lines in the usefile, including the comment lines. This allows you to include instructions and reminders in the usefile. In the example above, there were no commands for the user to enter.

NotesUsefiles cannot be nested in STExport. The usefile may be any unnumbered text file or a Qedit workfile, but no more than 256 characters per record are processed.

By default, STExport displays the commands in a usefile as they are executed. STExport can execute commands quietly using the Useq command. For compatibility with Qedit, Useq can be abbreviated to UQ.

278 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 278: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Verify Command [V]Print the definition of the current task.

VERIFY

Verify prints the current Input and Output files and all export specifications; in other words, it is a Verify All command.

Suprtool 5.2 for HP-UX User Manual STExport Commands · 279

Page 279: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Xeq Command [X]Perform the current task.

XEQ

Xeq checks that you have specified an Input file and an Output file. Then it performs the task and creates the Output file. Finally, it closes the files, ready for you to specify another task or Exit. If you also wish to leave STExport after completing the task, use Exit instead of Xeq.

280 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 280: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

XML Command [XML]Use XML to produce XML Documents for either Internet or Intranet applications.

XML

VERSION "string"

DOCTYPE "string"

FILE "string"

RECORD "string"

ExampleSTExport can generate "well-formed" XML output with just a few commands.

$input file1sd$xml$output myxml$xeq

These four simple commands will generate the following file that packages such as XMLSpy will consider to be "well-formed" XML. The result of such an STExport task will look as follows:

<?xml version='1.0'?><file><record><CITY>Los Altos</CITY><CREDIT-RATING>100000</CREDIT-RATING><CUST-ACCOUNT>4003302</CUST-ACCOUNT><CUST-STATUS>20</CUST-STATUS><NAME-FIRST>Ralph</NAME-FIRST><NAME-LAST>Perkins</NAME-LAST><STATE-CODE>CA</STATE-CODE><STREET-ADDRESS>Room 655</STREET-ADDRESS><STREET-ADDRESS>Los Altos 040033022</STREET-ADDRESS><ZIP-CODE>93002</ZIP-CODE></record></file>

NotesBy default STExport will add the simplest version tag at thebeginning of the file, then it inserts a <file> and matching </file> at the beginning and the end of the file. Then STExport encloses each record from the input file in a <record> and </record> tag. Finally, the Self-Describing tags are added around each field's data values and edited appropriately.

Naturally users would want options to customize and specify the various options and tags themselves, in order to generate a file that is acceptable to their tools.

VersionYou can specify the "version" tag at the beginning of the XML file with the following command:

xml version "?xml version='1.0' encoding='ISO-8859-1'?"

STExport will put the "<" and ">" around what is specified in the version string.

Suprtool 5.2 for HP-UX User Manual STExport Commands · 281

Page 281: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

DoctypeA Document Type Declaration can be made at the beginning of the file via the !DOCTYPE specification. This typically tells whatever tool that is parsing the xml file where the DTD for the file resides.

In STExport you can specify simple one-line doctype specs with the following command:

xml doctype '!DOCTYPE address-book SYSTEM "address-book.dtd"'

This will write the doctype specification at the top of the output file, directly after the XML version specification.

FileYou can customize the "file" tags with the following command commands:

xml file "orders"

STExport will put the "<" and ">" around what is specified in the File string.

RecordYou can customize the "record" tags with the following command commands:

xml record "Details"

STExport will put the "<" and ">" around what is specified in the Record string.

ExampleYou can enter multiple XML commands per task to set the XML options you require.

$in file1sd$xml version "?xml version='1.0' encoding='ISO-8859-1'?"$xml file "Orders" record "Details"$out myfile

An example of the output generated by the above commands is as follows:

<?xml version='1.0' encoding='ISO-8859-1'?><Orders><Details><CITY>Los Altos</CITY><CREDIT-RATING>100000</CREDIT-RATING><CUST-ACCOUNT>4003302</CUST-ACCOUNT><CUST-STATUS>20</CUST-STATUS><NAME-FIRST>Ralph</NAME-FIRST><NAME-LAST>Perkins</NAME-LAST><STATE-CODE>CA</STATE-CODE><STREET-ADDRESS>Room 655</STREET-ADDRESS><STREET-ADDRESS>Los Altos 040033022</STREET-ADDRESS><ZIP-CODE>93002</ZIP-CODE></Details></Orders>

TagsIn XML the tags that surrounded the data can not have any special characters other than hyphen, underscore and period ("-","_", "."). So STExport replaces any of the invalid special characters with a "." by default.

You can change the default character to be something else with the following set command:

282 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 282: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

$Set xmltagchar "_"

STExport will only allow the hyphen, underscore and period to be set with this command.

QuotesAll of STExport's XML command options (version, doctype, file and record) allow for a string to be passed via surrounding quotes. The quotes may be either single or double, but keep in mind that if the string is to contain double quotes, then you should surround the entire string with single quotes.

Suprtool 5.2 for HP-UX User Manual STExport Commands · 283

Page 283: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Zero Command [Z]Specify whether leading zeros are to appear in numeric fields.

ZERO NONE | LEADING

(Default: None)

Use Zero None to force all numeric fields to have leading zeros removed. If a numeric field has implied decimal places, STExport always formats the number with at least one digit to the left of the decimal place, even if it is zero.

Use Zero Leading to force all numeric fields to be zero-filled. In this case, Sign Leading and Sign Floating both cause the sign to appear in the same place (in front of the leading zeros).

284 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 284: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Example of STExport Output

ExampleIn this example we show you how to use Suprtool and STExport. We start with an SQL table, identify the fields that are dates and the number of implied decimal places in other fields. We then produce a self-describing file using the dataset as input and show the default output from STExport.

The Form command displays the fields in a dataset or a self-describing file. For files, this information is stored in a file with an extension of ".sd" and is not accessible with other tools. Use the Form command to obtain the record layout of STExport input files.

Sales FileWe will be formatting data from an Oracle table that has the following form:

>op oracle custdb dbpass>sel * from sales>form Column Name: Oracle Type: Suprtool Type:

CUSTOMERNUM Number (8) Double DELIVERYDATE Number (8) Double PRODUCTNUM Number (8) Double PRICE Number (10) Packed PURCHASEDATE Number (8) Double SALESQTY Number (10) Packed SALESTAX Number (10) Packed SALESTOTAL Number (10) Packed

Dates and Decimal PlacesWe use Suprtool's Define and Item commands to identify which of the fields in the sales table are dates and which fields have implied decimal places:

Suprtool 5.2 for HP-UX User Manual Example of STExport Output · 285

Page 285: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>def deliv_date,DELIVERYDATE,8,display>def purch_date,PURCHASEDATE,4,double>def product_price,PRICE,4,double>def sales_tax,SALESTAX,4,double>def sales_total,SALESTOTAL,4,double>item deliv_date ,date ,yyyymmdd>item purch_date ,date ,yyyymmdd>item product_price ,decimal ,2>item sales_tax ,decimal ,2>item sales_total ,decimal ,2

SalefileWe now produce a file called "salefile" using Suprtool's Output,Link option. The Link option produces a self-describing file, complete with the date and decimal-place information:

>open oracle custdb dbpass>select * from sales>def deliv_date,DELIVERYDATE,8,display>def purch_date,PURCHASEDATE,4,double>def product_price,PRICE,4,double>def sales_tax,SALESTAX,4,double>def sales_total,SALESTOTAL,4,double>item deliv_date ,date ,yyyymmdd>item purch_date ,date ,yyyymmdd>item product_price ,decimal ,2>item sales_tax ,decimal ,2>item sales_total ,decimal ,2>extract customernum>ext deliv_date>ext PRODUCTNUM>ext product_price>ext purch_date>ext SALESQTY>ext sales_tax>ext sales_total>output salefile,link>xeqIN=8, OUT=8. CPU-Sec=1. Wall-Sec=1.

>form salefile File: salefile (SD Version B.00.00) No linefeeds Entry: Offset CUSTOMERNUM I2 1 DELIV_DATE Z8 5 <<YYYYMMDD>> PRODUCTNUM I2 13 PRODUCT_PRICE I2 17 << .2 >> PURCH_DATE I2 21 <<YYYYMMDD>> SALESQTY P12 25 SALES_TAX I2 31 << .2 >> SALES_TOTAL I2 35 << .2 >> Entry Length: 38 Blocking: 1

Notice how the Form command correctly identifies which fields are dates and which fields have implied decimal places. STExport uses this information to format the file.

STExport OutputWe then use STExport to read the self-describing Salefile to produce our sample output on stdlist. To demonstrate how dates are handled, we insert a separator in each date field:

286 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 286: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

/opt/robelle/bin/stexport$input salefile {self-describing input file}$date yyyymmdd "-" {dates with a dash separator}$output * {output to stdlist}$xeq10020,1993-10-05,50511501,98.31,1993-10-01,0.02,27.53,224.1510003,1993-10-15,50511501,98.31,1993-10-15,0.01,13.76,112.0710003,1993-10-15,50512501,145.62,1993-10-15,0.01,20.39,166.0010003,1993-10-15,50513001,192.20,1993-10-15,0.01,26.91,219.1010016,1993-10-21,50521001,24.59,1993-10-21,0.03,10.33,84.1110016,1993-10-21,50532001,139.85,1993-10-21,0.01,19.58,159.42

There are no byte-type fields in the input file, so all fields are converted from their internal numeric representation to a string of digits. All date fields were converted from their internal yyyymmdd format to the external yyyymmdd format with a dash separator between day, month, and year. All fields with implied decimal places have been converted with a decimal point.

Load Data Into OracleIf you need to load the export file into an Oracle database, you can use Oracle's own SQL*Loader. Files created with STExport can be processed immediately with SQL*Loader. Suppose we want to load the data extracted in Salefile. We would use STExport to format the information and store the results in Expsale.

:run stexport.pub.robelle$input salefile {self-describing input file}$date yyyymmdd "-" {dates with a dash separator}$output expsales {output to a file}$xeq

If the Oracle database resided on an HP 9000, we would need to transfer Expsale. How you transfer the file is not important as long as it gets there in the same format, including line separators. Also note that the file should have an extension. SQL*Loader expects a .dat extension by default.

The Oracle table should have all the necessary columns. To create a table with the fields in Salefile, you could use the following:

create table sales_details ( CUST_ACCOUNT dec(8), DELIV_DATE date, PRODUCT_NO dec(8), PRODUCT_PRICE dec(8,2), PURCH_DATE date, SALES_QTY dec(6), SALES_TAX dec(8,2), SALES_TOTAL dec(8,2) ) tablespace USERS;

SQL*Loader requires what is known as a control file. It contains the load specifications such as the data file, the destination table, the field delimiter, the text field delimiters and the column specifications. In this case, the control file (expsales.ctl) looks like this:

Suprtool 5.2 for HP-UX User Manual Example of STExport Output · 287

Page 287: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

load data -- Specify input datafile. dat extension is assumed. -- Infile expsales

-- Name of the table where the data is loaded. -- -- Append new rows to existing data, if any. -- Append Into Table sales_details

-- Fields are separated by commas -- Fields Terminated By ','

-- Character fields are enclosed in double-quotes -- Optionally Enclosed By '"'

-- Specify the column names as they appear -- -- in the data records. -- -- For a Date-type column, specify the input format -- -- Example: column Date "YYYYMMDD" -- (CUST_ACCOUNT, DELIV_DATE date "YYYYMMDD", PRODUCT_NO, PRODUCT_PRICE, PURCH_DATE date "YYYYMMDD", SALES_QTY, SALES_TAX, SALES_TOTAL)

In its simplest form, SQL*Loader is invoked with the following command:

$ sqlload userid=username/password control=expsales.ctl log=expsales.log

The username and password are valid Oracle connect information. SQL*Loader reads the load specifications from the file specified in the control keyword. It writes operation information and statistics to the file specified in the log keyword. It also creates a number of files to report data problems etc. SQL*Loader has many other options to control the load task. Refer to the appropriate Oracle documentation for details.

288 · Example of STExport Output Suprtool 5.2 for HP-UX User Manual

Page 288: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Limits Within STExport

MaximumsDelimiter - Maximum Length - 3 BytesThe delimiter must appear between every field in the output record. To help avoid exceeding the maximum output record length, the maximum delimiter length is three characters.

Input File - Maximum Record Size - 4096 BytesWe recommend that you use Suprtool's Extract command to minimize the input record size.

Input File - Maximum Fields - 255If you must have more than 255 fields, use Suprtool's Define and Extract commands to extract several fields as one contiguous series of bytes.

Output File - Maximum Record Size - 4096 BytesWhen formatting many fields, it is possible to produce large output records. Once again, using the Extract command to minimize the size of the input records will avoid large output records.

The total length of the Heading line in the output file is also restricted to 4096 bytes.

Suprtool 5.2 for HP-UX User Manual Limits Within STExport · 289

Page 289: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Welcome to Dbedit

IntroductionWelcome to version 5.2 of Dbedit, a module of Suprtool that permits people to add, change, list, or delete individual records or "chains" of records from an Eloquence database. Dbedit is useful for debugging applications, for quickly prototyping systems, and for the data entry of simple applications.

You enter Dbedit via the Edit command of Suprtool. Once in Dbedit, you cannot use the Suprtool commands (while in Suprtool you cannot use the Dbedit commands). Certain commands are the same in both Dbedit and Suprtool (e.g., Use, Before, and Set). The Before command works independently and each software module saves its own last command.

Restrictions1. Most Dbedit commands require you to have opened the

database using the Base command of Suprtool. Dbedit does not have a Base command.

2. You cannot switch to another database while in Dbedit. Instead, you must Exit, do a Base command in Suprtool, then Edit.

3. The maximum size of any individual data item is 80 bytes (i.e., 5X80 is acceptable, but X100 is not).

4. Only datasets whose search fields are compatible with Dbedit can be accessed (i.e., no K5 search fields).

Functions of DbeditThere are five major functions in Dbedit:Command FunctionADD Add new entries to a dataset.CHANGE Change a master search value in all related datasets.DELETE Delete entries from a dataset.LIST List the value of entries in a dataset.

290 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 290: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

MODIFY Modify specific fields of an entry from a dataset.

Performance of DbeditSuprtool was designed to be as fast as possible, while Dbedit was designed to have as many features as possible. Dbedit does no special optimizations. It uses the standard IMAGE/Eloquence intrinsics to do all of the accesses to the database. Dbedit does not use the fast sequential access method of Suprtool, but Dbedit usually works only with a few records within your database at one time.

Field ListsDbedit arranges the list of fields in a dataset different from QUERY or Suprtool. The QUERY ADD command prompts for the each field in the dataset in the order they were declared in the IMAGE schema. In Dbedit, the order of field lists is changed using the following algorithm:

1. The search field for a master dataset or the primary search field for a detail dataset appears first.

2. Any other detail search fields appear second.

3. Any sort fields appear third.

4. All other non-search and non-sort fields that are compatible with Dbedit appear last.

5. Where a noncompatible field would appear in a list, Dbedit replaces it with a compatible field from the end of the list.

Example:

The following example shows the difference between QUERY and Dbedit. We add an entry to the d-inventory dataset of the Store database. In this dataset, supplier-name is the primary search field and product-no is another nonprimary search field.

QUERY/3000

>add d-inventoryBIN-NO =>>1201 LAST-SHIP-DATE =>> OH-HAND-QTY =>> PRODUCT-NO =>>2001001 SUPPLIER-NAME =>>STD Ribbons UNIT-COST =>>

DBEDIT/SUPRTOOL

Suprtool 5.2 for HP-UX User Manual Welcome to Dbedit · 291

Page 291: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

#add d-inventory SUPPLIER-NAME >STD Ribbons           PRODUCT-NO >2001001     BIN-NO >1201     LAST-SHIP-DATE >                      ON-HAND-QTY >                      UNIT-COST >               

Database LockingDbedit uses the following locking strategy. The Add command locks one dataset (using DBLOCK, mode-3) after all of the field values have been entered. The Modify and Delete commands do the following:

1. After all of the field values have been entered, the dataset is locked.

2. The records are re-read using DBGET, mode-4 for details or DBGET, mode-7 for masters.

3. The re-read record is compared with the original record. If they are not the same, no update or delete is done.

4. The record is updated or deleted. When a search field or a sort field is changed with the Modify command, the record is deleted and added again.

5. The dataset is unlocked.

The Change command locks the entire database while all key values are being changed. In all cases, the DBLOCK is done unconditionally. This means that Dbedit always waits for other locks to be released (possibly holding up your terminal).

Decimal PointsIf you use Suprtool's Item command to specify implied decimal places for an item, Dbedit scales all input values according to the number of implied decimal places. When listing records, fields with implied decimal places are formatted with a decimal point. For example,

>item unit-cost,decimal,2 {two implied decimal pts.}>edit#add d-inventory:unit-cost SUPPLIER-NAME >STD Ribbons           PRODUCT-NO >2001001     UNIT-COST >10.50        

SUPPLIER-NO = 5051PRODUCT-NO = 50513001UNIT-COST = 10.50

Type ? to get a description of the field.

When Dbedit prompts for field values, you can type a question mark to obtain a description of the field. If the field has implied decimal places, the field description will include the number of decimal places (e.g., << .2 >> for two implied decimal points).

292 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 292: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Critical-Item UpdateLike IMAGE on MPE, Eloquence has the critical-item update feature. This feature allows programs to change critical fields in detail datasets (search fields and sort fields) by using DBUPDATE. Prior to critical-item update, programs had to use DBDELETE and DBPUT to change critical fields.

By default, Eloquence databases have critical-item update disabled. It is enabled using the the dbutil program. Enabling critical-item update allows Dbedit's Change command and Modify;Updatekey to execute much faster. There are two choices in DBUTIL for enabling critical-item update:

1. Set CIUPDATE = On.

2. Set CIUPDATE = Allow.

The first option turns on critical-item update for all programs. The second option allows user programs (like Dbedit) to enable critical-item update as needed. The second option is the safest, since some programs depend on IMAGE/Eloquence giving an error when they attempt to change a critical field.

Suprtool 5.2 for HP-UX User Manual Welcome to Dbedit · 293

Page 293: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Dbedit Commands

General NotesWhen you run Dbedit, it prompts for commands on Stdlist with a "#" character and reads command lines from Stdin. Dbedit commands have a command name followed by one or more parameters separated by semicolons, colons, and commas. Semicolons are NOT used to combine several commands on the same line as in Suprtool.

This chapter describes the Dbedit commands in detail. The commands are presented in alphabetical order. Each command name is followed by the minimal abbreviation for the command, in brackets. For example: [F] for File and [FO] for Form.

AbbreviatingYou may shorten command names to any substring that uniquely defines the command. For example, Add can be shortened to AD or A, since there are no other commands that start with "A". Form, however, can be abbreviated only to FO, since there is a File command, abbreviated F, in Dbedit.

>base store.pub,5>edit#l m-customer;all {list}#e {exit}

Uppercase or LowercaseYou may enter letters in either uppercase or lowercase, because Dbedit upshifts everything in the command line. These two commands are identical:

#LIST M-CUSTOMER#list m-customer

ContinuationThe maximum physical command line is 256 characters. You may enter commands on multiple input lines by putting an "&" continuation character at the end of the line. The maximum total command length is 256 characters. Multiple commands cannot be placed on one input line.

294 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 294: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

The separating semicolon, colon, or comma in commands is REQUIRED, not optional.

:run suprtool.pub.robelle>base store.pub,5 {open the database in Suprtool}>edit {enter Dbedit}#list m-customer {use all of the defaults}#list m-customer;all {list all records in m-customer}#exit {return to Suprtool}

Control-YIf you press Control-Y during an operation, Dbedit responds by printing a blank line and stopping the current operation. Please note that on HP-UX the "Control-Y" or Interrupt character may be defined as Control-C

Comments on Command LinesComments may appear at the end of any command line, when they are surrounded by braces. Many of the examples in this manual show comments at the end of each command line. You can enter a comment as the only item in a Dbedit command line. You can also enter comments after field values.

# { List all related records for a specific supplier. }#list m-supplier;related {Must include Related keyword}

SUPPLIER-NAME >STD Ribbons {supplier to search for}

If you want to include a brace as part of an x-type field, you must precede the brace with the Dbedit escape character "[". For example, to search for the supplier "{STD Ribbons}", you would use:

#list m-supplier {include braces in the name} SUPPLIER-NAME >[{STD Ribbons}

OS CommandsDbedit interprets any command line beginning with a colon (:) as an OS (HP-UX) command. For example:

#:comment Modify M-CUSTOMER records#modify m-customer#exit

CalculatorAny command line beginning with an equal sign (=) is treated as a calculator expression. You may use this feature to compute data entry values without the need of an electronic calculator.

Suprtool 5.2 for HP-UX User Manual Dbedit Commands · 295

Page 295: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

=2745*1.33Result= 3650.85

Example DatabaseThe examples in this manual use the revised STORE database described in the IMAGE/3000 Handbook.

Prompting for Search CriteriaIn the Change, Delete, List and Modify commands, Dbedit first prompts you for search criteria and then processes the records you have selected. Search criteria are any or all of the search and sort fields of the file. Dbedit asks for the value of the primary search field first, unless you override the prompt ordering with the KEY option. For detail datasets, it then asks for match values for the other search fields and sort fields. You may press the Return key to any of these prompts to indicate that you don't care what values these fields have.

When Dbedit finishes processing the records you select, it recycles and prompts you for the next set of search criteria. You may press the Return key at this point to exit from the command and return to the # prompt.

Command ParametersThe major commands (File, List, Add, Delete, Modify, and Change) have a similar parameter structure, consisting of the command name, then an optional file part and an optional option part. A space separates the file part from the command name, and a semicolon separates the option part from the file part. The general format of these commands is

#command [file] [;options]

File ParameterThe file parameter consists of dataset name followed by an optional list of field names. If the file part is missing, Dbedit uses the previous file. The general format of the file parameter is

#command [file] [:fieldname,...]

Even when you use field names, Dbedit will add the search fields to the field list. In the Add command, Dbedit assumes default values for noncritical fields that are missing, but will prompt for the search fields and sort fields (they are required).

#add d-inventory:bin-no {assume defaults for all but BIN-NO} SUPPLIER-NAME >STD Ribbons           PRODUCT-NO >105391       BIN-NO >10    

In this case you will not be prompted for LAST-SHIP-DATE, ON-HAND-QTY, or UNIT-COST.

296 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 296: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

In the Modify command, you can specify a set of fields to modify. Dbedit will not prompt you for new values for any other fields. For example:

#mod d-inventory:unit-cost {only modify UNIT-COST} SUPPLIER-NAME >STD Ribbons           {prompt for search value} PRODUCT-NO >105391       {prompt for another one}

Enter new values (or <return> to leave as is): SUPPLIER-NAME >STD Ribbons {prints the search value} PRODUCT-NO >105391 {prints the other one} UNIT-COST >500 {prints existing value}                 {prompts for new value}

In this case you will not be prompted for BIN-NO, ON-HAND-QTY, or LAST-SHIP-DATE.

When working on a single dataset, it is only necessary to specify the dataset name in the first command. For example:

#list d-inventory SUPPLIER-NAME >STD Ribbons          

#list {use the previous file parameter}

SUPPLIER-NAME >//                            

Option ParameterThe file parameter and the options must be separated by a semicolon.

#command [file] [;option...]

The available options are:

numeric-value, All, Key, Limit, Related, UNder, UPdatekey

These options qualify the operation of the File, List, Modify, Change, Delete, and Add commands. Some options only apply to one command. Options can be combined and can be abbreviated. When more than one option is specified, each option must be separated by a semicolon.

#list d-inventory;key=product-no;under PRODUCT-NO >                 

Numeric-Value OptionCommands normally cycle, prompting for new search values or new entries, until you press Return or Control-Y. However, if you specify a numeric-value after the semicolon, the command only prompts you numeric-value number of times. For example, if you only want to do one List function, you would enter:

#list d-inventory;1 {only prompt for SUPPLIER-NAME once}

All OptionThe All option works only with the List, Modify, or Delete commands. When All is specified, every record in the specified file is processed sequentially. You can stop the scan by pressing Control-Y.

Suprtool 5.2 for HP-UX User Manual Dbedit Commands · 297

Page 297: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Key OptionThe Key option overrides the primary search field. Dbedit prompts for the primary search field first. Often, this is not the value that you know. You can use the Key option to force Dbedit to prompt you for another search field. For example:

#list d-inventory {use defaults} SUPPLIER-NAME >STD Ribbons PRODUCT-NO >                 

#list d-inventory;key=product-no {use PRODUCT-NO}

PRODUCT-NO >105391       SUPPLIER-NAME >                               

Limit OptionThe Limit option controls the number of entries allowed per key value. This option is only useful for the Add command. Dbedit limits the number of entries for the first field in the field list to the Limit value specified. For example,

#add d-inventory;limit=2 {two records per supplier}#add d-inventory;limit=2;key=product-no {two records per product}

Related OptionThe Related option is for finding or deleting related records. It applies only to Delete and List. If you use Related when Listing an entry in a master dataset, Dbedit prints the specified master entry and then prints all detail entries with the same search value in all datasets that are linked to the master dataset by an explicit path. If you use List Related with a detail dataset, Dbedit prints the specified detail entry, followed by the master entry for each search field in the detail.

You can only Delete Related from a master dataset. Dbedit shows the master entry. After confirming the deletion, Dbedit deletes all entries with the same search value in all related datasets. Control-Y can be used to interrupt the deletion process.

Dbedit can only use explicitly defined paths to navigate between datasets. User-defined paths are not supported in Dbedit. When listing related records, Dbedit shows all fields in each dataset including those that Dbedit normally doesn't support (e.g., X100). The following example shows how related records are listed, starting with a master dataset and then its related detail datasets.

298 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 298: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

#list m-supplier;related {all related records} SUPPLIER-NAME >STD Ribbons

The M-SUPPLIER record is listed here.

D-INVENTORY records with a SUPPLIER-NAME of STD Ribbons are listed here.

Under OptionWhen Dbedit prompts for a value for a field, it prints a series of underlines. These underlines indicate the maximum field width.

These underlines can be useful, but they may not work on all terminals. You can disable underlining by using Set Underline Off. Once underlining is turned off, you may wish to enable it again, but only for one command. The Under option overrides the Set Underline, but only for the current command.

Updatekey OptionThe Updatekey option allows the Modify command to change the value of search and sort fields (i.e., critical fields). Normally, Modify does not allow any changes to the search or sort fields. Without the Updatekey option, Modify does a DBUPDATE of the modified record. If CIUPDATE is Disallowed when you specify Updatekey and change a critical field, Modify will DBDELETE the existing record, then DBPUT a new record with the changed values. If CIUPDATE is On or Allowed in the database, Modify can use DBUPDATE to change the critical fields. This is much faster than using DBDELETE and DBPUT.

SubcommandsYou may enter a subcommand any time Dbedit prompts for the value of a field. The available subcommands are:Subcommand Purpose// stops the current command immediately.\\ same as // (you may also use the Control-Y (Interrupt key).? describes the current field, including any implied decimal points.< goes back one field to the previous field in the list.<3 goes back three fields.<< returns to the first field in the list.> goes forward one field to the next field in the list.>3 goes forward three fields.>> skips the rest of the fields in the list. This is especially useful when

Dbedit is prompting you for multiple search and sort fields and you only want to enter the first.

' uses blanks for the field (useful in batch).* uses the last value for this field.[ forces what follows the [ to be a value and not a subcommand (e.g.,

[*BOB tells Dbedit to use *BOB as the actual value instead of interpreting the * to mean "last value").

Suprtool 5.2 for HP-UX User Manual Dbedit Commands · 299

Page 299: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

@F search for the field F (e.g., @bin-no). The field can include a subscript (e.g., @street-address(2)).

= calculator.

Examples#list m-supplier {we'll stop immediately} SUPPLIER-NAME >//                            

#list m-supplier {we will start again}

SUPPLIER-NAME >Standard Type       PRODUCT-NO ><                 {re-enter supplier-name}

SUPPLIER-NAME >STD Ribbons           PRODUCT-NO >>>               {skips the rest}

#list m-supplier

SUPPLIER-NAME >STD Ribbons           PRODUCT-NO >[>575         {">575" is the part-no}

#modify d-inventory

SUPPLIER-NAME >STD Ribbons           PRODUCT-NO >105391       BIN-NO >@unit-cost {skip to unit-cost} UNIT-COST >                 

#modify m-customer

CUST-ACCOUNT >4003302   CITY >@street-address(2) {go to subfield}STREET-ADDRESS(2) >                                                 

300 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 300: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Add Command [A]Adds new entries to a dataset.

ADD [file] [;options]

Options: numeric-value|Key|Limit|UNder

If no field list is entered as part of the file, Dbedit will prompt for all of the fields in the file. You may use the ">n" or ">>" subcommands to navigate quickly through the field list, but you must enter values for all search and sort fields.

The database password must give you write access to the entire dataset. The Add command will stop after LIMIT= number of entries have been added for any one key value. Dbedit checks each search field value as it is entered. For master datasets the search field value must not exist. For detail datasets the search field value must exist. To add records from a disc file, see the Put command of Suprtool.

Suprtool 5.2 for HP-UX User Manual Dbedit Commands · 301

Page 301: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Before Command [B]Repeat any combination of the previous 1000 command lines, with or without editing.

BEFORE [ start [ / stop ] ]

[ string ]

[ ALL | @ ]

(Default: redo previous line)

(BQ=redo without change)

The Before command allows you to modify the commands before it executes them. If you don't need to change them, use BQ or Do.

The Before command uses Qedit-style Control characters for modifying the commands. The default mode is to replace characters. To delete use Control-D, and to insert use Control-B. If you prefer HP-style modify (D, R, I, and U), use the Redo command instead of Before.

Examples#listf @.soruce {'source' is not spelled right}NON-EXISTENT GROUP. (CIERR 908)#Before {redo most recent command}listf @.soruce {last command is printed} our {you enter changes to it}listf @.source {the edited command is shown} {you press <return> }

#listredo -10/#before 5 {redo 5th command in stack}#bef 8/10 {redo 8th through 10th}#b listf {redo last Listf command}#b @temp {redo last containing "temp"}#before -2 {redo command before previous}#before -5/-2 {redo by relative lines}

Modify OperatorsIf you wish to change any characters within the line, the modify operators are the regular Control Codes used in Qedit:

· Any printing characters replace the ones above.

· Control-D plus spaces deletes columns above.

· Control-B puts you into "insert before" mode.

· Control-A starts appending characters at the end of line.

· Control-A, Control-D, plus spaces, deletes from the end.

· Control-T ends Insert Mode, allowing movement to a new column.

· Control-G recovers the original line.

302 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 302: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

· Control-O specifies "overwrite" mode (needed for spaces).

Suprtool 5.2 for HP-UX User Manual Dbedit Commands · 303

Page 303: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Change Command [C]Changes all uses of a specific search field value in all detail datasets related to a master. This command only applies to master datasets.

CHANGE [file] [;options]

Options: numeric-value|Key|Limit|UNder

This command changes the search field value in all related detail datasets. Dbedit can only change values in detail datasets where there is an explicit IMAGE path. It is up to the user to change any user-defined paths.

Once this command has started making changes to the database, it cannot be stopped. Entering Control-Y during the change will have no effect. Dbedit locks the entire database while all changes are taking place. The database password must give you write access to all related datasets that must be changed.

If CIUPDATE is On or Allowed in the database, the Change command executes much faster.

Example#change m-supplierChange Key Value for File: M-SUPPLIER

Enter Existing Key Value to Find: SUPPLIER-NAME >Standard RibbonsEnter New Key Value to Replace with: SUPPLIER-NAME >STD Ribbons          

SUPPLIER-NAME = Standard RibbonsCITY = San Leandro STATE-CODE = CASTREET-ADDRESS = 100 Main St. (2)ZIP-CODE = 94345

OK to change this entry [no]: y Begin changes (be patient) .. .. end changes!!

304 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 304: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Delete Command [D]Removes entries from a dataset.

DELETE [file] [;options]

Options: numeric-value|All|Key|Limit|Related|UNder

If you are deleting entries from a master dataset, all entries from related detail datasets must be removed first. Before any record will actually be deleted, Delete prints the record and asks you whether it is okay to delete it; the default answer is NO.

The field list of the file specifies which fields to list before prompting for verification of the deletion. The ALL option allows you to review all entries in a detail dataset and remove some or all of them. The database password must give you write access to the entire dataset. ALL does not work on master datasets; use the Suprtool >Delete command instead.

You can delete records related to a master dataset, but not the other way around. Dbedit does not print the detail records that are deleted. Use the List command with the RELATED option before doing the deletion.

Suprtool 5.2 for HP-UX User Manual Dbedit Commands · 305

Page 305: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Do Command [DO]The Do command will repeat (without changes) any of the previous 1000 commands.

DO [ start [ / stop ] ]

[ string ]

[ ALL | @ ]

(Default: repeat the previous command)

Commands are numbered sequentially from 1 as entered and the last 1000 of them are retained. Use the :Listredo command to display the previous commands. You can repeat a single command (do 5), a range of commands (do 5/10) or the most recent command whose name matches a string (do list). If you want to modify the commands before executing them, use Redo or Before.

Examples#listredo#do {do previous command again}#do 39 {do command line 39 again}#do 5/8 {do command lines 5 to 8 again}#do list {do most recent List command}#do show {do last starting with "show"}#do showjob job {do last "showjob job" command}#do @job {do last containing "job"}#do -2 {do command before previous}#do -7/-5 {do by relative line number}#do 5/ {do command lines 5 to "last"}

NotesThe Do command cannot be abbreviated.

306 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 306: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Exit Command [E]Leaves Dbedit and returns control to Suprtool.

EXIT

Suprtool 5.2 for HP-UX User Manual Dbedit Commands · 307

Page 307: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

File Command [F]Establishes the current file, field list, and search field.

FILE [file] [;options]

Options: numeric-value|All|Key|Limit|Related|UNder|UPdatekey

If Set Reset is Off, you can use the File command to specify the KEY= for the specified file. For example:

#set reset off#file d-inventory;key=product-no

will cause all subsequent commands to prompt for the PRODUCT-NO before the SUPPLIER-NAME. Specifying a new file or options parameter in the Add, Change, Delete, List, or Modify commands overrides and replaces the current file and option values.

308 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 308: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Form Command [FO]The Form command displays a description of the items and datasets in a database.

FORM [ SETS | ITEMS | PATHS

dataset | data-item | filename ]

(Default: fields in current dataset)

If you request information about a specific detail dataset, Suprtool will print the path information in DBSCHEMA format. The path shows the related master dataset and the sort item-name. The capacity is also shown in DBSCHEMA format. The blocking factor appears after the capacity in parentheses. When showing the form of a dataset, Dbedit shows the byte offset of each field after the subcount, type, and sublength. The first field always appears at offset one. If you have specified a date format or the number of implied decimal points with the Item command, these attributes will appear as part of the form listing.

Example>base store,5>item last-ship-date,date ,yymmdd>item unit-cost ,decimal,2>edit {enter Dbedit}#form d-inventoryD-INVENTORY Detail Entry: BIN-NO J1 1 LAST-SHIP-DATE J2 3 <<YYMMDD>> ON-HAND-QTY J2 7 PRODUCT-NO Z8 11 (M-PRODUCT) SUPPLIER-NAME X16 19 (!M-SUPPLIER) UNIT-COST P8 35 << .2 >>Capacity: 112 Entries: 3 Entry Length: 19 Blocking: 14

Form KeywordsThe Form command shows Items, Paths, and Sets before searching for a dataset or file with these names. Use a string (e.g., "sets") to display the form of a dataset or file that matches one of the Form keywords.

>form "paths"

Suprtool 5.2 for HP-UX User Manual Dbedit Commands · 309

Page 309: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Help Command [H]Show what commands and options are available in Dbedit.

HELP [ command | keyword [ ,option ] ]

(Default: browse through the entire help file)

Command HelpIf you specify any parameters, Help first assumes that you want help on a specific Dbedit command. If you know the structure of the help file, you can specify one of the keywords under the command name.

#help list {Help on the List command}#help list,notes {notes section of the List command}

Keyword HelpIf no help is found in the Commands section of the help file, we assume you specified one of the outer-level keywords. To see this list of keywords, type help with no parameters. You'll see a short introduction to Dbedit before the list. Specify any of the keywords, or a subkeyword, on the Help command.

#help intro {introduction section}

Quick Help - HQHQ asks Dbedit to look under the keyword QUICK in the help file. QUICK contains the text from the Dbedit Quick Reference Guide, offering the experienced user a quick review of the syntax of any command.

#hq add {quick description of Add}#hq commands {quick list of command names}

NotesIf no parameters are specified, Help allows you to browse through the "help" file. The Help command uses the QHELP subsystem to enable you to move through the file Dbedit.Help.Robelle, which contains most of the User Manual. For "help in help", type "?" when you see the QHELP prompt character ("?"). The help file is organized into levels. To go back to the previous level, press Return instead of a key name. If you press F8, you will exit the QHELP subsystem and return to Dbedit.

310 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 310: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

List Command [L]Displays entries from a dataset.

LIST [file] [;options]

Options: numeric-value|All|Key|Limit|Related|UNder

The field list of the file parameter specifies which fields of the entry to print (default of course is all of them). Search field values are not listed, unless they are included in the field list. The ALL option lists all records in the specified file. The RELATED option prints related records from other datasets as well as the records you select. The Suprtool >List command also displays selected records, with the option of dumping totally in Octal/Char format. Use >List when you suspect that a dataset contains bad data, or to select from a large dataset (>List is faster than #List).

#list m-customerList in File: M-CUSTOMER

CUST-ACCOUNT >4003302  

CITY = Los Altos CREDIT-RATING = 100000CUST-ACCOUNT = 4003302 CUST-STATUS = 20NAME-FIRST = Ralph NAME-LAST = PerkinsSTATE-CODE = CASTREET-ADDRESS = Room 655 (2) Century Plaza BuildingZIP-CODE = 93002

#list m-supplier;related {all related records}List in File: M-SUPPLIER

SUPPLIER-NAME >Standard Ribbons

CITY = San Leandro STATE-CODE = CASTREET-ADDRESS = 100 Main St. (2)SUPPLIER-NAME = Standard RibbonsZIP-CODE = 94345

Related Records from the File : D-INVENTORY Key to path: SUPPLIER-NAMEBIN-NO = 1201 LAST-SHIP-DATE = 840501ON-HAND-QTY = 296 PRODUCT-NO = 105391 SUPPLIER-NAME = Standard RibbonsUNIT-COST = 500

Suprtool 5.2 for HP-UX User Manual Dbedit Commands · 311

Page 311: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Listredo Command [LISTREDO]The Listredo command will display any of the previous 1000 commands.

LISTREDO [ start [ / stop ] ] [;ABS] [;OUT=file]

[ string ] [;REL]

[ ALL | @ ] [;UNN]

(Default: display previous 20 commands)

(BJ and ,, are short for LISTREDO)

Commands are numbered sequentially from 1 as entered and the last 1000 are retained. You can display a single command, a range of commands, all 1000, or all the commands whose name matches the string. You can print the commands with ABSolute line numbers (the default), RELative line numbers (-5/-4), or UNNumbered. You can write the commands to your terminal or OUT to a temporary file. If you want to redo any of these commands, see Do, Redo, and Before.

Examples#listredo 5#listredo 5/10#listredo help {print all Help commands}#listredo -10 {print last ten commands}#listredo ALL {print entire redo stack}#listredo purge {print all Purge commands}#listredo purge xx {print all "purge xx" commands}#listredo @purge {print all with "purge" anywhere}#listredo @;rel {print ALL, relative numbers}#listredo 1/10;out=*lp {dump commands to printer}#listredo @;unn;out=save {write commands to a file}

NotesThe Listredo command cannot be abbreviated, but BJ is accepted as a short form.

312 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 312: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Modify Command [M]Changes the values of any or all fields in a dataset entry.

MODIFY [file] [;options]

Options: numeric-value|All|Key|Limit|UNder|UPdatekey

The field list of the file parameter specifies which fields to modify. When the UPDATEKEY option is specified, search and sort field values may be changed.

The existing value of each field is printed before a new value is accepted. Entering a carriage return preserves the old value. If a new value is entered, it replaces the old value. The ALL option allows you to review and modify all of the entries in a dataset in serial order.

If CIUPDATE is On or Allowed in the database, the UPDATEKEY option executes much faster.

#modify m-customer:credit-ratingModify in File: M-CUSTOMER

CUST-ACCOUNT >4003302  

Enter new values (or <return> to leave as is):

CUST-ACCOUNT =4003302 CREDIT-RATING =1000.00 2500.00             CUST-ACCOUNT = 4003302 CREDIT-RATING = 2500.00

Suprtool 5.2 for HP-UX User Manual Dbedit Commands · 313

Page 313: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Q Command [Q]Prints a message on $stdlist.

Q [ string ]

(Default: print a blank line)

The string of up to 80 characters is printed on $stdlist. The string should not be enclosed in quotes unless you want the message printed in quotes.

You can use Q to include instructions in usefiles. Use :COMMENT in usefiles for a nonprinting comment line.

314 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 314: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Redo Command [REDO]Enables you to modify and repeat any of the previous 1000 command lines.

REDO [ start [ / stop ] ]

[ string ]

[ ALL | @ ]

(Default: redo the previous command)

The Redo command allows you to modify the commands before it executes them. If you don't need to change them, use the Do command. Commands are numbered sequentially from 1 as entered and the last 1000 are retained. Use the :Listredo command to display the previous commands. You can redo a single command, a range of commands, or the most recent command whose name matches a string. The Redo command cannot be abbreviated.

The Redo command uses MPE-style editing logic (D, I, R, U and >). The default mode is to replace characters. To delete, type DDDD under the characters to be removed. To insert, type I under the insertion spot, then the new characters. To undo your changes, type U. To append to the end of the line, use >xxx. To delete from the end of the line, use >DD. To replace at the end of the line, use >Rxxx. And to erase the rest of the line, use D>. If you prefer Qedit-style editing (Control-D, etc.), use the Before command instead of the Redo command.

Examples#listf @.soruce {"source" is not spelled correctly}NON-EXISTENT GROUP. (CIERR 908)#redo {redo most recent command}listf @.soruce {last command is printed} our {you enter changes to it}listf @.source {edited command is shown} {you press <return> }

#listredo all#redo 5 {redo 5th command in stack}#redo {redo previous command}#redo -2 {redo command before previous}#redo 8/10 {redo 8th through 10th}#redo -10/ {redo -10 through last}#redo purge {redo last Purge command}#redo @temp {redo last containing "temp"}

Suprtool 5.2 for HP-UX User Manual Dbedit Commands · 315

Page 315: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Set Command [S]Changes certain operating options within Dbedit. Except for LP, these options are saved when you return to Suprtool and restored if you enter Dbedit again.

SET [LP ON|OFF ]

[PROMPT character ]

[QUIET ON|OFF ]

[RESET ON|OFF ]

[UNDERLINE ON|OFF ]

[VERIFY ON|OFF ]

LPSET LP ON|OFF

(Initially: OFF)

All output from the List command is normally sent to $stdlist. When you turn Set LP to On, Dbedit opens the file Suprlist which defaults to the line printer. Turning Set LP Off closes the SUPRLIST file and releases it to the spooler. Dbedit automatically closes the Suprlist file when you return to Suprtool.

PromptSET PROMPT char

(Initially: #)

Prompt tells Dbedit to use a different character for prompting. Any special character can be used as the prompt character. For example:

>edit#set prompt %%list m-customer

QuietSET QUIET ON|OFF

(Initially: OFF)

Turning this option On causes Dbedit to reduce the number of helpful messages that are printed and to shorten other messages.

ResetSET RESET ON|OFF

(Initially: ON)

When you use the File, List, Modify, Change, or Delete commands you may override the default order that Dbedit uses to prompt for search

316 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 316: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

fields (using the KEY= option). With Reset On, Dbedit always resets the KEY= option to the default. With Reset Off, Dbedit will continue to use the new order of search fields.

UnderlineSET UNDERLINE ON|OFF

(Initially: ON)

When Dbedit prompts for field values, it prints a series of underlines to show the field width. Underline Off disables this feature. Users with slow printing terminals will find Dbedit faster with Underline Off. The Under option may be used to temporarily enable underlining for a single command.

VerifySET VERIFY ON|OFF

(Initially: ON)

When you are adding new records to a dataset, Dbedit lists the contents of new records after you have entered all of the field values. Turning Verify Off causes Dbedit to stop listing new records after they are added.

Suprtool 5.2 for HP-UX User Manual Dbedit Commands · 317

Page 317: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Use Command [U]Specifies a file of commands to be executed as a group.

USE[Q] filename

ExamplesA usefile makes your task easier by allowing common commands to be specified once in an external file. Usefiles can also be set up for data entry functions such as adding a new customer into the database (e.g., add one master entry, add one billto entry, add multiple shipto entries, and then list the master entry plus RELATED details). For example, here is a usefile that uses the File command to define a dataset:

file d-inventory;key=product-no;5 {key and limit}q You may use the List, Modify, or Deleteq commands to modify inventory records. Youq are restricted to at most five inventoryq records per product number.

Use the file inside Dbedit:

>base store>edit {enter Dbedit}#useq dinvent.use {specify commands from the usefile}You may use the List, Modify, or Deletecommands to modify inventory records. Youare restricted to at most five inventoryrecords per product number.# {Dbedit prompts for commands}

Quiet ExecutionBy default, Dbedit displays the commands in the usefile as they are executed. Dbedit can execute commands quietly using the Useq command:

#useq store.use {no commands are listed}

NotesUsefiles cannot be nested in Dbedit. The usefile may be an EDITOR /KEEP file,UNN or a Qedit workfile, but no more than 256 characters per record will be processed. For compatibility with Qedit, Useq can be abbreviated to UQ.

318 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 318: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Verify Command [V]Displays the current status of Dbedit conditions.

VERIFY [ ALL | @ ]

[ BASE ]

[ DSET ]

[ SET ]

[ CIUPDATE ]

(Default: BASE, DSET, CIUPDATE, changed SET values)

Only one item can be verified at a time. The format of the Verify output is organized into columns. Verify with no parameters prints the database, the current dataset, and whether critical-item update is enabled or disabled. It also prints those Set options which are not currently at their default setting.

Examples#verify dset {current dataset}#verify all {print the status of everything}

Suprtool 5.2 for HP-UX User Manual Dbedit Commands · 319

Page 319: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Welcome to Suprlink

Welcome to SuprlinkWelcome to Suprlink for HP-UX Version 5.2. Suprlink is a program that works with Suprtool to add "multifile" capability to Suprtool. Rather than take the regular path to multiple datasets -- random retrieval via IMAGE keys -- with its well-known performance problems, we have chosen to follow a different path: fast serial extracts plus a very efficient merge.

Summary of the Suprlink commands:Before Input Redo XeqDo Join Reset =expressionExit Link Set :OS CommandForm LISTREDO UseHelp Output Verify

The minimum abbreviation of each command is shown in capital letters.

Terminology and HP-UXMany of the terms and examples in this manual use terminology specific to MPE and IMAGE/SQL databases. We have edited the Suprlink/UX manual to be more generic in this regard, however, some references remain for clarity.

NotationThe Suprlink documentation uses a common notation in describing all commands. Here is a sample command definition:

Link filename [BY link-keys [FROM input-keys]] [OPTIONAL]

1. UPPERCASE LETTERS are required elements in the command, and must be typed exactly as they appear.Example: BY

2. Highlighted lowercase letters, underlined or italic, are "variables" to be filled in by the user. In the help file,

320 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 320: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

underlining and italics are not available and variables will appear simply in lowercase.Example: filename.

3. [] - Brackets enclose optional fields.Example: [FROM input keys]

4. {} - Braces enclose comments in examples. Braces are allowed for comments in actual Suprlink commands.Example: +output repts temp {produces job-temporary Output}

5. | - Up lines separate alternatives from which you will select. Sometimes, the alternatives are shown listed on several lines.Example: [TEMP | ERASE]

6. In examples, there is an implied carriage return at the end of each line.

Installing SuprlinkSuprlink is installed as part of the Suprtool installation process. See the "Installing Suprtool" chapter of the Suprtool User Manual for more details of how to install both Suprtool and Suprlink.

Hardcoded File Names and ROBELLE VariableSome file names are hardcoded into Suprlink. This section describes the hardcoded file names that Suprlink/UX may need. Suprlink will normally look for files in the /opt/robelle directory unless you set the ROBELLE variable.

ROBELLE VariableNormally Suprlink looks files in the /opt/robelle directory. If you move Suprlink you must set the ROBELLE variable. For example, if you move Suprlink to the /users/robelle directory you must set ROBELLE variable in the following manner:

export ROBELLE="/users/robelle"

Suprtool 5.2 for HP-UX User Manual Welcome to Suprlink · 321

Page 321: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Accessing Suprlink

How To Run SuprlinkTo access Suprlink, type the following command:

/opt/robelle/bin/suprlinkSUPRLINK/Copyright Robelle Solutions Technology Inc. 1988-2002(Version 4.8)+

After a short pause, Suprlink will take over your terminal and print out some identifying information. You will notice that your command prompt has changed to "+", telling you that you have made it into Suprlink. Suprlink expects you to type command lines, ending each one with Return.

How to Xeq a Suprlink TaskNormally, you enter a series of commands. These commands specify the Input file, the Output file, and the Link file name(s). Finally, you enter an Xeq or an Exit command. This begins the actual Suprlink linkage task.

If you entered the Exit command, Suprlink will finish the current task, then return you to the Operating system.

+EXIT$

If you entered the Xeq command, Suprlink will finish the current task, then prompt you for another task. This continues until you enter the Exit command. If you wish to terminate Suprlink immediately (perhaps you are confused), enter Exit Abort. This will terminate the Suprlink program immediately, without attempting any task.

Suprtool Link CommandThis command is not currently available in the HP-UX version.

Exit with VerifyThis feature is not yet available in the HP-UX version.

Suprtool 5.2 for HP-UX User Manual Accessing Suprlink · 323

Page 322: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Using Suprlink in BatchYou normally run Suprlink as an on-line session. You type Suprlink commands on your terminal and Suprlink prints responses on your terminal. If you redirect stdin or stdlist, Suprlink assumes that it is in batch.

Suprlink in batch is almost identical to Suprlink on-line, except for answering questions. When Suprlink asks a question in batch, no one is there to answer it. Therefore, Suprlink does not expect an answer from stdin. Suprlink assumes that you want your batch task to complete, so it always selects the option that will complete the command successfully. This is normally a "YES" answer, as in "yes, purge the file". Suprlink prints the question on stdlist, as well as the answer that it has selected for you.

Command Line OptionsSuprlink currently allows certain features to be invoked when run from the command line.

Default Outcount File Name: -ocIf you want to know how many records SuprLink has processed, use the -oc option. This option sets the file name for outcount to ".sloutcount". After a successful task, SuprLink writes the number of output records to the .sloutcount file. You can then use this file in shell scripts to check for specific record counts.

For example, suppose that you want to check for at least ten records from a Suprlink join. You would write a shell script in the following manner:

&#!/bin/sh &# suprlink -oc << !EOD +in orders +join ordhist +out ordcomb exit !EOD if [ `cat .sloutcount` -ge 10 ]; then echo "More than 10 records found" fi

Variable Substitution -vA second command line option allows you to turn on variable substitution. Due to how environment variables and processes on HP_UX interact, the variable must be set prior to running Suprlink.

suprlink -v << !EOD +in $myvariable +join ordhist +out ordcomb exit !EOD

324 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 323: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Introduction to Suprlink

How Report Programs WorkThe best way to understand Suprlink is to examine the process of writing a report. Your report program will be written in COBOL, RPG, PowerHouse, or some other language. Imagine that instead of hunting all over the database to collect your data, you just read a sorted disc file with a big record containing all the data on a given entity. For example, a sales report might read a disc file whose records consist of sales transactions plus customer information. This file has been sorted by customer number and date. If there are several sales for the same customer, the customer information is just repeated in each record. The report program reads the records, checks for level breaks, and formats and prints the records. Suprlink fits into this model of report programs.

Working from the database to the final flat file, how do we use Suprtool and Suprlink to produce the desired result? Obviously, Suprtool can extract the desired fields from the desired records from the customer table and put them in a disc file. And Suprtool can extract the desired fields from the customer master dataset and write them to a second disc file. What does Suprlink do?

If Suprtool sorts both files by customer, Suprlink can "link" them together, producing a third file whose composite record consists of the related fields from both files. This file is just what we need to feed into the report program.

Input FilesOnly one file can have repeated records that pass through to the final file. This file is called the primary Input file. If any of the Link files contain duplicate records, Suprlink will select one of them to link to the primary record(s). The Suprlink Output file will have no more records than the Input file.

The Input file and Link files are created with the Output xxx,Link option in Suprtool. These files must be sorted by the same key field in ascending order.

Link FilesYou can have up to seven Link files that are combined with the Input file. Suprlink merges the Input file and Link files by comparing the key fields of both files (you can optionally specify a secondary-key). The default is for Suprlink to exclude any Input records that do not have a matching record in all Link files. Specifying the Optional keyword on the Link command will force Suprlink to fill the Output record

Suprtool 5.2 for HP-UX User Manual Introduction to Suprlink · 325

Page 324: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

with default values (spaces and zeros) when it doesn't find a match in a specific Link file. If you want to link the sales transaction to both the customer master and the salesman master, it's probably faster to use traditional methods.

Output FilesThe Output file will be a self-describing file, containing data extracted from the Input file and the Link files. Suprlink combines the Input and Link records together in a fixed way, dropping the duplicated key fields and appending the remaining fields of each file in the order specified. You control which fields occur by using the Extract command in Suprtool, but you have no control over their order. Use the Form command to print out the final record format so that you can prepare COBOL COPYLIB or PowerHouse QSCHEMA definitions.

Sort KeysThe Input file and Link files must be sorted by the same key field. Their names do not have to be identical, but they must be the same type and have the same length. Suprlink does not support real- or long-type keys.

Selection LogicSelection logic can be tricky, since it is distributed over independent Suprtool extract tasks, the Suprlink merge phase, and the final report program.

Suprtool Selection. You can use the If command to select which records you want from each SQL table. What you cannot do in Suprtool is check a field in a related SQL table. You do have the option to select key values from one dataset, then load them into a Table and use $lookup to select related entries in another dataset. It makes sense to use If on every SQL table, since you have another selection possibility when the files are linked. For example, you might select all customers in California and all invoices with an amount greater than $2000.

Suprlink Selection. The Input file limits the scope of the Output file. You cannot have more Output records than you do Input records, but you can have fewer. When you do a Link to another file, you have an implied selection criterion. That is, if Suprlink cannot find a record in the Link file with matching key value(s), the Input record is dropped from the Output file. If you have seven Link files, the Input record must match all seven or be dropped. This is the default selection logic. You can override this for any specific Link file by specifying the OPTIONAL keyword on the Link command. Only do this is you don't care whether that data exists or not, since Suprlink will supply default values for those Link fields.

A Link ExampleYou want to produce a report of all invoices over $2,000.00 for customers in California. The customer information is in the m_customer table, and the invoice information is in the d_invoice table. Here are the steps to produce this report:

1. Select and sort the California customers into the file customer.

2. Select and sort invoices over $2,000 into the file invoice.

326 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 325: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

3. Because there will often be more than one invoice per customer, specify the invoice file as input to Suprlink.

4. Link in the customer file.

5. Produce your report from the combined records in the output file.

>open oracle demo reader {sales database}>select * from m_customer {select all customers...}>if state = "CA" {...in California}>sort custnum {sort and link key}>output customer,link {Link output option}>xeq

We now have a self-describing file with all the customers from California sorted by the customer number. Next we select all invoices over $2,000.00 and sort them into customer number sequence:

>select * from d_invoice {select all invoices...}>if amount>200000 {...over $2,000.00}>sort custnum {sort and link key again}>output invoices,link {remember the link option}>exit

If we specify the cust file as input, the Output file will only contain one invoice per customer. Because we want to produce a report of all the selected invoices, we specify it as the input file:

+input invoices {driving input file, custnum is the key}+link customer {combined with customers}+output invcust {produces the file we want}+exit

Each record of the invcust file will have both the invoice information and the customer information for each invoice of the Input file (i.e., one record per invoice). What happens if there is no customer record for a specific invoice? In this case, the invoice record does not appear in the Output file. To force Suprlink to include these records, use the optional keyword on the Link command:

+input invoices {sorted by custnum}+link customer optional {don't exclude invoices if...}+output invcust {the customer information...}+exit {...is missing}

A Join ExampleSuprlink can join files together that have multiple key records in each file, what has been come to be know as a many-to-many link. Suprlink has traditionally been able to link an Input file with many records with the same key to a Link file that has a single record with the same key value.

The Join command, will link two files with many key records in both the input file and the "Linking" file. The syntax of the Join command is exactly the same as the Link command so a sample task would look as follows:

+input ordhist +join orders +output custord

Suprtool 5.2 for HP-UX User Manual Introduction to Suprlink · 327

Page 326: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

+xeq

The above task will link multiple records of the file ordhist, to the multiple records of the file in orders. This assumes that the files are sorted by a common key. In SQL terms this is known as an Inner Join. An Outer Join, one where the keys do not necessarily have a match can be achieved by adding the optional keyword to the Join command:

+input ordhist +join orders optional +output joined +xeq

In SQL parlance, once again you can achieve both a Left Outer Join and Right Outer Join by reversing the order of the files, between the input and the join commands.

To give you an example of how the Join operation would work consider the following data. First we have an inventory file with multiple records for the same product-no. This data is stored in the file dinv:

50512001 {Rest of data} 50512001 {Rest of data} 50512003 {Rest of data}

The next file will have sales records, once again with multiple key values, this data is stored in the file dsales:

50512001 {Rest of data} 50512001 {Rest of data}

If you did the following task assuming both files are sorted by the product-no:

+in dinv +join dsales +out invsales +xeq

The resulting file would have four records, with the multiple matching dinv and dsales records. The record layout would have the dinv information first followed by the dsales information. If you add the optional keyword on the join command the resulting file would have 5 records. The matching 4 records from dinv and dsales as well as the dinv record that did not match with the numeric fields set to zero and the byte fields set to spaces.

Only one Join operation is allowed per task.

By default, Suprlink will join files base on the primary sorted key in the self-describing file. You can specify a secondary key for the files to be joined on in a similar manner to how the Link command did:

+in orders +join dsales by order-no product-no +out ordsales +xeq

Performance ConsiderationsSelect only the records you need, unless the time to load a table of desired key values, plus the time needed to do $lookup for each record, is longer than the time to extract and sort the entire dataset. Use the Sorted and Hold options of the Table command when loading a table. Because of the time needed to search a large table, it

328 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 327: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

is often faster to extract all of the records and let Suprlink skip over the ones it doesn't need.

This method does a lot of sorts. Sorting time can vary depending on system load and available memory, but it increases dramatically for large records and large datasets. You should try to use Suprtool's Extract command to reduce the record size, and consider using Suprtool's If command to reduce the number of records.

Suprlink needs enough disc space to invert a significant subset of your database, then link it into an Output file. Although all of the Suprlink files can be job temporary, you still need enough disc space for the original database, the final Output file, the primary Input file, and each of the Link files. One of the tradeoffs with this method is more disc space for faster elapsed time.

Another ExampleFrom the sales records, retrieve all of the sales for October, 2000 and append the customer name, salesman code, and year-to-date sales total to the sales record (these fields are located in the customer records).

$/opt/robelle/bin/suprtool>open oracle demo reader>sel * from sales_detail>extract custnum,saledate,saleamt,...>if saledate >= 20001001 and &> saledate <= 20001031>sort custnum>sort saledate>output sales,link {creates SD file}>xeq

>sel * from customer>extract custnum,name>extract salesman,ytdsales>sort customernum>output custs,link>exit

$/opt/robelle/bin/suprlink+input sales {link sales...}+link custs {...to custs...}+output repts {...producing REPTS!}+xeq {...run the task}+form repts {fields in repts}+exit

$myprog {run program}$rm sales {these files...}$rm custs {...no longer needed}$rm repts

Illegal DigitsWhenever Suprlink is processing files with packed- or zoned-decimal keys, errors can occur because of invalid digits in the keys. Suprlink reports the input and link record numbers with illegal digits and processing stops. You can use Suprtool to examine input and link records, by using record selection with Suprtool's input command. A packed-decimal number consists of nibbles (there are two nibbles in each byte). The last nibble is the sign of the number. The remaining nibbles must each contain a number in the range 0-9. A zoned-decimal number must have a valid

Suprtool 5.2 for HP-UX User Manual Introduction to Suprlink · 329

Page 328: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

digit in each byte and end in "0"-"9", "A"-"R", "{", or "}". To remove or edit numbers to be valid display values please look at Suprtool's $number function.

Selecting Non-MatchesConsider a common problem easily solved with Quiz from Cognos: finding all records in a file which have no corresponding records in a related file. For example, to find all records in an invoice lines file with no corresponding invoice master record, the following Quiz code could be written.

>access lines link to header optional>select if not record header exists>report invoiceno of lines>go

This small amount of code, however, can take a long time to execute, depending on the size of the Lines and Header files. A Quiz program will usually take longer as new links are added, causing the size of the record complex to grow.

Suprlink can provide the same information, possibly in a fraction of the time. The technique as applied to the same problem requires four steps:

1. Sort the Lines file by Invoiceno.

2. Add a new constant field, Linkflag, to the Header file and fill it with "Y". Sort by Invoiceno.

3. Link the two files with Suprlink using the Optional parameter.

4. Select the record complexes where linkflag does not contain a "Y".

$/opt/robelle/bin/suprtool>open oracle demo reader>sel * from lines>sort invoiceno>output file1,link>xeq

>sel header>define linkflag,1,1>extract invoiceno,linkflag="Y">sort invoiceno>output file2,link>exit

$/opt/robelle/bin/suprlink+input file1+link file2 optional+output file3+exit

$/opt/robelle/bin/suprtool>input file3>if linkflag <> "Y">extract invoiceno>list standard>exit

Any invoice line with a corresponding record in the invoice Header file will have a "Y" in the linkflag field. Records failing the match will contain the default space.

330 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 329: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Suprlink with Quiz/QTPQuiz and QTP are part of PowerHouse, a popular fourth generation language sold by Cognos. You can use Suprtool and Suprlink to improve the performance of PowerHouse applications. For a complete discussion of how to use Suprtool and Quiz together, refer to the "Suprtool with Quiz/QTP" section of the Suprtool User Manual.

Suprlink can write to PowerHouse subfiles that have been created with Quiz or QTP. Subfiles are "self documenting" files that contain a complete description of the file's record structure. This information is stored in user labels in the file, and is known as a "mini-dictionary." When you access the subfile in Quiz, its description is read from the mini-dictionary. You must ensure that the PowerHouse subfile description exactly matches the record layout of Suprlink's output file. Remember that Suprlink will drop the common "key" fields from the link files.

Step 1: Create the Subfile with QTPBefore running Suprlink, you create an empty subfile with QTP:

$rm invcust$qtp>access d_invoice link custnum to &> custnum of m_customer>subfile invcust keep size numrecs include &> custnum, invdate, amount, invnum, &> name, address>set input limit 0>go

The subfile must contain all of the fields that Suprlink will produce in the output file, with the same attributes (data-type and length) and in the same order. Use the Include option of QTP's Subfile command to define each of the fields in the correct order.

The numrecs parameter must be replaced with the number of records that will be created by the Suprlink run. The default numrecs is 1023 when the input limit is set to 0.

Step 2: Output Erase in SuprlinkOnce you have created the PowerHouse subfile, use the Erase option of Suprlink's Output command to load the file. This will overwrite any data in the subfile, but it will not touch the PowerHouse mini-dictionary in the user labels:

+input invoices {created by Suprtool}+link customer {sorted by custnum}+output invcust erase {created by QTP}+exit

Step 3: Report with QuizThe INVCUST file contains the sorted records for the Quiz report. Quiz knows the structure of this file because of the initial QTP commands that we used to create the file. Now use Quiz to generate the report:

Suprtool 5.2 for HP-UX User Manual Introduction to Suprlink · 331

Page 330: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

quiz>access *invcust>report ...>go

Notes on SubfilesOne of the advantages that Suprlink has over the link function in PowerHouse is that Suprlink does not require the "key" field in the link files to be a database key. Because Suprlink uses a serial-merge approach, its files only need to have a common field with the same data-type and length. If you do use Suprlink to link files that do not share a common database key, you need some extra steps to create the PowerHouse subfile.

Since Suprlink cannot currently write to NM Ksam files you cannot directly write to PowerHouse indexed subfiles. You can use Suprtool to load file to the Indexed KSAM file.

Defining Fields in QTPIn our example above, "custnum" can be used to link the d_invoice and m_customer tables in QTP because custnum is an index in the m_customer table. If custnum was not an index, you could try declaring the record structure for the subfile with the QTP Define command:

$rm invcust$qtp>access d_invoice>define name character size 20 = " ">define address character size 20 = " ">subfile invcust keep size numrecs include &> custnum, invdate, amount, invnum, &> name, address>set input limit 0>go

You must be careful to ensure that the data definitions of the Defined fields are correct. Note that you cannot assign default display specifications (such as Heading or Picture specifications) for Defined fields in QTP.

Linking Subfiles by Record NumberAnother approach, which guarantees that the subfile will contain the correct data definitions and default display characteristics, is to create temporary subfiles with QTP for each dataset, then link them together by record number:$rm invcust$qtp>access d_invoice>subfile invtemp size 1 include &> custnum, invdate, amount, invnum>set input limit 0>go>access m_customer>subfile custtemp size 1 include &> name, address>set input limit 0>go>access *invtemp link to record 0 of *custtemp>subfile invcust keep size numrecs include &> custnum, invdate, amount, invnum, &> name, address>set input limit 0>go

332 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 331: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Suprlink Commands

General NotesWhen you run Suprlink, it prompts for commands on stdlist with a "+" character and reads command lines from stdin. Suprlink commands contain a command name followed by one or more parameters, and are patterned after the same commands in Suprtool.

In this chapter, we describe the Suprlink commands in alphabetic order. Following each command name in brackets is the minimal abbreviation for the command. For example: [I] for Input and [L] for Link.

AbbreviatingYou may shorten the command name to the first letter of the command name.

+v {verify}+x {xeq}

Uppercase or LowercaseYou may enter the letters in either uppercase or lowercase, because Suprlink upshifts everything in the command line except literal strings within quotes ("abc"). These two commands are identical:

+EXIT+exit

ContinuationThe maximum physical command line is 256 characters. You may enter commands on multiple input lines by putting an "&" continuation character at the end of the line. The maximum total command length is 256 characters. The most common reason for continuing commands is to specify a lengthy Link command with secondary keys.

Suprtool 5.2 for HP-UX User Manual Suprlink Commands · 333

Page 332: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

+input students+link majors by ssn cmaj from & ssn curmajor+output outfile+exit

Comments on Command LinesComments may appear at the end of any command line, when they are surrounded by braces. Many of the examples in this manual show comments at the end of each command line. You can enter a comment as the only item in a Suprlink command line. When continuing command lines, the comment can appear before or after the continuation character.

+ {link customer records to invoices. }+input invoices {sorted by custnum}+link customer {combined with customers}+output invcust {produces the file we want}+exit

HP-UX CommandsSuprlink also accepts HP-UX commands, with or without an exclamation mark or colon.

+!ls+ls

For commands that are the same in both Suprlink and HP-UX, Suprlink only executes the HP-UX command if you type the exclamation mark (or colon). For example:

+set {you get Suprlink Set command}+!set {you get HP-UX Set command (ksh)}

Suprlink/UX executes and HP-UX command (e.g., ls) or script file.

File NamesSuprlink's Input, Link and Output commands accept any valid HP-UX file name. File names are currently limited to a maximum of 240 characters.

CalculatorAny command line beginning with an equal sign (=) is treated as a calculator expression. This feature can be used to compute blocking factors and do other calculations without the need of an electronic calculator.

You can obtain a short description of the calculator by entering the following:

=? {? gives help} {prints a summary of = functions}

For a detailed description of the calculator and its options, see the Suprtool manual.

Control-YYou can interrupt a Suprlink task with the Control-Y key (hold down Control while striking Y). Suprlink responds by telling you how far it has gotten (IN=, OUT=,

334 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 333: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

etc.), and asking if you wish to stop. Hit the Return key to continue or type YES to stop the task.

If Control-Y has no effect, then try Control-C which is the default interrupt setting for HP-UX. See the section on "Control Characters and stty" in the "Running Suprtool Under HP-UX" chapter for notes on how change this default.

Suprtool 5.2 for HP-UX User Manual Suprlink Commands · 335

Page 334: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Before Command [B]Repeat any combination of the previous 1000 command lines, with or without editing.

BEFORE [ start [ / stop ] ]

[ string ] [ ALL | @ ]

(Default: redo previous line)

(BQ=redo without change)

The Before command allows you to modify the commands before it executes them. If you don't need to change them, use BQ or Do.

The Before command uses Qedit-style Control characters for modifying the commands. The default mode is to replace characters. To delete use Control-D, and to insert use Control-B. If you prefer HP-style modify (D, R, I, and U), use the Redo command instead of Before.

Examples+ll *.fd {".fd" is a typo}*.fd not found+Before {redo most recent command}ll *.fd {last command is printed} s {you enter changes to it}ll *.sd {the edited command is shown} {you press Return}

+listredo -10/+before 5 {redo 5th command in stack}+bef 8/10 {redo 8th through 10th}+b ls {redo last ls command}+b ls * {redo "ls *" command}+b @* {redo last containing "*"}+before -2 {redo command before previous}+before -5/-2 {redo by relative lines}

Modify OperatorsIf you wish to change any characters within the line, the modify operators are the regular Control Codes used in Qedit:

· Any printing characters replace the ones above.

· Assuming that you have changed the HP-UX default of your EOF key, Control-D plus spaces deletes columns above.

· Control-B puts you into "insert before" mode.

· Control-A starts appending characters at the end of line.

· Control-A, Control-D, plus spaces, deletes from the end.

· Control-T ends Insert Mode, allowing movement to a new column.

· Control-G recovers the original line.

· Control-O specifies "overwrite" mode (needed for spaces).

336 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 335: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Persistent RedoRedo commands can be saved in a permanent file and can therefore be used from another session. You can use the Set redo command to specify a filename to save your redo commands. Please see the Set Redo command for details.

Suprtool 5.2 for HP-UX User Manual Suprlink Commands · 337

Page 336: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Do Command [DO]The Do command will repeat (without changes) any of the previous 1000 commands.

DO [ start [ / stop ] ]

[ string ]

[ ALL | @ ]

(Default: repeat the previous command)

Commands are numbered sequentially from 1 as entered and the last 1000 of them are retained. Use the :Listredo command to display the previous commands. You can repeat a single command (do 5), a range of commands (do 5/10) or the most recent command whose name matches a string (do list). If you want to modify the commands before executing them, use Redo or Before.

Examples+listredo+do {do previous command again}+do 39 {do command line 39 again}+do 5/8 {do command lines 5 to 8 again}+do link {do most recent Link command}+do grep {do last starting with "grep"}+do grep job {do last "grep job" command}+do @job {do last containing "job"}+do -2 {do command before previous}+do -7/-5 {do by relative line number}+do 5/ {do command lines 5 to last}

NotesThe Do command cannot be abbreviated.

Persistent RedoRedo commands can be saved in a permanent file and can therefore be used from another session. You can use the Set redo command to specify a filename to save your redo commands. Please see the Set Redo command for details.

338 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 337: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Exit Command [E]Exit Suprlink in one of three ways. By default, perform the current linkage task, if any, then leave Suprlink. Users are often frustrated when they exit Suprlink after specifying part of a task and Suprlink starts processing the task. Use the Abort or Suspend options to exit Suprlink conveniently without executing the current task.

EXIT [ ABORT | SUSPEND | XEQ ]

(Default: XEQ)

Typing Exit with no parameters means Exit Xeq. Suprlink recognizes special command names which specify both the Exit command and an exit option (e.g., ES means Exit Suspend).

Exit Abort [EA]Cancels the current operation and terminates Suprlink. The Exit command without parameters always attempts to perform the task currently specified, while Exit Abort cancels the task and terminates immediately.

Examples+:comment. You began to specify a linkage, stopped for+:comment. coffee, and decided to cancel the task+:comment. upon your return.+input invoices... coffee break ...+exit abort {cancel linkage and terminate}

Exit Suspend [ES]This feature is not currently available in Suprlink/UX.

Exit Xeq [EX]To perform the current linkage task, you can either use Xeq (which leaves you inside Suprlink, ready to define another task) or Exit Xeq (which leaves Suprlink when done with the task).

Exit Xeq is the default option (i.e., specifying exit starts execution of the current task).

Examples/opt/robelle/bin/suprlink+exit {no input was specified}End Of Program

/opt/robelle/bin/suprlink+input invoices+link customer+output invcust+exit {link and stop}

Suprtool 5.2 for HP-UX User Manual Suprlink Commands · 339

Page 338: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Form Command [F]Display the fields in a self-describing file.

FORM [filename]

If no file name is specified, the fields in the input file are displayed. The display shows the field type and field length in IMAGE notation. An I1-field is a single integer. Packed-fields show the number of nibbles (subtract one to obtain the number of digits). Byte and zoned-decimal fields show the byte length.

When showing the form of a self-describing file, Suprlink shows the byte offset of each field after the subcount, type, and sublength. The first field always appears at offset one.

There are two types of self-describing files. One type is produced with Suprtool's Query output option. You produce the other type with the Link output option. The Form command shows the internal self-describing version number, enabling you to tell the difference.

A.00.00 - Query Output OptionCompound fields have a question mark for the type, and the length is the number of bytes in the field. Sort information about the file is missing. Here is an example form listing:

+form custfileFile: custfile (SD Version A.00.00) Has linefeeds Entry: Offset CHARACTER X5 1 {length is five bytes} ZONED Z5 6 {room for five digits} INTEGER I1 11 {single integer} DOUBLE I2 13 {double integer} PACKED P6 17 {room for five digits} QUAD I4 20 {eight-byte integer} REPEATINT ?6 28 {compound field} LOGICAL K1 34 {single logical} DBLLOG K2 36 {double logical}Entry Length: 44 Blocking: 1

B.00.00 - Link Output OptionThese self-describing files contain information about how the file is sorted. Compound fields are handled correctly, so the Form command shows compound fields just as you would see them in IMAGE. The Item command in Suprtool identifies the date format of an item. The Link output option saves the date format and any decimals as part of the field description:

340 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 339: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

+form datafileFile: datafile (SD Version B.00.00) Has Linefeeds Entry: Offset CHARACTER X5 1 <<Sort #1 >> REPEATINT 3I1 6 {compound field} DATE J2 12 <<YYYYMMDD>> DOLLAR P6 16 << .2 >>Entry Length: 16 Blocking: 1

NotesIf you do an ll datafile* it should show another file with a ".sd" extension. This file contains a description of its own record structure; this allows you to refer to the field names and Suprlink can compute where they occur in the record.

Formout FileThe Form command writes all output to the file Formout. This file defaults to $stdlist. +form custfile {writes to line printer}

Suprtool 5.2 for HP-UX User Manual Suprlink Commands · 341

Page 340: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Help Command [H]Show what commands and options are available in Suprlink.

HELP [ command | keyword [ ,option ] ]

(Default: browse through the entire help file)

Command HelpIf you specify any parameters, Help first assumes that you want help on a specific Suprlink command. If you know the structure of the help file, you can specify one of the keywords under the command name.

+help link {help on the Link command}+help link,notes {notes section of the Link command}

Keyword HelpIf we cannot find any help in the "Commands" section of the help file, we assume that you specified one of the outer-level keywords in the help file. To see this list of keywords, type help with no parameters. You will see a short introduction to Suprlink and then a list of keywords. You can specify any of these keywords on the Help command. You can also specify a subkeyword.

+help before,example {example section of Before command}

Quick Help - HQHQ asks Suprlink to look under the keyword QUICK in the help file. QUICK contains the text from the Suprlink Quick Reference Guide, offering the experienced user a quick review of the syntax of any command.

+hq input {quick description of Input}+hq commands {quick list of command names}

NotesIf no parameters are specified, Help allows you to browse through the help file, /opt/robelle/help/suprlink. The Help command uses the Qhelp subsystem from the QLIB. For "help in help", type "?" when you see the Qhelp prompt character ("?"). The help file is organized into levels. To go back to the previous level, press Return. Press F8 to exit the Qhelp subsystem and return to Suprlink.

342 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 341: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Input Command [I]Specifies the primary input source and the name of the key field by which it is sorted.

INPUT filename [ BY key-field ]

There can be only one Input file per linkage task, but up to seven Link files. The Input file should be created by Suprtool using the Output-Link option and must be sorted by key-field. The key field can be any type, except for Real or Long. The primary Input file may have more than one record per key value, and each record may appear in the Output file.

It is best to have Suprtool Extract only the fields you will actually need, since if any of the Suprtool extracts result in enormous Output files, the time to do the sort may be prohibitive.

The BY-clause is only necessary when the Input file has been created using the Suprtool Output-Query option instead of the Output-Link option. Output-Link adds the sort field information to the self-describing file, so that you do not have to specify it in a BY clause.

Suprtool 5.2 for HP-UX User Manual Suprlink Commands · 343

Page 342: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Join Command [J]Join the Input file to another Join file, this links files with multiple key values in both the input file and the Join file.

JOIN filename [BY join-keys [FROM input-keys]]

[OPTIONAL | REQUIRED]

(Default: REQUIRED)

File NameThe Join file should be created by Suprtool with the Output,Link option; it should only contain the fields that you actually need in the final report, plus any sort fields. If you do an ll file* of the file, it should show another file with a ".sd" extension. This file contains a description of its own record structure; this allows you to refer to the field names and Suprlink can compute where they occur in the record. For example:

+input sales {Sales is sorted by custno}+join custfile {key is custno}+output custsale {Join two files...}+exit {...into custsale}

Join KeysSuprlink allows files to be linked by up to two keys, a primary and a secondary key field.

By default, Suprlink assumes that the key field to the Join file is the same key field specified for the Input file. If the Join key field is different from the Input key field, use the BY-clause to specify the correct key field:

+input customer {key-name is custnum}+join sales by custno {new name for the same field}

You would also use the BY-clause if the Link file was created using the Suprtool Output,Query option instead of Output,Link.

Secondary KeysSuprlink has an option that allows you to select which join record you want by matching a second key field in the master.

JOIN filename BY primary-key secondary-key

This option forces Suprlink to compare both the primary-key and the secondary-key when comparing an input record to a join record. For example,

+input ordhist {key-name is cust}+join orders by cust prod {Orders contains prod}

This example says that the file Orders is sorted by both cust and prod fields. The join will occur on those records that match both keys.

Secondary Input KeyIt is possible that the second key field has a different name in the input file and the Join file. The FROM-clause lets you handle this case:

344 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 343: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

+input students {key-name is ssn}+join orders by ord prod from orders products

Note that you must specify the Input file key field as part of the FROM-clause. This example is identical to the previous secondary key example, but in this case the current major field is called "products" in the ordhist file and "prod" in the orders file.

Optional JoinIf there are no join records for a given key value of the input file, that input record is dropped from the output file (this is the default option, REQUIRED).

To make the join optional, specify the OPTIONAL keyword. When you use OPTIONAL, and Suprlink does not find a matching join record in the file, Suprlink fills in the linked fields with default values. The default for byte-type fields is spaces, for zoned-type the default is ASCII zeros "0", and for all other types the default is binary zeros. For example,

+input custfile {key-name is custno}+join addrfile optional {don't drop customers...}+output custaddr {...if there is no address}+exit

Suprtool 5.2 for HP-UX User Manual Suprlink Commands · 345

Page 344: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Link Command [L]Link the Input file to another Link file, maximum of seven input files.

LINK filename [BY link-keys [FROM input-keys]]

[OPTIONAL | REQUIRED]

(Default: REQUIRED)

File NameThe Link file should be created by Suprtool with the Output,Link option; it should only contain the fields that you actually need in the final report, plus any sort fields. If you do an ll file* of the file, it should show another file with a ".sd" extension. This file contains a description of its own record structure; this allows you to refer to the field names and Suprlink can compute where they occur in the record. For example:

+input sales {Sales is sorted by custno}+link custfile {key is custno}+link addrfile+output custsale {link three files...}+exit {...into custsale}

Link KeysSuprlink allows files to be linked by up to two keys, a primary and a secondary key field.

By default, Suprlink assumes that the key field to the Link file is the same key field specified for the Input file. If the Link key field is different from the Input key field, use the BY-clause to specify the correct key field:

+input customer {key-name is custnum}+link sales by custno {new name for the same field}

You would also use the BY-clause if the Link file was created using the Suprtool Output,Query option instead of Output,Link.

Secondary KeysSuppose that you are linking a master to a detail and the detail can have several entries for each master. Suprlink has an option that allows you to select which link record you want by matching a second key field in the master.

LINK filename BY primary-key secondary-key

This option forces Suprlink to compare both the primary-key and the secondary-key when comparing an input record to a link record. For example,

+input students {key-name is ssn}+link majors by ssn cmaj {Students contains cmaj}

This example says that the file Majors is sorted by ssn and may contain more than one record per student. To select the desired record for each student, Suprlink matches the students' cmaj against the cmaj in the link record.

346 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 345: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Secondary Input KeyIt is possible that the second key field has a different name in the input file and the Link file. The FROM-clause lets you handle this case:

+input students {key-name is ssn}+link majors by ssn cmaj from ssn curmajor

Note that you must specify the Input file key field as part of the FROM-clause. This example is identical to the previous secondary key example, but in this case the current major field is called "curmajor" in the students file and "cmaj" in the majors file.

Optional LinkageIf there is more than one link record with the same key value, Suprlink will select the first one it finds. You can sort by another value such as date-time to force a certain record to be first. Please note that this is unlike Quiz, which does a hierarchical expansion to include every record accessed. If there are no link records for a given key value of the input file, that input record is dropped from the output file (this is the default option, REQUIRED).

To make the linkage optional, specify the OPTIONAL keyword. When you use OPTIONAL, and Suprlink does not find a matching link record in the file, Suprlink fills in the linked fields with default values. The default for byte-type fields is spaces, for zoned-type the default is ASCII zeros "0", and for all other types the default is binary zeros. For example,

+input custfile {key-name is custno}+link addrfile optional {don't drop customers...}+output custaddr {...if there is no address}+exit

Suprtool 5.2 for HP-UX User Manual Suprlink Commands · 347

Page 346: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Listredo Command [LISTREDO]The Listredo command will display any of the previous 1000 commands.

LISTREDO [ start [ / stop ] ] [;ABS] [;OUT=file]

[ string ] [;REL]

[ ALL | @ ] [;UNN]

(Default: display previous 20 commands)

(BJ and ,, are short for LISTREDO)

Commands are numbered sequentially from 1 as entered and the last 1000 are retained. You can display a single command, a range of commands, all 1000, or all the commands whose name matches the string. You can print the commands with ABSolute line numbers (the default), RELative line numbers (-5/-4), or UNNumbered. You can write the commands to your terminal or OUT to a temporary file. If you want to redo any of these commands, see Do, Redo, and Before.

Examples+listredo 5+listredo 5/10+listredo help {print all Help commands}+listredo -10 {print last ten commands}+listredo ALL {print entire redo stack}+listredo rm {print all remove commands}+listredo rm xx {print all "rm xx" commands}+listredo @rm {print all with "rm" anywhere}+listredo @;rel {print ALL, relative numbers}

Saving to a FileSaving the Listredo commands to a file is not currently available in Suprlink/UX.

NotesThe Listredo command cannot be abbreviated, but BJ is accepted as a short form.

Persistent RedoRedo commands can be saved in a permanent file and can therefore be used from another session. You can use the Set redo command to specify a filename to save your redo commands. Please see the Set Redo command for details.

348 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 347: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Output Command [O]Specify the name of the output file.

OUTPUT filename [ERASE] [DATA] [LINK]

By default, the name of the output file is Output. The output file is a self-describing file, containing data extracted from the input file and the Link files. Use the Data option to make the output file a standard disc file without a corresponding .sd file.

There are two different types of self-describing files. The first type is created with Suprtool's Output Query option. A superior form of self-describing file is produced with Suprtool's Output Link option. Suprlink creates the output self-describing file in the same format as the input file. We recommend that you use the same type of self-describing file for all input and link files.

Output Record FormatThe record structure is determined by Suprlink, but is relatively easy to anticipate. Suprlink starts with all of the fields of the input file, in order. For each Link file, it appends the fields of the Link-file to the Output record, in order. Suprlink drops the key fields from the Link records, since they always contain duplicated data.

If a field name (other than one of the two explicit keys) is duplicated in several datasets, it will end up duplicated in the final output file. An example would be a Timestamp field that occurs in every SQL table. Workaround: use the Extract command from Suprtool to take out only the fields you want, or to rename duplicate fields.

You can verify the format of the Output-file using the Form command. It shows the field names, length, and structure, in order. From this display, you can generate an appropriate COPYLIB or QSCHEMA definition.

Quiz SubfilesThe Erase option is provided for Quiz users who create an empty subfile using QTP or Quiz before running Suprtool and Suprlink. See the Suprlink with Quiz/QTP section for details.

Since Suprlink cannot currently write to NM Ksam files you cannot directly write to PowerHouse indexed subfiles. You can use Suprtool to load file to the Indexed KSAM file.

Suprtool 5.2 for HP-UX User Manual Suprlink Commands · 349

Page 348: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Redo Command [REDO]Enables you to modify and repeat any of the previous 1000 command lines.

REDO [ start [ / stop ] ]

[ string ]

[ ALL | @ ]

(Default: redo the previous command)

The Redo command allows you to modify the commands before it executes them. If you don't need to change them, use the Do command. Commands are numbered sequentially from 1 as entered and the last 1000 are retained. Use the :Listredo command to display the previous commands. You can redo a single command, a range of commands, or the most recent command whose name matches a string.

The Redo command uses MPE-style editing logic (D, I, R, U and >). The default mode is to replace characters. To delete, type DDDD under the characters to be removed. To insert, type I under the insertion spot, then the new characters. To undo your changes, type U. To append to the end of the line, use >xxx. To delete from the end of the line, use >DD. To replace at the end of the line, use >Rxxx. And to erase the rest of the line, use D>. If you prefer Qedit-style editing (Control-D, etc.), use the Before command instead of the Redo command.

Examples+ll *.fd {".fd" is not spelled right}*.fd not found+redo {redo most recent command}ll *.fd {last command is printed} s {you enter changes to it}ll *.sd {the edited command is shown} {you press Return}

+listredo all+redo 5 {redo 5th command in stack}+redo {redo previous command}+redo -2 {redo command before previous}+redo 8/10 {redo 8th through 10th}+redo -10/ {redo -10 through last}+redo rm {redo last rm command}+redo rm temp {redo last "rm temp"}+redo @temp {redo last containing "temp"}

Persistent RedoRedo commands can be saved in a permanent file and can therefore be used from another session. You can use the Set redo command to specify a filename to save your redo commands. Please see the Set Redo command for details.

350 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 349: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Reset Command [R]Cancel the current linkage task.

RESET

Reset closes the current Input-file and any Link files, then resets the output file name to Output. This is actually a Reset All command; you cannot reset particular commands as you can do in Suprtool. If you try to reset an individual command, Suprlink prints a warning.

Suprtool 5.2 for HP-UX User Manual Suprlink Commands · 351

Page 350: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Set Command [S]Enables or disables certain operating options within Suprlink. These options are not reset by Xeq or Reset commands.

SET [MAPPED ON|OFF]

[REDO filename]

[STATISTICS ON|OFF]

[VARSUB ON|OFF]

[VARSUBCOMPAT ON|OFF]

[VARSUBDEBUG ON|OFF]

MappedSET MAPPED ON | OFF

MAPPED has no effect within Suprlink/UX.

RedoSET REDO filename

(Initially: unnamed temporary file)

Commands entered at the Suprlink prompt are saved in something called the redo stack. You can recall commands from the redo stack by using other commands such as Before, Do and Redo. By default, the redo stack is stored in a temporary file and discarded as soon as you exit. This temporary stack is not preserved across Suprlink invocations.

The new Set Redo command assigns a permanent file as the redo stack, allowing the stack to become available for future Suprlink invocations. For example, to assign the Myredo file as a persistent redo stack, enter

+set redo myredo

If the file does not exist, Suprlink creates it. Otherwise, Suprlink uses the existing file. All subsequent commands are written to the persistent redo stack. The setting is valid for the duration of the Suprlink session. As soon as you exit Suprlink, the setting is discarded. Next time you run Suprlink, you will get the temporary stack.

If the file name is not qualified, the redo stack is created in the cyrrent working directory. This may be desirable if you want to have separate stacks. If you want to always use the same persistent stacks, you should qualify the name.

The Verify command shows which stack is currently in use. If it shows <temporary>, it means Suprlink is using the default stack. Anything else is the name of the file used on the Set Redo command.

ConcurrencyWhen Suprlink uses the default temporary stack, it is only accessible to that particular instance of Suprlink. You can run as many Suprlink instances as you need and each one gets its own redo stack. With temporary stacks, you will never get into concurrency problems.

352 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 351: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

If you start using a persistent redo stack, however, you might start running into concurrency problems. A persistent redo stack can only be used by one Qedit instance at a time. If you try to use a persistent redo stack that is already in use, you will get the following message:

+set redo myredoThe redo file is already in use.Unable to open file for REDO stack

In this situation, Suprlink continues to use the redo stack active at the time and lets you continue working as normal.

Qedit can also have permanent redo stacks. To prevent products from writing to each other's stack, it is advisable to have separate stacks for each product by giving them different file names.

For example, if you use

set redo myredo

you will have a redo stack called Myredo for your Suprlink commands. If you exit Suprlink, then run Qedit and supply the same Set Redo command, your Qedit commands will be written to the same file that was used for your Suprlink commands.

StatisticsSET STATISTICS ON | OFF

(Initially: OFF)

STATISTICS causes Suprlink to print statistics at the end of each task.

VarsubSET VARSUB ON | OFF

(Initially: OFF)

Setting Variable Substitution causes Suprlink to resolve any environment variables in a command before processing.

VarsubCompatSet VarsubCompat On | Off

(Initially: OFF)

The Set VarsubCompat flag has been added to Suprtool for HP-UX to have variable substitution be more flexible. On MPE variable substitution would pass the name of the variable thru to be parsed even if the variable was not set. On HP-UX the default behaviour was to return spaces if the environment variable was not set. This is still the default behaviour, however if you set varsubcompat on, Suprtool will return the environment variable name similar to how MPE works with unresolved variables. You can also invoke this from the command line by running with –cv.

Suprtool 5.2 for HP-UX User Manual Suprlink Commands · 353

Page 352: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

VarsubDebugSET VARSUBDEBUG ON | OFF

(Initially: OFF)

Suprtool, now has a setting called Set VarsubDebug on which will print out the line after the variable substitution has occurred. This setting only works if Set Varsub is on and Set VarsubDebug is on.

export outfile &:"/GREEN/SUPRTEST/filename90123456789012345678901234567890123456789012345678901"/opt/robelle/bin/suprtoolSUPRTOOL/UX/Copyright Robelle Solutions Technology Inc. 1981-2007.(Version 5.2 Internal) TUE, OCT 30, 2007, 2:58 PM Type H for he>set varsub on>set varsubdebug on>in file1sd.suprtestvd:in file1sd.suprtest>output !outfile,link,tempvd:output /GREEN/SUPRTEST/filename90123456789012345678901234567890123vd:2345678901,link,temp

The output is formatted into 74 byte chunks and printed with a preceding “vd:” so the “substituted” line is clear. The above example shows Suprtool, however the same commands apply in STExport and Suprlink.

354 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 353: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Use Command [U]Specifies a file of commands to be executed as a group.

USE[Q] filename

ExamplesA usefile makes your task easier by allowing common commands to be specified once in an external file. For example, the following usefile contains all the commands for creating the invcust file:

+use usecustinput invoices {sorted by custnum}link customer {combined with customers}output invcust {produces the file we want}exit

Suprlink prints the lines in the usefile, including the comment lines. This allows you to include instructions and reminders in the usefile. In the example above, there were no commands for the user to enter.

NotesUsefiles cannot be nested in Suprlink. The usefile may be any unnumbered text file or a Qedit workfile, but no more than 256 characters per record will be processed.

By default, Suprlink displays the commands in a usefile as they are executed. Suprlink can execute commands quietly using the Useq command. For compatibility with Qedit, Useq can be abbreviated to UQ.

Suprtool 5.2 for HP-UX User Manual Suprlink Commands · 355

Page 354: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Verify Command [V]Print the definition of the current linkage task.

VERIFY

Verify prints the current Input, Link, and Output files; in other words, it is a Verify All command.

356 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 355: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Xeq Command [X]Perform the current linkage task.

XEQ

Xeq checks that you have specified an input file and at least one Link file. Then it performs the linkage and creates the output file. Finally, it closes the files and resets, ready for you to specify another linkage task or Exit. If you also wish to leave Suprlink after completing the linkage task, use Exit instead of Xeq.

Suprtool 5.2 for HP-UX User Manual Suprlink Commands · 357

Page 356: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Example Suprlink Output

ExampleThe Form command displays the fields in a self-describing file. This information is stored in a file with an extension of ".sd" and is not accessible with other tools. Use the Form command to obtain the record layout of Suprlink output files.

The following example shows the Form command listing for an input file, a Link file, and the resulting output file. We start with an input file of invoices.

+form invoicesFile: invoices (SD Version B.00.00) Has Linefeeds Entry: Offset CUSTNUM X8 1 <<Sort #1 >> DELIVERED I2 9 PRODUCTNUM Z8 13 PRICE I2 21 PURCHASED I2 25 QTY I1 29 TAX I2 31 TOTAL I2 35Entry Length: 38 Blocking: 1

Suprtool produced both the invoice and the customer file by using the Select, Extract, and Sort commands. The invoice file was produced with Suprtool's Output Link option. If you had used Suprtool's Output Query option, the Form command would not have printed any information about the key fields. The next listing is the customer file.

+form custFile:cust (SD Version B.00.00) Has Linefeeds Entry: Offset CITY X12 1 RATING I2 13 CUSTNUM X8 17 <<Sort #1 >> STATUS X2 25 FIRSTNAME X10 27 LASTNAME X16 37 STATE X2 53 ADDRESS 2X25 55 ZIPCODE X6 105Entry Length: 110 Blocking: 1

The street address is a compound-field. If you had used Suprtool's Output Query option, the field would have appeared with a question mark for the data-type. In that case, you cannot use the field as a key-field in Suprlink, but the actual data in the field will be processed and linked correctly. Your final report should be able to read this data just as if it came from the database. We use Suprlink to combine the invoice and cust files into one Output-file:

Suprtool 5.2 for HP-UX User Manual Example Suprlink Output · 359

Page 357: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

/opt/robelle/bin/suprlink+i invoices by custnum+l cust+o invcust+e

The final Form command shows the record layout of the Output-file. You would use this file as input to your report program.

+form invcustFile: invcust (SD Version B.00.00) Has Linefeeds Entry: Offset CUSTNUM X8 1 <<Sort #1 >> DELIVERED I2 9 PRODUCTNUM Z8 13 PRICE I2 21 PURCHASED I2 25 QTY I1 29 TAX I2 31 TOTAL I2 35 CITY X12 39 RATING I2 51 STATUS X2 55 FIRSTNAME X10 57 LASTNAME X16 67 STATE X2 83 ADDRESS 2X25 85 ZIPCODE X6 135Entry Length: 140 Blocking: 1

360 · Example Suprlink Output Suprtool 5.2 for HP-UX User Manual

Page 358: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Limits Within Suprlink

MaximumsThe various limitations of Suprlink are described here. In general you need to reduce the number or sizes of fields if you encounter any of these limits.

Input File - Maximum Record Size - 2048 WordsWe recommend that you use Suprtool's Extract command to minimize the input record size.

Input File - Maximum Block Size - 4096 WordsBy default, Suprtool restricts the maximum block size to 2,048 words. You can use the Set Blocksize command to increase this size up to 8192 words. If you increase the maximum block size, it is likely that Suprtool will produce an output file that Suprlink cannot read.

Input File - Maximum Fields - 255Suprlink restricts the number of fields per file to be 255. If you must have more fields, use Suprtool's Define and Extract commands to extract several fields as one contiguous series of bytes.

Link File - Maximum Record Size - 2048 WordsAs with the input file, you should use Suprtool's Extract command to minimize the link record size.

Link File - Maximum Block Size - 2048 WordsSee the description of the maximum input block size.

Link File - Maximum Fields - 255See the description of the maximum number of input fields.

Link File - Maximum Number - SevenSuprlink will link one input file with up to seven Link files.

Suprtool 5.2 for HP-UX Limits Within Suprlink · 361

Page 359: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Output File - Maximum Record Size - 4096 WordsWhen linking many files together, it is easy to produce large output records. Once again, using the Extract command to minimize the size of the input and link records will avoid large output records.

Output File - Maximum Fields - 1023Internal Suprlink tables that keep track of the output fields are restricted to 1023 entries.

362 · Index Suprtool 5.2 for HP-UX

Page 360: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Welcome to Calling Suprtool

Calling SuprtoolSuprtool, including its Suprlink and Dbedit components, is a utility program. You run it, either interactively or in a batch job, and feed it commands to define a task to be done. How would a user application program invoke Suprtool to perform a desired task? Unfortunately, the user program would have little control over when the batch job started or finished.

To solve this problem, Robelle provides an interface routine that will run Suprtool for a user program, and pass commands from the program to Suprtool (the same commands you would type into Suprtool). This routine (procedure, subroutine, intrinsic) allows user programs to "call" Suprtool. A typical use of this interface would be for a COBOL program to ask Suprtool to extract a selected subset from a large IMAGE dataset and write it to a disc file, which the COBOL program would then read and format into a report.

Suprtool2 RoutineThe interface routine is called Suprtool2 (not Suprtool). User programs written in nearly any language can call Suprtool2 and ask Suprtool to do any of the normal Suprtool tasks such as copy, extract, or sort. The routine creates Suprtool as a son process.

The user program instructs Suprtool by calling the Suprtool2 routine repeatedly with Suprtool command lines. When the first Suprtool command is sent, the interface builds temporary files which will be used for input and output to Suprtool. When the user program sends an Exit command in a separate call to the interface, the interface creates Suprtool as a son process. Finally, the interface prints the $stdlist message file, if so directed by the user program.

Importance of the Exit CommandThe interface will not invoke Suprtool until your program passes Exit to it as a command line. The Exit command must be alone and left-justified in the command line. You may use Xeq to separate multiple tasks, but none of the tasks will be executed until you pass Exit to the interface. If you forget the final Exit or put it in the same command line

Suprtool 5.2 for HP-UX Welcome to Calling Suprtool · 363

Page 361: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

with another command such as Xeq, your Suprtool tasks will be ignored.

Environment VariablesThere are two environment variables that help drive the Suprtool2 process.

ROBELLEThe Robelle variable where the Robelle directory is. Normally this variable is set in the following manner:

export ROBELLE=/opt/robelle

ROBSUPRThe ROBSUPR variable tells the Suprtool2 process the name of the program file that it can launch. If this variable is not set then by default Suprtool2 will launch the program file as being $ROBELLE/bin/suprtool. You can change the name of the Suprtool program file, (or even launch other programs), by doing a:

export ROBSUPR=bin/supramxw

You can even run Suprlink or STExport setting the environment variable to the appropriate name:

export ROBSUPR=/bin/suprlink

Control RecordThe user program must pass a special control record to the interface on each call.The most common error in using the Suprtool2 interface is typing the control record incorrectly.

The definition of the control record, with the proper initializing values, are as follows.

364 · Index Suprtool 5.2 for HP-UX

Page 362: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Cobol01 supr-control. 05 supr-version pic s9(4) comp value 4. 05 supr-status pic s9(4) comp. 88 supr-ok value zeros. 88 supr-bad-msgfiles value 1. 88 supr-aborted value 2. 88 supr-create-error value 3. 88 supr-bad-total-type value 4. 05 supr-command-line pic x(256) value spaces. 05 supr-flags. 10 supr-priority pic x(2) value spaces. 88 supr-priority-cs value "CS". 88 supr-priority-ds value "DS". 88 supr-priority-es value "ES". 10 supr-maxdata pic s9(9) comp value 0. 10 supr-print-state pic x(2) value "ER". 88 supr-print-on-error value "ER". 88 supr-print-always value "AL". 88 supr-print-never value "NE". 10 supr-total-type pic x(2) value "CO". 88 supr-total-cobol value "CO". 88 supr-total-ascii value "AS". 10 supr-other-flags pic x(18) value spaces. 05 supr-totals pic s9(17) sign is trailing separate character occurs 15 times. 05 supr-out-count pic s9(9) comp. 05 supr-workspace pic x(20) value spaces.

Ctypedef struct SuprControl SuprControl;

struct SuprControl { short version; short status; char command[256]; char priority[2]; char maxdata[4]; char print_state[2]; char total_type[2]; char other_flags[18]; short totals[15][9]; int out_count; char workspace[20]; };

StatusThe supr-status field returns a 0 if the command line was sent to Suprtool without incident or one of the error numbers shown as 88 levels.

Command LineThe supr-command-line can contain any Suprtool command. Use the same format that you use in typing commands into Suprtool. You don't need to enter commands as a single string of 256 characters in a single call to the interface. You may use ";" to send several commands in one string, or you may use the "&" mechanism to continue commands.

The final call must have Exit as the command, alone and left-justified in the command line. The final Exit command can be in uppercase or lowercase, but cannot be abbreviated. OS commands can be passed into the interface and Suprtool will execute them.

Suprtool 5.2 for HP-UX Welcome to Calling Suprtool · 365

Page 363: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

PriorityThis setting has no effect on HP-UX and is included solely for compatibility reasons.

MaxdataThis setting has no effect on HP-UX and is included solely for compatibility reasons.

Print StateIf the supr-print-state contains "AL", the output from Suprtool will always be printed on $stdlist. If the state is "NE", the output will never be printed. If the state is "ER" or blank, the output will be printed only if Suprtool aborts due to an error.

Total TypeThe supr-total-type determines the format of the supr-totals array. If you call Suprtool2 from COBOL, you should use "CO". The COBOL format is display (with leading zeros) and a trailing sign. If the type is "AS", each total is returned left-justified in the total field with a leading sign.

TotalsIf you specify the Total command as part of an extract task, Suprtool2 returns the totals in the supr-totals array. Totals are returned in exactly the same order in which they were specified. If you are calling Suprtool2 from COBOL, never specify the decimal-precision portion of the Total command. If your total includes an implied decimal point, you will have to modify the supr-totals declaration to include an implied decimal point (e.g., pic s9(15)v99 ...).

If you specify "AS" as the supr-total-type, each total is formatted as an 18-byte string. In this case, you should specify the correct decimal-precision in the Total command. The exponent portion of real totals is truncated by the Suprtool2 interface.

Out CountAfter a successful call to the Suprtool2 interface, the supr-out-count is set to the number of Suprtool output records. The supr-out-count is only returned after the Suprtool2 call with the Exit commandWorkspace

The supr-workspace part of the record MUST contain spaces before the first call to the Suprtool2 procedure.

366 · Index Suprtool 5.2 for HP-UX

Page 364: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Examples of Calling Suprtool

Copying the ExamplesThis chapter contains some examples of source code that calls Suprtool2. You can copy the examples from the manual, but typing them from scratch would be tedious and error-prone.

COBOL ExampleBelow is a sample COBOL program named TOOL2COB. It calls the Suprtool2 interface procedure. The purpose of TOOL2COB is to print selected item master entries from an inventory database, sorted by item number. The program uses Suprtool to create a disc file named SELITEM, filled with the selected item numbers and their descriptions. Then it reads the disc file and prints a report on the line printer.

The listing for the COBOL program is:

Suprtool 5.2 for HP-UX Examples of Calling Suprtool · 367

Page 365: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Here's a control definition:

01  SUPR-CONTROL.    05  SUPR-VERSION            PIC S9(4) BINARY VALUE 4.    05  SUPR-STATUS             PIC S9(4) BINARY VALUE 0.        88  SUPR-OK                                VALUE ZEROS.        88  SUPR-BAD-MSGFILES                      VALUE 1.        88  SUPR-ABORTED                           VALUE 2.        88  SUPR-CREATE-ERROR                      VALUE 3.        88  SUPR-BAD-TOTAL-TYPE                    VALUE 4.    05  SUPR-COMMAND-LINE       PIC X(256)         VALUE SPACES.    05  SUPR-FLAGS.        10  SUPR-PRIORITY       PIC X(002)         VALUE SPACES.            88  SUPR-PRIORITY-CS                   VALUE "CS".            88  SUPR-PRIORITY-DS                   VALUE "DS".            88  SUPR-PRIORITY-ES                   VALUE "ES".        10  SUPR-MAXDATA        PIC S9(9) BINARY   VALUE 0.        10  SUPR-PRINT-STATE    PIC X(002)         VALUE "AL".            88  SUPR-PRINT-ON-ERROR                VALUE "ER".            88  SUPR-PRINT-ALWAYS                  VALUE "AL".            88  SUPR-PRINT-NEVER                   VALUE "NE".        10  SUPR-TOTAL-TYPE     PIC X(002)         VALUE "CO".            88  SUPR-TOTAL-COBOL                   VALUE "CO".            88  SUPR-TOTAL-ASCII                   VALUE "AS".        10  SUPR-OTHER-FLAGS    PIC X(018)         VALUE SPACES.    05  SUPR-TOTALS             PIC S9(17) SIGN IS TRAILING                          SEPARATE CHARACTER OCCURS 15 TIMES.    05  SUPR-OUT-COUNT          PIC S9(9) BINARY.    05  SUPR-WORKSPACE          PIC X(020)         VALUE SPACES.

Here's the command definition:

01  SUPRTOOL-COMMANDS.    05  SUPRTOOL-COMMAND-LINE    OCCURS 30 TIMES.        07  FILLER                 PIC X(72)  VALUE SPACES.

Here's some sample code that moves the suprtool commands to the commandarray:

2100-SUPRTOOL-COMMANDS.

    MOVE 1 TO X.    MOVE 12 TO Y.    MOVE "USE $DIR_PUB/dbopen" TO SUPRTOOL-COMMAND-LINE(X).

    ADD 1 TO X.    MOVE "SELECT * FROM V_MEMBER_SPAN"      TO SUPRTOOL-COMMAND-LINE(X).

    MOVE "IF $READ" TO SUPRTOOL-COMMAND-LINE(Y).

    ADD 1 TO Y.    IF DI-OPTRDP-TRANSCODE = "TM"        STRING "(YMDEFF <= '", DI-OPTRDP-YMDEFF               "' AND YMDEND >= '", DI-OPTRDP-YMDEND, "')"            DELIMITED BY SIZE INTO SUPRTOOL-COMMAND-LINE(Y)    ELSE        STRING "((YMDEFF >= '",DI-OPTRDP-YMDEFF               "' AND YMDEFF <= '", DI-OPTRDP-YMDEND, "') OR "            DELIMITED BY SIZE INTO SUPRTOOL-COMMAND-LINE(Y)        ADD 1 TO Y        STRING "(YMDEND >= '", DI-OPTRDP-YMDEFF               "' AND YMDEND <= '", DI-OPTRDP-YMDEND, "'))"            DELIMITED BY SIZE INTO SUPRTOOL-COMMAND-LINE(Y).

    ADD 1 TO Y.    MOVE "AND VOID = '  '" TO SUPRTOOL-COMMAND-LINE(Y).

368 · Index Suprtool 5.2 for HP-UX

Page 366: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

    IF USE-PROGRAM        OPEN OUTPUT PROG-FILE        CONTINUE;        ADD 1 TO X, Y       MOVE          "TABLE B,PROG_NBR,FILE,$DIR_TEMPDATA/mep833pg.dat"

             TO SUPRTOOL-COMMAND-LINE(X)

       MOVE "AND $LOOKUP(B,PROG_NBR)"

             TO SUPRTOOL-COMMAND-LINE(Y)

    END-IF.

    IF USE-CARRIER        OPEN OUTPUT CARRIER-FILE        CONTINUE;        ADD 1 TO X, Y        MOVE         "TABLE C,CARRIER,FILE,$DIR_TEMPDATA/mep833ca.dat"

             TO SUPRTOOL-COMMAND-LINE(X)

        MOVE "AND $LOOKUP(C,CARRIER)"             TO SUPRTOOL-COMMAND-LINE(Y)

    END-IF.

    IF USE-REGION        OPEN OUTPUT REGION-FILE        CONTINUE;        ADD 1 TO X, Y                                              MOVE                         

        "TABLE D,REGION,FILE,$DIR_TEMPDATA/mep833rg.dat"

            TO SUPRTOOL-COMMAND-LINE(X)

        MOVE "AND $LOOKUP(D,REGION)"            TO SUPRTOOL-COMMAND-LINE(Y)    END-IF.

    ADD 1 TO Y.    MOVE "//" TO SUPRTOOL-COMMAND-LINE(Y).    ADD 1 TO Y.    MOVE "SORT MEMBER_nbr" TO SUPRTOOL-COMMAND-LINE(Y).    ADD 1 TO Y.                      

    MOVE "SORT YMDEND DESC" TO SUPRTOOL-COMMAND-LINE(Y).

    ADD 1 TO Y.                      

    MOVE "OUT $DIR_TEMPDATA/mep0833i.dat,ERASE"

    TO SUPRTOOL-COMMAND-LINE(Y).     

    ADD 1 TO Y.    MOVE "EXIT" TO SUPRTOOL-COMMAND-LINE(Y).2100-EXIT.        EXIT.

Here's the code to call suprtool2:

*******************************************************************  Execute Speed Demon commands from memory table. ****************************************************************** 3000-CALL-SUPRTOOL.

     PERFORM WITH TEST AFTER VARYING X FROM 1 BY 1 UNTIL X = 30

Suprtool 5.2 for HP-UX Examples of Calling Suprtool · 369

Page 367: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

         IF SUPRTOOL-COMMAND-LINE(X) > SPACES            MOVE SUPRTOOL-COMMAND-LINE(X) TO SUPR-COMMAND-LINE

            DISPLAY SUPR-COMMAND-LINE

            MOVE 0 TO SUPR-STATUS

            CALL "suprtool2" USING SUPR-CONTROL ;            IF NOT SUPR-OK

            DISPLAY "Error:  Unable to call suprtool2"            DISPLAY " "            DISPLAY "Suprtool interface error number: "                    SUPR-STATUS            DISPLAY SUPR-COMMAND-LINE           GOBACK;         END-IF     END-PERFORM. 3000-EXIT.       EXIT.

C SampleBelow is a C program to invoke Suprtool through the interface routine.

370 · Index Suprtool 5.2 for HP-UX

Page 368: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

#include <stdio.h>#include <stdlib.h>

#include <sys/types.h>#include <sys/wait.h>

#include "/users/robdev/ux/include/defines.h"

#define cmd_max_len 256#define filename_len 36;

typedef struct SuprControl SuprControl;

struct SuprControl { short version; short status; char command[256]; char priority[2]; char maxdata[4]; char print_state[2]; char total_type[2]; char other_flags[18]; short totals[15][9]; int out_count; char workspace[20]; };

/*----------------------------------------------------------------*//* Everything below this line is for testing *//* *//*----------------------------------------------------------------*/ void init_st2( SuprControl *MyControl) { int i;

MyControl->version = 4; MyControl->status = 0; MyControl->priority[0] = 'C'; MyControl->priority[1] = 'S'; MyControl->maxdata[0] = '0'; MyControl->print_state[0] ='E'; MyControl->print_state[1] ='R'; MyControl->total_type[0] = 'A'; MyControl->total_type[1] = 'S'; i=0; for (i = 0;i < 20;i++) MyControl->workspace[i]=' '; i=0; for (i=0;i<256;i++) MyControl->command[i]=' '; }

void call_suprtool2(SuprControl *MyControl) { suprtool2(MyControl); if (MyControl->status!=0) { printf("Call to Suprtool2 has failed with a status of: %d \n",MyControl->status); exit(99); } }

void assign_cmd( char *cmd, SuprControl *MyControl ){ int i;

for (i=0;i< cmd_max_len;i++) MyControl->command[i]=' ';

Suprtool 5.2 for HP-UX Examples of Calling Suprtool · 371

Page 369: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

i=0; for (i=0;i< cmd_max_len;i++) MyControl->command[i]=cmd[i]; }

void main(){ char cmd[256];

struct SuprControl MyControl;

init_st2(&MyControl); assign_cmd( "set varsub on",&MyControl); call_suprtool2(&MyControl); assign_cmd( "in infile",&MyControl); call_suprtool2(&MyControl); assign_cmd( "out outfile",&MyControl); call_suprtool2(&MyControl); assign_cmd( "set varsub on",&MyControl); call_suprtool2(&MyControl); assign_cmd( "set varsub on",&MyControl); call_suprtool2(&MyControl); assign_cmd( "exit",&MyControl); call_suprtool2(&MyControl);}

372 · Index Suprtool 5.2 for HP-UX

Page 370: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Installing the Suprtool2 Interface

InstallingThere is no need to Install anything for the Suprtool2 Interface on HP-UX. We provide two files for PA_RISC machines. Suprcall.o and Suprcall.sl, a simple object file an a shared library. The PA_RISC files can be found in the lib directory whereever you have installed the Robelle software, typically /opt/robelle/lib.

The same files for Itanium are found under lib/itanium. We provide three files named suprcall.o, suprcall.sl and suprcall.so. Either can be used depending on your linking and or naming preferences and conventions.

Just link it in with your Cobol or C program.

AMXWThe AMXW version has the same names and conventions, however, it works using typical MPE intrinsics and in a manner such that AMXW can be aware of what it is doing. Externally, Suprtool2 for AMXW operates in the same manner as Suprtool2 for HP-UX with the same control record and calling conventions and rules.

Suprtool 5.2 for MPE User Manual Installing the Suprtool2 Interface · 373

Page 371: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Suprtool2 Error Messages

Error NumbersSuprtool2 returns error numbers in the status parameter of the workspace. For most errors, a message is also displayed on $stdlist. The following summarizes the form of Suprtool2 error messages and the error numbers returned.

Messages On $StdlistMost Suprtool2 errors result in a message being displayed on $stdlist

1 - Error: Version of the control buffer is incorrect

2 - Error: Priority value in the control buffer is incorrect.

3 - Error: Value of print state in the control buffer is incorrect.

4 - Error: Could not open STDIN file

5 - Error: Could not close STDIN file

6 - Error: Could not successfully call System Call

7 - Error: Invalid total type was specified

8 – Error: Failure to fwrite to stdin file.

9 - Error: Unable to get ROBELLE environment variable.

10 - Error: Unable to get ROBSUPR environment variable

11 - Error: Suprtool errors encountered.

374 · Index Suprtool 5.2 for HP-UX

Page 372: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Glossary of Terms

Commonly-used Terms

BatchSuprtool operates in session mode or batch mode. In batch, any error message causes Suprtool to quit. Warning messages do not cause an abort. If an error occurs, Suprtool returns a non-zero value as its result.

In batch mode, Suprtool does not prompt for missing information as it does in session mode. For example, if the output file is a duplicate file name, Suprtool automatically answers "yes" to the question asking you to purge the existing file.

Pseudo-Batch TasksDuring a canned on-line task, such as passing usefiles to Suprtool, you can "fool" Suprtool into responding YES to operational questions. For example, if one of the canned tasks requires Suprtool to output myfile,erase, then Suprtool asks the question

ERASE all records from this OUTPUT file [no]?

You can avoid typing "yes" in response to this question by invoking Suprtool with:

$suprtool < filename

BlocksizeThe block size of a file is the record length multiplied by the blocking factor. MPE permits block sizes up to 32,000 words, but Suprtool restricts the total block size. When copying an MPE file, the maximum block size of either the input or output file is 14,336 words. If Suprtool detects an input or output file with a block size larger than 14,336 words, it prints one of the following error message:

The input blocksize is greater than 14336 words

The output blocksize is greater than 14336 words

Suprtool 5.2 for MPE User Manual Glossary of Terms · 375

Page 373: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

CalculatorSuprtool, Suprlink and Stexport and Dbedit treat any line that begins with an equal sign ("=") as an expression to be evaluated. To add two numbers together:

>=125+512

Result= 637.0

An expression consists of numbers and operators. The operators can be addition (+), subtraction (-), multiplication (*), division (/), or exponentiation (**). The value of the expression is printed immediately.

Any number can be followed by a percent sign (%). The calculator assumes that you want to qualify the number as a percentage. For example,

>=125*5%

Result= 6.25

A complete description of the Suprtool calculator is given after the description of the Xeq command.

Control CharacterYou create a control character by holding down the Control key while you strike another key. "Y" plus Control generates Control-Y. These are normally nonprinting characters, but they may do things to your terminal. For example, Control-G rings the bell. For notes on how to change the HP-UX defaults, see the section on Control Characters and stty in the "Running Suprtool Under HP-UX" chapter.

Suprtool uses control characters for a number of purposes:

In the Before command, control characters specify the edit functions: Control-D for delete, Control-B for before, etc.

Control-Y stops execution of the current Suprtool task. Suprtool prints a status report and asks if you would like to stop the operation.

Control-H causes the cursor to backspace one position in the current line.

Control-X cancels the current input line.

Control-S pauses a listing that is printing too fast for you to read.

Control-Q resumes a listing that you have paused with Control-S.

DatabaseA database in Suprtool/UX is an Eloquence database or an SQL database. A database is specified in the Base or Open command. Several commands (e.g., Get, Chain, or Select) do not work until a database has been specified. Some commands only work with Eloquence databases and other commands only work with SQL databases.

An Eloquence database consists of datasets (files) which in turn consist of fields. An SQL database consists of tables or views, and each table

376 · Index Suprtool 5.2 for HP-UX

Page 374: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

or view consists of columns. In Suprtool, a column name can be used anywhere that a field-name is used. The advantage of using a database is that information about the database is automatically available to Suprtool.

The Form command shows the database structure.

ErrorsErrors are messages printed by Suprtool indicating a fatal problem in the task which prevents it from completing. Error messages are further described in Appendix A.

FieldA field is a portion of a record. When you access an Eloquence dataset, this makes Suprtool aware of the Eloquence fields in the dataset. When you access an SQL database with the Select command, Suprtool is aware of each column name (fields and columns are synonymous in Suprtool). The Define command allows you to define new fields or redefine existing fields to have new sizes or data-types. Use Define to get at bytes of interest within existing fields and to give them an appropriate name. Then you can refer to the defined field in other commands (e.g., Extract, If, etc.). The following commands all contain a field:

>if balance>10000

>sort account

>extract a,b

FilenameA filename is any valid filename and is used in Suprtool commands to identify the input source, specify the output destination, or to specify an external file to be accessed in the Table or Use command. File names may be enclosed in quotes. The following commands all contain file names:

>input xyz

>output *out

>use supruse

>input "872xyz"

StringsSuprtool expects all strings to be surrounded by a pair of single or double quotes (' or "). When Suprtool knows the length of a field, it pads strings with trailing spaces. For example,

>define long,1,125 {125 character field}

>extract long="abcef" {Suprtool adds 120 spaces}

Suprtool 5.2 for MPE User Manual Glossary of Terms · 377

Page 375: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>if long="abcde" {Suprtool checks for trailing spaces}

Suprtool accepts the null string. Suprtool pads it with spaces, so this is an easy way to see if a field is blank:

>if name = "" {if name is blank}

One problem with any tool that accepts strings is how to include a quote mark inside the string. Suprtool offers two solutions:

1. Use the opposite quote mark (e.g., "don't").

2. Whenever two quote marks appear in a string, they are treated as a single quote (e.g., 'don''t').

SubscriptA subscript is used to specify one-of-many fields in a repeated item. Within Eloquence it is possible to specify repeated fields. For example:

costs, 5J2;

The item COSTS consists of five double integers. You select one element of a compound field by specifying a subscript in parentheses (the first element is 1, not 0). For example, if you wanted to select the input records where the second cost was greater than 10000, you would use:

>if costs(2) > 10000

The (2) portion of the command is the 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 (1). The If command has another syntax, using up to three subscripts, allowing you to refer to subfields without Define (see the If command for details).

TablesTables are created with the Table command and they are used for testing in the If and Chain commands. Tables are used by the $lookup function of the If command. Use tables when you wish to check a data field for many different test values. You may also use tables to specify the records to search for with the Chain command.

Table can also mean a table from an SQL database.

WarningsWarnings are messages produced by Suprtool to let you know about nonfatal conditions that might affect your task. Some common warning messages and their meanings are described in Appendix A.

Yes or NoWhen Suprtool asks a question that requires a YES or NO answer, "Y", "OUI", "JA", and "SI" are accepted as "YES", and any other answer is considered "NO".

378 · Index Suprtool 5.2 for HP-UX

Page 376: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Special Characters

Special CharactersCertain non-alpha and non-numeric characters like > and : have special meaning within Suprtool. See the descriptions that follow. As well, the term "special" designates a class of characters in the If command.

* Means $Stdinx / $Stdlist* in the Input command means to read input from $stdinx (MPE only). * in the Output command means to write the output to $stdlist.

>input * {MPE only}

>output *

= Means "Equals" or Calculate= in the If command means "EQUALS":

>if customer = "40832"

= in commands means calculate something:

=10+25

Result= 35.0

= in the Output command means to write the sorted input file back into itself.

>input myfile; key 1,10

>output=input {MPE only}

< Means "Less Than"< in the If command means is one field "less than" another field or constant value:

>if balance < 10000

By combining < and =, you get "less than or equals":

>if balance <= 10000

> Means "Greater Than" or "Enter A Command"> is used for two purposes in Suprtool:

As the Suprtool prompt character (e.g., >Input actrec)

To mean greater than in an If command (e.g., if balance>10000). Combining > and =, gives >= for "greater than or equal to".

Suprtool 5.2 for MPE User Manual Glossary of Terms · 379

Page 377: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

<> Means "Not Equals"In the If command, use the two characters <> to mean "not equals":

>if status <> "01"

== Means "Matches Pattern"In the If command, use the two characters == when you want to check a field for a pattern of characters. For example, to select records where the customer name contains the word "THOMPSON" somewhere, use:

>if name == "@THOMPSON@"

>< Means "Mismatches Pattern"In the If command, use the two characters >< when you want to select records that fail to match a pattern of characters:

>if address >< "@CANADA@"

@ Means "Match Anything" in a PatternThe At-Sign character (@) is used in patterns to indicate that Suprtool should accept anything in that position. For example:

>if name == "@ROBERT@"

The @ matches <null> ("ROBERT" is a valid match); it matches one character ("ROBERTA" is a valid match); it matches multiple characters ("ROBERT M. GREEN" and "The ROBERT E. LEE" are valid matches).

# Means Number (in Patterns) or Prompt Character for the Edit Command# is used in patterns to match a single numeric character:

>if type=="REC##" {look for "REC" followed by 2 digits}

# is used by the Edit command on MPE to prompt for commands:

>edit {MPE only}

#list d-inventory

# is used in the Get and Input commands to read every n-th record

? Means Alphanumeric (in Patterns)? is used in patterns to match a single alphabetic or numeric character:

>if type=="BASE??"{look for "BASE" plus 2 alphanumerics}

380 · Index Suprtool 5.2 for HP-UX

Page 378: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

& Means Escape (in Patterns) or Continue Command Line& is used in patterns to match one of the special pattern characters. For example, the #-character matches a single numeric character. If you need to look for the #-character itself, you would specify &# in the pattern:

>if type=="REC&#" {look for "REC" followed by "#"}

& is used to continue a command line. You may enter commands on multiple input lines by putting an "&" continuation character at the end of the line:

>if status="20" and & {continue the If command}

state="AZ","CA","OR" {select several states}

: Means O/S Commands or Bit SelectionColon (:) at the start of a command line indicates an operating system command:

>:listf

>:ls

Colon (:) is used in the If command for bit selections:

>define bitfield,1,2,logical

>if bitfield.(4:2)=3

! Means O/S Commands! at the start of a command line indicates an operating system command. This only works on Suprtool/UX.

>!du

>!ls

; Means Multiple CommandsSemicolon (;) is used to string several Suprtool commands together on a single line:

>input a;output b;xeq {complete "task" is in one line}

, Means a ListComma (,) in Suprtool commands is used to separate parameters:

>base actrec.data,3 {open the database exclusively}

Suprtool 5.2 for MPE User Manual Glossary of Terms · 381

Page 379: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

>key 1,4,double {specify a double-integer key}

>if acct=764523,456732,98765

Commas are optional in some Suprtool commands (e.g., Output), but are required in others (e.g., Extract).

, is the abbreviation for the Redo command.

,. is the abbreviation for the Do command.

,, is the abbreviation for the Listredo command.

" or ' Means StringQuotes (" or ') are the string delimiters in Suprtool (IF NAME="BOB"). Strings that start with " must end with ".

>if name='BOB' {' is the string delimiter here}

( Means Start ParameterLeft parenthesis "(" is used to specify a subscript (see subscript below) or to select a specific range of input record numbers. Left parenthesis always comes with a right parenthesis.

>input actrec.data(10/20) {choose records 10 through 20}

>total budget(2) {total second repeated field}

) Means End ParameterRight parenthesis ")" is used to complete a subscript or a selected range of record numbers. Right parenthesis always comes with left parenthesis.

% Means PercentageIn the Numrecs command, use % to indicate the number of output records as a percentage of the input file size.

>numrecs 10%

/ Means Range of RecordsSlash (/) in the Input and Get commands means a range of record numbers.

>input cat.dog.mouse(1000/2000)

\ Means Range of FieldsBackslash (\) in the Extract command means a range of fields.

>extract account \ rating

382 · Index Suprtool 5.2 for HP-UX

Page 380: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Index

'

' means string...........................................................385

!

! for HP-UX commands...........................................384! for O/S commands.................................................384

"

" means string...........................................................385"closed" tables..........................................................220

#

# as the Dbedit prompt character.....................298, 383# changing the prompt character..............................320# matches number....................................................383# means every n-th record........................140, 162, 383

$

$abs function....................................................119, 149$atoe, Extract function.............................................135$Clean function........................................................151$Clean Function, Extract command.........................124$Counter Function, Extract command.....................121$date function...................................................116, 153$date, how it works....................................................74$days........................................................................155$days function..........................................................116$Edit function...........................................................129$etoa, Extract function.............................................135$file, Total command...............................................224$-functions, if command..........................................159

$invalid..............................................................75, 154$lookup data, If command.......................................144$lookup function......................................................144$lookup, Extract command......................................125$lookup, performance..............................................145$lower..............................................................122, 152$ltrim................................................................123, 152$null file...................................................................186$null, SQL................................................................145$number function.............................................199, 202$Number, Extract Function......................................128$read function..........................................................158$rtrim................................................................123, 152$signed function.......................................................127$Split Function, Extract command..........................123$stddate............................................................116, 154$stdinx file...............................................................382$stdlist file........................................................182, 382$SubTotal Function, extract command....................120$today function................................................115, 154$today, how it works..................................................74$Total Function, Extract command..........................120$trim.................................................................123, 152$truncate function............................................120, 149$upper..............................................................122, 152

%

% means percentage.................................................385

&

& continuation character..........................298, 337, 383& means escape (pattern).........................................383

(

( means start parameter............................................385

Suprtool 5.2 for MPE User Manual Index · 383

Page 381: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

)

) means end parameter.............................................385

*

* means $stdinx / $stdlist / file command................382*, file name.................................................................51

,

, means a list.............................................................384

/

/ means range of records..........................139, 161, 385

:

: for O/S commands.................................................384: for shell commands..................................................48

?

? (prompt for database password)..............................88? means alphanumeric (pattern)...............................383

@

@ matches anything.................................................383

\

\ means range of fields.............................................117

^

^ means character constant..............................115, 146

{

{ start command line comment................243, 299, 338

}

} end command line comment.................243, 299, 338

<

< means less than.....................................................382<> means not equal to..............................................382

=

= means calculator...........................................299, 382= means equal to......................................................382= set name parameter.......................................135, 382== means matches pattern........................................382

>

> changing the prompt character..............................213> is the prompt character.........................................382> means greater than................................................382>< means doesn't match pattern...............................383

4

4GLs...........................................................................69

A

A4-size paper...........................................................174aammdd date format..........................................75, 166abbreviating commands.....................84, 243, 298, 337Abort option on Exit................................110, 255, 343absolute field definition.............................................96absolute value function....................................119, 149accuracy in numeric expressions.............................148Add command....................................................87, 305Add command, locking............................................296Add Dates.................................................................117adding records to a dataset.......................................188All option, Dbedit....................................................302Allbase applications...................................................61Allbase database.......................................................181alphanumeric string test...........................................150alternate values.................................................144, 220alternatives to the If command.................................142AMXW Externalsd, Set.............................................58AMXW Perfwrite, Set...............................................58analyzing performance data.......................................82AND operator...........................................................143appending to a file................................................57, 59appending to file........................................................26appending, Hpmodify..............................................192APS, date format......................................................165arithmetic expressions......................................118, 148arithmetic trap..........................................................235Arithmetic, Set option..............................................198ascending order................................................169, 218ASCII option......................................................40, 184

384 · Index Suprtool 5.2 for HP-UX

Page 382: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

ASK MANMAN date selection...............................165ASK option..............................................................184asterisk...................................................................see *at sign (@) in patterns..............................................383attached printer.........................................................177

B

backslash..................................................................385Base command...........................................................88Base command, default mode..................................210base name parameter..........................................88, 188batch.........................................................240, 328, 378batch passwords.........................................................88batch vs online...........................................................47Before command................................90, 245, 306, 340bit extracts................................................................147block size.................................................................378Blocksize, Set option...............................................198BOT and BACKSPACE error.................................206Bourne shell...............................................................43braces.......................................................243, 299, 338Buffer, Set option.....................................................198BY-part of the Join command..................................348BY-part of the Link command.................................350byte fields, comparing..............................................150Byte to Numeric Conversion...................................128bytelen parameter...............................................96, 169byteposition parameter.......................................96, 169

C

-c cmdstring option....................................................47C invocation of Suprtool..........................................374C shell........................................................................43Calculator.................................232, 244, 299, 338, 379Calendar intrinsic, date format.................................165Calling Suprtool.......................................................367Century and $date....................................................157CGI script.................................................................268Chain command.........................................................92chained access............................................................92Change command.....................................................308Change command, locking.......................................296character constants...........................................115, 146Chronos....................................................................166CI variables..............................216, 217, 278, 357, 358CIUPDATE, see critical-item update......................297Clean........................................................................199Clean Command.................................................94, 276Clean command, STExport......................................247CleanChar................................................................199CleanChar, Set.........................................................276Cleaning data Suprtool.............................................124COBOL invocation of Suprtool...............................371code overflow error..................................................159Cognos, date fields...................................................165colon...........................................86, 244, 299, 338, 384column headings, List command...............................41

Columns command..................................................248combining commands on same line...........................85comma..............................................................298, 384command line...................................................298, 337Command Line...........................................................47command line options..............................................328command line, STExport.........................................240commands................................................242, 294, 298commands, formatting.............................................242commands, multiple...................................................85comments.................................................243, 299, 338Comparing against Key and Data............................144comparing strings as numbers....................................29Complex criteria.........................................................29compound items...............................................113, 218configuring Suprtool..................................................47constants...........................................................113, 145constants in arithmetic expressions..................119, 121constants in the output file.......................................113continuing commands......................................298, 337control break............................................................225control characters.....................................................379control record for Suprtool2.....................................368Control-D in modify..................................................46Control-Y...........................................86, 244, 299, 338conventions........................................................17, 324convert from binary to ASCII....................................36Converting dates........................................................76copying files...............................................................26copying to another database.....................................188count...........................................................................37count duplicate records............................................105count parameter................................................140, 162count qualifying records..........................................186Count, output restrictions.........................................107critical fields, changing............................................303critical-item update..................297, 303, 308, 317, 323

D

data conversion........................................................127Data option...............................................183, 272, 353Data option, Table....................................................222data overflow error...................................................159database editing........................................................109database parameter...................................................379database, open mode................................................210database, opening.......................................................88database, output........................................................188database, password.............................................88, 188dataset, end-of-file...................................................202dataset, highwater mark...........................................202dataset, input......................................................92, 139dataset, output..........................................................188data-types...........................................................97, 241data-types, Oracle......................................................62Date command.........................................................249Date command, invalid dates...................................250Date command, separator character.........................249date constants...........................................................152date format in List............................................175, 207

Suprtool 5.2 for MPE User Manual Index · 385

Page 383: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

date format, Date command.....................................249date function of Extract............................................116date function of If.....................................................152date limits.................................................117, 157, 164Date option...............................................................205date selection............................................................152date selection with ASK MANMAN.......................165Date, Set List............................................................207Date, Set option................................................199, 200dates in the output file......................................115, 116dates, defining..........................................................163dates, relative...........................................................153days function....................................................116, 155DBCONTROL intrinsic...........................................202Dbedit, decimal points.............................................296ddd dates..................................................................166ddd, date format.......................................................166Decimal command...................................................251decimal places....................................................36, 166decimal places, Chain command................................92decimal places, constant values...............................167decimal places, Dbedit.............................................296decimal places, defining...........................................163decimal places, Extract command............................114decimal places, If command....................................147decimal places, List command.................................172decimal places, Table command..............................221default field filling in Suprlink........................349, 351default processing....................................................111Defer, Set option......................................................202deferred output in IMAGE.......................................202Define command................................................96, 227Defining fields...........................................................26definition parameter...................................................96delete all records warning........................................101Delete command......................................101, 209, 309Delete command, locking........................................296deleting duplicate records........................................106deleting entries.........................................................101deleting entries, recovery.........................................101delimited output files.........................................68, 185Delimiter command.................................................252Delimiter, maximum length.....................................293Desc parameter.................................................169, 218descending order..............................................169, 218differences, MPE vs. HP-UX.....................................50disc space...................................................................59disc space, reduced.............................................57, 180display constants......................................................114display fields, maintaining the sign.........................127Display option..........................................................184Do command....................................103, 253, 310, 342documentation............................................................17double quotes...........................................................273double-sided printing...............................................174downshifting strings.................................................122Dumponerror, Set option.........................................202Duplicate and non-SD files......................................106Duplicate command.................................................104duplicate field names...............................................353duplicate keys, order of sort.......................................68duplicate output file...................................................50

duplicate records..............................................104, 188Duplicate records.......................................................33duplicates, removing................................................104duplicates, saving.....................................................104dynamic dataset expansion..............................136, 137dynamic Web pages.................................................264

E

EBCDIC conversions...............................................135Edit command..........................................................109Edit masks................................................................129editing databases......................................................109EditStoperror, Set option.........................................202EDSdate...................................................................165Eloquence...................................................................81Eloquence loading......................................................45Eloquence, Ciupdate option.....................................297Else clause of the IF command................................142end-of-file, IMAGE.................................................202endrecord parameter.........................................139, 161Environment variables, Suprtool2...........................368Eofread, Set option...................................................202equal to sign.....................................................379, 382Erase option of Output.....................................335, 353erasing files..............................................................182error block size.........................................................378error messages in Suprtool...............................235, 380error messages, Suprtool2........................................377error, code overflow.................................................159error, data overflow..................................................159escape character.......................................................146Escape Command.....................................................254Euro currency symbol..............................................115example of Suprlink.................................................330exclam......................................................................244exclamation mark.....................................................338Exit command..........................110, 231, 255, 284, 311Exit command, importance of..................................367Exit command, Suprlink..................................343, 361exit with verify...................................................48, 327exiting from batch jobs............................................110Export command......................................................112Extract command...............................................39, 113Extract command, decimal places............................114Extract from a table..................................................125Extract functions and Sort................................107, 219extracting a range.....................................................117extracting bits...........................................................134extracting dates........................................................115extracting records.....................................................142

F

Fastread, Set option..................................................203field list....................................................................295field parameter...................................96, 113, 224, 380field type..................................................................169Fieldname, Heading command................................259

386 · Index Suprtool 5.2 for HP-UX

Page 384: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

File command...........................................................312file name parameter..........................................161, 182file names, hardcoded................................49, 239, 325File option in List.....................................................209file parameter, Dbedit..............................................300file system error.......................................................235Filecode, Set option...........................................58, 203filename parameter...................................................380filling unmatched join fields....................................349filling unmatched link fields....................................351finding invalid dates.................................................154Firstrec, Set option...................................................203fixed columns...........................................................273fixed-length, output file...........................................248Floating command...................................................257floating point, classic.................................................51floating sign.............................................................280floating-point numbers.............................................257Form command........................................258, 313, 344Form Command.......................................................136Form command, default...........................................138Form command, keywords...............................138, 313formatting commands..............................................242FormFeed, Set List...................................................209Formout file.............................................................345four-digit years...........................................................72FROM-part of Join command..................................349FROM-part of Link command.................................351

G

Get command...........................................................139greater than (>).........................................................382

H

Heading command...................................................259heading, HTML option............................................263heading, maximum length........................................293Help command.........................................141, 261, 314Help command, Suprlink.........................................346highwater mark, reading to......................................202holding tables for re-use...........................................221How to run.................................................................25HPCalendar, date.....................................................166HPCalendar,date format...........................................165Hpmodify editing, examples....................................192HP-UX commands.....................................86, 244, 338HP-UX vs. MPE.........................................................50HTML command.....................................................262HTML files, maximum size.....................................262

I

IEEE numbers..........................................................257If $lookup.................................................................144If command..............................................................142If command too long, use $read...............................158

If command too long, use Table..............................220If command, combining with Chain..........................93If command, decimal places....................................147If command, prompting for values...........................159Ifcheck, Set option...................................................204Ignore, Set option.....................................................204illegal digits (packed or zoned)................................333IMAGE, end-of-file.................................................202initial command line..................................................47initializing a field.....................................................113input choices..............................................................60Input command........................................161, 270, 347input file...................................................................241input file, maximum block size................................365input file, maximum fields...............................293, 365input file, maximum record length...................293, 365input files.................................................................329input key fields.................................................270, 347input, from Stdlist......................................................51input, line feeds..........................................................50installation, AMXW...................................................23installation, HPUX.....................................................23installing STExport..................................................237installing Suprlink....................................................325Interactive, Set.........................................................205interrupt............................................................244, 338Introduction................................................................16introduction to Dbedit..............................................294introduction to STExport.........................................241introduction to Suprlink...........................................329invalid dates...............................................75, 154, 250Invalid Dates............................................................155ISO-8859-1 characters, HTML output.....................263Item command.........................................163, 205, 227

J

Join command..........................................................348Join command, example...........................................331join key fields...........................................................348Julian dates...............................................................166Julian day number....................................................116JulianDay data format..............................................165

K

Key command..........................................................169key fields, input file.........................................270, 347key fields, join file...................................................348key fields, link file...................................................350Key option................................................................183Key option, Dbedit...................................................302Korn shell...................................................................43KSAM files..............................................................161KSAM, order of sort..................................................68

Suprtool 5.2 for MPE User Manual Index · 387

Page 385: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

L

labelled tapes............................................................206landscape output.......................................................207Large files, HP-UX....................................................61LaserJet............................................................173, 207leading sign..............................................................280less than (<)..............................................................382Libary Loading...........................................................45Libraries have not been loaded..................................45Limit option, Dbedit.................................................302limits within Suprlink..............................................365Limits, Set................................................................206line feeds....................................................50, 186, 272Link command.........................................171, 327, 350Link file, maximum block size................................365Link file, maximum fields........................................365Link file, maximum number of................................366Link file, maximum record length...........................365link key fields...........................................................350Link option...............................................................183linking files..............................................................329list clears screen.......................................................174List command...................................................172, 315list device.................................................................176List File....................................................................176List, Char option......................................................172List, Column Headings............................................176List, Date default......................................................207List, Date option.......................................................175List, Decimal option.................................................172List, Duplex option..................................................174List, FormFeed default.............................................209List, Heading option.................................................176List, Hex option.......................................................172List, Leftjustnum option...........................................173List, Noname option.................................................173List, Norec option....................................................173List, Noskip option...................................................173List, Octal option.....................................................172List, Oneperline option............................................173List, Record option...................................................177List, Rightjustnum option........................................173List, Standard option................................................175List, Time default.....................................................208List, Time option......................................................175List, Title option.......................................................174listing..........................................................................39listing formats..........................................................172listing one per line....................................................173listing with subheadings...........................................176listing without field names.......................................173listing, producing simple reports..............................175listing, suppressing blank lines................................173Listredo......................................................................27Listredo command...........................179, 271, 316, 352literals in the output file...........................................113loader warnings..........................................................48Loader Warnings, print option...................................46Lock, Set option.......................................................209locking, IMAGE..............................................209, 296

long expressions.......................................................158Lotus 1-2-3...............................................................185low values................................................................146lower-case........................................................122, 152LP device.................................................................177LP, Set option...........................................................320

M

Machine types, PA_RISC or Itanium........................45MACS, date format..................................................165mailing labels.............................................................41MakeAbsent, Set option...................................209, 210Mapped, Set option..................................................356master dataset expansion..........................................137match pattern............................................................382maximum block size in Suprtool.............................378maximum delimiter length.......................................293maximum heading length.........................................293maximum input block size.......................................365maximum input record length..........................293, 365maximum link block size.........................................365maximum link fields................................................365maximum link files..................................................366maximum link record length....................................365maximum output fields............................................366maximum output record length........................293, 366maximum size, HTML files.....................................262MDX........................................................................137means range of fields...............................................385missing comma, error.......................................119, 121mixed case comparisons..........................................152mode parameter..................................................88, 188Modify command.....................................................317Modify command, locking.......................................296modulo operator...............................................118, 148MPE commands, disabling access...........................206MPE vs. HP-UX.........................................................50MPE, restricting.......................................................206multidataset access.....................................................17multiple commands per line.......................85, 298, 384multiple search values..............................................220

N

native language support...........................................209negative value..........................................................127NLS option, Set command.......................................209no quotes..................................................................273NOLF.......................................................................186Non-Collating Date Types.......................................157nonprinting characters..............................................146non-SD Files and duplicate......................................106not equal to (<>)......................................................382NOT operator...........................................................143null values................................................................146Num option..............................................................183Num,Data option......................................................183Num,Key option.......................................................183

388 · Index Suprtool 5.2 for HP-UX

Page 386: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Num,Query option...................................................184number sign (#) in patterns......................................383numeric bytes, Suprtool...........................................147numeric constants.....................................................145numeric conversion..................................................148numeric expressions.........................................118, 147numeric justification................................................173numeric string test....................................................150Numeric to Byte conversion....................................129numeric truncation...................................................148Numeric-value option, Dbedit.................................301Numrecs command............................................57, 180

O

O/S commands...........................................................86-oc option...................................................................47offset parameter.........................................................96Open command........................................................181option parameter, Dbedit.........................................301optional command name..........................................170optional Join option..................................................349optional Link option.................................................351OR operator..............................................................143Oracle applications.....................................................62Oracle database........................................................181Oracle data-types.......................................................62Oracle date format....................................................166Oracle dates..............................................................249Oracle Integer, Set...................................................211Oracle Loading...........................................................45Oracle Number Conversion.......................................63Oracle OpenFix, Set.................................................211Oracle PassShift, Set................................................212Oracle Rows, Set......................................................211Oracle ZeroNull, Set................................................212Oracle, performance...................................................82OS commands..........................................................299out of disc space.................................................57, 180outcount, default file name........................................47outcount, Set Filename...............................................49output choices............................................................60Output command......................................182, 272, 353output file format.....................................................248output file name duplicated......................................378output file, maximum fields.....................................366output file, maximum record length.................293, 366output file, Suprlink.................................................330output filecode...................................................58, 203output format............................................................289output limits with Count and Total..........................107output record format................................................363Output, Append option.............................................182Output, ASCII option.........................................40, 184Output, ASK option.................................................184Output, Data option..................................183, 272, 353Output, Display option.............................................184output, duplicate file..................................................50Output, Erase option................................................182Output, Key option...................................................183Output, Link option..................................................183

Output, Num option.................................................183Output, Num,Data option.........................................183Output, Num,Key option..........................................183Output, Num,Query option......................................184Output, PRN option.................................................185Output, Query option...............................................183overpunches, not used..............................................145overview of Dbedit..................................................294

P

PA_RISC and Itanium...............................................45packed constants......................................................114packed fields, maintaining the sign..........................127packed-decimal fields................................................98packed-decimal, illegal digits..................................333page headings in List...............................................174parameters, Dbedit commands.................................300parentheses.......................................................143, 385Parm=64 in Suprlink................................................327password in batch.......................................................88password parameter...........................................88, 188password upshifted.....................................................88path, default for Suprtool...........................................44paths, IMAGE detail datasets....................................92pattern matching...............................151, 212, 382, 383pausing for user........................................................229PC files...............................................................68, 185PCL option, Set List.........................................173, 207percent sign......................................................379, 385Performance...............................................................81Performance considerations, Suprlink.....................332Performance Eloquence...........................................203performance of Dbedit.............................................295performance of STExport........................................242Perl script.................................................................267Permanent redo........................................214, 276, 356Persistent redo..........................................214, 276, 356personal computers....................................................68PHdate option, Item command................................165positive value...........................................................127PowerHouse...............................................................69PowerHouse applications...........................................69PowerHouse dates....................................................165PowerHouse subfiles..................................70, 335, 353Prefetch............................................................209, 210preformatted, HTML option....................................262Printer Command Language....................................207printer, attached to terminal.....................................177printing reports...........................................................40PRN option.........................................................68, 185processing selections..................................................60Program files, PA_RISC or Itanium..........................45progress messages....................................................213prompt character......................................................382Prompt, Set option...........................................213, 320prompting using Quiz................................................71pseudo-batch tasks...................................................378Put command...................................................188, 209

Suprtool 5.2 for MPE User Manual Index · 389

Page 387: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Q

Q command......................................................190, 318Qedit program......................................68, 90, 245, 306Qedit program and Suprlink.............................340, 343Qhelp................................................141, 261, 314, 346QTP for subfile..........................................................70QTP, Cognos............................................................335QUERY "numbers" format......................................184Query option............................................................183question mark, database password.............................88question, delete all records.......................................101Quick help........................................141, 261, 314, 346Quiet, Set option......................................................320Quiz report writer...............................69, 335, 351, 353quote characters.......................................................145Quote command.......................................................273quotes, double..........................................................273quotes, none.............................................................273quotes, single............................................................273

R

random sampling..............................................140, 162range of fields..........................................................117range, extracting.......................................................117read only mode.........................................................206reals, classic...............................................................51record format, output.................................................39record length..............................................................50Record Mode, List option........................................177record number..........................................................161record number selection...................................139, 161record number, IMAGE...........................................139record number, Output.............................................183record number, XSORT...........................................203records, number of qualifying..................................186Redo command................................191, 274, 319, 354Redo, number of commands....................................191Redo, Set..................................................214, 276, 356reduced output..........................................................207Reflection...................................................................68Related option, Dbedit.............................................302relative dates............................................................153relative field definitions.............................................96Remote Oracle Database..........................................181removing spaces...............................................123, 152repeated fields..........................................................146reports........................................................................40Reset command........................................194, 275, 355Reset, Set option......................................................321Resolving Variables.................................217, 278, 358Resolving Variables like MPE.........................278, 357restrictions in Dbedit................................................294ROBELLE variable....................................49, 239, 325Roman-8 characters, HTML output.........................263Roman-8 vs. ASCII..................................................174running out of disc space in sort..............................219running STExport.....................................................239running Suprlink......................................................327

running Suprtool........................................................43running, supramxw....................................................53

S

scientific format.......................................................257SD files...............................26, see self-describing filesSD files, date formats.................................................67SD files, decimal places.............................................67SD files, extended names...........................................67SD files, Input............................................................67SD files, listing...........................................................67SD files, restrictions...................................................68SDExtname, Set.........................................................67SDUnix......................................................................64search criteria...........................................................300Select by list of values...............................................31Select command.......................................................195Select command, Allbase rows................................198Select performance...................................................195Select, Long commands...........................................195Selecting by date........................................................29selecting multiple values..........................................144Selecting non-matches,Suprlink..............................334selecting records.......................................................142Selecting records........................................................28selection by date.......................................................152selection logic..........................................................330selection using arithmetic........................................148self describing files, field name limit.........................66self-describing file format................................289, 363self-describing files......................64, 66, 106, 183, 330semicolon.................................................................298semicolon means multiple commands.....................384separator, dates.........................................................249serial vs. chained read................................................92session........................................................................68session mode............................................................378Set Allbase...............................................................198Set Arithmetic..........................................................198Set Blocksize............................................................198Set Buffer.................................................................198Set command, Dbedit...............................................320Set command, STExport..........................................276Set command, Suprlink............................................356Set command, Suprtool............................................196Set CurrencySymbol................................................199Set Date....................................................................201Set Date Cutoff..................................................72, 199Set Date Forcecentury........................................73, 200Set DecimalSymbol.................................................202Set Defer..................................................................202Set Dumponerror......................................................202Set EditStoperror......................................................202Set Eofread...............................................................202Set Fastread..............................................................203Set Filecode........................................................58, 203Set Firstrec...............................................................203Set Hints...................................................................203Set Ifcheck...............................................................204

390 · Index Suprtool 5.2 for HP-UX

Page 388: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

Set Ignore.................................................188, 204, 235Set Itemabbreviatedate.............................................205Set Labelledtaperewind............................................206Set Limits.................................................................206Set List PCL.....................................................173, 207Set Lock...................................................................209Set LP, Dbedit..........................................................320Set Mapped..............................................................356set name parameter....................................92, 139, 188Set NLS....................................................................209Set Openmode..........................................................210Set Progress..............................................................213Set Prompt, Dbedit...................................................320Set Prompt, Suprtool................................................213Set Quiet, Dbedit......................................................320Set Reset, Dbedit......................................................321Set Sortfast.......................................................215, 216Set Squeeze................................................................59Set Statistics, STExport...........................................277Set Statistics, Suprlink.............................................357Set Statistics, Suprtool.............................................216Set ThousandSymbol...............................................216Set Underline, Dbedit...............................................321Set VarSub...............................................................216Set Varsub, STExport......................................278, 357Set VarSubCompat...................................217, 278, 357Set VarSubDebug.....................................217, 278, 358Set Verify, Dbedit....................................................321Set ZonedFix, STExport..........................................279shell commands..........................................................48shell script................................................................265Sign command.........................................................280signed function.........................................................127Simple selection.........................................................29single quotes.............................................................273slash, range of records..............................................385Software Research Northwest..................................166son process...............................................110, 255, 343sort break....................................................................37sort break totals........................................................225Sort command..........................................................218sort information not retained....................................106sort keys...................................................................330Sortfast, Set option...........................................215, 216sorting files.........................................................68, 169Sorting records...........................................................32Spaces command......................................................281spaces, removing..............................................123, 152special characters.....................................................381Special Characters....................................................151special string test......................................................150specifying input..........................92, 139, 161, 270, 347spool file errors........................................................235SQL database, Allbase rows....................................198SQL database, inserting records................................87SQL database, Select command...............................195SQL database, specifying.........................................181SQL database, structure...........................................137Squeeze, Set option....................................................59SRN, Chronos date...................................................166startrecord parameter.......................................139, 161Statistics, Set option.................................216, 277, 357

stddate function................................................116, 154Stddate, Set date cutoff..............................................72Stdlist, input from......................................................51STExport....................................................16, 112, 185string constants.................................................145, 385string conversion......................................................121string expressions.....................................................149string of digits............................................................29string replacement, Hpmodify.................................192string truncation.......................................................122string, as a delimiter.................................................252string, heading command.........................................259strings.......................................................................380stty, terminal settings.................................................46sub totaling.................................................................38subcommands, Dbedit..............................................303subfile script...............................................................71subfiles, PowerHouse.........................................70, 335subscript parameter..................................113, 224, 381subscript parameter, character.................................146subscript parameter, Define.......................................96subscript parameter, numeric...................................146substrings.................................................................146subtotals.............................................................37, 105Subtract Days...........................................................117sum of field values...................................................224summary of STExport..............................................241summary of Suprlink................................................329Super Cartridge........................................................174Supramxw differences...............................................54Suprhint.Help.Robelle..............................................203Suprlink..............................................................17, 183Suprlink commands.................................................337Suprlink, using from Suprtool..................................327Suprlist file...............................................................320Suprmgr files........................................................47, 49Suprtool dynamic loading..........................................45Suprtool in Suprlink.................................330, 348, 350Suprtool package........................................................16Suprtool Road Map....................................................24Suprtool2 error messages.........................................377Suprtool2 routine.....................................................367Suprtool2, Installation..............................................376SuprtoolOutCount JCW...........................................370Suspend option on Exit....................................255, 343

T

Table command........................................................220Table command, decimal places..............................221Table, $lookup...........................................................31table, HTML option.................................................262tables........................................................................381tables in Chain command...........................................92tables, holding between Xeqs..................................221tables, maximum size...............................................206tape files...................................................................161tape files of large size................................................57Target field, Extract command................................118task, what is a task...............................................25, 60terminology..............................................................324

Suprtool 5.2 for MPE User Manual Index · 391

Page 389: ftp.robelle.comftp.robelle.com/ftp/manuals/suprtool52/suprux.doc · Web viewUser Manual. Doc-To-Help Standard Manual. by Robelle Solutions Technology Inc. Program and manual copyright

third-party indexing.........................................138, 236ThousandSymbol, Set option...................................216time format in List...........................................175, 208Time, Set List...........................................................208title, HTML option...................................................262TMPDIR....................................................................81TMPDIR variable.....................................................219today function of Extract.........................................115today function of If..................................................154Total command........................................................224Total, output restrictions..........................................107totaling by field..........................................................38totaling duplicate records.........................................105totals to a file............................................................224totals,running.............................................................38trailing sign..............................................................280trimming spaces...............................................123, 152truncate function..............................................120, 149truncation, numeric..................................................148truncation, strings.....................................................122two-digit years...........................................................73type parameter..............................................96, 97, 169

U

Under option, Dbedit...............................................303Underline, Set option...............................................321Undo edit, Hpmodify...............................................192Un-printable characters............................................124unsigned value.........................................................127Update command.............................................209, 226Updatekey option, Dbedit........................................303upper-case........................................................122, 152upshifting strings......................................................122Use command...................................227, 282, 322, 359Use command with If $read.....................................159user specified heading..............................................259Userpause command................................................229

V

-v option.....................................................................48value tests.................................................................143

variable length strings......................................122, 149Variable substitution..................................................82Variable Substitution, Set option.....................216, 217variable-length, output file.......................................248Varsub, Set option....................................................357Verify command......................219, 230, 283, 323, 360Verify, Set option.....................................................321

W

warning messages............................................236, 381warning, delete all records.......................................101Warnings, Set...........................................................278Web server...............................................................264Web, html.................................................................262What is AMXW.........................................................53

X

Xeq command, STExport.................................255, 284Xeq command, Suprlink..................................343, 361Xeq command, Suprtool..................................110, 231Xeq option on Exit...................................110, 255, 343XML command........................................................285Xmltagchar, Set........................................................279XSORT....................................................................203

Y

Year 2000.................................................................201Year 2000 testing.......................................................81Year 2000, solutions..................................................72yes answer to questions....................................235, 381yes response in pseudo-batch...................................378yyymmdd date format..............................................165

Z

Zero command.........................................................288zoned constants........................................................114zoned-decimal, illegal digits....................................333

392 · Index Suprtool 5.2 for HP-UX