Download Print this page
HP 3000 Manual
HP 3000 Manual

HP 3000 Manual

Mpe/ix computer systems, rpg/xl utilities
Hide thumbs Also See for 3000:

Advertisement

Quick Links

HP RPG/XL Utilities
HP 3000 MPE/iX Computer Systems
Edition 1
Manufacturing Part Number: 30318-90006
E1089
U.S.A. October 1989

Advertisement

loading

Summary of Contents for HP 3000

  • Page 1 HP RPG/XL Utilities HP 3000 MPE/iX Computer Systems Edition 1 Manufacturing Part Number: 30318-90006 E1089 U.S.A. October 1989...
  • Page 2 Rights for non-DOD U.S. Government Departments and Agencies are as set forth in FAR 52.227-19 (c) (1,2). Acknowledgments UNIX is a registered trademark of The Open Group. Hewlett-Packard Company 3000 Hanover Street Palo Alto, CA 94304 U.S.A. © Copyright 1989 by Hewlett-Packard Company...
  • Page 3 In using XSORT, you may have programs and systems that interface with the Keyed Sequential Access Method (KSAM/3000), the IMAGE Data Base Management System (IMAGE/3000), and the Data Entry and Forms Management System (V/3000). For information about these systems, please read:...
  • Page 4 Conventions NOTATION DESCRIPTION UPPERCASE Within syntax statements, characters in uppercase must be entered in exactly the order shown, though you can enter them in either uppercase or lowercase. example: SHOWJOB Valid entries: showjob ShowJob SHOWJOB Invalid entries: shojwob ShoJob SHOW_JOB italics Within syntax statements, a word in italics represents a formal parameter or...
  • Page 5 stacked, you can select any one of the elements or none. In the following example, you can select devicename deviceclass or neither: SHOWDEV [ devicename ] [ deviceclass ] [...] Within syntax statements, a horizontal ellipsis enclosed in brackets indicates that you can repeatedly select elements that appear within the immediately preceding pair of brackets or braces.
  • Page 6 must select A or B or AB or BA. The first element cannot be preceded by a comma: {B}|,...| Within examples, horizontal or vertical ellipses indicate where portions of the example are omitted. Å Within syntax statements, the space symbol Å shows a required blank. In the following example, you must separate modifier...
  • Page 7 the Y key on the keyboard. base prefixes The prefixes %,#, and $ specify the numerical base of the value that follows: % num specifies an octal number. # num specifies a decimal number. $ num specifies a hexadecimal number. When no base is specified, decimal is assumed.
  • Page 9 Introduction Hewlett-Packard's Extra Function Sort for RPG/XL, hereaft er referred to as XSORT, enables users to rearrange data in their files, drop records from their files, and reformat records, as shown in figure 1-1. XSORT runs on the MPE XL computer system and is primarily used in conjunction with the RPG programming language.
  • Page 10 Characteristics of XSORT: In extending and enhancing your sort capabilities, XSORT: • Uses from one to nine input files. • Employs multiple logical criteria to select records from MPE (disk and non-disk) and KSAM files, so you can process a subset of your input records. •...
  • Page 11 36 of the work record. The following is an example of how XSORT builds your work record to reflect your specifications: ------------------------------------------------------- Control field Control field Data ------------------------------------------------------- 17 18 NOTE The control fields must precede the data fields in the work record. They will be re- tained on output unless you wish to drop them.
  • Page 12 Record-Out Sort (SORTR) The output from a Record-out sort is a file of complete records that are immediately available for processing. These sorted records can contain: • Control fields and data. • Control fields only. • Data only. A Record-out sort offers faster processing than the Address-out as well as enabling you to reformat files and to create new files from reformatted records.
  • Page 13 • The relative record numbers of the records in the input file. • Part or all of the records in the input files. • A count of the number of records selected for processing from the input files. Supplying the Sort Specifications XSORT specifications are normally entered through a job stream.
  • Page 14 1- 16...
  • Page 15 You do not always need to use all the specification types for every sort; but the order in which the specifications are used doesn't vary. You always fill out Header Specifications first. The ALTSEQ (Alternate Collating Sequence) and the S (Special) Option specifications can be ignored if they are not to be used in the sort.
  • Page 16 A discussion of the commands for SORT3 as compared to XSORT appears in appendix A. Your MPE Commands Provide: • Name of the program--XSORT.PUB.SYS • Name of the files you want to sort. The formal designator for a single-file sort is XSORTIN. For multiple- file sorts, formal file designators are XSORTIN1 through XSORTIN9.
  • Page 17 with XSORTIN1. When you use more than one input file: • You cannot do an Address-out (SORTA) sort. • You cannot do an in place sort, in which output file overlays input file. • XSORT bases its operations on the characteristics of the first file opened.
  • Page 18 Data and Timing Data Considerations • Maximum data input record size is 8192 bytes. • The collating sequence may be altered by the ALTSEQ specs. (See appendix C for further information concerning data.) Timing Factors The time it takes to run a sort depends on the following factors: •...
  • Page 19 Specifications for Address-Out Sort (SORTA) The columns that are shaded must be considered when you are planning an Address-out sort job. 1- 21...
  • Page 20 Specifications for Count-Only Sort (SORTC) The Columns that are shaded must be considered when you are planning a Count-only sort. 1- 22...
  • Page 21 1- 23...
  • Page 22 1- 24...
  • Page 23 Chapter 2 Header Specifications When you enter Header Specifications you are telling XSORT the following: Introduction • The type of sort you want to do--Address-out, Record-out, or Count-only. • The format you have selected for the sorted file. • The information you wish to have printed to help you check for errors. Only one Header Specification is needed for each sort job.
  • Page 24 Table 1: Header Specification Column Entries Columns Entries Explanation 0 or blank Print: XSORT specifications Diagnostic messages Statistics Abort messages Display messages Print: Statistics Abort messages Display messages Print: Abort messages Display messages Print only display messages 28*** Blank Retain control fields on output records in Record-out sort jobs. Drop control fields from output records in Record-out sort jobs.
  • Page 25 Place the largest of these sums in columns 13-17. The entry cannot exceed 256. Additional information concerning this entry can be found under column 7 of the Field Description Specifications. Also, see figure 2-1, in which the largest control field sum of two record sections is calculated and the total entered in columns 13-17.
  • Page 26 Figure 2-1. Calculating Control Field Length Column 18 2- 28...
  • Page 27 Ascending or Descending Sequence This entry indicates the sequence in which you want the records sorted. Table 3: Column 18 Entry Sequence Ascending sequence by control field Descending sequence by control field Sequencing will be done according to the ASCII collating sequence unless it is altered using ALTSEQ specifications.
  • Page 28 Column 28 only applies to Record-out sorts (SORTR). It indicates whether or not you want to drop control fields from output records after they are sorted. An X means drop them. Leaving Column 28 blank means keeping the control fields. Reasons for Dropping Control Fields If you are using an alternate collating sequence or opposite control fields you would probably drop the control fields.
  • Page 29 Chapter 3 Alternate Collating Sequence Specifications Normally, XSORT uses the standard ASCII collating sequence included in appendix C. If you want to change the standard collating sequence, you must code an S in column 26 of the Header Specification and code a set of ALTSEQ specifications.
  • Page 30 Enter as many such pairs as the number of characters you are taking out of normal sequence. Leave no spaces between sets of hex numbers. When you reach the end of a statement, continue on the next specification line, following the rules above (1-6).
  • Page 31 Programming with ALTSEQ Placing an alternate character in the sequence position which is normally assigned to another means that both occupy the same position and are considered equal. (See Sample ALTSEQ Statements section in this chapter.) If you do not want to have the characters regarded as equal, the one which normally occupies that position must be moved.
  • Page 32 Column 7: Address-Out File First Record Number This entry states the first record number of an Address-out file. It is used primarily for sorts converted from other systems, such as IBM, that start record numbering at 1 instead of 0 (as HP does). 3-34...
  • Page 33 • If you enter blank, the record numbering starts at 0 unless you are sorting a KSAM file built with Fir- strec=1, in which case record numbering starts as 1. • If you enter "0", the record numbering starts at 0. This is true even if you are sorting a KSAM file built with Firstrec=1.
  • Page 34 Chapter 5 Record Type Specifications Introduction Record Type Specifications tell XSORT which records in a file you wish to have sorted. If you want all the records in a file to be sorted, and they have all been prepared in the same format, you do not have to fill out this section of your XSORT specifications.
  • Page 35 unconditionally. Sets The unique identification of a Record Type is made using sets of "include" and "omit" Record Type Specifications. These sets may be used singly or intermixed to include or omit data records in the current section according to their characteristics. (Multiple characteristics within a set must be tied together using the AND operation.) An Include set defines the characteristics of a Record Type that is to be included (accepted) in the current section.
  • Page 36 COLUMNS ENTRIES EXPLANATION 17-18* Factor 1 must equal factor 2. Factor 1 must not equal factor 2 Factor 1 must be less than factor 2. Factor 1 must be greater than factor 2. Factor 1 must be less than or equal to factor 2. Factor 1 must be greater than or equal to factor 2.
  • Page 37 Column 7 Explanation Entry This line contains the first characteristic of a new Record Type that has the same spec type (column 6) as the previous line. The O stands for OR. The asterisk indicates a comment line. Comment lines are included as an aid in remembering why you were proceeding as you were at various points in the program.
  • Page 38 Colum Colum Type Explanation Omit AND ..One or more lines defining the characteristics of one Record Type. and OR First characteristic of a different Record Type than the previous line. Lines Additional characteristics for the same Record Type as the previous line. An Omit set can be preceded by the Header (or ALTSEQ or S Option, if used), Field Descriptions for the previous section, or an include set.
  • Page 39 Column 8 Entry Comparison Type Maximum Field Length* Numeric data is unpacked. 28 characters (unpacked digits) * Maximum field length applies to both factor 1 and factor 2 data. ** If you specify an alternate collating sequence, you cannot use packed data for record selection factors or sort control fields.
  • Page 40 Columns 17-18: Type of Comparison This entry tells XSORT what kind of comparison you want to make between factor 1 and factor 2. You will specify the type and location of factor 2 when you fill in columns 20-80 (if it is a constant) or 20-27 (if it is another field in the same record).
  • Page 41 Columns 20-80: Factor 2 Constant If factor 2 is a constant, you use columns 20-80 to enter the constant you have selected. Normally, columns 40-80 are reserved for comments. They can, however, be used as necessary for constants longer than 20 characters or digits.
  • Page 42 If last digit in You replace it with constant is: this character: Packed Constants Packed numbers in this entry receive different treatment. If factor 1 contains a packed number, the length of the constant must be twice the length of the factor 1 field. This includes the sign, "+" or "-", which must be placed in the rightmost position of the constant after the last digit (negative signs cannot be "overpunched"...
  • Page 43 The following table is an overview of field description specification column entries. Columns Entries Explanation Any value. Line number. Field Description line identification. Normal control field. Opposite control field. Forced control field. Data field. Comment line. Packed decimal data. Unpacked decimal data. Character data.
  • Page 44 commands. Column 7 Entry Meaning To Program This is a normal control field. The field will be sorted according to the sequence specified in column 18 of the Header Specifications. This is an opposite control field. It tells the program to sort the data in the sequence opposite to that specified in column 18 of the Header Specifications.
  • Page 45 3-47...
  • Page 46 Forced Control Fields You can force a character into your control field by using forced control. There are special considerations you should keep in mind when you plan to use forced control fields. • Only one character can be used in your forced control field. •...
  • Page 47 Record |------|---|------| Record |---|------| A 1 - position control field (A) in input record is moved to first control field position in work record. * Change each A to a $. |---|-------| |---|-------| | A | Data | | $ | Data | |---|-------| |---|-------| Original work record...
  • Page 48 Unconditional Force Your unconditional force does not represent a field present in the input records. You might wish to place a 5 in the first position of every output record. Using an unconditional force control field, you could tell XSORT to place a 5 in the first available control field of the work record. Control field portion Data portion All other control fields would then follow the 5 that has been unconditionally forced.
  • Page 49 Comment lines have nothing to do with the way your program operates. They provide you with an opportunity to document your work. You can code documents anywhere within the XSORT specifications, but they will be printed only if a blank or 0 is in column 27 of your Header Specification. Column 8: C, P, U, or V Column 8 entries tell XSORT what type of data is to be used in the work records.
  • Page 50 Columns 9-16: Field Locations Columns 9-16 locate the input record positions that contain the field. The starting position (from) is identified in columns 9-12. The end position (to) is identified in columns 13-16. The order you impose in your Field Description Specifications will determine the order in which they will be located in the output records.
  • Page 51 Right-justifying entries is recommended. The starting (from) position of the input records ends in column 12. The end (to) position ends in column 16. In the example above, because it is a 1-character field, the 9- 12 positions are left blank and the entry of the character's position is right-justified in column 16. Field Length The maximum allowable length of the field depends on your column 8 entry.
  • Page 52 not changed when you use forced characters. Column 19: Continuation A non-blank character here says that this line is a continuation of the force character specifications group begun on the preceding line or lines. When several force character specifications apply to the same 1-character control field, they must be entered together as a group.
  • Page 53 • Force-all. • Conditional force on normal or opposite control fields. • Stand-alone conditional force. Example 1: Unconditionally Forced Character In this example a control field ($) is unconditionally forced into the work and output records. Example 2: Stand-Alone Conditional Force This example shows how different control field characters can be forced into position in the work record, depending on the character present in an input record position.
  • Page 54 continuation lines are used in this example, only one position in the work and output records is defined by the first three lines. If column 19 were left blank and no continuation lines were used, each line would then define a new position in the work and output records. When you sort records in ascending order, having placed an A in column 18 of the Header, XSORT places hex FF into the work record before you force any characters.
  • Page 55 Example 3: Conditional Force on Normal or Opposite Control Field In this example, as in the one previous, the control field in the input record changes the work and output records. This example is significantly different, however. Here the control field is moved to the work record and then changes are made.
  • Page 56 Example 4: Force-All In the example, if control fields contain characters other than 2, 4, and 6, use a force-all line so that you won't have a hex FF or 00 present in the work and output records. 3-58...
  • Page 57 Columns 20-39 Reserved for future use. Columns 40-80 Comments These columns are reserved for your comments. Columns 40-45 are set aside by dotted lines as a convenient place to write down the names of fields described in the Field Description lines. If you specified in your Header line that you wanted to have your specifications printed, your comments will be printed also.
  • Page 58 3-60...
  • Page 59 Chapter 7 Using XSORT Commands Introduction This section contains examples of the MPE commands necessary to run XSORT in interactive and job stream modes. These examples also encompass the various input and output file options provided by the utility. Running XSORT Extra Function Sort for RPG can be run in job stream or interactively.
  • Page 60 Case 1 - XSORTIN-and XSORTOUT are disk files. Case 2 - XSORTIN=$STDIN and XSORTOUT=$STDLIST. * Example #9 uses single file input. Count-only (SORTC) can also be used with multiple file input. To determine the appropriate commands for a multiple file SORTC, see Example #8 regarding how it specifies multiple input files (XSORTIN1...XSORTIN9).
  • Page 61 A brief explanation of each specification follows. 7-63...
  • Page 62 Header Specifications Column Entry Explanation blank No line numbers are required. The H designates this as the Header specification for the sort. 7-12 SORTR SORTR indicates that this is a Record-out sort. 13-17 Largest sum of control field lengths for any record section, in bytes. In this sort the total is 4.
  • Page 63 About the Job Stream Examples The easiest way to prepare job control commands is to enter them in a disk file using EDIT/3000. When you want to run a job stored in a disk file, you can use the MPE :STREAM command. All of the stream jobs described in the examples use this method.
  • Page 64 00005I C 33NECX 00010FNC 00020FDC 00030FDV !EOD !SAVE TSTOUT !FCOPY FROM=TSTOUT;TO= !EOJ The first command in a job must be the JOB command, followed by the user name, account name, and optionally the group name. In production work it is useful to specify a job name before the user name to identify the specific job that is being run.
  • Page 65 5 RECORDS PROCESSED *** 0 ERRORS ∅ END OF SUBSYSTEM :PURGE TSTOUT :FILE XSORTIN=TSTIN :FILE XSORTOUT=TSTOUT :RUN XSORT.PUB.SYS HP32104A.05.00 EXTRA FUNCTION SORT FOR RPG/3000 (XSORT) (C) HEWLETT-PACKARD CO. 1980 WED, MAR 11, 1981, 9:44 AM 00000HSORTR 00005I C 33NECX 00010FNC...
  • Page 66 Example 3: Session With the Specifications Entered Interactively. Single input to different output. :PURGE TSTOUT :FILE XSORTIN=TSTIN :FILE XSORTOUT=TSTOUT :RUN XSORT.PUB.SYS HP32104A.05.00 EXTRA FUNCTION SORT FOR RPG/3000 (XSORT) (C) HEWLETT-PACKARD CO. 1980 WED, MAR 11, 1981, 9:16 AM 00000HSORTR X 33 00000NSORTR X 33...
  • Page 67 Single input to different output. Both XSORTIN and XSORTOUT are disk files. :PURGE TSTOUT :FILE XSORTIN=TSTIN :FILE XSORTOUT=TSTOUT :FILE XSORTEXT=TSTSPEC :RUN XSORT.PUB.SYS HP32104A.05.00 EXTRA FUNCTION SORT FOR RPG/3000 (XSORT) (C) HEWLETT-PACKARD CO. 1980 WED, MAR 11, 1981, 9:21 AM 00000HSORTR X 33 00005I C...
  • Page 68 Option line, specifying "Maximum number of records to be sorted" in columns 10-16. :PURGE TSTOUT :FILE XSORTIN=$STDIN :FILE XSORTOUT=$STDLIST .FILE XSORTEXT=TSTSPEX :RUN XSORT.PUB.SYS HP32104A.05.00 EXTRA FUNCTION SORT FOR RPG/3000 (XSORT) (C) HEWLETT-PACKARD CO. 1980 WED, MAR 11, 1981, 9:24 AM 00000HSORTR X 33 00000S Y...
  • Page 69 AB234CICO12345 ALBERS * Output to BB222CICO12345 WOODS * $STDLIST AC102GSD100001 WOODSON RECORDS READ = 5 RECORDS SELECTED & SORTED = 4 NUMBER OF COMPARES = 7 SCRATCHFILE I/O = 2 CPU SECONDS = .000 ELAPSED SECONDS = 101.440 TOTAL CPU SECONDS = 1.220 END OF PROGRAM Example 6: Job stream With Specifications Imbedded Single file, in place sort.
  • Page 70 !COMMENT THIS IS AN EXAMPLE OF A SINGLE SORT FILE TO !COMMENT DIFFERENT OUTPUT THAT ALREADY EXISTS. !COMMENT IT IS STREAMED, SPECS IMBEDDED !COMMENT ************************************** !COMMENT ************************************** !FCOPY FROM=TSTIN;TO= !FCOPY FROM=TSTFILE;TO= !FILE XSORTIN=TSTIN !FILE XSORTOUT=TSTFILE !RUN XSORT.PUB.SYS 00000HSORTR X 33 00000S Y Specifications 00005I C...
  • Page 71 !FILE XSORTIN2=TSTIN2 file designators !FILE XSORTIN3=TSTIN3 !FILE XSORTOUT=TSTOUT !RUN XSORT.PUB.SYS 00000HSORTR X 33 00000S Y Specifications 00005I C 33NECX imbedded in 00010FNC 6 9 job stream 00020FDC 1 32 EDITOR file 00030FDV !EOD !SAVE TSTOUT !FCOPY FROM=TSTOUT;TO= !EOJ S Option is used to provide the maximum number of records to be sorted. NOTE The example uses XSORTIN1, XSORTIN2, etc.
  • Page 72 EOF FOUND IN FROMFILE AFTER RECORD 4 5 RECORDS PROCESSED *** 0 ERRORS END OF SUBSYSTEM :FILE XSORTIN=TSTIN :RUN XSORT.PUB.SYS HP32104A.05.0O EXTRA FUNCTION SORT FOR RPG/3000 (XSORT) (C) HEWLETT-PACKARD CO. 1980 WED, MAR 11, 1981, 9:40 AM 00000HSORTC 00005I C 33NECX...
  • Page 73 TOTAL CPU SECONDS = .224 END OF PROGRAM :EOJ CPU SEC. = 4. ELAPSED MIN. = 1. WED, MAR 11, 1981, 9:41 AM 7-75...
  • Page 74 7-76...
  • Page 75 Chapter 8 XSORT Applications Introduction There are three applications in this section. The first is a simple use of mixed include and omit sets in a single section. The second application involves multiple sections and sets. In both, the "comments" are used to make the sorts somewhat self-explanatory, and additional notes are provided to clarify what takes place.
  • Page 76 0 0 0 B3257 =INCLUDE (NOT 1 IN POS.7) 1 1 1 A0001 =INCLUDE (1 IN POS.3 AND POS.5) The descending order is evident in the characters of the control field described in positions 9-13. Application #2 This application shows how multiple sections and sets may be applied in a sort. Again, the comments are used to earmark the records and the specifications for the results of the sort.
  • Page 77 The specifications for the sort are supplied by the file designated TSTSPECB. HSORTR EXAMPLE USING MIXED SECTIONS & SETS. OVERLAY EXISTING OUTPUT; 75 RECS MAX 6EQCX SECTION-A, TYPE 1 24LEC50 (INCLUDE X'S BELOW 50) 6EQCY SECTION-A, TYPE 2 24LEC50 (INCLUDE Y'S BELOW 50) 6EQCM SECTION-A, TYPE 4 24LEC50...
  • Page 78 B0001X 60 SECTION-B, OTHER 09000112 00004000 B0113M 20 SECTION-A, TYPE-4 08000860 00005000 B9001M 51 SECTION-B, OTHER 05000525 00006000 B9001M 72 SECTION-B, OTHER 05000501 00007000 09059Z 01 SECTION-B, TYPE-3 08000801 00008000 C0001Y 99 SECTION-B, OTHER 05000602 00009000 C0113Z 20 SECTION-B, TYPE-3 02503000 00010000 C9001M...
  • Page 79 A breakdown of the files to be sorted and their contents precedes the discussion. Files Records in File Fields Used in Sorts Weekly Sales Detail sales records. Date, customer, product, quantity Weekly Bookings Detail booking records. Date, customer, product, quantity Sales and Bookings Summary sales and history Date, customer, product, bookings.
  • Page 80 Field Record Contents Names Positions MRCHLN Merchandise line 21 -22 PRODCO Product code 23 -32 STACDE State code 33 -34 SLSTER Sales territory 35 -36 SLSNM1 Salesman number 37 -39 CANIND Cancel indicator 40 -40 DATEMM Date - month 41 -42 DATEYY Date - year 43 -44...
  • Page 81 Field Record Contents Names Positions DOLSHP Shipped value 75 -83 DOLCAN Cancelled value 84 -92 DOLRET Returned value 93 -101 These are the files that were created specifically for the sample sorts. They are the Weekly Sales file (WKSALE), the Weekly Bookings file (WKBOOK), and the Sales History file (HISTUPD), in that order. WB11111111119999999105ZZZ9999999CA0110110181123459 WB21111111128999998205XXX8888888TX0120210281234568 WB31111111137999997305LLL7777777AZ0130311280345677...
  • Page 82 WS9000012001812311111113209XXX888888834567CA031122 SB1111111111CA11101ZZZ9999999110281123456723456783456789123456705123456789 SB2111111112CA01202XXX8888888120281234567834567894567890567890109234567890 SB3111111113TX01303LLL7777777130281345678945678905678901678901209345678901 SB4111111114CA01404VVV6666666140181444444444444446444444444444709444444440 SB5111111115CA01505AAA5555555150281555555155555525555553555555405555555551 SB6111111116CA01606DDD4444444160281666666166666626666663666666405666666661 SB7111111117CA01707JJJ3333333970281777777177777727777773777777409777777771 SB8111111118CA01808GGG2222222980281888888188888828888883888888405888888881 SB9111111119CA02909ZZZ1111111290181999999199999929999993999999409999999991 SB0111111110CA04101VVV0000000100281000000100000020000003000000405000000001 SB1111111111CA01202ZZZ9999999710281111111111111121111113111111406111111111 SB2111111112AZ01303XXX8888888120281222222122222222222223222222409222222221 Sample Sort 1 This sort is used to select cancelled order records from the Weekly Bookings file. It produces a Weekly Cancellation Analysis. The "cancellation indicator" (in position 40), which is equal to 1, provides selection criteria.
  • Page 83 Explanation of Specifications. Header Specification. Col 6 The H entry identifies this as the Header line. Cols 7-12 SORTR identifies this as a Record-out sort. Cols 13-17 Total length of the sort control fields for this sort is 20. The total is derived from adding CUSTNO (10 characters) and PRODCO (10 characters).
  • Page 84 Record Type Specifications. Column 6 The I identifies this an an include line. Input records which match the criteria specified by this line will be used in the sort. Those which fail to meet the criteria will be omitted. Column 7 The * indicates a comment line.
  • Page 85 An opposite sort is performed on units booked (UNITSB) to put the bookings in descending se- quence within Merchandise Line. Here are the specifications as they would appear at the terminal and on the specification form. HSORTA I C 15 16EQC01 SELECT TERR.
  • Page 86 Explanation of Specifications. Header Specification. Column 6 The H identifies this as the Header line. Cols 7-12 SORTA identifies this as an Address-out sort. Cols 13-17 10 is the largest sum of all control field lengths. It is derived generally from adding all control fields designated with an F, N, or 0 in column 7 for each record type.
  • Page 87 Column 6 The I identifies this as an include line. The input records matching the criteria specified by this line will be used by the sort. Column 7 Leaving this column blank indicates that this is the first line of an I (include) set of record type lines.
  • Page 88 SRTUT RECORD 7 (%7, #7) 00000: 0000 0007 A simple RPG program has been devised to make use of the output of the sort. PAGE 0001 HEWLETT PACKARD 32104A.04.07 RPG/3000 (C) HEWLETT-PACKARD CO. 1978. WED, MAR 11, 1981, 10:24 AM 0001...
  • Page 89 0019 70 "PAGE" 0020 0021 0022 37 "GRMNT UNITS" 0023 58 "CUSTOMER DATE" 0024 0025 0026 37 "----- -----" 0027 58 "---------- -----" 0028 0029 GARTCD 25 0030 UNITSBJ 38 0031 CUSTNO 50 0032 DATE Y 58 0033 0034 TOTAL J 38 Here is the output of the program.
  • Page 90 Sample Sort 3 This sample sort utilizes the multiple input file feature of XSORT. It combines the Weekly Bookings file and the Weekly Sales file. The sequence of the combined output file will be by customer number. Additionally, the Weekly Sales file is reformatted on output to the sorted file in order to match the format of the Weekly Bookings file records.
  • Page 91 8- 93...
  • Page 92 Explanation of Specifications. Header Specification. Column 6 The H identifies this as the Header line. Cols 7-12 SORT R identifies this as a Record-out sort. Cols 13-17 10 is the largest total of control field lengths for either of the two record sections in the sort. 8- 94...
  • Page 93 It is the sum derived from adding together all the control fields (fields with N, O, or F in col- umn 7 of the Field Description specifications). In this case, control field length for the first record section is the same as that for the second section since it represents the same field, Customer Number.
  • Page 94 Column 8 C means the full character--1 byte (8 bits)--will be used in the comparisons. Cols 9-12 A 1 entered here indicates the position in the record where the factor 1 field begins. Cols 13-16 2 entered here indicates the position in the record where the factor 1 field ends. Cols 17-18 EQ means that, in the comparisons, factor 1 must equal factor 2.
  • Page 95 WS41111111146900009605VVV6666666AZ011046018145678 WS51111111155900008505AAA5555555CA011055018156789 WS51111111153900006309JJJ3333333CA031073018178901 WS61111111164900007405DDD4444444CA011064018167890 WB71111111177999997305LLL7777777AZ0130311281234569 WB71111111173999993709LLL3333333CA81707N0281789013 WB71111111171999991909ZZZ1111111CA11909Y0181901231 WS81111111182900005209GGG2222222CA031082018189012 WS91111111191900004109ZZZ1111111CA031091018190123 8- 97...
  • Page 96 8- 98...
  • Page 97 Appendix A COMPATIBILITY WITH OTHER SYSTEMS Compatibility with SORT3 XSORT is based on the unsupported utility program named SORT3. To avoid difficulties in converting from SORT3, XSORT has been designed to recognize the formal file designators used by SORT3. There are no significant differences in the syntax of the sort specifications between the two products.
  • Page 98 File XSORT NAMES SORT3 NAMES CONVERSION ACTIONS Output XSORTOUT SORT3OUT No action necessary. (Note, however, that the first input file, "...IN" or "...IN1," is what determines whether XSORT or SORT3 names will be expected for rest of the input/output files. No mixing of formal file names is allowed among the input and output files within any sort job.) Comparison with $DSORT and #GSORT...
  • Page 99 Appendix B ERROR MESSAGES XSORT error messages distinguish between two types of errors--syntax errors and execution errors. In the discussion of these messages below, the syntactical errors are covered first. They are broken down by the category under which they can be grouped. General syntactical errors are followed by those which occur under the headings of the various types of specifications: Header, ALTSEQ, S Option, Record Type, and Field Description.
  • Page 100 Syntax Messages General Errors NUMBER MESSAGE FURTHER EXPLANATION INVALID SPECIFICATION TYPE- Only exceptions are ALTSEQ records. COL 6 MUST BE H, I, O, OR F 1001 MORE THAN ONE HEADER SPEC XSORT specifications must begin with one, and only one, header specification. 1004 BEGIN/END COLUMN MISSING For both Record Type and Field Description specifi-...
  • Page 101 Alternate Collating Sequence Errors NUMBER MESSAGE FURTHER EXPLANATION 1015 ALTSEQ TABLE MUST END ALTSEQ specifications must be terminated by a record WITH ** containing "**" in columns 1-2. 1016 INVALID HEX DIGIT Each hexidecimal character must be in the range of ASCII characters "O"...
  • Page 102 NUMBER MESSAGE FURTHER EXPLANATION 1019 INVALID DECIMAL DIGIT Constant in columns 20-80 must contain valid deci- mal digits and "+" or "-" in last position. 1024 MAX U FIELD LENGTH IS 28 DIGITS The maximum length of any unpacked numeric field is 28 digits.
  • Page 103 Field Description Errors NUMBER MESSAGE FURTHER EXPLANATION INVALID FIELD TYPE -COL 7 MUST BE N, O, D, F OR * CONTROL FIELD LENGTH The sum of control field lengths for this record section EXCEEDS HEADER VALUE exceeds the maximum sum specified in Header columns 13-17.
  • Page 104 WORK BUFFER TOO Work record (control fields and data fields) cannot exceed SMALL CHANGE 1000 characters. MAX'WORK'REC is a value hardcoded in MAX'WORK'REC XSORT source code and so can only be changed by modifica- tion and recompilation of XSORT by HP. B-106...
  • Page 105 NUMBER MESSAGE FURTHER EXPLANATION LOADPROC OF FREADC Internal error: loading procedure for FREADC intrinsic FAILED failed. MULTI INPUT (XSORTIN1) Address-out sort (SORTA in Header columns 7-11 not AND SORTA INVALID allowed when multiple input files (XSORTIN1..XSORTIN9) are used. MULTI INPUT AND Inplace sort not allowed when multiple input files INPLACE SORT INVALID (XSORTIN1..XSORTIN9) are used.
  • Page 106 B-108...
  • Page 107 Appendix C DATA INFORMATION Collating Sequence Table The Collating Sequence Table brings together comparative information concerning data used in sort jobs. It includes the ASCII and EBCDIC collating sequences in decimal, octal, hexidecimal, and binary representations. It gives the character (graphic) or control equivalents for both ASCII and EBCDIC. The relative position of alphabetic and numeric characters in the sorting sequence is shown in the right hand columns.
  • Page 108 ALPHA/CONTROL NUMERIC VALUE COLLATING SEQUENCE CHARACTER Binary ASCII EBCDIC ASCII EBCDIC 0001 0001 0001 0010 0001 0011 0001 0100 0001 0101 0001 0110 0001 0111 0001 1000 0001 1001 0001 1010 0001 1011 0001 1100 0001 1101 0001 1110 0001 1111 0010 0000...
  • Page 109 ALPHA/CONTROL NUMERIC VALUE COLLATING SEQUENCE CHARACTER Binary ASCII EBCDIC ASCII EBCDIC 0010 1101 0010 1110 0010 1111 0011 0000 0011 0001 0011 0010 0011 0011 0011 0100 0011 0101 0011 0110 0011 0111 0011 1000 0011 1001 0011 1010 0011 1011 0011 1100...
  • Page 110 ALPHA/CONTROL NUMERIC VALUE COLLATING SEQUENCE CHARACTER Binary ASCII EBCDIC ASCII EBCDIC 0100 1001 0100 1010 Â 0100 1011 0100 1100 < 0100 1101 0100 1110 0100 1111 0101 0000 & 0101 0001 0101 0010 0101 0011 0101 0100 0101 0101 0101 0110 0101...
  • Page 111 ALPHA/CONTROL NUMERIC VALUE COLLATING SEQUENCE CHARACTER Binary ASCII EBCDIC ASCII EBCDIC 0110 0101 0110 0110 0110 0111 0110 1000 0110 1001 0110 1010 0110 1011 0110 1100 0110 1101 0110 1110 > 0110 1111 0111 0000 0111 0001 0111 0010 0111 0011 0111...
  • Page 112 ALPHA/CONTROL NUMERIC VALUE COLLATING SEQUENCE CHARACTER Binary ASCII EBCDIC ASCII EBCDIC 1000 0001 1000 0010 1000 0011 1000 0100 1000 0101 1000 0110 1000 0111 1000 1000 1000 1001 1000 1010 1000 1011 1000 1100 1000 1101 1000 1110 1000 1111 1001 0000...
  • Page 113 ALPHA/CONTROL NUMERIC VALUE COLLATING SEQUENCE CHARACTER Binary ASCII EBCDIC ASCII EBCDIC 1001 1101 1001 1110 1001 1111 1010 0000 1010 0001 1010 0010 1010 0011 1010 0100 1010 0101 1010 0110 1010 0111 1010 1000 1010 1001 1010 1010 1010 1011 1010 1100...
  • Page 114 ALPHA/CONTROL NUMERIC VALUE COLLATING SEQUENCE CHARACTER Binary ASCII EBCDIC ASCII EBCDIC 1011 1001 1011 1010 1011 1011 1011 1100 1011 1101 1011 1110 1011 1111 1100 0000 1100 0001 1100 0010 1100 0011 1100 0100 1100 0101 1100 0110 1100 0111 1100 1000...
  • Page 115 ALPHA/CONTROL NUMERIC VALUE COLLATING SEQUENCE CHARACTER Binary ASCII EBCDIC ASCII EBCDIC 1101 0101 1101 0110 1101 0111 1101 1000 1101 1001 1101 1010 1101 1011 1101 1100 1101 1101 1101 1110 1101 1111 1110 0000 1110 0001 1110 0010 1110 0011 1110 0100...
  • Page 116 ALPHA/CONTROL NUMERIC VALUE COLLATING SEQUENCE CHARACTER Binary ASCII EBCDIC ASCII EBCDIC 1111 0001 1111 0010 1111 0011 1111 0100 1111 0101 1111 0110 1111 0111 1111 1000 1111 1001 1111 1010 1111 1011 1111 1100 1111 1101 1111 1110 1111 1111 C- 118...
  • Page 117 [ERROR: ] Click here to view figure. C- 119...
  • Page 118 [ERROR: ] Click here to view figure. C- 120...
  • Page 119 Appendix D XSORT SPECIFICATION FORMS The forms for specifications are for your convenience. Copies may be made for use in your sort jobs. Hewlett-Packard holds the copyright for the forms and asks that they be copied only for your particular applications.
  • Page 120 D- 122...
  • Page 121 D- 123...
  • Page 122 D- 124...
  • Page 123 HP RPG/XL Utilities-Part 2 RISE...
  • Page 125 INTRODUCTION The RPG Interactive System Environment is a specialized editor, designed to create and modify programs written in the column-dependent language, RPG. It is an RPG Utility and, therefore, intended for the use of RPG programmers. You may need it for a simple, quick program, or you may have a job which requires interfacing with KSAM, Image, and VPLUS.
  • Page 126 RISE Features: Visual editing with images that represent the RPG specification coding forms. Menu and special function keys (softkeys) for a broad range of uses. Page-at-a-time direct screen editing via the terminal's cursor control keys. Ability to call the RPG compiler as well as the Segmenter and manipulate the compiled listing using a split screen.
  • Page 127 Requirements for Operation Hardware Requirements RISE operates as a member of the VPLUS family. Your terminal must be oneof those compatible with VPLUS, such as the model 2645. In addition, your terminal must have at least 8K of memory and the display enhancement character set. VPLUS requires a minimum of 8K ofmemory in your terminal to store and display RISE's special forms of the RPG Specification Records.
  • Page 128 RISE operates in Line or Block mode using the terminal's powerful capabilities to their fullest. Each mode offers you its own unique advantages. Line mode is similar to EDIT/3000. You type in lines in response to a ">" prompt. Typing errors can be corrected by backspacing, which erases the errors and allows you to retype the line as it should appear.
  • Page 129 Figure 1-3. HP 2645 Terminal Keyboard Line Mode Advantages RISE is primarily a line mode editor. Line mode is effective because of the speed with which commands, one at a time, are sent to RISE for execution. Also, the effects of a command's execution are shown to you on the screen so that you see exactly what has occurred.
  • Page 130 | control. ------------------------------------------------------------------------------- --------------- Since RISE's command set is similar to that of EDIT/3000, familiarity with the editor will be of value in using RISE. It is not necessary, however. (See appendix A for a comparison of RISE and EDIT/3000.)
  • Page 131 Command Window Besides the Command Menu, you have another means of entering commands while in Block Mode. You can use the Command Window which is always displayed on the terminal when you are in this mode. The Command Window is useful to those who are familiar with the commands and have no need to go through the menu but want immediate action.
  • Page 132 file you wish to become your work file. The work file is a KSAM file (Keyed Sequential Access Method), and is used so that RISE can quickly random access your source records. (See the KSAM/3000 Reference Manual for more information on this file organization.) The name of the work file is in the form Wdddhhmm, where "ddd"...
  • Page 133 retain the deleted lines in the permanent file. Using the TEXT command you could copy it back to the work file in its original state for further work at the terminal. The price of the safeguard is additional time required to copy the files back and forth between your permanent file and the RISE work file.
  • Page 134 You use the parameter when you are certain of the results you want. Running RISE To run RISE you enter the following MPE command at your terminal: RUN RISE.PUB.SYS Your command will be answered with an HP banner like the one below: HP32104A.05.00 RPG INTERACTIVE SYSTEM ENVIROHMENT RISE (C) HEWLETT-PACKARD CO. 1981 WED, SEP 16, 1981, 10:29 AM >...
  • Page 135 RISETOUR is interactive; it contains many requests and directions which call for your direct participation in the tour. It is automatic and controls the complete tour. Using it, you will quickly develop a familiarity with most of RISE's features first-hand. The tour is divided into lessons, and the lessons are grouped under the following headings: File manipulation commands.
  • Page 136 E[XIT] --end subsystem FIL[E] --work file directly F[IND] --locate a string FO[RM] --display an RPG specification form on the screen G[ET] --read and execute commands from a file H[ELP] --explain commands I[NCR] --set default increment value J[OIN] --append or merge an entire file K[EEP] --save the work file LIN[E]...
  • Page 137 The following commands execute only in Line Mode: BEGIN FORM LINE LIST MODIFY :MPEcommand The following commands execute only in Block Mode: COMMENT HELP MENU SHOW VERIFY The following commands execute in either mode: CHANGE COPY DELETE EXIT FILE FIND INCR JOIN KEEP...
  • Page 138 Command Limitations RISE will not accept commands longer than 50 characters. This limitation is established by the number of characters which will fit into the Command Window. It holds true with all commands, whatever the mode in which they are entered. Also, multiple commands entered on a single line are not accepted by RISE.
  • Page 139 COMMANDS-DETAILED DESCRIPTIONS 2- 141...
  • Page 140 Notations for this Manual Notation Meaning Example of Use -------------------------------------------------------------------------------------- [opt] Part of command or parameter enclosed by A[DD] [^^[formf]] brackets is optional. form One of the designators of the RPG Record FO[RM] form Specifications--H,F E,L,I,C,O--or CO[L], which brings a column indicator to the screen. Line begin (beginning with line).
  • Page 141 U[NN] The work file is to be made permanent without K[EEP] SAVEFILE U[NN] the appended sequence numbers. A[LL] The command applies to the entire work file. D[ELETE] A[LL] F[IRST] Indicates first line in work file. COM[MENT] F[IRST] L[AST] Indicates last line in work file. M[ODIFY] L[AST] Controls the display of the RPG Record A[DD] ^^H...
  • Page 142 | position of the record pointer.) --------------------------------------------------------------------------------------- | (The special character, @, may be used in | L@-5/@+5 | place of * to indicate record pointer | position.) --------------------------------------------------------------------------------------- | (Specifications may be mixed.) | LF[IRST]/* +10 L* -5/L L 10/L --------------------------------------------------------------------------------------- Increments for Sequence Numbers Every text record in RISE's work file has a unique sequence number that RISE uses to access the KSAM...
  • Page 143 The comments on the right are for your information and are not part of your responses. While the Segmenter is executing, its HP banner and responses will appear on your screen. You are expected to supply colon (":") prompts as required when entering the ":MPEcommand".
  • Page 144 (See:MPEcommand.) RISE will respond with execution messages, mode changes, and banners to some of the commands. The example below includes only the prompt for information to be used in running the calculator. Comments appear to the right and are not part of your responses. Also, see the MPE Segmenter Reference Manual, for more information on USL and program files.
  • Page 145 Parameter Explanation The line number where you wish to start adding lines. If not specified, adding begins after the last line in the work file. If "lb" exists in the work file, RISE will first display the existing source record at "lb" and prompt you with a sequence number immediately following "lb". BY inc Increment by which you wish to add lines.
  • Page 146 portion of SIMCAL is entered. Various parameters are used. Errors are committed, and the messages appear with the listing. In the first example below, when the ADD command creates a work file, the ADD begins at line 1 because the file is empty. If the file existed previously, RISE would display the last line in the file and the next line number, where the ADD would begin.
  • Page 147 In the next example, lines 2 and 3 are entered (1). With the ^^R[EPEAT]2 parameter in effect, the second screen display shows that lines 2 and 3 have cleared automatically, the cursor has homed, and line 4 has been added (2). The new line contains a syntax error in the attempt to shut off the REPEAT parameter while changing the specification form to I, for Input Specifications (3).
  • Page 148 The remaining examples show lines added correctly with the prompt at column 6 (1). In line 9, the R[EPEAT] parameter is again in effect (2). The display shows the results after two Input Specification records are entered (3). After the second line is entered (line 10), the cursor will home up and prompt for more text with line 11.
  • Page 149 [ERROR: ] Click here to view figure. BEGIN BEGIN allows you to initiate a new editing session as if you had just entered the RPG Interactive System Environment. Form B[EGIN] [N[OW]] Parameter Explanation N[OW] If you are editing a work file initiated with the TEXT command, NOW will cause the command to execute immediately, and it will disable the safety prompts.
  • Page 150 The BEGIN command achieves effects similar to entering an EXIT command, thus leaving RISE to end the current editing session, and then reentering RISE to begin a new editing session. If you are editing or adding to one file and you wish to clear what you have done and start over quickly, BEGIN will save time and add convenience.
  • Page 151 :LINE FIVE :<Control Y> (3) >KEEP SAVEFILE File exist already, purge old SAVEFILE?YES Keep completed. File name is SAVEFILE In the next example, SIMCAL is copied into a work file, and the first five lines are listed (1). When BEGIN is entered, no safety prompts appear because no changes have been made to the work file.
  • Page 152 editing session (6). > (1) >FILE SIMCAL Enter new file name followed by additional number of records. DIRSIM 10 File opened. >LIST 1/6 00011H SIMCAL 00012FINPUT DISK 00013FOUTPUT DISK 00014IINPUT 1 CA 00015I 1 CS 00016I 1 CM (4) >CHANGE ;DISK; TO ;TAPE; IN ALL 00012FINPUT TAPE 00013FOUTPUT...
  • Page 153 > (3) >FILE DIRSIM File opened. (4) >L1/6 00011H SIMCAL 00012FINPUT TAPE 00013FOUTPUT TAPE 00014IINPUT 1 CA 00015I 1 CS 00016I 1 CM > > > CHANGE CHANGE changes an "oldstring" to a "newstring". Form CH[ANGE] "oldstring" TO "newstring" [IN lb [/le]] Parameter Explanation "oldstring"...
  • Page 154 Examples The following are legal abbreviations which may be used with the CHANGE command and its parameters: CH;OLD;TO $NEW$ Change oldstring TO newstring from first line to current IN F/* position of record pointer. CHAN;OLD; TO; Change oldstring to newstring in lines 1 through 10. NEW;IN1/10 In the examples of the CHANGE command, a mistake is made in the spelling of the command, and an error message is returned (1).
  • Page 155 Form COM[MENT] [C] [lb] [BY inc] Parameter Explanation A fifteen line comment banner is displayed. (If the C parameter is not given, the default ban- ner occupies 10 lines.) The "C" parameter displays a banner with the Column Indicator form instead of the RPG Record Specification form.
  • Page 156 The next example is of the fifteen line comment banner shown with the column indicator (2). 2- 158...
  • Page 157 COPY COPY allows you to duplicate lines in a file. Form COP[Y] lb [/le] TO loc [BY inc] Parameter Explanation First--or only--line you wish to have copied. Last line of a group of lines you are copying elsewhere. TO loc Location where the lines will be copied.
  • Page 158 Error 62: The TO line cannot be less than the FROM line number. (3) >COPY ALL Error 149: TO location missing. (4) >COPY 1/5 TO LAST BY 1 00011H SIMCAL 00012FINPUT DISK 00013FOUTPUT DISK 00014IINPUT 00015I Copy completed. > DELETE DELETE enables you to delete lines from a work file.
  • Page 159 DELE A Delete all lines in the file. In the example, an error is produced when an attempt to delete nonexistent lines is made (1).A second error occurs when ALL is misspelled (2). A third results from an unnecessary character entered following last line (3).Finally, those lines copied to the end of SIMCAL in the COPY example above are deleted by a legal command, and the results are displayed (4).
  • Page 160 Purpose The EXIT command terminates the execution of RISE, returning control to MPE. Execution mode: Line or Block. Examples The following are legal abbreviations which may be used with the EXIT command and its parameters: EXI NOW Exit immediately without the safety prompts. Exit immediately without the safety prompts.
  • Page 161 Form FIL[E] filename [N[OW]] Parameter Explanation filename Name of the file to be edited directly. N[OW] Execute the command immediately without safety prompts. NOW is significant with FILE if, previous to issuing the command, you were editing a copy of another file. If you were directly editing another file, having used the FILE command, that file will be closed automatically, and your changes made permanent.
  • Page 162 "filename" could represent FILE SIMCAL. Case 3. Converting Non-KSAM File to New KSAM File "filename" exists but is not a KSAM file. RISE must convert it. (The converted file is called "newfile" below.) You type > FILE " filename " RISE responds Enter new file name followed by additional number of records.
  • Page 163 In the first example, the FILE command is used to create a new KSAM file named SIMCAL2. A message is returned asking for the maximum number of records to be included in the new file. The number given is 5 (1).
  • Page 164 The third example of the FILE command usage represents Case 2, in which an old KSAM file (SIMCAL2, which was created in the first example) is made available for direct editing using the FILE command. RISE responds with a message stating that the file is opened (1). LIST ALL shows the contents of the file (2).
  • Page 165 LINE 2 LINE 3 LINE 4 LINE 5 LINE 6 LINE 7 (3) >EXIT END OF PROGRAM In the fourth example, the TEXT command is used with SIMCAL, and the first five lines are listed (1). Next, the five lines are deleted (2). When the user attempts to change work files to SIMCAL3, using the FILE command, a safety prompt is displayed.
  • Page 166 The last example shows how to purge files created by the FILE command as well as the key files associated with KSAM files. First KSAMUTIL.PUB.SYS is run, and an HP banner is displayed (1). The user then enters the file names of the files with the PURGE command (2). Note that the execution messages contain those filenames plus the RISE-created file designators of the associated key files in the execution messages...
  • Page 167 Form F[IND] [E[VERY] ] "string" [IN lb[/le] ] Parameter Explanation E[VERY] Every occurrence of the string is located in the given range. (If not specified, only the first occurrence is located.) "string" Character or characters you wish to find. (Note that you may omit "string", and RISE will default and use the previous "string"...
  • Page 168 distinguished from other commands which are similar (4). Note that "F" alone is defaulted to FIND, but when "F" is used with a second character, RISE requires a more thorough identification of the command, and no default is assumed. Finally, FIND is used with the string "DISK" in a line range. The first occurrence of "DISK" is listed on the screen (5).
  • Page 169 > FORM FORM displays an RPG Record Specification form or column indicator on the screen. Form FO[RM] form Parameter Explanation "form" Meaning Header specifications File specifications File extension specifications Line counter specifications Input specifications Calculation specifications Output specifications CO[L] Column indicator NOTE Space is not required between command and parameters.
  • Page 170 The Column Indicator is displayed and SIMCAL, which is the work file, is listed (3). <Control Y> halts the listing (4). > >FORM XSPECS Error 173: Only H,F,E,L,I,C,O, or COl allowed. >FORM COL 12345678901234567890123456789012345678901234567890123456789012345678901234567890 >L A 00011H SIMCAL 00012FINPUT DISK 00013FOUTPUT DISK 00014IINPUT...
  • Page 171 the command. For example, a comment may appear in the command file by specifying an asterisk (*) as the first character in a new line. You may use the GET command to activate the softkeys to execute commands. The function of a particular softkey may be accomplished indirectly by putting the numbers 0 through 8 on a single line in the command file where 0=ENTER key, 1=F1 (special function key 1), 2=F2, up to 8=F8.
  • Page 172 Creating work space file. THIS IS A SAMPLE COMMAND FILE. AN ASTERISK INDICATES A COMMENT LINE. YOU STORE A SEQUENCE OF COMMANDS IN A FILE TO HAVE THEM ALL EXECUTED AUTOMATICALLY. TEXT IN A FILE. :TEXT SIMCAL :LIST ALL LET'S USE SHOW MODE TO AUTOMATICALLY SCROLL THROUGH THE FILE WITH THE RPG SPECIFICATION RECORD FORMS.
  • Page 173 Related Commands Special function key (softkey) labels are displayed on the top of the screen with the HELP command. They have the following meanings: Meaning -------------------------------------------------------------------------------------- (not used) (not used) RPG source lines with or without editor sequence line numbers will be displayed with the next SHOW command you enter.
  • Page 174 The second example shows a typical detailed explanation of a command--in this case the HELP command itself (2). (The command which brought the second example to the screen, if abbreviated to the minimum, could have been "H H".) 2- 176...
  • Page 175 INCR INCRement resets default increment. Form I[NCR] [value] Parameter Explanation value New increment value you wish to establish. (For limitations, see Note below.) Purpose The INCRement command resets the default INCRement to your new "value". Once you use the INCR command, all subsequent commands which require the increment value will use your new value unless you specify a different increment in the parameters of the command.
  • Page 176 >L ALL 00011H SIMCAL 00012FINPUT DISK 00013FOUTPUT DISK 00014IINPUT 1 CA 00015I 1 CS In the second example, the I command without a value resets the default increment value of 1, and the RENUMber command is entered (1). When an illegal abbreviation of LIST is entered, an error is generated (2).
  • Page 177 Purpose The JOIN command appends or merges the entire contents of file "file name" to the work file. If "TO loc" is not specified "filename" is appended at the end of the work file. If "BY inc" is not specified, the current increment default value is used.
  • Page 178 >JOIN RPGDOC TO .1 PROGRAM NAME: PROGRAMMER DATE WRITTEN: PURPOSE Join completed. > >LF/5 Error 112: Can't distinguish between LINe or LISt command. >L F/5 PROGRAM NAME: PROGRAMMER DATE WRITTEN: PURPOSE 00011H SIMCAL 00012FINPUT DISK 00013FOUTPUT DISK 00014IINPUT 00015I > KEEP KEEP saves the contents of the work file in a permanent file.
  • Page 179 The "NOW" option ensures that the overwriting will take place immediately. It also disables the safety prompts. It saves time but it should only be used when you are certain that the work file should replace the permanent file. There is no provision for reconsidering changes once NOW is used. When you omit NOW, and respond to the message informing you that the "filename"...
  • Page 180 00048O*END OF PROGRAM NAMED SIMCAL >KEEP BACKUP NOW UNN Keep completed. >File name is BACKUP > In the second example, a file named TESTFILE is copied into the work file, TESTFILE was previously stored as a permanent file with the UNNumbered parameter. Because sequence numbers are essential as references in editing, they are appended automatically for the user's convenience (1).
  • Page 181 DELETE command, the lines being deleted are displayed. (You may not wish to have all the lines being deleted displayed. By typing <Control Y> you stop the listing. <Control Y> does not stop the execution of the command, however.) Related Commands Another method of entering Line Mode from Block Mode is the the special function key F7, when the softkey label for F7 reads "LINE MODE".
  • Page 182 L *-5/*+5 List a range of lines beginning five lines before the current position of the record pointer and ending five lines after the record pointer. List line 10. List the line following the position of the current record pointer. (Used for stepping through a file, line by line.) In the first example, TEXT is used to copy SIMCAL into a work file, and the first five lines are listed on the screen using the LIST command (1).
  • Page 183 In the next example, an error results when non-existent lines are used with the LIST command (1). Following that, LIST is entered with a "line beginning" which is higher in sequence than the "line ending", and another error message is shown (2). Next, the same error is committed using special characters to indicate the current position of the record pointer (3).
  • Page 184 SHOW command. Move cursor to Command Window. Move cursor to Edit Commands. Move cursor to General-2 Commands. Enter Line Mode. Refresh main menu (clears the screen and redraws the menu). Execution mode: Block. Examples The following is a legal abbreviation which may be used for the MENU command: ME Display the main command menu.
  • Page 185 Purpose The MODIFY command is your means of modifying lines interactively. It operates similarly to the same command in EDIT/3000. The line which is selected for modification is displayed at the terminal. You modify the line by positioning the cursor beneath the first, or only, character you wish to modify Three subcommands operate with MODIFY.
  • Page 186 Related Commands Insert ("I") Subcommand "Istring" will insert a character or string. You position the cursor beneath the position where you wish the insertion to begin. You type an "I" immediately followed by the "string" to be inserted. Replace ("R") Subcommand "Rstring"...
  • Page 187 Modify line at the current position of the record pointer. MOD AL^^ Modify all the lines and display the corresponding RPG Record Specification form. The first five lines of SIMCAL are used for these examples. After the lines are listed, MODIFY FIRST is entered, and a two-character string is replaced using the R subcommand (1).
  • Page 188 00012FINFILES DISK TAPE In the next example, the delete (D) subcommand is used in conjunction with the insert (1) subcommand with the result that "MAGTAPE" replaces "TAPE" in the line (1). The next example demonstrates how all characters between the two outside D's used in the delete subcommand are removed upon execution of the subcommand (2).
  • Page 189 MOVE MOVE transfers lines to a new location. 2- 191...
  • Page 190 Form MOV[E] lb[/le] TO loc [BY inc] Parameter Explanation Single line you wish to move or the beginning of a range of lines you are moving. Last line of range you wish to move. TO loc Location where the lines are to appear. If destination line exists, the lines will be moved start- ing at the next line in sequence.
  • Page 191 >L1/5 00011H SIMCAL 00013FOUTPUT DISK 00012FINPUT DISK 00014IINPUT 00015I In the next example, the record pointer is moved to the last line in the file when LIST LAST is entered (1). A command is then given to MOVE a range of lines beginning ten lines before the current record pointer and ending with the last line in the file to line 100 (2).
  • Page 192 with the formal file name of "RISELIST" and device class of "LP". Whenever the RPG form type in column 6 changes, the PRINT command will skip three lines to group together those lines which have the same form type. This produces a more readable format for the source code. Because of this feature, the PRINT command should only be used when you are working on RPG source code.
  • Page 193 Parameter Explanation Parameter option 1:[lb/le] [BY inc] Renumbers the range "lb/le" by "inc". If the line range is omitted, the entire file will be renumbered. (As in other commands, "ALL" may be used in place of "lb/le".) If "BY inc" is omitted, the default increment is used.
  • Page 194 R SO W SE Renumber source line numbers so that they correspond with sequence line numbers. REN SO Renumber source line numbers so that they have bracketing values according to the record specification form with which they are associated. The examples use a truncated version of SIMCAL consisting of the first five lines. It has been stored in a permanent file with the name PARTSIM.
  • Page 195 >RENUM SOUCE Error 161: Syntax error on SOURCE. >RENUM SOURCE Renum completed. >L FIR/L 00010H SIMCAL 06000FINPUT DISK 06001FOUTPUT DISK 10000IINPUT 10001I > >RENUM SEQNUM WITT SOURCE Error 164: Syntax error on WITH. >RENUM SEQNUM WITH SOURCE Renum completed. >L A 00010H SIMCAL 6000...
  • Page 196 [;STACK=stacksize] [;DL=dlsize] [;NOCB] [;LIB=G] The parameters, preceded by a semicolon, can appear in any order. The RUN command is similar to the MPE :RUN command. Because it is similar, the syntax of RISE's RUN command is exactly the same as MPE's RUN command syntax.
  • Page 197 Segmenter (or, alternatively, with the VERIFY PREP command). Initially, the command to run the Segmenter subsystem is given (1). The HP banner is then brought to the screen (2). The USL file is identified (3), and then prepared in a new program file (4). The user then leaves the Segmenter subsystem with the EXIT command and RISE's banner is displayed (5).
  • Page 198 >RUN $OLDPASS SIMPLE CALCULATOR ENTER DATA IN THE FORMAT: C NNNDD NNNDD A 11100 11100 ..YOUR PROBLEM: 111.00 ADD 111.00 EQUALS 222.0000 ENTER DATA IN THE FORMAT: C NNNDD NNNDD S 22222 11111 ..YOUR PROBLEM: 222.22 111.11 EQUALS 111.1100 ENTER DATA IN THE FORMAT: C NNNDD NNNDD...
  • Page 199 instance.) In SHOW mode the terminal's cursor control keys and two of the editing keys--INSERT CHAR[acter] and DELETE CHAR[acter]--will prove particularly useful in your editing. (INSERT LINE and DELETE LINE keys are not activated.) Also, tabs have been set to correspond with the important Record Specification form columns.
  • Page 200 NOTE If the terminal is unexpectedly locked out at this point, see the section on Recovery Procedures. Scroll Set While in SHOW mode, you can increase your scrolling capabilities by switching to Scroll set. Again, this is accomplished by pressing F1. The softkeys have the following functions when Scroll set is activated: Switch to Master set.
  • Page 201 In the next examples, the special function key labeled SCROLL FORWARD is used while the Header Specification form is displayed. The first time the scrolling occurs, the RPG File Specification form appears on the screen with the associated source file lines (1). The next form to be brought to the screen by the SCROLL FORWARD softkey is the RPG Input Specification form.
  • Page 202 displayed (2). In the next example, the form shown with the message in the bottom line communication window, and the changed labels for the softkeys are produced when the INSERT LINES softkey (F2) is pressed. Note that 2- 204...
  • Page 203 the SHOW MODE window contains precise instructions for inserting from one to four lines (1). The second display is produced by pressing softkey #3 (INSERT 3 LINES) after the cursor has been positioned at line 18. Note that the column 6 entries, which designate the Record Specification form appropriate to the lines being inserted, are supplied automatically by RISE (2).
  • Page 204 "SCROLL". This indicates that the Scroll Set of keys are now active (1). Special function key #3 (SCROLL LAST) produces the next screen display, which contains the final lines of the source file associated with the RPG Output Specifications form (2). Bad graphic In the next example, the SHOW FIRST COL command brings the column indicator to the screen.
  • Page 205 To produce the first display in the final example, the user has entered SHOW FIRST COL command or some valid abbreviation. Also, special function key #3 has been pressed while in Master Set (this key toggles sequence numbers on and off). A fifteen line "page" is brought to the screen and with it the sequence line numbers which RISE keeps for use in referencing records.
  • Page 206 2- 208...
  • Page 207 See the discussion of the KEEP command. If the file is unnumbered, RISE automatically appends the sequence numbers in columns 81-88. If the text file is already numbered, RISE uses the existing sequence numbers. Text files are compatible with EDIT/3000 files. Execution mode: Line or Block.
  • Page 208 >L 1/5 00011H SIMCAL 00012FINPUT DISK 00013FOUTPUT DISK 00014IINPUT 00015I >D 1/3 00011H SIMCAL 00012FINPUT DISK 00013FOUTPUT DISK Delete completed. >T SIMCAL KEEP not done, CLEAR current work file?NO Text cancelled. >KEEP BACKUP Keep completed. File name is BACKUP In the second example, the CHANGE command is used to replace one four-character string with another. The results of the command, and an execution message, are then displayed (1).
  • Page 209 Form U[NDEL] Purpose The UNDELete command restores the lines which were removed by the last DELETE command. It does not restore characters which were deleted while in the MODIFY mode. If you DELETE lines, then ADD new ones with the same numbers as those deleted, the deletions will not be restored by the UNDEL command.
  • Page 210 00014IINPUT 00015I Undel completed. > >D 5/10 00015I 00016I 00017I 00018I 00019I 72OPRND1 00020I 9 132OPRND2 Delete completed. In the next example, a file named RPGDOC--used previously in the JOIN example--is JOINed to the work file beginning at line 5 (1). The UNDEL command is then tried and rejected by RISE. This occurs because line 5, which was deleted in the first example, has been used again through the JOIN command.
  • Page 211 V[ERIFY] L[IST] P[REP] [progfile] [;ZERODB] [;PMAP] [;MAXDATA=segsize] [;STACK=stacksize] [;DL=dlsize] [;CAP=caplist] [;RL=filename] [;PATCH=patchsize] Parameter Explanation R[PG] Calls the RPG compiler to compile the work file into the USL file named "$OLDPASS", a sys- tem-defined file name. Afterwards, it causes the newly compiled listing to be displayed on the screen.
  • Page 212 When the Segmenter is executing, its HP banner and all its responses will appear on your terminal. Moreover, because RISE's PREP option is exactly the same as the Segmenter's PREPARE command, the syntax is the same, and delimiters are necessary between parameters.
  • Page 213 Scroll forwards one page. Scroll backwards one page. Scroll forwards 1/2 page. Scroll backwards 1/2 page. Softkey F1 allows you to divide the screen up into two fixed portions--a top and bottom half--or join them in a full page display. Pressing F1 will switch the screen display in the following order: Top Window, Bottom Window, and back to Full Window.
  • Page 214 00011H SIMCAL 00012FINPUT DISK 00013FOUTPUT DISK 00014IINPUT 00015I >VERIFY RPG 2- 216...
  • Page 215 The next example follows the previous one directly. Special function key #1 (TOP WINDOW) has been pressed, and the x screen is split (1). In the bottom half of the screen, error and warning message numbers appear beneath the lines containing the errors (2). Now, if special function key #4 (FIND ERR+MSG) is 2- 217...
  • Page 216 pressed, the usefulness of the split screen is demonstrated. In the second display, the top portion of the screen contains the compiled source lines and the error and warning numbers (3). The bottom window contains the numbers and their messages (4). Note that the up arrows (^^) indicate that the screen is presently in top window mode.
  • Page 217 In the next example, it is assumed that no serious compilation error occurred so the user proceeds to 2- 219...
  • Page 218 2.22 EQUALS 3.3300 ENTER DATA IN THE FORMAT: C NNNDD NNNDD HP#####X.00.00 RPG INTERACTIVE SYSTEM ENVIRONMENT RISE (C) HEWLETT-PACKARD CO. 1981 THU, JUN 4, 1981, 2:59 PM > In the final example, the VERIFY PREP option is demonstrated again, this time with two additional parameters, PMAP and MAXDATA.
  • Page 219 C NNNDD NNNDD S 22222 11111 ..YOUR PROBLEM: 222.22 SUB 111.11 EQUALS 111.1100 ENTER DATA IN THE FORMAT: C NNNDD NNNDD HP#####X.00.00 RPG INTERACTIVE SYSTEM ENVIRONMENT RISE (C) HEWLETT-PACKARD CO. 1981 THU, JUN 4, 1981, 3:02 PM > XPAND XPAND expands file limit size of the current work file.
  • Page 220 Related Commands When you use the FILE command to create a new file, RISE asks you for the maximum number of records the file will contain. If, for example, you specified 10 lines for the new file, entered 10, and discovered that you had more lines to add to the file, RISE would return the following message: Error 147: No room in edit file;...
  • Page 221 Form :MPEcommand Purpose Executes an "MPEcommand" following a colon--:--that can be executed programmatically with RISE. How these commands are executed is described in the MPE Intrinsic Manual under Command Intrinsic. Related Commands When you type H[ELP]: a list of the MPE commands which can be executed programmatically by RISE will be displayed on the screen.
  • Page 222 THU, MAY 28, 1981, 3:20 PM > >:LISTF BACKUP,2 ACCOUNT= SUBSYS GROUP= RPG FILENAME CODE -------LOGICAL RECORD---------- ----SPACE---- SIZE TYP LIMIT R/B SECTORS #X MX BACKUP 88B FA >:PURGE BACKUP > > 2- 224...
  • Page 223 RECOVERY PROCEDURES While using the RPG Interactive System Environment, you may encounter one of six problem situations. They are: * System failures. * Terminal lockouts. * Breaking out of Block Mode. * Transmission errors. * Loss of echo at the screen. * Effects of :EOD.
  • Page 224 file: D:\filtrixfiles\rpgutilrisk\Chap3.html >KEYINFO filename;RECOVER (and, after recovery is made) >EXIT (In the above, "filename" is the name of the KSAM data file determined in the LISTF command.) This will recover the work file and take you out of KSAMUTIL. You can then run RISE and continue editing after you TEXT in the recovered work file name.
  • Page 225 NOTE Steps 6 and 7 may be skipped if you press softkey F7, which puts you in Line Mode instead of Block Mode. Recovery from a Transmission Error Transmission errors usually bring to the screen a nonsensical clutter of characters. The keyboard works but characters, such as escape characters, appear on the screen erroneously.
  • Page 226 file: D:\filtrixfiles\rpgutilrisk\Chap3.html 3- 228...
  • Page 227 Appendix A COMMAND SUMMARY A[DD] [lb] [BY inc] [^^[form] [R[EPEAT] [n]]] ADD lines starting at "lb" BY inc (rement); "^^" controls the RPG Record Spec forms and may be entered while in Add Mode at the start of a new line; the "R[EPEAT] n" option homes the cursor and clears the screen after "n"...
  • Page 228 restricts the search to a range. FO[RM] form Displays the RPG Record Spec form of type "form". "form" may be H,F,E,L,I,C,O, or COL. G[ET] filename Reads and executes commands stored in the file "filename". H[ELP] [command] Gives brief desciptions of all RISE commands; when "command" is specified, provides detailed descriptions of single command.
  • Page 229 BOTH [BY inc] SO[URCE] [BY inc] SO[URCE] W[ITH] SE[QNUM] SE[QNUM] W[ITH] SO[URCE] Renumbers work file sequence line numbers; "lb/le" establishes range for renumbering; "BY inc" establishes increment value; "BOTH" renumbers sequence line numbers and RPG source line numbers (cols 1- 5); "SOURCE WITH SEQNUM" renumbers source lines to agree with the sequence line numbers;...
  • Page 230 Expands the size of the work file by "numrecs" (number of records). :MPEcommand Executes an "MPEcommand" entered following a colon (:) character. The MPE commands which you may enter are listed when you type H[ELP]:. A- 232...
  • Page 231 Appendix B COMPARISON OF RISE AND EDIT/3000 RISE and EDIT/3000 are in many respects similar editors. There are significant differences between them, however. Below is a list of contrasting features that new RISE users, who are accustomed to EDIT/ 3000, will find helpful.
  • Page 232 between changes in column 6 (form type). | LIST ALL OFF prints offline without spacing. ------------------------------------------------------------------------------------------ 9. HELP command replaces. | XPLAIN command. ----------------------------------------------------------------------------------------- 10. MOVE command replaces. | GATHER command. ------------------------------------------------------------------------------------------ 11. RENUM command replaces. | GATHER ALL command. ------------------------------------------------------------------------------------------ 12.
  • Page 233 Appendix C INFORMATIVE EXECUTION MESSAGES Informative Execution Message -------------------------------------------------------------------------------------- Syntax checking is turned on. Syntax checking is turned off. Preparing for compilation... Return to main menu with the MENU command, then compile. Text completed. Warning: record size is greater than 88 bytes, truncated to 80. File is unnumbered;...
  • Page 234 Informative Execution Message -------------------------------------------------------------------------------------- Xpand completed. Creating new Ksam file; enter maximum number of records. Enter response and press ENTER key. Errors in response; Command cancelled. File opened. Enter new file name followed by additional number of records. File exists already; enter a NEW file name. Join completed.
  • Page 235 Appendix D ERROR MESSAGES Error Message -------------------------------------------------------------------------------------- Can't sense cursor position. Only one command allowed. Incorrect specification of the command in the menu. Only F,T,K,J allowed in File type command. Only I,P,C,R,M allowed in Gen1 type command. Only D,S,A,F,CO,CH allowed in Edit type command. Only U,H,V,E allowed in Gen2 type command.
  • Page 236 Error Message -------------------------------------------------------------------------------------- Syntax error on SHOW command. Syntax error on TEXT command. Syntax error on UNDEL command. Syntax error on VERIFY command. Syntax error on NOW parameter. Only NOW parameter allowed with Exit command. KEEP not done - use NOW option to CLEAR work file. Illegal special character.
  • Page 237 Error Message -------------------------------------------------------------------------------------- Only a ‘*',line number,FIRST,LAST,ALL allowed in range. The TO line cannot be less than the FROM line number. Only the RPGLIST option is allowed after the range. There is no compilation listing to print. There is no edit file. Syntax error on Rpglist option.
  • Page 238 Error Message -------------------------------------------------------------------------------------- No parameters are allowed with this command. No string to find. Missing range after IN option. Only a delimited string and/or IN range allowed. Missing close delimiter. A string must be given between the delimiters. A slash (/) cannot delimit a string. Should be blank after line range.
  • Page 239 Error Message -------------------------------------------------------------------------------------- Expecting equal sign after a parameter. Illegal numeric value after the equal sign. Numeric value may only have a maximum of 5 digits. Only G,P,S allowed for libsearch value. Program name may contain a maximum of 8 chars. Expecting lockword immediately after the slash.
  • Page 240 Error Message -------------------------------------------------------------------------------------- Expecting SOURCE after WITH. Expecting WITH SOURCE after SEQNUM. Expecting SEQNUM after WITH. Only WITH or BY allowed after SOURCE. Syntax error on SOURCE. Syntax error on SEQNUM. Can't distinquish between SOurce and SEqnum. Syntax error on WITH. A source line number has non-numeric characters.
  • Page 241 Error Message -------------------------------------------------------------------------------------- Should be blank after BY increment. Should be blank after file name. Should be blank after ^^. Only ^^ allowed after line range. Should be blank after SOURCE. Should be blank after SEQNUM. Only capital letters are allowed. Syntax error on EVERY.
  • Page 242 D- 244...
  • Page 243 HP RPG/XL Utilities-Part 3 SIGEDIT...
  • Page 245 Summarizes the SIGEDITOR keys. Appendix C Describes how to calculate the self-check field. Additional Documentation For more information on RPG, see the HP RPG/XL Reference Manual and PROCMON/3000. Unsupported Devices SIGEDITOR does not support these HP terminals: * 264X Series...
  • Page 246 Conventions NOTATION DESCRIPTION UPPERCASE Within syntax statements, characters in uppercase must be entered in exactly the order shown, though you can enter them in either uppercase or lowercase. For example: SHOWJOB Valid entries: showjob ShowJob SHOWJOB Invalid entries: shojwob ShoJob SHOW_JOB italics Within syntax statements, a word in italics represents a formal parameter or...
  • Page 247 If a punctuation character precedes the ellipsis, you must use that character as a delimiter to separate repeated elements. However, if you select only one element, the delimiter is not required. In the following example, the comma cannot precede the first instance of itemname: [itemname ][,...] |...| Within syntax statements, a horizontal ellipsis enclosed in parallel vertical lines indicates...
  • Page 248 simultaneously press the Control key and the Y key on the keyboard. base prefixes The prefixes %,#, and $ specify the numerical base of the value that follows %num specifies an octal number. #num specifies a decimal number. $num specifies a hexadecimal number. When no base is specified, decimal is assumed.
  • Page 249 • Modify existing forms. • Convert S, D, and H RPG specifications from an IBM System 34 or 36 into a format that is compatible with HP RPG programs. • Print hard copies of forms and form specifications. • Copy existing forms.
  • Page 250 Running SIGEDITOR To begin using SIGEDITOR, enter the following command: :run sigedit.pub.sys The main menu heading appears at the top of the as shown in Figure 1-1. __________________________________________________________________________________ HP32104A.08.00 SIGEDITOR WED, MAR 3, 1988 9:32 AM| __________________________________________________________________________________ Figure 1-1. Main Menu Heading The main menu keys appear at the bottom of the screen.
  • Page 251 EDIT EDT FORM EDT FLD SWITCH PREV PAG NEXT PAG FORM MAIN| FORM ATTRIB ATTRIB LST FMT FRM LIST FRM LIST UTILS MENU| _____________________________________________________________________________________ Figure 1-4. The Edit Menu From here you can select the functions for designing a new form, editing an existing form, or selecting the form utilities functions.
  • Page 252 SOC. SEC. NO. NAME ADDRESS ZIP CODE PHONE NO. Figure 1-7. Sample Form with a Centered Line Press ENTER . In the next screen, type the name of the new form and press ENTER to store the form and return to the main menu. At this point, you have created a forms file, designed a new form, and stored the form in the file.
  • Page 253 ADDRESS ADDRESS ZIP CODE PHONE NO. Figure 1-10. Sample Form with a Field Deleted The f4 key (HOLD FIELD) copies or moves a single field from one position to another. Position the cursor on the field labeled PHONE NO. and press the f1 key. An H appears in the field to indicate that the field is being held.
  • Page 254 SOC. SEC. NO. ___________________ NAME ________________________________________ ADDRESS _____________________________________ ADDRESS _____________________________________ ZIP CODE ___________ PHONE NO. ________ OFFICE PHONE __________ _______________________________________________________________________ Figure 1-13. Location of Lines Drawn on Sample Form Set the horizontal line type to bold by pressing the f3 key until the key on the screen reads 'HORIZON BOLD.' Next, move the cursor with the cursor control keys to approximately the same position on the screen that the letter b appears in Figure 1-13.
  • Page 255 Chapter 2 Using SIGEDITOR Introduction This chapter gives a detailed description of SIGEDITOR's capabilities. They are: • * Creating forms files. • * Entering forms specifications. • * Specifiying form field attributes. • * Using additional editing features. • * Using the form utilities. Opening, Creating, and Listing Forms Files To open a forms file, press f1 (SELECT FRMS FIL) from the main menu.
  • Page 256 Suppress input Return input Erase input fields PRNT ROLL ROLL REC DOWN CLEAR HELP BKSPC _____________________________________________________________________________________________| Retain function keys N or Retain command keys N or PRESS ENTER: TO CONTINUE ______________________________________________________________________________________________ Figure 2-1. The Form Attribute Screen After editing the form attributes, you must save or abandon the changes. To save them, press ENTER ; to abandon them, press f7 .
  • Page 257 start line number and the number of lines to clear is eight, lines three through ten are cleared. The number of lines to clear plus the start line number must not exceed 24. If a value is not given, 24 lines (the default) are cleared.
  • Page 258 Forms can be downloaded using the DOWNLOAD command of the Process Monitor software product, PROCMON. Currently, only the 2394A and 700/94 terminals sup- port forms downloading. For more information, see the PROCMON/3000 Reference Manual. If Y (yes) is specified, the name of the form in the forms cache directory consists of the form name and *GLOBAL.
  • Page 259 field corresponding to the command key. If a field is left blank, the corresponding command key is not enabled. The command key indicators are used in the RPG program to control the flow of operation. Refer to the HP RPG/XL Reference Manual, chapter 11 for a detailed list of command keys.
  • Page 260 _____________________________________________________________________________________ NEXT PREV FIRST DEFAULT SEE/SET EDIT| FIELD FIELD FIELD FIELD ATTRIB. ATTRIB. MENU| _____________________________________________________________________________________ Figure 2-2. Field Attribute Keys The first three keys allow you to move the cursor from field to field. Pressing f1 (NEXT FIELD) moves the cursor to the next field on the form according to line and column numbers.
  • Page 261 Form File: formfile.group.account Form: formname ----------------------------------------------------------------------------------| Field Name: Sequence Number: Position Cursor: N Protect Fields: N High Intense: N Blink Field: N Security Video: Inverse Video: Y Underline: Output Field: N Constant Type (C=constant, M=Message, " " = User Program) Input Field: Message Set No:...
  • Page 262 new I/O specifications, the data is not stored in the correct buffer locations. NOTE If you change the sequence numbers of a form's fields, regenerate I/O specifications and recompile the program. (See "Generating I/O Specifications.") Position Cursor Legal values for this field are Y, N, and 01-99. The Position Cursor attribute positions the cursor at a specific input field when a form is first displayed.
  • Page 263 If Y (yes) is specified, the characters in the field appear in inverse video. If N (no) is specified, the characters appear in normal video. If an indicator is specified, the field appears in inverse video when the indicator is on. Underline Legal values for this field are Y, N, and 01-99.
  • Page 264 Constant Type Legal values for this field are C or blank. If C is specified in the Constant type specification, constant information given in the field is displayed in the output field. If the field is blank, blanks are displayed. If a blank is specified, information from the program output buffer area is displayed.
  • Page 265 Examples of numeric and signed numeric data types are shown below. Entered on screen In buffer Numeric: 1234.5 12345 Signed numeric: -1234 123M 1234- 123M A blank is represented by a Mandatory Enter Legal values for this field are Y and N. If Y (yes) is specified, the user must enter at least one character in the field before input from the form can be returned to your program.
  • Page 266 items such as account numbers. The number is initially created by a user program, using an appropriate algorithm, to compute a check digit, which is then appended to the right-most end of the number. For example, a 6-digit number plus the check digit would become a 7-digit account number. When the number is entered on the screen and self-check is specified, the number is checked, again using an appropriate algorithm, to ensure the number was entered correctly.
  • Page 267 Other Keyboard Edit Keys Although it is not recommended, you can modify a form with keys not included in the function keys f1 through f8 . The additional six keys are shown in Figure 2-6. These keys can be useful when editing fields;...
  • Page 268 RPG program to avoid entering information that is already available (see the $COPY option description in the HP RPG/XL Reference Manual ). If a field's size, position, name, or sequence number is changed, the changes must be reflected in the program by regenerating the I/O specifications and copying the new specifications into the program.
  • Page 269 ______________________________________________________________________________________ Figure 2-8. Copy Form Screen The space allowed to enter the name of the FROM forms file is long enough to specify the fully qualified filename of a forms file. Once the designated forms file and form names are given and the ENTER key is pressed, SIGEDITOR simply copies the form to the specified forms file under the new form name.
  • Page 270 2- 272...
  • Page 271 Chapter 3 Application Help Facility Introduction to the Application Help Facility The application help facility is part of the RPG Screen Interface (RSI). At runtime, RSI uses "help areas" and "help forms" created by SIGEDITOR. For applications converted from the IBM S/36, the SIGEDITOR converts the help (or H) specifications to the RSI format as part of the convert S and D specifications function.
  • Page 272 Figure 3-1. Defined Help Area If you are not satisfied with the help area, you can start over by pressing the f5 (REFRESH FORM) key. The current help area is the only one discarded. To see all help areas defined for the form, press the f6 (SHOW ALL AREAS) key.
  • Page 273 ______________________________________________________________________________________ RPG Screen Interface - Help Area List Specification Form File: RSID002F Form: FORM --------------------------------------------------------------------------- Upr Left Lower Rt Indicators Form NAMADD10 ZIPCOD10 PHONUM10 --------------------------------------------------------------------------- List Entry ID: New List Entry ID: CHANGE DELETE CHANGE SHOW ALL SCROLL SCROLL ABANDON HELP| ATTRIB AREA...
  • Page 274 application form. It must be in the range of 01 to 24. The only exception is in the case of the "NULL HELP AREA" (see roll key processing). When a "NULL HELP AREA" is created all row and column attributes must be zero (0).
  • Page 275 indicator set on (by the RPG program); if any are found they are deleted from the global help area list. 3- 277...
  • Page 276 3- 278...
  • Page 277 Chapter 4 A Quick Reference to SIGEDITOR Introduction This chapter provides a quick guide to specific tasks of SIGEDITOR and gives step-by-step directions to perform a task. You can use these directions without reading chapters 1 and 2. The tasks in this chapter are: •...
  • Page 278 Press f7 (FORM UTIL). 10 Press f1 (HELP AREAS). 11 Enter forms file name if forms file name displayed on screen is not correct. 12 Enter form name which help form is to be attached to and press f2 (CREATE AREAS). 13 Move cursor to the upper left corner of help area and press f1 (UPPER LEFT).
  • Page 279 Creating a Field in an Existing Form From the main menu, press f1 (SELECT FRMS FIL) to open a forms file. Enter a valid forms filename and press ENTER . Enter a valid form name and press f1 (EDIT FORM). Position the cursor where the field is to begin.
  • Page 280 Press f1 (FROM POSITION). Position the cursor at the line's ending position. Press f2 (TO POSITION). (Repeat steps 5 through 9, as needed, to draw all the desired lines.) 10 Press ENTER . 11 Press ENTER again to save the form, or press f7 to abandon changes.
  • Page 281 NOTE When deleting lines from a form, the line connectors (T's, crosses) will not be deleted. To delete them, re-draw a line (or portion of a line) over the area containing the con- nector. Generating RPG I/O Specs From the main menu, press f6 (GEN I/O SPECS). Enter the name of the forms file and the file to contain RPG input and output specifications.
  • Page 282 Enter a valid form name and press f1 (EDIT FORM). Press f8 to switch menus. Position the cursor in the field to be shortened. Press f2 (SHORTEN FIELD) until the field is the correct length. Press ENTER . Press ENTER again to save the form, or press f7 to abandon changes. Press f8 to return to the main menu.
  • Page 283 Chapter 5 Using SIGEDITOR with RPG Introduction This chapter explains how to design SIGEDITOR forms for use with RPG. The chapter assumes you are familiar with SIGEDITOR. For more information about SIGEDITOR functions, refer to chapters 1 through Sample RPG Program The program in Figure 4-1 uses two forms, FORM21 and FORM22, in the forms file SAMPLIB.
  • Page 284 71 ADDR 800ZIP 90 PHONE# CLEAN UP SETOF 808182 SETOF 656070 DETERMINE ACTION REQUESTED SETON ADD RECORD SETON DEL RECORD SETON UPD RECORD SETON END JOB GOTO EOF GOTO EOF READ RECORD FROM CUSTOMER MASTER FILE USING SSN AS A KEY SETOF CHAINCUSTMAST NO HIT...
  • Page 285 UPDATE DISK RECORD OCUSTMASTD 02 82 NAME ADDR PHONE# B ADD DISK RECORD DADD 02 80 NAME ADDR PHONE# B DELETE DISK RECORD DDEL 01 81N42 NAME ADDR PHONE# B END OF SOURCE STATEMENTS ___________________________________________________________________________________ Figure 5-1. RPG Program (continued) FORM21 (shown in Figure 4-2) allows the user to enter a social security number, choose to add a new record, delete an existing record, or update an existing record.
  • Page 286 ____________________________________________________________ Figure 5-2. FORM21 If you choose to add a new record, the system searches the KSAM file for a record with the specified social security number. If the record already exists, an error message is displayed in a message field, as shown in Figure 4-2.
  • Page 287 chapter 3 for more details). Once this process is complete, you can begin constructing the RPG program. FORM21 For this example, begin with FORM21 by setting the correct form attributes. Enable command keys 1, 2, 3, and 7 (A, B, C, and G) by placing a character in the space identified by the correct letter. The keys correspond to the three options available to the user (adding, deleting, or updating).
  • Page 288 $CONTROL NAME=) suffixed with "FM". If the program name is missing, the default forms filename becomes "RPGOBJFM". The forms filename can be referenced by a file equation at runtime to redirect the forms file. The social security number is split into three fields on the screen to allow for punctuation. In the RPG program, the three fields have been combined into a single field by modifying the "I"...
  • Page 289 FORM21 K6 'FORM21' ERRMSG OWRKSTN O* FORM22 'FORM22' NAME ADDR PNPT1 PNPT2 PNPT3 ___________________________________________________________________________________ Figure 5-4. RPG Specifications Overlays and Variable Starting Lines Overlays are two or more forms that are displayed so that portions of all the forms are visible at the same time.
  • Page 290 An example of overlays and variable start line forms used together is an order entry application that begins with a small form that occupies the top few lines of the screen to enter header information. The next form is a one-line form that is displayed once for each detail line of the order, moving down the screen a line at a time.
  • Page 291 Appendix A SIGEDITOR Error Messages Introduction This appendix lists and explains the SIGEDITOR error messages. ----------------------------------------------------------------------------- MESSAGE UNABLE TO OPEN TERMINAL. (SIGERR 001) CAUSE There is a system problem with the terminal. ACTION Contact your system manager if you are unable to resolve this problem. ----------------------------------------------------------------------------- MESSAGE UNABLE TO OPEN LIBRARY FORM FILE.
  • Page 292 MESSAGE FORM DOES NOT EXIST. (SIGERR 011) CAUSE The form file does not contain the specified form. ACTION Verify that spelling of form name is correct, including the usage of upper and lower case. ----------------------------------------------------------------------------- MESSAGE FORM SPECIFIED ALREADY EXISTS. (SIGERR 013) CAUSE The name specified for this form is the name of an existing form in the same forms file.
  • Page 293 MESSAGE FORM FILE SPECIFIED ALREADY EXISTS. (SIGERR 026) CAUSE The specified file currently exists as a permanent file. ACTION Select a unique form filename. ----------------------------------------------------------------------------- MESSAGE UNABLE TO PURGE OLD FORMS FILE. (SIGERR 029) CAUSE There is a system problem, or the file is open from another source. ACTION Contact your system manager if you are unable to resolve this problem.
  • Page 294 MESSAGE INVALID PROCESSING OPTION SPECIFIED. (SIGERR 040) CAUSE A value other than "A" or "P" was input. ACTION Type "A" to process all form files or "P" for a prompt before processing each forms file. ----------------------------------------------------------------------------- MESSAGE A (Y)ES OR (N)O RESPONSE IS REQUIRED. (SIGERR 041) CAUSE A value other than "Y"...
  • Page 295 CAUSE There are too many record definitions for the console file. ACTION Reduce the number of record types in the RPG input specifications for this file. ----------------------------------------------------------------------------- MESSAGE TOTAL NUMBER OF FIELDS WILL NOT FIT ON FORM. (SIGERR 060) CAUSE There are too many fields defined for a console form.
  • Page 296 ACTION Reenter the name, making sure that it is 8 characters long and that the last 2 characters are numeric digits from 0 through 9. ----------------------------------------------------------------------------- MESSAGE SUPPRESS SELECTION IND. MUST BE BLANK OR 01 TO 99. (SIGERR 067) CAUSE The suppress selection indicator is not a legal value.
  • Page 297 CAUSE The upper left row and column numbers used to define the help area must be less than or equal to the lower right row and column numbers, and they are not. ACTION Reenter the row and column numbers, making sure that they are correct in relation to each other.
  • Page 298 A-300...
  • Page 299 Appendix B Summary of the SIGEDITOR Keys Introduction This appendix summarizes the function of each key. Main Menu SELECT CONVERT MERGE PRINT GEN I/O FORM EXIT FRMS FIL S&D SPEC CATALOG SPECS SPECS UTILS Description SELECT FRMS FIL Opens the file once a forms file has been named. CONVERTS &D SPEC Converts files containing S, D, and H specifications from an IBM system to the files used by SIGEDITOR.
  • Page 300 Help Areas Menu CREATE UPDT/DEL UTIL AREAS AREAS MENU Description CREATE AREAS Takes you to the create help areas keys. UPDT/DEL AREAS Takes you to the update/delete help areas keys UTIL MENU Takes you to the form utilities menu. Form Utilities Menu HELP DELETE COPY MERGE PRINT GEN I/O EXIT FRM...
  • Page 301 Description ABANDON ALL Discards all help areas defined during this create session and returns you to the help CHGS areas menu. HELP MENU Saves all help areas defined during this create session and returns you to the help areas menu. Keys for Designing a New Form START STOP CENTER REFRESH SWITCH...
  • Page 302 Keys for Drawing Lines FORM HORIZON VERTICAL ERASE REFRESH SWITCH POSITION POSITION SINGLE SINGLE MENU Description FROM POSITION Identifies the beginning of the line. TO POSITION Identifies the end of the line. HORIZON SINGLE Specifies the type of horizontal lines; can be SINGLE, BOLD, or DOUBLE. VERTICAL SINGLE Specifies the type of vertical lines;...
  • Page 303 Description EDIT MENU Returns you to the Edit Menu. Update/Delete Help Areas CHANGE DELETE CHANGE SHOW ALL SCROLL SCROLL ABANDON HELP ATTR AREA AREAS FRWD BACK ALL CHGS MENU Description CHANGE ATTR Allows you to change the help attributes of a specific help area displayed on the screen.
  • Page 304 B- 306...
  • Page 305 Appendix C Calculating the Self-Check Digit Introduction As described in chapter 2, the self-check digit is used for numeric fields. If a mode of self-checking is specified, the field is checked by the checking algorithm when information is entered. Modulus 10 Self-Check Digit To calculate the modulus 10 self-check digit, follow these steps: Multiply the rightmost position and every other position, moving to the left, of the number by 2.
  • Page 306 Example: 2 + 14 + 18 + 20 + 20 + 18 + 14 = 106 Divide the sum from step 3 by 11. Example: 106 divided by 11 is 9 with a remainder of 7. If the remainder is 0, the self-check digit is 0. If the remainder is 1, your number does not have a modulus 11 self-check digit, and you should not use the number in the fields you define with modulus 11 self-check fields.
  • Page 307 RPG programmers to create and initialize a Local Data Area file, create and initialize the RPG user date file, and display the contents of both files. This manual assumes that you are an experienced RPG programmer using RPGINIT. Additional Documentation More information on RPG/3000 can be found in the RPG/3000 Reference Manual. 1- 309...
  • Page 308 The Local Data Area is a temporary file named LDAFILE and is used to pass information between RPG programs and other programs or job control procedures (such as PROCMON/3000). RPGINIT creates and initializes LDAFILE to blanks. The file can be created as 1 through 32 multiples of 256 bytes (such as 256, 512, 768, 1024,..., 8192 bytes).
  • Page 309 By running RPGINIT with the SHOW entry point, the current contents of the LDA file are displayed on the terminal. The character data is blocked in groups of ten characters for easy verification of correct updating of the LDA file by programs and by other job control procedures (such as PROCMON/3000). This screen is shown below: HP32104A.07.00 RPG INITIALIZER UTILITY (RPGINIT) (C) HEWLETT-PACKARD CO.
  • Page 310 RPGUDATE: 090186 USWITCH: U1=OFF, U2= ON, U3=OFF, U4=OFF, U5=OFF, U6=OFF, U7=OFF, U8=OFF LDAFILE: 0001: AA2001 AS SEM. BRACK ET 0051: 0101: 0151: 0201: 0251: MORE (Y/N)? 0257: 0307: 0357: 0407: 0457: 0507: If a value for PARM is not specified or is less than 1, you are prompted to view one 256-byte LDA record at a time.