home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv4.zip / VACPP / IBMCPP / HELP / EVFERLSH.HLP (.txt) < prev    next >
OS/2 Help File  |  1995-05-11  |  436KB  |  13,714 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. RPG/400 Help ΓòÉΓòÉΓòÉ
  3.  
  4.  Introduction to RPG/400 
  5.  Control Specifications 
  6.  File Description Specifications 
  7.  Extension Specifications 
  8.  Line Counter Specifications 
  9.  Input Specifications 
  10.  Calculation Specifications 
  11.  Output Specifications 
  12.  Operation Codes 
  13.  RPG/400 Words with Special Functions 
  14.  RPG/400 Restrictions 
  15.  The Structured Query Language 
  16.  RPG/400 Reserved Fields 
  17.  
  18.  
  19. ΓòÉΓòÉΓòÉ 1.1. How This Product Has Changed ΓòÉΓòÉΓòÉ
  20.  
  21.  Optional factor 1 on CAT and SUBST. For details and examples see String 
  22.   Operations, CAT (Concatenate Two Character Strings), and SUBST (Substring). 
  23.  
  24.  CHEKR provides the same function as CHECK but in the reverse direction (right 
  25.   to left). This function can be used to determine the length of a string. For 
  26.   details and examples see CHEKR (Check Reverse). 
  27.  
  28.  P in the operation extender field for MOVE, MOVEA, and MOVEL allowing padding 
  29.   of the result after the operation. For details and examples see Move 
  30.   Operations, MOVE (Move), MOVEA (Move Array), and MOVEL (Move Left). 
  31.  
  32.  Support for hexadecimal literals. For details and examples see Bit 
  33.   Operations. 
  34.  
  35.  Support for a 4-digit year. For details and examples see User Date Special 
  36.   Words, and TIME (Time of Day). 
  37.  
  38.  
  39. ΓòÉΓòÉΓòÉ 1.2. Introduction to RPG/400 ΓòÉΓòÉΓòÉ
  40.  
  41. The valid character set for the RPG/400 language consists of: 
  42.  
  43.  The letters A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 
  44.  The numbers 0 1 2 3 4 5 6 7 8 9 
  45.  The characters + - * , . ' & / $ # : @ 
  46.  The blank character 
  47.  
  48. RPG/400 code is written on a variety of specifications. Each specification has 
  49. a specific set of functions. See Common Entries for details on specification 
  50. types. The RPG/400 language is a position-dependent language. Each entry must 
  51. start in a specific column. To represent this, each illustration of RPG/400 
  52. code will be in listing format with a scale drawn across the top. You may find 
  53. it helpful to use your RPG/400 Debugging Template (GX21-9129). 
  54.  
  55. This help contains a detailed description of the individual RPG/400 
  56. specifications. Each field and its possible entries are described. Operation 
  57. Codes describes the operation codes that are coded on the Calculation 
  58. specification, which is described in Calculation Specifications. 
  59.  
  60. In addition, there is information on indicators, the logic cycle, arrays and 
  61. tables, edit codes and edit words, file translation, multifile processing, and 
  62. match fields. 
  63.  
  64.  
  65. ΓòÉΓòÉΓòÉ 1.2.1. Compiler Directives ΓòÉΓòÉΓòÉ
  66.  
  67. The compiler directive statements /TITLE, /EJECT, /SPACE, and /COPY allow you 
  68. to specify heading information for the compiler listing, to control the spacing 
  69. of the compiler listing, and to insert records from other file members during a 
  70. compile. The compiler directive statements must precede any arrays, tables, 
  71. translation records, and alternate collating sequence records (that is,  ** 
  72. records). 
  73.  
  74.  
  75. ΓòÉΓòÉΓòÉ 1.2.1.1. /TITLE (Positions 7-12) ΓòÉΓòÉΓòÉ
  76.  
  77. Use the compiler directive /TITLE to specify heading information (such as 
  78. security classification or titles) that is to appear at the top of each page of 
  79. the compiler listing.  The following entries are used for /TITLE: 
  80.  
  81. Positions    Entry 
  82. 7-12         /TITLE 
  83. 13           Blank 
  84. 14-74        Title information 
  85.  
  86. A program can contain more than one /TITLE statement. Each /TITLE statement 
  87. provides heading information for the compiler listing until another /TITLE 
  88. statement is encountered. A  /TITLE statement must be the first RPG/400 
  89. specification encountered  to print  information on the first page of the 
  90. compiler listing. The information specified by the /TITLE statement is printed 
  91. in addition to compiler heading information. 
  92.  
  93. The /TITLE statement causes a skip to the next page before the title is 
  94. printed. The /TITLE statement is not printed on the compiler listing. 
  95.  
  96.  
  97. ΓòÉΓòÉΓòÉ 1.2.1.2. /EJECT (Positions 7-12) ΓòÉΓòÉΓòÉ
  98.  
  99. Enter /EJECT in positions 7 through 12 to indicate that subsequent 
  100. specifications are to begin on a new page of the compiler listing.  Positions 
  101. 13 through 74 of the /EJECT statement must be blank. /EJECT is not printed on 
  102. the compiler listing. 
  103.  
  104.  
  105. ΓòÉΓòÉΓòÉ 1.2.1.3. /SPACE (Positions 7-12) ΓòÉΓòÉΓòÉ
  106.  
  107. Use the compiler directive /SPACE to control line spacing within the compiler 
  108. listing.  The following entries are used for /SPACE: 
  109.  
  110. Positions    Entry 
  111. 7-12         /SPACE 
  112. 13           Blank 
  113. 14-16        A positive integer value from 1 through 112 that defines the 
  114.              number of lines to space on the compiler listing.  The number must 
  115.              be left-adjusted. 
  116.  
  117. If the number specified in positions 14 through 16 is greater than the number 
  118. of lines remaining on the current page, subsequent specifications begin on a 
  119. new page. 
  120.  
  121. /SPACE is not printed on the compiler listing, but is replaced by the specified 
  122. line spacing.  The line spacing caused by /SPACE is in addition to the two 
  123. lines that are skipped between specification types. If position 6 is blank, it 
  124. is considered to be equal to the preceding specification and the two lines are 
  125. not skipped. 
  126.  
  127.  
  128. ΓòÉΓòÉΓòÉ 1.2.1.4. /COPY (Positions 7-11) ΓòÉΓòÉΓòÉ
  129.  
  130. The /COPY compiler directive causes records from other files to be inserted, at 
  131. the point where the /COPY occurs, with the file being compiled. The inserted 
  132. files may contain any valid specification except /COPY. 
  133.  
  134. The /COPY statement is entered in the following way: 
  135.  
  136. Positions    Entry 
  137. 7-11         /COPY 
  138. 12           Blank 
  139. 13-44        Identifies the location of the member to be copied (merged). The 
  140.              format is: 
  141.  
  142.              libraryname/filename,membername (RPG/400 AS/400 environment) 
  143.  
  144.     A member name must be specified. 
  145.     If a file name is not specified, QRPGSRC is assumed. 
  146.     If a library is not specified, the library list is searched for the file. 
  147.      All occurrences of the specified source file in the library list are 
  148.      searched for the member until it is located or the search is complete. 
  149.     If a library is specified, a file name must also be specified. 
  150. 45-49        Blank 
  151. 50-80        Comments 
  152.  
  153. Examples of the /COPY Compiler Directive Statement shows some examples of the 
  154. /COPY directive statement. 
  155.  
  156. Note:   Programs compiled under the AS/400 environment can use the extended 
  157. naming convention. If extended names are used, each part of the qualified name 
  158. must be enclosed in quotation marks. 
  159.  
  160. For more information see How the Compiler Recognizes a Compiler /COPY, 
  161. Conditions on the Members That Are Copied, Sequence Numbering of the Listing 
  162. after a Compile, and Results of the /COPY during Compile. 
  163.  
  164.  
  165. ΓòÉΓòÉΓòÉ 1.2.1.4.1. How the Compiler Recognizes a Compiler /COPY ΓòÉΓòÉΓòÉ
  166.  
  167. Use the rules for RPG/400 symbolic names, to specify the library files and 
  168. member. 
  169.  
  170.  1. The CRTRPGPGM command will treat any /COPY directive encountered in the 
  171.     source code as a compiler copy and does not accept the sorting or string 
  172.     replacement functions. 
  173.  
  174. Examples of the /COPY Compiler Directive Statement 
  175.  
  176. C/COPY MBR1 1
  177.  
  178. I/COPY SRCFIL,MBR2 2
  179.  
  180. O/COPY SRCLIB/SRCFIL,MBR3 3
  181.  
  182. O/COPY "SRCLIB!"/"SRC>3","MBR^3" 4
  183.  
  184. 1    Copies from member MBR1 in source file QRPGSRC.  The current library list 
  185.      is used to search for file QRPGSRC. 
  186. 2    Copies from member MBR2 in file SRCFIL. The current library list is used 
  187.      to search for file SRCFIL. Note that the comma is used to separate the 
  188.      file name from the member name. 
  189. 3    Copies from member MBR3 in file SRCFIL in library SRCLIB. 
  190. 4    Copies from member "MBR^3" in file "SRC>3" in library "SRCLIB!" 
  191.  
  192.  
  193. ΓòÉΓòÉΓòÉ 1.2.1.4.2. Conditions on the Members That Are Copied ΓòÉΓòÉΓòÉ
  194.  
  195. If the member being copied from is not a source type file, meaning that the 
  196. file was not created with the filetype *SRC, then a message is issued. This 
  197. condition does not stop compilation and the copy function is still processed. 
  198.  
  199. The members being copied can contain any valid RPG/400 specifications except 
  200. another /COPY directive. 
  201.  
  202. The member being copied can contain a control specification (form type H), 
  203. which is then processed as if it were part of the source code. Therefore, the 
  204. first statement in the program can be a /COPY directive pointing to the member 
  205. containing the control specification. The H specification must still follow the 
  206. rules governing its use (refer to Control Specifications) and precede any other 
  207. RPG/400 specification. 
  208.  
  209.  
  210. ΓòÉΓòÉΓòÉ 1.2.1.4.3. Results of the /COPY during Compile ΓòÉΓòÉΓòÉ
  211.  
  212. During compilation, the specified file members are merged into the program at 
  213. the point where the /COPY statement occurs. Any overrides defined that apply to 
  214. the specified file and member are ignored. 
  215.  
  216.  
  217. ΓòÉΓòÉΓòÉ 1.2.1.4.4. Sequence Numbering of the Listing after a Compile ΓòÉΓòÉΓòÉ
  218.  
  219. For an RPG/400 compile, the low-order 6 digits of the 8-character sequence 
  220. number in the listing reflect the original source sequence number of the /COPY 
  221. member. In this way you can correlate the compiler listing sequence numbers 
  222. (the last 6 digits) to the source member sequence numbers (in SEU). 
  223.  
  224. The high order 2 digits of the sequence number are made up of the characters A 
  225. through Z and 0 through 9 in the following order: A, B, C, ..., Z, 1, 2, ..., 
  226. 9, A0, AA, AB, ..., AZ, A1, A2, ..., A9, B0, BA, ..., ZZ, ..., Z9, 10, ..., 99. 
  227.  
  228. This structure allows for up to 1295 different increments of the high order 
  229. sequence number. 
  230.  
  231. Each /COPY directive causes the high order 2 characters of the sequence number 
  232. for all the code lines brought in by this /COPY to be incremented in value. 
  233.  
  234. If the copied code contains specifications for externally defined files, each 
  235. externally defined file may cause the high-order characters of the sequence 
  236. number to be incremented in value two more times: once for input 
  237. specifications, and once for output specifications. 
  238.  
  239. If more than 1295 increments result from /COPY directives and/or externally 
  240. defined files, a message is issued.  A message is also issued if more than 50 
  241. externally defined files are specified. Remember that one externally defined 
  242. file can take up two increments: for input and output specifications. 
  243.  
  244. The low order 6 digits of the sequence number is incremented by one for each I 
  245. specification generated for an externally defined file. 
  246.  
  247. If the program is compiled by RPG/400, records that are copied into the program 
  248. in this way contain a "+" adjacent to the sequence number field on the left 
  249. side of the listing, between the sequence number and the form type field. If 
  250. the Program Verifier is used, the lines from the copied file are identified on 
  251. the listing by line numbers which start at 100001. For example, the third line 
  252. in the first copied file would be 100003 and the seventh line of the fourth 
  253. copied file would be 400007. 
  254.  
  255. Note:   The /COPY directive is treated as a comment line. Because the compiler 
  256. may have to read ahead to gather sufficient information about specifications, 
  257. comments, or /COPY directives, certain lines may appear on the listing out of 
  258. sequence. 
  259.  
  260.  
  261. ΓòÉΓòÉΓòÉ 1.2.2. Common Entries ΓòÉΓòÉΓòÉ
  262.  
  263. The following entries are common to all RPG specifications: 
  264.  
  265.  Page (positions 1-2) and Line (positions 3-5).  These are the equivalent of 
  266.   source line number. 
  267.  Specification type (position 6).  The following letter codes can be used: 
  268.  
  269.    Entry       Specification Type 
  270.    H           Control 
  271.    F           File description 
  272.    E           Extension 
  273.    L           Line counter 
  274.    I           Input 
  275.    C           Calculation 
  276.    O           Output 
  277.  
  278.  Program Identification (positions 75-80). Must be blank or program name on 
  279.   the Control specification. 
  280.  Comment Statements (* in position 7). On a comment statement or a compiler 
  281.   directive, position 6 may be blank. 
  282.  
  283.  
  284. ΓòÉΓòÉΓòÉ <hidden> Specification Type Not Known ΓòÉΓòÉΓòÉ
  285.  
  286. The entry in position 6 of your specification is not valid. Select from the 
  287. following valid types. 
  288.  
  289.  Specification type.  The following letter codes can be used: 
  290.  
  291.    Entry       Specification Type 
  292.    H           Control 
  293.    F           File description 
  294.    E           Extension 
  295.    L           Line counter 
  296.    I           Input 
  297.    C           Calculation 
  298.    O           Output 
  299.  
  300.  Comment Statements (* in position 7). On a comment statement or a compiler 
  301.   directive, position 6 may be blank. 
  302.  Compiler Directive (blank in position 6).  Select from the following entries 
  303.   for positions 7-12. 
  304.  
  305.    - /COPY 
  306.    - /EJECT 
  307.    - /SPACE 
  308.    - /TITLE 
  309.  
  310.  SQL delimeters (blank in position 6). You may use the following starting and 
  311.   ending delimeters in positions 7-15. 
  312.  
  313.    - /EXEC SQL 
  314.    - /END-EXEC 
  315.  
  316.  
  317. ΓòÉΓòÉΓòÉ 1.3. Control Specifications ΓòÉΓòÉΓòÉ
  318.  
  319. The control specification statement, identified by an H in column 6, provides 
  320. information about generating and running programs. Only one control 
  321. specification is allowed per program. In the OS/400 system, you can create a 
  322. data area named RPGHSPEC to contain the information to be used for all RPG/400 
  323. programs that do not contain a control specification. 
  324.  
  325. The data area must be a character string 80 positions long.  Use the CL command 
  326. CRTDTAARA (Create Data Area) to create the data area.  Specify as the initial 
  327. value of the data area the entries for the control specification that are to be 
  328. used.  For example, if the DEBUG operation is to be used for all RPG/400 
  329. programs, place an initial value of 1 in position 15 of the data area.  (See 
  330. the Programming:  Control Language Reference for a description of the Create 
  331. Data Area command.)  The library in which the data area is placed must be in 
  332. the library list when the program is compiled. 
  333.  
  334. If you are using Program Verifier on a program which uses the data area 
  335. RPGHSPEC you must create a file called RPGHSPEC.RPG and place it in the CODE 
  336. base directory. The installation default for that directory is D:|CODE. The 
  337. file should contain the same specifications as are in the RPGHSPEC data area 
  338. you would be using on the host. 
  339.  
  340. The RPG/400 language uses the control specification that is present in the 
  341. program.  In the OS/400 system, if a control specification is not present, the 
  342. RPG/400 compiler checks for the data area RPGHSPEC in *LIBL. If the data area 
  343. is not found, the RPG/400 compiler checks for the data area DFTHSPEC in QRPG. 
  344. If it is not found, a default specification with blanks in positions 7 through 
  345. 74 is used, (no data area is created). Since QRPG is the product library for 
  346. the CRTRPGPGM command, if a data area called RPGHSPEC exists in QRPG it will 
  347. always be found.  Use the data area DFTHSPEC in QRPG to create a common control 
  348. specification for your installation, and use RPGHSPEC in your library to 
  349. override this specification. 
  350.  
  351. If a control specification is not present, Program Verifier will search for the 
  352. file RPGHSPEC.RPG in the CODE base directory. If that file is not found, a 
  353. default  blank H specification will be used. 
  354.  
  355. See the description of the individual entries for the meaning of blank entries 
  356. and for an explanation of the program name. If the default blank specification 
  357. is used, asterisks are printed on the compiler listing under the Page/Line 
  358. heading. Compiler-generated symbols are placed in the symbol table. 
  359.  
  360.  
  361. ΓòÉΓòÉΓòÉ 1.3.1. Control Specification Statement ΓòÉΓòÉΓòÉ
  362.  
  363.  Position 6 (Form Type) 
  364.  Positions 7-14 (Reserved) 
  365.  Position 15 (Debug) 
  366.  Positions 16-17 (Reserved) 
  367.  Position 18 (Currency Symbol) 
  368.  Position 19 (Date Format) 
  369.  Position 20 (Date Edit) 
  370.  Position 21 (Decimal Notation) 
  371.  Positions 22-25 (Reserved) 
  372.  Position 26 (Alternate Collating Sequence) 
  373.  Positions 27-39 (Reserved) 
  374.  Position 40 (Sign Handling) 
  375.  Position 41 (Forms Alignment) 
  376.  Position 42 (Reserved) 
  377.  Position 43 (File Translation) 
  378.  Positions 44-56 (Reserved) 
  379.  Position 57 (Transparency Check) 
  380.  Positions 58-74 (Reserved) 
  381.  Positions 75-80 (Program Identification) 
  382.  
  383.  
  384. ΓòÉΓòÉΓòÉ 1.3.1.1. Position 6 (Form Type) ΓòÉΓòÉΓòÉ
  385.  
  386. An H must appear in position 6 to identify this line as the control 
  387. specification (or header) statement. 
  388.  
  389.  
  390. ΓòÉΓòÉΓòÉ 1.3.1.2. Positions 7-14 (Reserved) ΓòÉΓòÉΓòÉ
  391.  
  392. Positions 7 through 14 must be blank. 
  393.  
  394.  
  395. ΓòÉΓòÉΓòÉ 1.3.1.3. Position 15 (Debug) ΓòÉΓòÉΓòÉ
  396.  
  397. Entry        Explanation 
  398. Blank        DEBUG and DUMP operations are not done. Compiler-generated symbols 
  399.              are not placed in the symbol table. 
  400. 1            DEBUG and DUMP operations are done. Compiler-generated symbols are 
  401.              placed in the symbol table. 
  402.  
  403. Use position 15 to indicate whether the DEBUG (Debug Function) and DUMP 
  404. (Program Dump) operations will be done. A 1 in position 15 when the source 
  405. program is compiled causes the compiler to generate the object code for these 
  406. operations. When the program is run, DEBUG and DUMP are performed. 
  407.  
  408. The DEBUG entry also controls the contents of the symbol table that is produced 
  409. with the program.  If position 15 contains a 1, the compiler-generated symbols, 
  410. starting with a period (.), are placed in the symbol table.  If position 15 is 
  411. blank, the compiler-generated symbols are not placed in the symbol table. The 
  412. symbol table is printed with a program dump.  You can then use the 
  413. compiler-generated symbols in debugging a program. 
  414.  
  415. See the DEBUG and DUMP operations in Operation Codes for more information. 
  416.  
  417.  
  418. ΓòÉΓòÉΓòÉ 1.3.1.4. Positions 16-17 (Reserved) ΓòÉΓòÉΓòÉ
  419.  
  420. Positions 16 and 17 must be blank. 
  421.  
  422.  
  423. ΓòÉΓòÉΓòÉ 1.3.1.5. Position 18 (Currency Symbol) ΓòÉΓòÉΓòÉ
  424.  
  425. Entry                Explanation 
  426. Blank                A dollar sign is used as the currency symbol in editing 
  427.                      (edit words and edit codes). 
  428. Currency Symbol      Any character except zero (0), asterisk (*), comma (,), 
  429.                      period (.), ampersand (&), minus sign (-), the letter C, 
  430.                      or the letter R may be specified as the currency symbol. 
  431.  
  432. The specification of a currency symbol does not affect the user-defined edit 
  433. codes 5 through 9. 
  434.  
  435.  
  436. ΓòÉΓòÉΓòÉ 1.3.1.6. Position 19 (Date Format) ΓòÉΓòÉΓòÉ
  437.  
  438. The entry in this position specifies the format of the RPG/400 user dates. 
  439.  
  440. Entry        Explanation 
  441. Blank        Defaults to month/day/year if position 21 is blank. Defaults to 
  442.              day/month/year if position 21 contains a D, I, or J. 
  443. M            Month/day/year. 
  444. D            Day/month/year. 
  445. Y            Year/month/day. 
  446.  
  447.  
  448. ΓòÉΓòÉΓòÉ 1.3.1.7. Position 20 (Date Edit) ΓòÉΓòÉΓòÉ
  449.  
  450. Entry                     Explanation 
  451. Ampersand (&)             Blank is used as the separator character 
  452. Any nonblank character    The character entered is used as a separator 
  453.                           character 
  454. Blank                     The separator character follows the specification in 
  455.                           position 21. 
  456.  
  457. The entry in this position specifies the separator character to be used with 
  458. the Y edit code. 
  459.  
  460.  
  461. ΓòÉΓòÉΓòÉ 1.3.1.8. Position 21 (Decimal Notation) ΓòÉΓòÉΓòÉ
  462.  
  463. The entry in this position specifies the notation for the user date. It also 
  464. specifies the decimal notation and the separator used for numeric literals and 
  465. edit codes. The term decimal notation refers to the character that separates 
  466. whole numbers from decimal fractions. The word separator refers to the 
  467. character that separates the hundreds position from the thousands position, the 
  468. hundred thousands position from the millions position, and so on. Below is an 
  469. example of a number using a period for the decimal notation character and 
  470. commas for the separator characters. 
  471.  
  472. 12,342,343.00
  473.         
  474.   Γöé   Γöé   ΓööΓöÇΓöÇDecimal Notation
  475.  Separators
  476.  
  477. An entry in this position does not affect the edit words. 
  478.  
  479. Entry        Explanation 
  480. Blank        Uses a period for the decimal notation, and a comma for the 
  481.              separator.  If position 19 is blank, uses the month/day/year 
  482.              format for user date. If position 20 is blank, uses a slash as the 
  483.              separator for the Y edit code. 
  484. I            Uses a comma for the decimal notation, and a period for the 
  485.              separator.  If position 19 is blank, uses the day/month/year 
  486.              format for user date. If position 20 is blank, uses a period as 
  487.              the separator for the Y edit code. 
  488. J            Uses a comma for the decimal notation, and a period for the 
  489.              separator.  If position 19 is blank, uses the day/month/year 
  490.              format for user date. If position 20 is blank, uses a period as 
  491.              the separator for the Y edit code.  When you use edit codes that 
  492.              cause zero balances to be printed, zero is written to the left of 
  493.              the decimal notation (comma): 0,00.  If the number of decimal 
  494.              positions in the field is equal to the length of the field, the 
  495.              decimal notation (comma) is the leftmost character printed. 
  496. D            Uses a period for the decimal notation, and a comma for the 
  497.              separator.  If position 19 is blank, uses the day/month/year 
  498.              format for user date. If position 20 is blank, uses a slash as the 
  499.              separator for the Y edit code. 
  500.  
  501.  
  502. ΓòÉΓòÉΓòÉ 1.3.1.9. Positions 22-25 (Reserved) ΓòÉΓòÉΓòÉ
  503.  
  504. Positions 22 through 25 must be blank. 
  505.  
  506.  
  507. ΓòÉΓòÉΓòÉ 1.3.1.10. Position 26 (Alternate Collating Sequence) ΓòÉΓòÉΓòÉ
  508.  
  509. Entry        Explanation 
  510. Blank        Normal collating sequence is used. 
  511. S            Alternate collating sequence is used. 
  512.  
  513. Use position 26 to indicate whether an alternate collating sequence is to be 
  514. used for character compare operations or match fields. 
  515.  
  516.  
  517. ΓòÉΓòÉΓòÉ 1.3.1.11. Positions 27-39 (Reserved) ΓòÉΓòÉΓòÉ
  518.  
  519. Positions 27 through 39 must be blank. 
  520.  
  521.  
  522. ΓòÉΓòÉΓòÉ 1.3.1.12. Position 40 (Sign Handling) ΓòÉΓòÉΓòÉ
  523.  
  524. Entry        Explanation 
  525. Blank        The sign is always forced on input and output of zoned numeric 
  526.              fields. 
  527.  
  528. Position 40 must be blank to ensure a consistent + or - sign when data is 
  529. extracted or moved from or to numeric input or output fields.  When data is 
  530. moved to unpacked numeric fields in output records, the valid external signs 
  531. are forced. 
  532.  
  533.  
  534. ΓòÉΓòÉΓòÉ 1.3.1.13. Position 41 (Forms Alignment) ΓòÉΓòÉΓòÉ
  535.  
  536. Entry        Explanation 
  537. Blank        First line is printed only once. 
  538. 1            First line can be printed repeatedly allowing the operator to 
  539.              adjust the printer forms. 
  540.  
  541. If the program contains more than one printer file, the entry in position 41 
  542. applies to each printer file that has 1P (first-page) output. This function may 
  543. also be specified by the CL command OVRPRTF (Override to Print File) or in the 
  544. printer device file and can be affected by the ALIGN option on the STRPRTWTR 
  545. command. 
  546.  
  547. Use column 41 only when the first output line is written to a printer file. 
  548.  
  549. When forms are first put in the printer, they may not be in the correct 
  550. position.  Sometimes several lines must be printed to determine the correct 
  551. position. If you specify the 1P forms position, the system prints the first 
  552. line of output and issues a message. The operator can then line up the forms 
  553. and select the option from the message to print the line again or to continue 
  554. printing.  The 1P forms specification is also valid if the output is spooled. 
  555. The page counter is not increased until the forms are positioned correctly. 
  556.  
  557.  
  558. ΓòÉΓòÉΓòÉ 1.3.1.14. Position 42 (Reserved) ΓòÉΓòÉΓòÉ
  559.  
  560. Position 42 must be blank. 
  561.  
  562.  
  563. ΓòÉΓòÉΓòÉ 1.3.1.15. Position 43 (File Translation) ΓòÉΓòÉΓòÉ
  564.  
  565. Entry        Explanation 
  566. Blank        No file translation is requested. 
  567. F            Files are to be translated. 
  568.  
  569. An entry of F indicates that a file translation table is to be used to 
  570. translate all data in specified files. 
  571.  
  572.  
  573. ΓòÉΓòÉΓòÉ 1.3.1.16. Positions 44-56 (Reserved) ΓòÉΓòÉΓòÉ
  574.  
  575. Positions 44 through 56 must be blank. 
  576.  
  577.  
  578. ΓòÉΓòÉΓòÉ 1.3.1.17. Position 57 (Transparency Check) ΓòÉΓòÉΓòÉ
  579.  
  580. Entry        Explanation 
  581. Blank        No check for transparency. 
  582. 1            Check for transparency. 
  583.  
  584. If you specify 1 in position 57 of the control specification, the RPG/400 
  585. compiler scans literals and constants for DBCS characters. It does not check 
  586. hexadecimal literals. For more information on transparency and DBCS data, see 
  587. Where You Can Use DBCS Data in RPG/400 Programs, Transparent Literals and 
  588. Constants, and Additional Considerations for Using DBCS Data in RPG/400 
  589. Programs. 
  590.  
  591.  
  592. ΓòÉΓòÉΓòÉ 1.3.1.18. Positions 58-74 (Reserved) ΓòÉΓòÉΓòÉ
  593.  
  594. Positions 58 through 74 must be blank. 
  595.  
  596.  
  597. ΓòÉΓòÉΓòÉ 1.3.1.19. Positions 75-80 (Program Identification) ΓòÉΓòÉΓòÉ
  598.  
  599. The symbolic name entered in these positions is the name of the program that 
  600. can be run. You can override this name with the PGM parameter in the CL command 
  601. CRTRPGPGM (Create RPG Program). 
  602.  
  603. If you do not specify a name in positions 75 through 80 of the control 
  604. specification or on the CRTRPGPGM command, but the source is from a database 
  605. file, the member name is used as the program name. If the source is not from a 
  606. database file, the program name defaults to RPGOBJ. 
  607.  
  608. If you specify the program name on the control specification, its maximum 
  609. length is 6 characters. If you specify the program name in the CRTRPGPGM 
  610. command, its maximum length is 10 characters. 
  611.  
  612. Note:   Names entered here must follow the RPG/400 symbolic name rules. 
  613. Extended names are not allowed.  However, the name specified on the CRTRPGPGM 
  614. command can follow the extended naming rules. 
  615.  
  616.  
  617. ΓòÉΓòÉΓòÉ 1.4. File Description Specifications ΓòÉΓòÉΓòÉ
  618.  
  619. File description specifications identify each file used by a program.  One 
  620. file-description specification statement is required for each file in the 
  621. program. 
  622.  
  623. A maximum of 50 files can be described per program.  Only one primary file can 
  624. be specified; however, the presence of a primary file is not required. 
  625.  
  626. Only one record-address file is allowed per program.  You can specify a maximum 
  627. of eight PRINTER files. The maximum number of other file types is limited only 
  628. by the maximum number of files allowed for the program. 
  629.  
  630. Program-described files require more entries on the file-description 
  631. specifications than externally described files.  Many of the entries required 
  632. for a program-described file are part of the external description for an 
  633. externally described file. 
  634.  
  635. Enter the file-description specifications on the RPG/400 Control and File 
  636. Description Specifications. 
  637.  
  638. You can specify the following file types: 
  639.  
  640.  Input 
  641.  Output 
  642.  Update 
  643.  Combined (input/output). 
  644.  
  645. You enter file-description specifications on the main file description line. 
  646. Additional details can be entered on the continuation lines. 
  647.  
  648.  
  649. ΓòÉΓòÉΓòÉ 1.4.1. File Description Specification Statement ΓòÉΓòÉΓòÉ
  650.  
  651.  Position 6 (Form Type) 
  652.  Positions 7-14 (File Name) 
  653.  Position 15 (File Type) 
  654.  
  655.    - Input Files 
  656.    - Output Files 
  657.    - Update Files 
  658.    - Combined Files 
  659.  
  660.  Position 16 (File Designation) 
  661.  
  662.    - Primary File 
  663.    - Secondary File 
  664.    - Record Address File 
  665.    - Array or Table File 
  666.    - Full Procedural File 
  667.  
  668.  Position 17 (End of File) 
  669.  Position 18 (Sequence) 
  670.  Position 19 (File Format) 
  671.  Positions 20-23 (Reserved) 
  672.  Positions 24-27 (Record Length) 
  673.  Position 28 (Limits Processing) 
  674.  Positions 29-30 (Length of Key or Record Address) 
  675.  Position 31 (Record Address Type) 
  676.  
  677.    - Blank = Non-keyed Processing 
  678.    - A = Character Keys 
  679.    - P = Packed Keys 
  680.    - K = Key 
  681.  
  682.  Position 32 (File Organization) 
  683.  
  684.    - Indexed Files 
  685.    - Nonkeyed Program-Described File 
  686.    - Record Address File 
  687.  
  688.  Positions 33-34 (Overflow Indicator) 
  689.  Positions 35-38 (Key Field Starting Location) 
  690.  Position 39 (Extension Code) 
  691.  Positions 40-46 (Device) 
  692.  Positions 47-52 (Reserved) 
  693.  Position 53 (Continuation Lines) 
  694.  Positions 54-59 (Routine) 
  695.  Positions 60-65 (Reserved) 
  696.  Position 66 (File Addition) 
  697.  Positions 67-70 (Reserved) 
  698.  Positions 71-72 (File Condition) 
  699.  Positions 73-74 (Reserved) 
  700.  Positions 75-80 (Comments) 
  701.  Continuation Line 
  702.  Continuation Line Summary Chart 
  703.  Continuation Line Options Summary Chart 
  704.  PRTCTL Data Structure 
  705.  
  706.  
  707. ΓòÉΓòÉΓòÉ 1.4.1.1. Position 6 (Form Type) ΓòÉΓòÉΓòÉ
  708.  
  709. An F must be entered in this position for file-description specifications. 
  710.  
  711.  
  712. ΓòÉΓòÉΓòÉ 1.4.1.2. Positions 7-14 (File Name) ΓòÉΓòÉΓòÉ
  713.  
  714. Entry                Explanation 
  715.  
  716. A valid file name    Every file used in a program must have a unique name.  The 
  717.                      file name can be from 1 to 8 characters long, and must 
  718.                      begin in position 7. 
  719.  
  720. Each file used in the program is identified by a unique symbolic name in 
  721. positions 7 through 14. 
  722.  
  723. The file name specified in positions 7 through 14 must be an existing file name 
  724. that has been defined to the OS/400 system, or one of the OS/400 system 
  725. override commands must be used to associate the RPG/400 file name to the file 
  726. name defined to the OS/400 system. For an externally-described file, the file 
  727. must exist at both compilation time and at run time. For a program-described 
  728. file, the file need exist only at run time. The file name specified in these 
  729. positions, rather than the device name specified in positions 40 through 46, is 
  730. used to point to the file. When the files are opened at run time, they are 
  731. opened in the reverse order to that specified in the file-description 
  732. specifications. The RPG/400 device name defines the functions that can be 
  733. processed on the associated file. 
  734.  
  735. You can specify file names in positions 7 through 14 that correspond to 
  736. predefined device-file definitions supplied by IBM. 
  737.  
  738.  
  739. ΓòÉΓòÉΓòÉ 1.4.1.2.1. Program Described File ΓòÉΓòÉΓòÉ
  740.  
  741. For program-described files, the file name entered in positions 7 through 14 
  742. must also be entered on: 
  743.  
  744.  Input specifications if the file is a primary, secondary, or full procedural 
  745.   file 
  746.  
  747.  Output specifications or an output calculation operation line if the file is 
  748.   an output, update, or combined file, or if the file is an input file and 
  749.   records are also being added to the file 
  750.  
  751.  Extension specifications if the file is a table, array, or record address 
  752.   file, or a file processed by a record-address file 
  753.  
  754.  Calculation specifications if the file name is required for the operation 
  755.   code specified 
  756.  
  757.  Line counter specifications if the device is a printer and default values are 
  758.   to be overridden. 
  759.  
  760.  
  761. ΓòÉΓòÉΓòÉ 1.4.1.2.2. Externally Described File ΓòÉΓòÉΓòÉ
  762.  
  763. For externally described files, the file name entered in positions 7 through 14 
  764. is the name used to locate the record descriptions for the file.  The following 
  765. rules apply to externally described files: 
  766.  
  767.  Input and output specifications for externally described files are optional. 
  768.   They are required only if you are adding RPG/400 functions, such as control 
  769.   fields or record identifying indicators, to the external description 
  770.   retrieved. 
  771.  
  772.  When an external description is retrieved, the record definition can be 
  773.   referred to by its record format name on the input, output, or calculation 
  774.   specifications. 
  775.  
  776.  A record format name must be a unique symbolic name. 
  777.  
  778.  A logical file with two record formats of the same name cannot have the 
  779.   duplicate format names renamed and cannot be externally described. However, 
  780.   such a file can be accessed if it is program described. 
  781.  
  782.  
  783. ΓòÉΓòÉΓòÉ 1.4.1.3. Position 15 (File Type) ΓòÉΓòÉΓòÉ
  784.  
  785. Entry        Explanation 
  786. I            Input file 
  787. O            Output file 
  788. U            Update file 
  789. C            Combined (input/output) file. 
  790.  
  791.  
  792. ΓòÉΓòÉΓòÉ 1.4.1.3.1. Input Files ΓòÉΓòÉΓòÉ
  793.  
  794. An input file is one from which a program reads information. It can contain 
  795. data records, arrays, or tables, or it can be a record-address file. 
  796.  
  797.  
  798. ΓòÉΓòÉΓòÉ 1.4.1.3.2. Output Files ΓòÉΓòÉΓòÉ
  799.  
  800. An output file is a file to which information is written. 
  801.  
  802.  
  803. ΓòÉΓòÉΓòÉ 1.4.1.3.3. Update Files ΓòÉΓòÉΓòÉ
  804.  
  805. An update file is an input file whose records can be updated. Updating alters 
  806. the data in one or more fields of any record contained in the file and writes 
  807. that record back to the same file from which it was read. If records are to be 
  808. deleted, the file must be specified as an update file. 
  809.  
  810.  
  811. ΓòÉΓòÉΓòÉ 1.4.1.3.4. Combined Files ΓòÉΓòÉΓòÉ
  812.  
  813. A combined file is both an input file and an output file.  When a combined file 
  814. is processed, the output record contains only the data represented by the 
  815. fields in the output record.  This differs from an update file, where the 
  816. output record contains the input record modified by the fields in the output 
  817. record. 
  818.  
  819. A combined file is valid for a SPECIAL or WORKSTN file. A combined file is also 
  820. valid for a DISK or SEQ file if position 16 contains T (an array or table 
  821. replacement file). 
  822.  
  823.  
  824. ΓòÉΓòÉΓòÉ 1.4.1.4. Position 16 (File Designation) ΓòÉΓòÉΓòÉ
  825.  
  826. Entry        Explanation 
  827. Blank        Output file 
  828. P            Primary file 
  829. S            Secondary file 
  830. R            Record address file 
  831. T            Array or table file 
  832. F            Full procedural file 
  833.  
  834.  
  835. ΓòÉΓòÉΓòÉ 1.4.1.4.1. Primary File ΓòÉΓòÉΓòÉ
  836.  
  837. When several files are processed by cycle processing, one must be designated as 
  838. the primary file. In multifile processing, processing of the primary file takes 
  839. precedence. Only one primary file is allowed per program. 
  840.  
  841.  
  842. ΓòÉΓòÉΓòÉ 1.4.1.4.2. Secondary File ΓòÉΓòÉΓòÉ
  843.  
  844. When more than one file is used during cycle-controlled programming, secondary 
  845. files are input files. The processing of secondary files is determined by the 
  846. order in which they are specified in the file-description specifications and on 
  847. the rules of multifile logic. 
  848.  
  849.  
  850. ΓòÉΓòÉΓòÉ 1.4.1.4.3. Record Address File ΓòÉΓòÉΓòÉ
  851.  
  852. A record-address file is a sequentially organized file used to select records 
  853. from another file.  Only one file in a program can be specified as a 
  854. record-address file. This file is described on the file-description and 
  855. extension specifications and not on the input specifications. The file 
  856. processed by the record-address file must also be specified on the extension 
  857. specifications and must be a primary, secondary, or full procedural file. 
  858.  
  859. You cannot specify a record-address file for the device SPECIAL. You cannot 
  860. specify an externally described file as a record-address file; however, you can 
  861. use a record-address file to process a program described file or an externally 
  862. described file. 
  863.  
  864. A record-address file that contains relative-record numbers must also have a T 
  865. specified in position 32 and an F in position 19. 
  866.  
  867.  
  868. ΓòÉΓòÉΓòÉ 1.4.1.4.4. Array or Table File ΓòÉΓòÉΓòÉ
  869.  
  870. Array and table files specified by a T in position 16 are loaded at program 
  871. initialization time. The array or table file can be input or combined. Leave 
  872. this entry blank for array or table output files. You cannot specify SPECIAL as 
  873. the device for array and table input files. You cannot specify an externally 
  874. described file as an array or table file. 
  875.  
  876. If T is specified in position 16, you can specify C in position 15 for a DISK 
  877. or SEQ file. This C allows an array or table file to be read from or written to 
  878. the same file (an array or table replacement file).  The To and From file names 
  879. on the extension specifications must specify this file name. 
  880.  
  881.  
  882. ΓòÉΓòÉΓòÉ 1.4.1.4.5. Full Procedural File ΓòÉΓòÉΓòÉ
  883.  
  884. This entry is used when the input is controlled by calculation operations. File 
  885. operation codes such as CHAIN or READ are used to do input functions. 
  886.  
  887.  
  888. ΓòÉΓòÉΓòÉ 1.4.1.5. Position 17 (End of File) ΓòÉΓòÉΓòÉ
  889.  
  890. Entry        Explanation 
  891.  
  892. E            All records from the file must be processed before the program can 
  893.              end. This entry is not valid for files processed by a 
  894.              record-address file. 
  895.  
  896. Blank        If position 17 is blank for all files, all records from all files 
  897.              must be processed before end of program (LR) can occur. If 
  898.              position 17 is not blank for all files, all records from this file 
  899.              may or may not be processed before end of program occurs in 
  900.              multifile processing. 
  901.  
  902. Use position 17 to indicate whether the program can end before all records from 
  903. the file are processed. An E in position 17 applies only to input, update, or 
  904. combined files specified as primary, secondary, or record-address files. 
  905.  
  906. If the records from all primary and secondary files must be processed, position 
  907. 17 must be blank for all files or must contain E's for all files.  For multiple 
  908. input files, the end-of-program (LR) condition occurs when all input files for 
  909. which an E is specified in position 17 have been processed.  If position 17 is 
  910. blank for all files, the end-of-program condition occurs when all input files 
  911. have been processed. 
  912.  
  913. When match fields are specified for two or more files and an E is specified in 
  914. position 17 for one or more files, the LR indicator is set on after: 
  915.  
  916.  The end-of-file condition occurs for the last file with an E specified in 
  917.   position 17. 
  918.  
  919.  The program has processed all the records in other files that match the last 
  920.   record processed from the primary file. 
  921.  
  922.  The program has processed the records in those files without match fields up 
  923.   to the next record with nonmatching match fields. 
  924.  
  925. When no file or only one file contains match field specifications, no records 
  926. of other files are processed after end of file occurs on all files for which an 
  927. E is specified in position 17. 
  928.  
  929.  
  930. ΓòÉΓòÉΓòÉ 1.4.1.6. Position 18 (Sequence) ΓòÉΓòÉΓòÉ
  931.  
  932. Entry         Explanation 
  933. A or blank    Match fields are in ascending sequence. 
  934. D             Match fields are in descending sequence. 
  935.  
  936. Position 18 specifies the sequence of input fields used with the match fields 
  937. specification (positions 61 and 62 of the input specifications). Position 18 
  938. applies only to input, update, or combined files used as primary or secondary 
  939. files. Use positions 61 and 62 of the input specifications to identify the 
  940. fields containing the sequence information. 
  941.  
  942. If more than one input file with match fields is specified in the program, a 
  943. sequence entry in position 18 can be used to check the sequence of the match 
  944. fields and to process the file using the matching record technique.  The 
  945. sequence need only be specified for the first file with match fields specified. 
  946. If sequence is specified for other files, the sequence specified must be the 
  947. same; otherwise, the sequence specified for the first file is assumed. 
  948.  
  949. If only one input file with match fields is specified in the program, a 
  950. sequence entry in position 18 can be used to check fields of that file to 
  951. ensure that the file is in sequence.  By entering one of the codes M1 through 
  952. M9 in positions 61 and 62 of the input specifications, and by entering an A or 
  953. D in position 18, you specify sequence checking of these fields. 
  954.  
  955. Sequence checking is required when match fields are used in the records from 
  956. the file. When a record from a matching input file is found to be out of 
  957. sequence, the RPG/400 exception/error handling routine is given control. 
  958.  
  959.  
  960. ΓòÉΓòÉΓòÉ 1.4.1.7. Position 19 (File Format) ΓòÉΓòÉΓòÉ
  961.  
  962. Entry        Explanation 
  963. F            Program described file 
  964. E            Externally described file 
  965.  
  966. An F in position 19 indicates that the records for the file are described 
  967. within the RPG/400 program on input/output specifications. 
  968.  
  969. An E in position 19 indicates that the record descriptions for the file are 
  970. external to the RPG/400 source program. The compiler obtains these descriptions 
  971. at compilation time and includes them in the source program. 
  972.  
  973. An entry is required in position 19. 
  974.  
  975.  
  976. ΓòÉΓòÉΓòÉ 1.4.1.8. Positions 20-23 (Reserved) ΓòÉΓòÉΓòÉ
  977.  
  978. Positions 20 through 23 must be blank. (Block length, if allowed, is specified 
  979. outside the RPG/400 program.) 
  980.  
  981.  
  982. ΓòÉΓòÉΓòÉ 1.4.1.9. Positions 24-27 (Record Length) ΓòÉΓòÉΓòÉ
  983.  
  984. Use positions 24 through 27 to indicate the length of the logical records 
  985. contained in a program-described file.  The maximum record size that can be 
  986. specified is 9999; however, record-size constraints of any device may override 
  987. this value. This entry must be blank for externally described files. 
  988.  
  989. If the file being defined is a record-address file and the record length 
  990. specified is 3, it is assumed that each record in the file consists of a 3-byte 
  991. binary field for the relative-record numbers starting at offset 0.  If the 
  992. record length is 4 or greater, each relative-record number in the 
  993. record-address file is assumed to be a 4-byte field starting at offset 1.  If 
  994. the record length is left blank, the actual record length is retrieved at run 
  995. time to determine how to handle the record-address file. 
  996.  
  997. If the file opened at run time has a primary record length of 3, then 3-byte 
  998. relative-record numbers (one per record) are assumed; otherwise, 4-byte 
  999. relative-record numbers are assumed. This support can be used to allow RPG/400 
  1000. programs to use System/36 environment SORT files as record-address files. 
  1001.  
  1002. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  1003. Γöé          Valid Combinations for a RAF Table File               Γöé
  1004. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1005. Γöé RECORD LENGTH Γöé RAF LENGTH     Γöé TYPE OF SUPPORT               Γöé
  1006. Γöé POSITIONS     Γöé POSITIONS      Γöé                               Γöé
  1007. Γöé 24-27         Γöé 29-30          Γöé                               Γöé
  1008. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1009. Γöé Blank         Γöé Blank          Γöé Support determined at run     Γöé
  1010. Γöé               Γöé                Γöé time.                         Γöé
  1011. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1012. Γöé 3             Γöé 3              Γöé System/36 support.            Γöé
  1013. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1014. Γöé > = 4         Γöé 4              Γöé Native support.               Γöé
  1015. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  1016.  
  1017.  
  1018. ΓòÉΓòÉΓòÉ 1.4.1.10. Position 28 (Limits Processing) ΓòÉΓòÉΓòÉ
  1019.  
  1020. Entry        Explanation 
  1021. L            Sequential-within-limits processing by a record-address file 
  1022. Blank        Sequential or random processing 
  1023.  
  1024. Use position 28 to indicate whether the file is processed by a record-address 
  1025. file that contains limits records. 
  1026.  
  1027. A record-address file used for limits processing contains records that consist 
  1028. of upper and lower limits.  Each record contains a set of limits that consists 
  1029. of the lowest record key and the highest record key from the segment of the 
  1030. file to be processed.  Limits processing can be used for keyed files specified 
  1031. as primary, secondary, or full procedural files. 
  1032.  
  1033. The L entry in position 28 is valid only if the file is processed by a 
  1034. record-address file containing limits records.  Random and sequential 
  1035. processing of files is implied by a combination of positions 16 and 31 of the 
  1036. file-description specifications, and by the calculation operation specified. 
  1037.  
  1038. The operation codes SETLL (Set Lower Limit) and SETGT (Set Greater Than) can be 
  1039. used to position a file; however, the use of these operation codes does not 
  1040. require an L in position 28. 
  1041.  
  1042. For more information on limits processing, refer to the RPG/400* User's Guide. 
  1043.  
  1044.  
  1045. ΓòÉΓòÉΓòÉ 1.4.1.11. Positions 29-30 (Length of Key or Record Address) ΓòÉΓòÉΓòÉ
  1046.  
  1047. Entry        Explanation 
  1048.  
  1049. 1-99         The number of positions required for the key field in a program 
  1050.              described file or the length of the entries in the record-address 
  1051.              file (which must be a program-described file). 
  1052.  
  1053.              If the program-described file being defined uses keys for record 
  1054.              identification, enter the number of positions occupied by each 
  1055.              record key.  This entry is required for indexed files. 
  1056.  
  1057.              If the keys are packed, the key field length should be the packed 
  1058.              length; this is the number of digits in DDS divided by 2 plus 1 
  1059.              and ignoring any fractions. 
  1060.  
  1061.              If the file being defined is a record-address file, enter the 
  1062.              number of positions that each entry in the record-address file 
  1063.              occupies. 
  1064.  
  1065. Blank        These positions must be blank for externally described files. 
  1066.              (The key length is specified in the external description.) For a 
  1067.              program-described file, a blank entry indicates that keys are not 
  1068.              used. Positions 29-30 can also be blank for a record-address file 
  1069.              with a blank in positions 24-27 (record length). 
  1070.  
  1071.  
  1072. ΓòÉΓòÉΓòÉ 1.4.1.12. Position 31 (Record Address Type) ΓòÉΓòÉΓòÉ
  1073.  
  1074. Entry        Explanation 
  1075.  
  1076. Blank        Relative record numbers are used to process the file. 
  1077.  
  1078.              Records are read consecutively. 
  1079.  
  1080.              Record address file contains relative-record numbers. 
  1081.  
  1082.              Keys in record-address-limits file are in the same format as keys 
  1083.              in the file being processed. 
  1084.  
  1085. A            Character keys (valid only for program-described files specified 
  1086.              as indexed files or as a record-address-limits file). 
  1087.  
  1088. P            Packed keys (valid only for program-described files specified as 
  1089.              indexed files or as a record-address-limits file). 
  1090.  
  1091. K            Key values are used to process the file.  This entry is valid only 
  1092.              for externally described files. 
  1093.  
  1094.  
  1095. ΓòÉΓòÉΓòÉ 1.4.1.12.1. Blank = Non-keyed Processing ΓòÉΓòÉΓòÉ
  1096.  
  1097. A blank indicates that the file is processed without the use of keys, that the 
  1098. record-address file contains relative-record numbers (a T in position 32), or 
  1099. that the keys in a record-address-limits file are in the same format as the 
  1100. keys in the file being processed. 
  1101.  
  1102. A file processed without keys can be processed consecutively or randomly by 
  1103. relative-record number. 
  1104.  
  1105. Input processing by relative-record number is determined by a blank in position 
  1106. 31 and by the use of the CHAIN, SETLL, or SETGT operation code. Output 
  1107. processing by relative-record number is determined by a blank in position 31 
  1108. and by the use of the RECNO keyword on the file description specifications. 
  1109.  
  1110.  
  1111. ΓòÉΓòÉΓòÉ 1.4.1.12.2. A = Character Keys ΓòÉΓòÉΓòÉ
  1112.  
  1113. The indexed file (I in position 32) defined on this line is processed by 
  1114. character-record keys. (A numeric field used as the search argument is 
  1115. converted to zoned decimal before chaining.) The A entry must agree with the 
  1116. data format of the field identified as the key field (length in positions 29 
  1117. and 30 and starting position in positions 35 through 38). 
  1118.  
  1119. The record-address-limits file (R in position 16) defined on this line contains 
  1120. character keys.  The file being processed by this record address file can have 
  1121. an A, P, or K in position 31. 
  1122.  
  1123.  
  1124. ΓòÉΓòÉΓòÉ 1.4.1.12.3. P = Packed Keys ΓòÉΓòÉΓòÉ
  1125.  
  1126. The indexed file (I in position 32) defined on this line is processed by 
  1127. packed-decimal-numeric keys.  The P entry must agree with the data format of 
  1128. the field identified as the key field (length in positions 29 and 30 and 
  1129. starting position in positions 35 through 38). 
  1130.  
  1131. Note:   The sign of all decimal numeric input fields is forced to F or D.  All 
  1132. numeric result fields specified by calculation specifications also have an F or 
  1133. D sign. Therefore, if the sign of the key field in the file is not F or D, a 
  1134. record-not-found error occurs when you retrieve that file. 
  1135.  
  1136. The record-address-limits file defined on this line contains record keys in 
  1137. packed decimal format.  The file being processed by this record address file 
  1138. can have an A, P, or K in position 31. 
  1139.  
  1140.  
  1141. ΓòÉΓòÉΓòÉ 1.4.1.12.4. K = Key ΓòÉΓòÉΓòÉ
  1142.  
  1143. A K entry indicates that the externally described file is processed on the 
  1144. assumption that the access path is built on key values.  If the processing is 
  1145. random, key values are used to identify the records. 
  1146.  
  1147. If this position is blank for a keyed file, the records are retrieved in 
  1148. arrival sequence. 
  1149.  
  1150. For more information on record address type, refer to the RPG/400* User's 
  1151. Guide. 
  1152.  
  1153.  
  1154. ΓòÉΓòÉΓòÉ 1.4.1.13. Position 32 (File Organization) ΓòÉΓòÉΓòÉ
  1155.  
  1156. Entry        Explanation 
  1157. Blank        The program-described file is processed without keys, or the file 
  1158.              is externally described. 
  1159. I            Indexed file (valid only for program-described files). 
  1160. T            Record address file that contains relative-record numbers (valid 
  1161.              only for program-described files). 
  1162.  
  1163. Use position 32 to identify the organization of program described files. 
  1164.  
  1165.  
  1166. ΓòÉΓòÉΓòÉ 1.4.1.13.1. Indexed Files ΓòÉΓòÉΓòÉ
  1167.  
  1168. An indexed file can be processed: 
  1169.  
  1170.  Randomly or sequentially by key 
  1171.  
  1172.  By a record-address file (sequentially within limits). Position 28 must 
  1173.   contain an L. 
  1174.  
  1175.  
  1176. ΓòÉΓòÉΓòÉ 1.4.1.13.2. Nonkeyed Program-Described File ΓòÉΓòÉΓòÉ
  1177.  
  1178. A program-described file that is processed without keys can be processed: 
  1179.  
  1180.  Randomly by relative-record numbers, positions 28 and 31 must be blank. 
  1181.  Entry Sequence, positions 28 and 31 must be blank. 
  1182.  As a record-address file, position 28 must be blank. 
  1183.  
  1184.  
  1185. ΓòÉΓòÉΓòÉ 1.4.1.13.3. Record Address File ΓòÉΓòÉΓòÉ
  1186.  
  1187. A record-address file (indicated by an R in position 16) that contains 
  1188. relative-record numbers must be identified by a T in position 32.  (A 
  1189. record-address file must be program described.) Each record retrieved from the 
  1190. file being processed is based on the relative record number in the 
  1191. record-address file.  (Relative record numbers cannot be used for a 
  1192. record-address-limits file.) 
  1193.  
  1194. Each relative-record number in the record-address file is a 4-byte binary 
  1195. field; therefore, each 4-byte unit of a record-address file contains a 
  1196. relative-record number. A minus one (-1 or hexadecimal FFFFFFFF ) 
  1197. relative-record number value causes the record to be skipped. End of file 
  1198. occurs when all record-address file records have been processed. 
  1199.  
  1200. For more information on how to handle System/36 Environment record-address 
  1201. files, see the RPG/400* User's Guide. 
  1202.  
  1203.  
  1204. ΓòÉΓòÉΓòÉ 1.4.1.14. Positions 33-34 (Overflow Indicator) ΓòÉΓòÉΓòÉ
  1205.  
  1206. Entry            Explanation 
  1207. Blank            No overflow indicator is used. 
  1208. OA-OG, OV        Specified overflow indicator conditions the lines to be 
  1209.                  printed when overflow occurs. 
  1210. 01-99            Set on when a line is printed on the overflow line, or the 
  1211.                  overflow line is reached or passed during a space or skip 
  1212.                  operation. 
  1213.  
  1214. Indicators OA through OG, and OV are not valid for externally described files. 
  1215.  
  1216. Use positions 33 and 34 to specify an overflow indicator to condition which 
  1217. lines in each PRINTER file will be printed when overflow occurs.  This entry is 
  1218. valid only for a PRINTER device. Overflow only occurs if defined. 
  1219.  
  1220. Only one overflow indicator can be assigned to a file. If more than one PRINTER 
  1221. file in a program is assigned an overflow indicator, that indicator must be 
  1222. unique for each file. 
  1223.  
  1224.  
  1225. ΓòÉΓòÉΓòÉ 1.4.1.15. Positions 35-38 (Key Field Starting Location) ΓòÉΓòÉΓòÉ
  1226.  
  1227. Entry        Explanation 
  1228. Blank        Key fields are not used for this program-described file, or the 
  1229.              file is externally described. 
  1230. 1-9999       Record position in a program described indexed file in which the 
  1231.              key field begins. 
  1232.  
  1233. Use positions 35 through 38 to identify the record position in which the key 
  1234. field for a program described indexed file begins. An entry must be made in 
  1235. these positions for a program described indexed file. The key field of a record 
  1236. contains the information that identifies the record.  The key field must be in 
  1237. the same location in all records in the file. The entry in these positions must 
  1238. be right-adjusted.  Leading zeros can be omitted. 
  1239.  
  1240.  
  1241. ΓòÉΓòÉΓòÉ 1.4.1.16. Position 39 (Extension Code) ΓòÉΓòÉΓòÉ
  1242.  
  1243. Entry        Explanation 
  1244. Blank        No extension or line-counter specifications are used. 
  1245. E            Extension specifications further describe the file. 
  1246. L            Line counter specifications further describe the file. 
  1247.  
  1248. Use position 39 to indicate whether the program-described file is further 
  1249. described on the extension specifications or on the line counter 
  1250. specifications.  An E in position 39 applies only to array or table files or to 
  1251. record-address files; an L in position 39 applies to files assigned to the 
  1252. PRINTER device. 
  1253.  
  1254.  
  1255. ΓòÉΓòÉΓòÉ 1.4.1.17. Positions 40-46 (Device) ΓòÉΓòÉΓòÉ
  1256.  
  1257. Entry        Explanation 
  1258. PRINTER      File is a printer file, a file with control characters that can be 
  1259.              sent to a printer. 
  1260. DISK         File is a disk file.  This device supports sequential and random 
  1261.              read/write functions. These files can be accessed on a remote 
  1262.              system by Distributed Data Management (DDM). 
  1263. WORKSTN      File is a workstation file.  Input/output is through a display or 
  1264.              ICF file. 
  1265. SPECIAL      This is a special file.  Input or output is on a device that is 
  1266.              accessed by a user-supplied routine. The name of the routine must 
  1267.              be specified in positions 54 through 59. A parameter list is 
  1268.              created for use with this routine, including an option code 
  1269.              parameter and a status code parameter. The file must be a fixed 
  1270.              unblocked format. 
  1271. SEQ          File is a sequentially organized file. The actual device is 
  1272.              specified in a CL command or in the file description, which is 
  1273.              accessed by the file name. 
  1274.  
  1275. Use positions 40 through 46 to specify the RPG/400 device name to be associated 
  1276. with the file. On the AS/400 system the file name in positions 7 through 14, 
  1277. rather than the device name specified in positions 40 through 46, is used to 
  1278. point to the file. The RPG/400 device name defines the RPG/400 functions that 
  1279. can be done on the associated file. Certain functions are valid only for a 
  1280. specific RPG/400 device name, such as the EXFMT operation for WORKSTN. The file 
  1281. name specified in positions 7 through 14 can be overridden at compilation time 
  1282. or run time, allowing you to change the input/output device used in the 
  1283. program. 
  1284.  
  1285. Note that the RPG/400 device names are not the same as the system device names. 
  1286.  
  1287.  
  1288. ΓòÉΓòÉΓòÉ 1.4.1.18. Positions 47-52 (Reserved) ΓòÉΓòÉΓòÉ
  1289.  
  1290. Positions 47 through 52 must be blank. 
  1291.  
  1292.  
  1293. ΓòÉΓòÉΓòÉ 1.4.1.19. Position 53 (Continuation Lines) ΓòÉΓòÉΓòÉ
  1294.  
  1295. A K in position 53 indicates a continuation line. See Continuation Line for 
  1296. more information. 
  1297.  
  1298.  
  1299. ΓòÉΓòÉΓòÉ 1.4.1.20. Positions 54-59 (Routine) ΓòÉΓòÉΓòÉ
  1300.  
  1301. When SPECIAL is the device entry (positions 40 through 46), the routine named 
  1302. in positions 54 through 59 handles the support for the special I/O device.  The 
  1303. routine name must be left-adjusted. The name is used by the compiler to produce 
  1304. the linkage to the routine. 
  1305.  
  1306.  
  1307. ΓòÉΓòÉΓòÉ 1.4.1.21. Positions 60-65 (Reserved) ΓòÉΓòÉΓòÉ
  1308.  
  1309. Positions 60 through 65 must be blank. 
  1310.  
  1311.  
  1312. ΓòÉΓòÉΓòÉ 1.4.1.22. Position 66 (File Addition) ΓòÉΓòÉΓòÉ
  1313.  
  1314. Position 66 indicates whether records are to be added to a DISK file. 
  1315.  
  1316. Entry        Explanation 
  1317.  
  1318. Blank        No records can be added to an input or update file (I or U in 
  1319.              position 15). For an output file (O in position 15), a blank is 
  1320.              equivalent to an A. 
  1321.  
  1322. A            Add records to the file.  Positions 16 through 18 of the output 
  1323.              record specifications for this file must contain ADD, or the WRITE 
  1324.              operation code must be used in the calculation specifications. 
  1325.  
  1326. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  1327. Γöé          Processing Functions for Files                        Γöé
  1328. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1329. Γöé                         Γöé FILE       Γöé FILE       Γöé            Γöé
  1330. Γöé                         Γöé DESCRIPTIONΓöé DESCRIPTIONΓöé OUTPUT     Γöé
  1331. Γöé                         Γöé SPECIFICA- Γöé SPECIFICA- Γöé SPECIFICA- Γöé
  1332. Γöé FUNCTION                Γöé TIONS      Γöé TIONS      Γöé TIONS      Γöé
  1333. Γöé                         Γöé POSITION   Γöé POSITION   Γöé POSITIONS  Γöé
  1334. Γöé                         Γöé 15         Γöé 66         Γöé 16-18      Γöé
  1335. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1336. Γöé Create new file(1)      Γöé O          Γöé Blank      Γöé Blank      Γöé
  1337. Γöé                         Γöé            Γöé            Γöé            Γöé
  1338. Γöé   or                    Γöé            Γöé            Γöé            Γöé
  1339. Γöé                         Γöé            Γöé            Γöé            Γöé
  1340. Γöé Add records to existing Γöé O          Γöé A          Γöé ADD        Γöé
  1341. Γöé file                    Γöé            Γöé            Γöé            Γöé
  1342. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1343. Γöé Process file            Γöé I          Γöé Blank      Γöé Blank      Γöé
  1344. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1345. Γöé Process file and add    Γöé I          Γöé A          Γöé ADD        Γöé
  1346. Γöé records to the existing Γöé            Γöé            Γöé            Γöé
  1347. Γöé file                    Γöé            Γöé            Γöé            Γöé
  1348. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1349. Γöé Process file and update Γöé U          Γöé Blank      Γöé Blank      Γöé
  1350. Γöé the records (update or  Γöé            Γöé            Γöé            Γöé
  1351. Γöé delete)                 Γöé            Γöé            Γöé            Γöé
  1352. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1353. Γöé Process file and add    Γöé U          Γöé A          Γöé ADD        Γöé
  1354. Γöé new records to an       Γöé            Γöé            Γöé            Γöé
  1355. Γöé existing file           Γöé            Γöé            Γöé            Γöé
  1356. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1357. Γöé Process file and delete Γöé U          Γöé Blank      Γöé DEL        Γöé
  1358. Γöé an existing record from Γöé            Γöé            Γöé            Γöé
  1359. Γöé the file                Γöé            Γöé            Γöé            Γöé
  1360. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1361. Γöé (1)Within RPG, the term create a new file means to add records Γöé
  1362. Γöé to a newly created file.  Thus, the first two entries in this  Γöé
  1363. Γöé table perform the identical function.  Both are listed to show Γöé
  1364. Γöé that there are two ways to specify that function.              Γöé
  1365. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  1366.  
  1367.  
  1368. ΓòÉΓòÉΓòÉ 1.4.1.23. Positions 67-70 (Reserved) ΓòÉΓòÉΓòÉ
  1369.  
  1370. Positions 67 through 70 must be blank. 
  1371.  
  1372.  
  1373. ΓòÉΓòÉΓòÉ 1.4.1.24. Positions 71-72 (File Condition) ΓòÉΓòÉΓòÉ
  1374.  
  1375. Entry        Explanation 
  1376.  
  1377. Blank        The file can be used by the program, and, if it is an input file, 
  1378.              the file is opened. 
  1379.  
  1380. U1-U8        The file can be used by the program when the indicator is on; it 
  1381.              is ignored when the indicator is off. 
  1382.  
  1383. UC           Programmer control of first open.  If a file is to be initially 
  1384.              opened by the OPEN operation in the calculation specifications, 
  1385.              then a UC entry causes the file not to be opened at program 
  1386.              initialization.  This entry is not valid for input files 
  1387.              designated as primary, secondary, table, or record-address files, 
  1388.              or for output files conditioned by the 1P indicator. 
  1389.  
  1390. An entry of U1 through U8 in positions 71 and 72 lets the programmer control 
  1391. the operation of input, output, update, and combined files at run time.  If the 
  1392. specified indicator is on at program initialization, the file is opened.  If 
  1393. the indicator is not on, the file is not opened and is ignored during 
  1394. processing.  The U1 through U8 indicators can be set as follows: 
  1395.  
  1396.  By the OS/400 control language. 
  1397.  
  1398.  When used as a resulting indicator for a calculation operation or as field 
  1399.   indicators on the input specifications.  Setting the U1 through U8 indicators 
  1400.   in this manner has no effect on file conditioning. 
  1401.  
  1402. The UC entry is required for programmer control of only the first file opening. 
  1403. If a file is opened and later is closed by the CLOSE operation, the programmer 
  1404. can reopen the file (by the OPEN operation) and the UC entry is not required in 
  1405. positions 71 and 72. 
  1406.  
  1407.  
  1408. ΓòÉΓòÉΓòÉ 1.4.1.25. Positions 73-74 (Reserved) ΓòÉΓòÉΓòÉ
  1409.  
  1410. Positions 73 and 74 must be blank. 
  1411.  
  1412.  
  1413. ΓòÉΓòÉΓòÉ 1.4.1.26. Positions 75-80 (Comments) ΓòÉΓòÉΓòÉ
  1414.  
  1415. Positions 75 to 80 can be used for comments, or left blank. These positions are 
  1416. not printed contiguously with positions 6-74 on the compiler listing. 
  1417.  
  1418.  
  1419. ΓòÉΓòÉΓòÉ 1.4.2. File Types and Processing Methods ΓòÉΓòÉΓòÉ
  1420.  
  1421. The following table shows the valid entries for positions 28, 31, and 32 of the 
  1422. file-description specifications for the various file types and processing 
  1423. methods. The methods of disk file processing include: 
  1424.  
  1425.  Relative-record-number processing 
  1426.  Consecutive processing 
  1427.  Sequential-by-key processing 
  1428.  Random-by-key processing 
  1429.  Sequential-within-limits processing. 
  1430.  
  1431. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  1432. Γöé          Processing Methods for DISK Files                     Γöé
  1433. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1434. Γöé ACCESSΓöé METHODΓöé OPCODEΓöé POSI-  Γöé POSI- Γöé POSI- Γöé EXPLANATION   Γöé
  1435. Γöé       Γöé       Γöé       Γöé TION   Γöé TION  Γöé TION  Γöé               Γöé
  1436. Γöé       Γöé       Γöé       Γöé 28     Γöé 31    Γöé 32    Γöé               Γöé
  1437. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1438. Γöé RandomΓöé RRN   Γöé CHAIN Γöé Blank  Γöé Blank Γöé Blank Γöé Access by     Γöé
  1439. Γöé       Γöé       Γöé       Γöé        Γöé       Γöé       Γöé physical      Γöé
  1440. Γöé       Γöé       Γöé       Γöé        Γöé       Γöé       Γöé order of      Γöé
  1441. Γöé       Γöé       Γöé       Γöé        Γöé       Γöé       Γöé records       Γöé
  1442. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1443. Γöé SequenΓöéiKey   Γöé READ  Γöé Blank  Γöé Blank Γöé I     Γöé Access by key Γöé
  1444. Γöé       Γöé       Γöé READE Γöé        Γöé       Γöé       Γöé sequentially  Γöé
  1445. Γöé       Γöé       Γöé READP Γöé        Γöé       Γöé       Γöé               Γöé
  1446. Γöé       Γöé       Γöé REDPE Γöé        Γöé       Γöé       Γöé               Γöé
  1447. Γöé       Γöé       Γöé cycle Γöé        Γöé       Γöé       Γöé               Γöé
  1448. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1449. Γöé SequenΓöéiWithinΓöé READ  Γöé L      Γöé A or  Γöé I     Γöé Access by key Γöé
  1450. Γöé       Γöé LimitsΓöé READE Γöé        Γöé P     Γöé       Γöé sequentially  Γöé
  1451. Γöé       Γöé       Γöé READP Γöé        Γöé       Γöé       Γöé controlled by Γöé
  1452. Γöé       Γöé       Γöé REDPE Γöé        Γöé       Γöé       Γöé record-       Γöé
  1453. Γöé       Γöé       Γöé cycle Γöé        Γöé       Γöé       Γöé address-      Γöé
  1454. Γöé       Γöé       Γöé       Γöé        Γöé       Γöé       Γöé limits file   Γöé
  1455. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1456. Γöé SequenΓöéiRRN   Γöé READ  Γöé Blank  Γöé Blank Γöé T     Γöé Access        Γöé
  1457. Γöé       Γöé       Γöé READE Γöé        Γöé       Γöé       Γöé sequentially  Γöé
  1458. Γöé       Γöé       Γöé READP Γöé        Γöé       Γöé       Γöé restricted to Γöé
  1459. Γöé       Γöé       Γöé REDPE Γöé        Γöé       Γöé       Γöé RRN numbers   Γöé
  1460. Γöé       Γöé       Γöé cycle Γöé        Γöé       Γöé       Γöé in RAF file   Γöé
  1461. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  1462.  
  1463.  
  1464. ΓòÉΓòÉΓòÉ 1.4.2.1. Random-by-Key Processing ΓòÉΓòÉΓòÉ
  1465.  
  1466. For the random-by-key method of processing, you specify a search argument that 
  1467. identifies the key of the record to be read in factor 1 of the calculation 
  1468. specifications for the CHAIN operation. See the section on "Keyed Processing 
  1469. Examples" in Chapter 7 of the RPG/400* User's Guide for an example of an 
  1470. externally described DISK file being processed randomly by key. The specified 
  1471. record can be read from the file either during detail calculations or during 
  1472. total calculations. 
  1473.  
  1474. The random-by-key method of processing is valid for a full-procedural file 
  1475. designated as an input file or an update file. 
  1476.  
  1477. For an externally described file, position 31 of the file description 
  1478. specifications must contain K, which indicates that the file is processed 
  1479. according to an access path that is built on keys. The data description 
  1480. specifications for the file specifies the field that contains the key value 
  1481. (the key field). Position 32 of the file-description specifications must be 
  1482. blank. 
  1483.  
  1484. You must designate a program-described file as an indexed file (I in position 
  1485. 32), and position 31 of the file-description specifications must contain an A 
  1486. or a P. The length of the key field is identified in positions 29 and 30 of the 
  1487. file-description specifications, and the starting location of the key field is 
  1488. identified in positions 35 through 38. Data description specifications must be 
  1489. used to create the access path for a program-described input file. Refer to the 
  1490. section "Indexed File" in chapter 7 of the RPG/400* User's Guide. 
  1491.  
  1492.  
  1493. ΓòÉΓòÉΓòÉ 1.4.3. Continuation Line ΓòÉΓòÉΓòÉ
  1494.  
  1495. Continuation lines can be specified on the file description specification to 
  1496. provide additional information about the file being defined.  Any number of 
  1497. continuation lines can be specified. A continuation line is indicated by a K in 
  1498. position 53. 
  1499.  
  1500. A continuation line can be specified on the main file-description specification 
  1501. line if the functions use positions 54 through 65 for their definition; 
  1502. however, the keywords SFILE, RENAME, IGNORE, and PLIST cannot be defined there. 
  1503. To specify the continuation line information on the main file description 
  1504. specification line, enter K in position 53 and the valid entries in positions 
  1505. 54 through 67. See Continuation Line Summary Chart for more information. 
  1506.  
  1507.  
  1508. ΓòÉΓòÉΓòÉ 1.4.3.1. Continuation Line Summary Chart ΓòÉΓòÉΓòÉ
  1509.  
  1510. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  1511. Γöé          Continuation Line Summary Chart                       Γöé
  1512. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1513. Γöé POSI-    Γöé NAME     Γöé ENTRY    Γöé EXPLANATION                   Γöé
  1514. Γöé TIONS    Γöé          Γöé          Γöé                               Γöé
  1515. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1516. Γöé 1-2      Γöé Page     Γöé Page     Γöé Entry assigns a page number   Γöé
  1517. Γöé          Γöé          Γöé number   Γöé to each specification form.   Γöé
  1518. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1519. Γöé 3-5      Γöé Line     Γöé Line     Γöé Entry numbers the specifica-  Γöé
  1520. Γöé          Γöé          Γöé number   Γöé tion line.                    Γöé
  1521. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1522. Γöé 6        Γöé Form     Γöé F        Γöé Identification for a file     Γöé
  1523. Γöé          Γöé type     Γöé          Γöé description specification.    Γöé
  1524. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1525. Γöé 7-18     Γöé          Γöé Blank    Γöé These positions must be blank Γöé
  1526. Γöé          Γöé          Γöé          Γöé for a separate continuation   Γöé
  1527. Γöé          Γöé          Γöé          Γöé line.                         Γöé
  1528. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1529. Γöé 19-28    Γöé          Γöé External Γöé These positions are used to   Γöé
  1530. Γöé          Γöé          Γöé name of  Γöé specify the external name of  Γöé
  1531. Γöé          Γöé          Γöé record   Γöé the record format that is to  Γöé
  1532. Γöé          Γöé          Γöé format   Γöé be renamed ("RENAME") or      Γöé
  1533. Γöé          Γöé          Γöé          Γöé ignored ("IGNORE").           Γöé
  1534. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1535. Γöé 29-46    Γöé          Γöé Blank    Γöé These positions must be blank Γöé
  1536. Γöé          Γöé          Γöé          Γöé for a separate continuation   Γöé
  1537. Γöé          Γöé          Γöé          Γöé line.                         Γöé
  1538. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1539. Γöé 47-52    Γöé Record   Γöé Numeric  Γöé For the "SFILE" options,      Γöé
  1540. Γöé          Γöé number   Γöé field    Γöé these positions must specify  Γöé
  1541. Γöé          Γöé field    Γöé name     Γöé the name of a Relative Record Γöé
  1542. Γöé          Γöé for      Γöé          Γöé Number ("RECNO") field. For   Γöé
  1543. Γöé          Γöé "SFILE"  Γöé          Γöé other continuation line       Γöé
  1544. Γöé          Γöé          Γöé          Γöé options, these positions must Γöé
  1545. Γöé          Γöé          Γöé          Γöé be blank.                     Γöé
  1546. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1547. Γöé 53       Γöé Contin-  Γöé K        Γöé Indicates a continuation      Γöé
  1548. Γöé          Γöé uation   Γöé          Γöé line.                         Γöé
  1549. Γöé          Γöé line     Γöé          Γöé                               Γöé
  1550. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1551. Γöé 54-59,   Γöé          Γöé          Γöé These positions are used      Γöé
  1552. Γöé 60-67    Γöé          Γöé          Γöé together.  Positions 54       Γöé
  1553. Γöé          Γöé          Γöé          Γöé through 59 specify the        Γöé
  1554. Γöé          Γöé          Γöé          Γöé option, while positions 60    Γöé
  1555. Γöé          Γöé          Γöé          Γöé through 67 provide further    Γöé
  1556. Γöé          Γöé          Γöé          Γöé explanation of the option.    Γöé
  1557. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1558. Γöé 68-74    Γöé          Γöé Blank    Γöé These positions must be blank Γöé
  1559. Γöé          Γöé          Γöé          Γöé for a separate continuation   Γöé
  1560. Γöé          Γöé          Γöé          Γöé line.                         Γöé
  1561. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1562. Γöé 75-80    Γöé          Γöé Optional Γöé This space is available for   Γöé
  1563. Γöé          Γöé          Γöé          Γöé comments.                     Γöé
  1564. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  1565.  
  1566.  
  1567. ΓòÉΓòÉΓòÉ 1.4.3.2. Continuation Line Options Summary Chart ΓòÉΓòÉΓòÉ
  1568.  
  1569. The valid entries for positions 54 through 67 are: 
  1570.  
  1571. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  1572. Γöé          Continuation Line Options                             Γöé
  1573. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1574. Γöé OPTION   Γöé ENTRY    Γöé EXPLANATION                              Γöé
  1575. Γöé (54-59)  Γöé (60-67)  Γöé                                          Γöé
  1576. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1577. Γöé "COMIT"  Γöé Blank    Γöé This file is specified for commitment    Γöé
  1578. Γöé          Γöé          Γöé control.  Use the "COMIT" and "ROLBK"    Γöé
  1579. Γöé          Γöé          Γöé operation codes to group changes to this Γöé
  1580. Γöé          Γöé          Γöé file so that the changes all happen      Γöé
  1581. Γöé          Γöé          Γöé together, or do not happen at all.       Γöé
  1582. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1583. Γöé "ID"     Γöé Field    Γöé Positions 60-65 contain the left-        Γöé
  1584. Γöé          Γöé name     Γöé justified name of a 10-character alpha-  Γöé
  1585. Γöé          Γöé          Γöé numeric field which need not be further  Γöé
  1586. Γöé          Γöé          Γöé defined.  This field contains the name   Γöé
  1587. Γöé          Γöé          Γöé of the program device that supplied the  Γöé
  1588. Γöé          Γöé          Γöé record processed in the file.  The field Γöé
  1589. Γöé          Γöé          Γöé is updated each time a record is read    Γöé
  1590. Γöé          Γöé          Γöé from a file.  Also, you may move a       Γöé
  1591. Γöé          Γöé          Γöé program device name into this field to   Γöé
  1592. Γöé          Γöé          Γöé direct an output or device-specific      Γöé
  1593. Γöé          Γöé          Γöé input operation (other than a            Γöé
  1594. Γöé          Γöé          Γöé "READ"-by-file-name or an implicit cycle Γöé
  1595. Γöé          Γöé          Γöé read) to a different device.  When       Γöé
  1596. Γöé          Γöé          Γöé moving a literal into the field, blank   Γöé
  1597. Γöé          Γöé          Γöé the field first, and use the "MOVEL"     Γöé
  1598. Γöé          Γöé          Γöé operation to place the literal left-     Γöé
  1599. Γöé          Γöé          Γöé justified in the field.  Initially, the  Γöé
  1600. Γöé          Γöé          Γöé field is blank. A blank field indicates  Γöé
  1601. Γöé          Γöé          Γöé the requester device.  If the requester  Γöé
  1602. Γöé          Γöé          Γöé device is not acquired for your file,    Γöé
  1603. Γöé          Γöé          Γöé you must not use a blank field.  The     Γöé
  1604. Γöé          Γöé          Γöé "ID" field is maintained for each call   Γöé
  1605. Γöé          Γöé          Γöé to a program.  If you call program B     Γöé
  1606. Γöé          Γöé          Γöé from within program A, the "ID" field    Γöé
  1607. Γöé          Γöé          Γöé for program A is not affected.  Program  Γöé
  1608. Γöé          Γöé          Γöé B uses a separate "ID" field.  When you  Γöé
  1609. Γöé          Γöé          Γöé return to program A, its "ID" field has  Γöé
  1610. Γöé          Γöé          Γöé the same value as it had before you      Γöé
  1611. Γöé          Γöé          Γöé called program B.  If program B needs to Γöé
  1612. Γöé          Γöé          Γöé know which devices are acquired to       Γöé
  1613. Γöé          Γöé          Γöé program A, program A must pass this      Γöé
  1614. Γöé          Γöé          Γöé information (as a parameter list) when   Γöé
  1615. Γöé          Γöé          Γöé it calls program B.  When you specify    Γöé
  1616. Γöé          Γöé          Γöé "ID" but not "NUM", the RPG/400 program  Γöé
  1617. Γöé          Γöé          Γöé assumes "NUM" is present with a value of Γöé
  1618. Γöé          Γöé          Γöé 1.  To determine the name of the         Γöé
  1619. Γöé          Γöé          Γöé requester device, you may look in the    Γöé
  1620. Γöé          Γöé          Γöé appropriate area of the file information Γöé
  1621. Γöé          Γöé          Γöé data structure.  Or, you may process one Γöé
  1622. Γöé          Γöé          Γöé of the input or output operations        Γöé
  1623. Γöé          Γöé          Γöé described above with the "ID" field      Γöé
  1624. Γöé          Γöé          Γöé blank.  After the operation, the "ID"    Γöé
  1625. Γöé          Γöé          Γöé field has the name of the requester      Γöé
  1626. Γöé          Γöé          Γöé device.                                  Γöé
  1627. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1628. Γöé "IGNORE" Γöé Blank    Γöé This option lets you ignore a record     Γöé
  1629. Γöé          Γöé          Γöé format from an externally described      Γöé
  1630. Γöé          Γöé          Γöé file.  On the continuation line, posi-   Γöé
  1631. Γöé          Γöé          Γöé tions 19 through 28 specify the external Γöé
  1632. Γöé          Γöé          Γöé name of the record format to be ignored, Γöé
  1633. Γöé          Γöé          Γöé and positions 60 through 67 must be      Γöé
  1634. Γöé          Γöé          Γöé blank.  The program runs as if the       Γöé
  1635. Γöé          Γöé          Γöé record format did not exist.             Γöé
  1636. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1637. Γöé "IND"    Γöé Indi-    Γöé Indicators from 01 to the number speci-  Γöé
  1638. Γöé          Γöé cator    Γöé fied are saved and restored for each     Γöé
  1639. Γöé          Γöé number   Γöé device attached to a mixed or multiple   Γöé
  1640. Γöé          Γöé          Γöé device file.  Before an input operation, Γöé
  1641. Γöé          Γöé          Γöé the indicators for the device associated Γöé
  1642. Γöé          Γöé          Γöé with the previous input or output opera- Γöé
  1643. Γöé          Γöé          Γöé tion are saved.  After the input opera-  Γöé
  1644. Γöé          Γöé          Γöé tion, the indicators for the device      Γöé
  1645. Γöé          Γöé          Γöé associated with this current input oper- Γöé
  1646. Γöé          Γöé          Γöé ation are restored.  Specify a number    Γöé
  1647. Γöé          Γöé          Γöé from 01 through 99, right-justified, in  Γöé
  1648. Γöé          Γöé          Γöé positions 60 through 65.  No indicators  Γöé
  1649. Γöé          Γöé          Γöé are saved and restored if "IND" is not   Γöé
  1650. Γöé          Γöé          Γöé specified or if the option "NUM" has the Γöé
  1651. Γöé          Γöé          Γöé entry 1.  If you specified the keyword   Γöé
  1652. Γöé          Γöé          Γöé "INDARA", the number you specify for     Γöé
  1653. Γöé          Γöé          Γöé "IND" must be less than any response     Γöé
  1654. Γöé          Γöé          Γöé indicator you use in your DDS.  For      Γöé
  1655. Γöé          Γöé          Γöé example, if you specify "INDARA" and     Γöé
  1656. Γöé          Γöé          Γöé CF01(55) in your DDS, the maximum value  Γöé
  1657. Γöé          Γöé          Γöé for "IND" is 54. "IND" must not be used  Γöé
  1658. Γöé          Γöé          Γöé with shared files.  When you specify     Γöé
  1659. Γöé          Γöé          Γöé "IND" but not "NUM", the RPG/400 program Γöé
  1660. Γöé          Γöé          Γöé assumes "NUM" is present with a value of Γöé
  1661. Γöé          Γöé          Γöé 1.                                       Γöé
  1662. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1663. Γöé "INFDS"  Γöé Data     Γöé This entry lets you define and name a    Γöé
  1664. Γöé          Γöé struc-   Γöé data structure to contain the            Γöé
  1665. Γöé          Γöé ture     Γöé exception/error information.  The data   Γöé
  1666. Γöé          Γöé name     Γöé structure name is entered in positions   Γöé
  1667. Γöé          Γöé          Γöé 60 through 65 and left justified.  If    Γöé
  1668. Γöé          Γöé          Γöé "INFDS" is specified for more than one   Γöé
  1669. Γöé          Γöé          Γöé file, each associated data structure     Γöé
  1670. Γöé          Γöé          Γöé must have a unique name.                 Γöé
  1671. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1672. Γöé "INFSR"  Γöé Subrou-  Γöé The file exception/error subroutine      Γöé
  1673. Γöé          Γöé tine     Γöé named (left justified) in positions 60   Γöé
  1674. Γöé          Γöé name     Γöé through 65 may receive control following Γöé
  1675. Γöé          Γöé          Γöé file exception/errors.  The subroutine   Γöé
  1676. Γöé          Γöé          Γöé name may be "*PSSR", which indicates the Γöé
  1677. Γöé          Γöé          Γöé user defined program exception/error     Γöé
  1678. Γöé          Γöé          Γöé subroutine is to be given control for    Γöé
  1679. Γöé          Γöé          Γöé errors on this file.                     Γöé
  1680. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1681. Γöé "NUM"    Γöé Maximum  Γöé The number specified must be greater     Γöé
  1682. Γöé          Γöé number   Γöé than zero and right-justified in posi-   Γöé
  1683. Γöé          Γöé of       Γöé tions 60 through 65.  The lesser of this Γöé
  1684. Γöé          Γöé devices  Γöé number and the number of devices defined Γöé
  1685. Γöé          Γöé          Γöé for the "WORKSTN" file on the create-    Γöé
  1686. Γöé          Γöé          Γöé file command is the maximum number of    Γöé
  1687. Γöé          Γöé          Γöé devices that this file can acquire.      Γöé
  1688. Γöé          Γöé          Γöé With a shared file, the "NUM" value is   Γöé
  1689. Γöé          Γöé          Γöé not used to restrict the number of       Γöé
  1690. Γöé          Γöé          Γöé acquired devices.  When you specify      Γöé
  1691. Γöé          Γöé          Γöé "ID", "IND", or "SAVDS" but not "NUM",   Γöé
  1692. Γöé          Γöé          Γöé the RPG/400 program assumes "NUM" is     Γöé
  1693. Γöé          Γöé          Γöé present with a value of 1.               Γöé
  1694. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1695. Γöé "PASS"   Γöé "*NOIND" Γöé Specify "PASS *NOIND" on the file        Γöé
  1696. Γöé          Γöé          Γöé description specification continuation   Γöé
  1697. Γöé          Γöé          Γöé line for a program described "WORKSTN"   Γöé
  1698. Γöé          Γöé          Γöé file if you are taking responsibility    Γöé
  1699. Γöé          Γöé          Γöé for passing indicators on input and      Γöé
  1700. Γöé          Γöé          Γöé output.  With "PASS *NOIND", the RPG/400 Γöé
  1701. Γöé          Γöé          Γöé language does not pass indicators to     Γöé
  1702. Γöé          Γöé          Γöé data management on output and does not   Γöé
  1703. Γöé          Γöé          Γöé receive them on input. Pass indicators   Γöé
  1704. Γöé          Γöé          Γöé by describing them as fields (in the     Γöé
  1705. Γöé          Γöé          Γöé form "*INxx, *IN," or "*IN,xx") in the   Γöé
  1706. Γöé          Γöé          Γöé input or output record. They must be     Γöé
  1707. Γöé          Γöé          Γöé specified in the sequence required by    Γöé
  1708. Γöé          Γöé          Γöé the data description specifications      Γöé
  1709. Γöé          Γöé          Γöé (DDS).  You can use the DDS listing to   Γöé
  1710. Γöé          Γöé          Γöé determine this sequence.  If you do not  Γöé
  1711. Γöé          Γöé          Γöé specify "PASS *NOIND" and you use the    Γöé
  1712. Γöé          Γöé          Γöé keyword "INDARA" in the DDS for the      Γöé
  1713. Γöé          Γöé          Γöé "WORKSTN" file, indicators are not       Γöé
  1714. Γöé          Γöé          Γöé passed to data management on output nor  Γöé
  1715. Γöé          Γöé          Γöé received from data management on input.  Γöé
  1716. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1717. Γöé "PLIST"  Γöé Param-   Γöé This entry is valid only when the device Γöé
  1718. Γöé          Γöé eter     Γöé specified in positions 40 through 46 of  Γöé
  1719. Γöé          Γöé list     Γöé the main file-description line is        Γöé
  1720. Γöé          Γöé name     Γöé "SPECIAL".  Positions 60 through 65 give Γöé
  1721. Γöé          Γöé          Γöé the left-justified name of the parameter Γöé
  1722. Γöé          Γöé          Γöé list to be passed to the special         Γöé
  1723. Γöé          Γöé          Γöé routine.  The parameters identified by   Γöé
  1724. Γöé          Γöé          Γöé this entry are added to the end of the   Γöé
  1725. Γöé          Γöé          Γöé parameter list passed by the program.    Γöé
  1726. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1727. Γöé "PRTCTL" Γöé Data     Γöé The dynamic printer control option is    Γöé
  1728. Γöé          Γöé struc-   Γöé being used.  The data structure speci-   Γöé
  1729. Γöé          Γöé ture     Γöé fied left-justified in positions 60      Γöé
  1730. Γöé          Γöé name     Γöé through 65 refers to the forms control   Γöé
  1731. Γöé          Γöé          Γöé information and line count value.  The   Γöé
  1732. Γöé          Γöé          Γöé "PRTCTL" option is valid only for a      Γöé
  1733. Γöé          Γöé          Γöé program described file.                  Γöé
  1734. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1735. Γöé "RECNO"  Γöé Field    Γöé This entry is optional for disk files to Γöé
  1736. Γöé          Γöé name     Γöé be processed by relative-record number.  Γöé
  1737. Γöé          Γöé          Γöé A "RECNO" field must be specified for    Γöé
  1738. Γöé          Γöé          Γöé output files processed by relative-      Γöé
  1739. Γöé          Γöé          Γöé record number, output files that are     Γöé
  1740. Γöé          Γöé          Γöé referenced by a random "WRITE" calcu-    Γöé
  1741. Γöé          Γöé          Γöé lation operation, or output files that   Γöé
  1742. Γöé          Γöé          Γöé are used with "ADD" on the output spec-  Γöé
  1743. Γöé          Γöé          Γöé ifications.                              Γöé
  1744. Γöé          Γöé          Γöé                                          Γöé
  1745. Γöé          Γöé          Γöé "RECNO" can be specified for             Γöé
  1746. Γöé          Γöé          Γöé input/update files.  The relative-record Γöé
  1747. Γöé          Γöé          Γöé number of the record retrieved is placed Γöé
  1748. Γöé          Γöé          Γöé in the field named, left justified, in   Γöé
  1749. Γöé          Γöé          Γöé positions 60 through 65 for all oper-    Γöé
  1750. Γöé          Γöé          Γöé ations that reposition the file (such as Γöé
  1751. Γöé          Γöé          Γöé "READ, SETLL", or "OPEN").  It must be   Γöé
  1752. Γöé          Γöé          Γöé defined as numeric with zero decimal     Γöé
  1753. Γöé          Γöé          Γöé positions.                               Γöé
  1754. Γöé          Γöé          Γöé                                          Γöé
  1755. Γöé          Γöé          Γöé The field length must be sufficient to   Γöé
  1756. Γöé          Γöé          Γöé contain the longest record number for    Γöé
  1757. Γöé          Γöé          Γöé the file. "RECNO" is valid for "DISK"    Γöé
  1758. Γöé          Γöé          Γöé files only.  The contents of positions   Γöé
  1759. Γöé          Γöé          Γöé 60 through 65 may be not valid when the  Γöé
  1760. Γöé          Γöé          Γöé RPG/400 compiler does the blocking and   Γöé
  1761. Γöé          Γöé          Γöé unblocking of records.                   Γöé
  1762. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1763. Γöé "RENAME" Γöé Record   Γöé This entry, which is optional, allows    Γöé
  1764. Γöé          Γöé format   Γöé you to rename record formats in an       Γöé
  1765. Γöé          Γöé name     Γöé externally described file.  Positions 19 Γöé
  1766. Γöé          Γöé          Γöé through 28 of the continuation line      Γöé
  1767. Γöé          Γöé          Γöé specify the external name of the record  Γöé
  1768. Γöé          Γöé          Γöé format that is to be renamed.  Positions Γöé
  1769. Γöé          Γöé          Γöé 60 through 67 specify the left-justified Γöé
  1770. Γöé          Γöé          Γöé name of the record as it is used in the  Γöé
  1771. Γöé          Γöé          Γöé program.  The external name is replaced  Γöé
  1772. Γöé          Γöé          Γöé by this name in the program.             Γöé
  1773. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1774. Γöé "SAVDS"  Γöé Data     Γöé Positions 60-65 contain the left-        Γöé
  1775. Γöé          Γöé struc-   Γöé justified name of the data structure     Γöé
  1776. Γöé          Γöé ture     Γöé saved and restored for each device.      Γöé
  1777. Γöé          Γöé name     Γöé Before an input operation, the data      Γöé
  1778. Γöé          Γöé          Γöé structure for the device operation is    Γöé
  1779. Γöé          Γöé          Γöé saved. After the input operation, the    Γöé
  1780. Γöé          Γöé          Γöé data structure for the device associated Γöé
  1781. Γöé          Γöé          Γöé with this current input operation is     Γöé
  1782. Γöé          Γöé          Γöé restored.  This data structure cannot be Γöé
  1783. Γöé          Γöé          Γöé a data area data structure, file infor-  Γöé
  1784. Γöé          Γöé          Γöé mation data structure, or program status Γöé
  1785. Γöé          Γöé          Γöé data structure, and it cannot contain a  Γöé
  1786. Γöé          Γöé          Γöé compile-time array or prerun-time array. Γöé
  1787. Γöé          Γöé          Γöé                                          Γöé
  1788. Γöé          Γöé          Γöé If "SAVDS" is not specified, no saving   Γöé
  1789. Γöé          Γöé          Γöé and restoring is done. "SAVDS" must not  Γöé
  1790. Γöé          Γöé          Γöé be specified for shared files.  When you Γöé
  1791. Γöé          Γöé          Γöé specify "SAVDS" but not "NUM", the       Γöé
  1792. Γöé          Γöé          Γöé RPG/400 program assumes "NUM" is present Γöé
  1793. Γöé          Γöé          Γöé with a value of 1.                       Γöé
  1794. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1795. Γöé "SFILE"  Γöé Record   Γöé If the main file-description line con-   Γöé
  1796. Γöé          Γöé format   Γöé tains E in position 19 and "WORKSTN" in  Γöé
  1797. Γöé          Γöé name     Γöé positions 40 through 46, this option     Γöé
  1798. Γöé          Γöé          Γöé must be used to define any subfiles to   Γöé
  1799. Γöé          Γöé          Γöé be used in the file.  Positions 60       Γöé
  1800. Γöé          Γöé          Γöé through 67 must specify, left justified  Γöé
  1801. Γöé          Γöé          Γöé the RPG/400 name of the record format to Γöé
  1802. Γöé          Γöé          Γöé be processed as a subfile.               Γöé
  1803. Γöé          Γöé          Γöé                                          Γöé
  1804. Γöé          Γöé          Γöé Positions 47 through 52 must specify the Γöé
  1805. Γöé          Γöé          Γöé name of the relative-record number field Γöé
  1806. Γöé          Γöé          Γöé for this subfile.  The relative-record   Γöé
  1807. Γöé          Γöé          Γöé number of any record retrieved by a      Γöé
  1808. Γöé          Γöé          Γöé "READC" or "CHAIN" operation is placed   Γöé
  1809. Γöé          Γöé          Γöé into the field named in positions 47     Γöé
  1810. Γöé          Γöé          Γöé through 52.  This field is also used to  Γöé
  1811. Γöé          Γöé          Γöé specify the record number that RPG/400   Γöé
  1812. Γöé          Γöé          Γöé uses for a "WRITE" operation to the      Γöé
  1813. Γöé          Γöé          Γöé subfile or for output operations that    Γöé
  1814. Γöé          Γöé          Γöé use "ADD".  The field name specified in  Γöé
  1815. Γöé          Γöé          Γöé positions 47 through 52 must be defined  Γöé
  1816. Γöé          Γöé          Γöé as numeric with zero decimal positions.  Γöé
  1817. Γöé          Γöé          Γöé The field must have enough positions to  Γöé
  1818. Γöé          Γöé          Γöé contain the largest record number for    Γöé
  1819. Γöé          Γöé          Γöé the file.  (See the "SFLSIZ" keyword in  Γöé
  1820. Γöé          Γöé          Γöé the Data Description Specifications Ref- Γöé
  1821. Γöé          Γöé          Γöé erence.)                                 Γöé
  1822. Γöé          Γöé          Γöé                                          Γöé
  1823. Γöé          Γöé          Γöé Relative record number processing is     Γöé
  1824. Γöé          Γöé          Γöé implicitly defined as part of the        Γöé
  1825. Γöé          Γöé          Γöé "SFILE" definition.  If multiple sub-    Γöé
  1826. Γöé          Γöé          Γöé files are defined, each subfile requires Γöé
  1827. Γöé          Γöé          Γöé a separate continuation line.  Do not    Γöé
  1828. Γöé          Γöé          Γöé use SFILE with SLN.                      Γöé
  1829. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1830. Γöé "SLN"    Γöé Field    Γöé Positions 60-65 contain the left-        Γöé
  1831. Γöé          Γöé name     Γöé justified name of a start line number    Γöé
  1832. Γöé          Γöé          Γöé ("SLN") field.  The "SLN" field deter-   Γöé
  1833. Γöé          Γöé          Γöé mines where a record format is written   Γöé
  1834. Γöé          Γöé          Γöé to a display file.  The main file-       Γöé
  1835. Γöé          Γöé          Γöé description line must contain "WORKSTN"  Γöé
  1836. Γöé          Γöé          Γöé in positions 40 through 46 and a C or O  Γöé
  1837. Γöé          Γöé          Γöé in positions 15.  The data description   Γöé
  1838. Γöé          Γöé          Γöé specifications for the file must specify Γöé
  1839. Γöé          Γöé          Γöé the keyword "SLNO(*VAR)" for one or more Γöé
  1840. Γöé          Γöé          Γöé record formats.  When you specify "SLN"  Γöé
  1841. Γöé          Γöé          Γöé on the continuation line, the "SLN"      Γöé
  1842. Γöé          Γöé          Γöé field will automatically be defined in   Γöé
  1843. Γöé          Γöé          Γöé the program as a numeric field with      Γöé
  1844. Γöé          Γöé          Γöé length of 2 and with 0 decimal posi-     Γöé
  1845. Γöé          Γöé          Γöé tions.  Do not use SLN with SFILE.       Γöé
  1846. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  1847.  
  1848.  
  1849. ΓòÉΓòÉΓòÉ 1.4.3.3. PRTCTL Data Structure ΓòÉΓòÉΓòÉ
  1850.  
  1851. Data Structure Positions   Subfield Contents 
  1852. 1                          A one-position character field that contains the 
  1853.                            space-before value 
  1854. 2                          A one-position character field that contains the 
  1855.                            space-after value 
  1856. 3-4                        A two-position character field that contains the 
  1857.                            skip-before value 
  1858. 5-6                        A two-position character field that contains the 
  1859.                            skip-after value 
  1860. 7-9                        A three-digit numeric field with zero decimal 
  1861.                            positions that contains the current line count 
  1862.                            value. 
  1863.  
  1864. The values contained in the first four subfields of the data structure are the 
  1865. same as those allowed in positions 17 through 22 (space and skip entries) of 
  1866. the output specifications. If the space and skip entries (positions 17 through 
  1867. 22) of the output specifications are blank, and if subfields 1 through 4 are 
  1868. also blank, the default is to space 1 after. If the PRTCTL option is specified, 
  1869. it is used only for the output records that have blanks in positions 17 through 
  1870. 22. You can control the space and skip value (subfields 1 through 4) for the 
  1871. PRINTER file by changing the values in these subfields while the program is 
  1872. running. 
  1873.  
  1874. Subfield 5 contains the current line count value. The RPG/400 compiler does not 
  1875. initialize subfield 5 until after the first output line is printed. The RPG/400 
  1876. compiler then changes subfield 5 after each output operation to the file. 
  1877.  
  1878.  
  1879. ΓòÉΓòÉΓòÉ 1.5. Extension Specifications ΓòÉΓòÉΓòÉ
  1880.  
  1881. Extension specifications describe all record address files, arrays, and tables. 
  1882. A maximum of 200 arrays and tables can be used in a program. 
  1883.  
  1884.  
  1885. ΓòÉΓòÉΓòÉ 1.5.1. Extension Specification Statement ΓòÉΓòÉΓòÉ
  1886.  
  1887.  Position 6 (Form Type) 
  1888.  Positions 7-10 (Reserved) 
  1889.  Positions 11-18 (From File Name) 
  1890.  Positions 19-26 (To File Name) 
  1891.  Positions 27-32 and 46-51 (Array or Table Name) 
  1892.  Positions 33-35 (Entries per Record) 
  1893.  Positions 36-39 (Entries per Array or Table) 
  1894.  Positions 40-42 and 52-54 (Length of Entry) 
  1895.  Positions 43 and 55 (Data Format) 
  1896.  Positions 44  and 56 (Decimal Positions) 
  1897.  Position 45 and 57 (Sequence) 
  1898.  Positions 46-57 (Second Array Description) 
  1899.  Positions 58-74 (Comments) 
  1900.  Positions 75-80 (Comments) 
  1901.  
  1902.  
  1903. ΓòÉΓòÉΓòÉ 1.5.1.1. Position 6 (Form Type) ΓòÉΓòÉΓòÉ
  1904.  
  1905. An E must appear in position 6 to identify this line as an extension 
  1906. specifications statement. 
  1907.  
  1908.  
  1909. ΓòÉΓòÉΓòÉ 1.5.1.2. Positions 7-10 (Reserved) ΓòÉΓòÉΓòÉ
  1910.  
  1911. Positions 7 through 10 must be blank. 
  1912.  
  1913.  
  1914. ΓòÉΓòÉΓòÉ 1.5.1.3. Positions 11-18 (From File Name) ΓòÉΓòÉΓòÉ
  1915.  
  1916. Entry                         Explanation 
  1917. Blank                         The array or table is loaded at compilation time, 
  1918.                               or the array is loaded by input or calculation 
  1919.                               specifications. 
  1920. Record address file name      Name of the record address file. 
  1921. Array or table file name      Name of the array or table file loaded at prerun 
  1922.                               time. 
  1923.  
  1924. Use positions 11 through 18 to name an array file, table file, or record 
  1925. address file. File names must begin in position 11.  The record address file 
  1926. name must always be entered in these positions.  The file name of every 
  1927. prerun-time array or table used in the program must be entered in these 
  1928. positions.  Leave positions 11 through 18 blank for compile-time arrays or 
  1929. tables and for run-time arrays loaded with input and/or calculation 
  1930. specifications. 
  1931.  
  1932. Table "From and To File Name Entries" shows the relationship between positions 
  1933. 11 through 18 and positions 19 through 26. 
  1934.  
  1935. When an array or table is loaded at compilation time, it is compiled along with 
  1936. the source program and included in the program.  Such an array or table does 
  1937. not need to be loaded separately every time the program is run. Only those 
  1938. arrays and tables that contain constant data should be compiled with the 
  1939. program. 
  1940.  
  1941.  
  1942. ΓòÉΓòÉΓòÉ 1.5.1.4. Positions 19-26 (To File Name) ΓòÉΓòÉΓòÉ
  1943.  
  1944. Entry                           Explanation 
  1945. Blank                           The array or table is not written at end of 
  1946.                                 program. 
  1947. Input or update file with data  File processed with the record address file 
  1948.                                 named in positions 11 through 18. 
  1949. Output or combined file         Output file to which an array or table is to be 
  1950.                                 written, or the same file name (must be a 
  1951.                                 combined table file) specified in positions 11 
  1952.                                 through 18 if the output array or table is to 
  1953.                                 replace input in the same file. The file should 
  1954.                                 be externally described as a physical file. 
  1955.  
  1956. If a record address file is named in positions 11 through 18, the name of the 
  1957. input or update file that contains the data records to be processed must be 
  1958. entered in positions 19 through 26. 
  1959.  
  1960. If an array or table is to be written, enter the file name of the output or 
  1961. combined file in positions 19 through 26. This file must also be named in the 
  1962. file description specifications. An array or table can be written to only one 
  1963. output device. Leave positions 19 through 26 blank if the array or table is not 
  1964. to be written. 
  1965.  
  1966. If an array or table is assigned to an output file, it is automatically written 
  1967. if LR is on. The array or table is written after all other records are written 
  1968. in the format used when it was entered. 
  1969.  
  1970. If an array or table is to be written to the same file from which it was read, 
  1971. the same file name must be entered in positions 11 through 18 and in positions 
  1972. 19 through 26. This file must be specified as a combined file (C in position 
  1973. 15) in the file description specifications. 
  1974.  
  1975. Table "From and To File Name Entries" describes the possible entries. 
  1976.  
  1977.  
  1978. ΓòÉΓòÉΓòÉ 1.5.1.4.1. From and To File Name Table ΓòÉΓòÉΓòÉ
  1979.  
  1980. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  1981. Γöé          From and To File Name Entries                         Γöé
  1982. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1983. Γöé TYPE OF FILE  Γöé FROM FILE NAME Γöé TO FILE NAME (POSITIONS       Γöé
  1984. Γöé               Γöé (POSITIONS     Γöé 19-26)                        Γöé
  1985. Γöé               Γöé 11-18)         Γöé                               Γöé
  1986. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1987. Γöé Array or      Γöé If an array or Γöé If the array or table being   Γöé
  1988. Γöé table files   Γöé table loaded   Γöé defined is being written out  Γöé
  1989. Γöé loaded at     Γöé at prerun time Γöé after it is updated, enter    Γöé
  1990. Γöé prerun time   Γöé is being       Γöé the name of the output file   Γöé
  1991. Γöé               Γöé defined (posi- Γöé or the combined array file if Γöé
  1992. Γöé               Γöé tions 27       Γöé it is to be written to the    Γöé
  1993. Γöé               Γöé through 57),   Γöé same file that was assigned   Γöé
  1994. Γöé               Γöé enter the name Γöé to it in the file description Γöé
  1995. Γöé               Γöé of the file    Γöé specifications.(1)  If the    Γöé
  1996. Γöé               Γöé that contains  Γöé array or table is not being   Γöé
  1997. Γöé               Γöé the array or   Γöé written out, leave these      Γöé
  1998. Γöé               Γöé table.(1)      Γöé positions blank.              Γöé
  1999. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2000. Γöé Arrays or     Γöé Blank.         Γöé Enter the name of the output  Γöé
  2001. Γöé tables loaded Γöé                Γöé file if the array or table is Γöé
  2002. Γöé at compile    Γöé                Γöé to be written out at the end  Γöé
  2003. Γöé time          Γöé                Γöé of the program.(1)            Γöé
  2004. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2005. Γöé Arrays loaded Γöé Blank.         Γöé Blank.                        Γöé
  2006. Γöé by input or   Γöé                Γöé                               Γöé
  2007. Γöé calculation   Γöé                Γöé                               Γöé
  2008. Γöé specifica-    Γöé                Γöé                               Γöé
  2009. Γöé tions         Γöé                Γöé                               Γöé
  2010. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2011. Γöé Record        Γöé Enter the name Γöé Enter the name of the file    Γöé
  2012. Γöé address file  Γöé of the record  Γöé that contains the data        Γöé
  2013. Γöé               Γöé address        Γöé records to be processed by    Γöé
  2014. Γöé               Γöé file.(1)       Γöé the record address file.(1)   Γöé
  2015. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2016. Γöé (1)These entries must be left-adjusted.                        Γöé
  2017. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  2018.  
  2019.  
  2020. ΓòÉΓòÉΓòÉ 1.5.1.5. Positions 27-32 and 46-51 (Array or Table Name) ΓòÉΓòÉΓòÉ
  2021.  
  2022. Entry                    Explanation 
  2023. Array or table name      The name of the array or table used in the program. 
  2024.  
  2025. Use positions 27 through 32 to name the array or table. 
  2026.  
  2027.  
  2028. ΓòÉΓòÉΓòÉ 1.5.1.6. Positions 33-35 (Entries per Record) ΓòÉΓòÉΓòÉ
  2029.  
  2030. Entry        Explanation 
  2031. Blank        The array is loaded by input or calculation specifications. 
  2032. 1-999        Number of array or table entries in each array or table input 
  2033.              record. 
  2034.  
  2035. Use positions 33 through 35 to indicate the exact number of array or table 
  2036. entries in each array or table input record. The number must end in position 
  2037. 35.  Every array or table input record except the last must contain the number 
  2038. of entries indicated in positions 33 through 35.  The last record can contain 
  2039. fewer entries than indicated, but not more.  Comments can be entered on table 
  2040. input records in the positions following the table entries. 
  2041.  
  2042. If two arrays or tables are in alternating format in one file, each array or 
  2043. table input record must contain the corresponding entries from each array or 
  2044. table.  The corresponding entries from the two arrays or tables are considered 
  2045. one entry and must be on the same record. 
  2046.  
  2047. If positions 27 through 32 contain an array name, the following rules apply to 
  2048. the use of positions 11 through 18 and 33 through 35: 
  2049.  
  2050.  For a prerun-time array, positions 11 through 18 must contain a file name and 
  2051.   positions 33 through 35 must have an entry. 
  2052.  For a compile-time array, positions 11 through 18 must be blank and positions 
  2053.   33 through 35 must have an entry. 
  2054.  For an run-time array, positions 11 through 18 and positions 33 through 35 
  2055.   must be blank. 
  2056.  
  2057.  
  2058. ΓòÉΓòÉΓòÉ 1.5.1.7. Positions 36-39 (Entries per Array or Table) ΓòÉΓòÉΓòÉ
  2059.  
  2060. Entry        Explanation 
  2061. 1-9999       Maximum number of array or table entries. 
  2062.  
  2063. Use positions 36 through 39 to indicate the maximum number of entries that can 
  2064. be contained in the array or table named in positions 27 through 32. This 
  2065. number applies to one array or table or to two arrays or tables in alternating 
  2066. format.  The number entered must end in position 39. 
  2067.  
  2068. Because the number of entries for two arrays or tables written in alternating 
  2069. format must be the same, the number in these positions also gives the number of 
  2070. entries in the second array or table specified in positions 46 through 51. 
  2071.  
  2072.  
  2073. ΓòÉΓòÉΓòÉ 1.5.1.8. Positions 40-42 and 52-54 (Length of Entry) ΓòÉΓòÉΓòÉ
  2074.  
  2075. Entry        Explanation 
  2076. 1-256        Length of each element in the array or table named in positions 27 
  2077.              through 32. 
  2078.  
  2079. If L or R is specified in positions 43 or 55, the length includes the sign 
  2080. position. 
  2081.  
  2082. If two arrays or tables are entered in alternating format, the specification in 
  2083. positions 40 through 42 applies to the array or table whose entry appears first 
  2084. in the record. 
  2085.  
  2086.  
  2087. ΓòÉΓòÉΓòÉ 1.5.1.9. Positions 43 and 55 (Data Format) ΓòÉΓòÉΓòÉ
  2088.  
  2089. Entry        Explanation 
  2090. Blank        The data for the array or table (1) is in zoned decimal format, or 
  2091.              (2) is character data, or (3) is loaded through input or 
  2092.              calculation specifications. 
  2093. P            The data for the array or table is in packed decimal format. 
  2094. B            The data for the array or table is in binary format. 
  2095. L            The data for a numeric array or table element has a preceding 
  2096.              (left) plus or minus sign. 
  2097. R            The data for a numeric array or table element has a following 
  2098.              (right) plus or minus sign. 
  2099.  
  2100. The entry in position 43 specifies the format of the data in the records in the 
  2101. file.  This entry has no effect on the format used for internal processing of 
  2102. the array or table in the program. 
  2103.  
  2104.  
  2105. ΓòÉΓòÉΓòÉ 1.5.1.10. Positions 44  and 56 (Decimal Positions) ΓòÉΓòÉΓòÉ
  2106.  
  2107. Entry        Explanation 
  2108. Blank        Character array or table. 
  2109. 0-9          Number of positions to the right of the decimal in numeric array 
  2110.              or table elements. 
  2111.  
  2112. Use position 44 to indicate the number of decimal positions in a numeric array 
  2113. or table element.  Position 44 must always have an entry for a numeric array or 
  2114. table.  If the entries in an array or table have no decimal positions, enter a 
  2115. 0. 
  2116.  
  2117. If two arrays or tables are entered in alternating format, the specification in 
  2118. this position applies to the array or table containing the entry that appears 
  2119. first on the record. 
  2120.  
  2121.  
  2122. ΓòÉΓòÉΓòÉ 1.5.1.11. Position 45 and 57 (Sequence) ΓòÉΓòÉΓòÉ
  2123.  
  2124. Entry        Explanation 
  2125. Blank        No particular sequence 
  2126. A            Ascending sequence 
  2127. D            Descending sequence. 
  2128.  
  2129. Use position 45 to describe the sequence (either ascending or descending) of 
  2130. the data in an array or table loaded at prerun time or compile time. 
  2131.  
  2132. When an entry is made in position 45, the array or table is checked for the 
  2133. specified sequence at the time the array or table is loaded with data.  If a 
  2134. prerun-time array or table is out of sequence, control passes to the RPG/400 
  2135. exception/error handling routine. 
  2136.  
  2137. Ascending sequence means that the array or table entries start with the lowest 
  2138. data entry (according to the collating sequence) and go to the highest. 
  2139. Descending sequence means that the array or table entries start with the 
  2140. highest data entry and go to the lowest. Items with equal values are allowed. 
  2141.  
  2142. If two arrays or tables are entered in alternating format, the entry in 
  2143. position 45 applies to the array or table containing the entry that appears 
  2144. first on the record. 
  2145.  
  2146. When the LOKUP operation is used to search an array or table for an entry to 
  2147. determine whether the entry is high or low compared with the search argument, a 
  2148. sequence must have been specified (A or D) for the array or table.  See LOKUP 
  2149. (Look Up) for more information. 
  2150.  
  2151. A run-time array (loaded by input and/or calculation specifications) is not 
  2152. sequence checked.  However, an A or D entry must be specified if a high or low 
  2153. LOKUP operation is processed.  Sequence must be specified if the SORTA 
  2154. operation code is used with the array. 
  2155.  
  2156.  
  2157. ΓòÉΓòÉΓòÉ 1.5.1.12. Positions 46-57 (Second Array Description) ΓòÉΓòÉΓòÉ
  2158.  
  2159. The fields in positions 46 through 57 have the same significance and require 
  2160. the same type of entries as the fields with corresponding titles in positions 
  2161. 27 through 32 and 40 through 45. 
  2162.  
  2163. Positions 46 through 57 can be used to describe a second array: 
  2164.  
  2165.  For compile-time and prerun-time arrays, the array described in positions 46 
  2166.   through 57 is loaded in alternating format with the array named in positions 
  2167.   27 through 32. 
  2168.  For run-time arrays, positions 46 through 57 can be used to describe a second 
  2169.   run-time array that is loaded independently of the array named in positions 
  2170.   27 through 32. 
  2171.  
  2172. See the discussion on positions 27 through 45 for information about correct 
  2173. specifications. Leave positions 46 through 57 blank for a single array or 
  2174. table. 
  2175.  
  2176.  
  2177. ΓòÉΓòÉΓòÉ 1.5.1.13. Positions 58-74 (Comments) ΓòÉΓòÉΓòÉ
  2178.  
  2179. Positions 58 through 74 can be used for comments. 
  2180.  
  2181.  
  2182. ΓòÉΓòÉΓòÉ 1.5.1.14. Positions 75-80 (Comments) ΓòÉΓòÉΓòÉ
  2183.  
  2184. Positions 75 through 80 can be used for comments, or left blank. 
  2185.  
  2186. These positions are not printed contiguously with positions 6-74 on the 
  2187. compiler listing. 
  2188.  
  2189.  
  2190. ΓòÉΓòÉΓòÉ 1.6. Line Counter Specifications ΓòÉΓòÉΓòÉ
  2191.  
  2192. Line counter specifications can be used for each program described PRINTER file 
  2193. to indicate the length of the form and the number of lines to print on a page. 
  2194. These entries are specified on the RPG/400 Extension and Line Counter 
  2195. Specifications. Line counter specifications may be used for each PRINTER file 
  2196. in your program. If line counter specifications are used, position 39 of the 
  2197. file description specifications for the PRINTER device must contain an L. 
  2198.  
  2199. A form length and an overflow line specified by the OS/400 system override 
  2200. commands override any program specifications. If no override commands are used 
  2201. for the PRINTER file, the program specification of form length and overflow 
  2202. line is used.  If there are no overrides and no program specifications, the 
  2203. form length and the overflow line specified in the device file are used. 
  2204.  
  2205.  
  2206. ΓòÉΓòÉΓòÉ 1.6.1. Line Counter Specification Statement ΓòÉΓòÉΓòÉ
  2207.  
  2208.  Position 6 (Form Type) 
  2209.  Positions 7-14 (File Name) 
  2210.  Positions 15-17 (Lines Per Page) 
  2211.  Positions 18-19 (Form Length) 
  2212.  Positions 20-22 (Overflow Line Number) 
  2213.  Positions 23-24 (Overflow Line) 
  2214.  Positions 25-74 (Reserved) 
  2215.  
  2216.  
  2217. ΓòÉΓòÉΓòÉ 1.6.1.1. Position 6 (Form Type) ΓòÉΓòÉΓòÉ
  2218.  
  2219. An L must be entered in position 6 to identify this line as a line counter 
  2220. specifications statement. 
  2221.  
  2222.  
  2223. ΓòÉΓòÉΓòÉ 1.6.1.2. Positions 7-14 (File Name) ΓòÉΓòÉΓòÉ
  2224.  
  2225. Entry               Explanation 
  2226. A valid file name   File name of the program described PRINTER file as 
  2227.                     previously defined on the file description specifications. 
  2228.                     The file name must begin in position 7. 
  2229.  
  2230.  
  2231. ΓòÉΓòÉΓòÉ 1.6.1.3. Positions 15-17 (Lines Per Page) ΓòÉΓòÉΓòÉ
  2232.  
  2233. Entry        Explanation 
  2234. 2-112        The number of printing lines available is 2 through 112. 
  2235.  
  2236. Use positions 15 through 17 to specify the exact number of lines available on 
  2237. the form or page to be used.  The entry must end in position 17.  Leading zeros 
  2238. can be omitted. 
  2239.  
  2240.  
  2241. ΓòÉΓòÉΓòÉ 1.6.1.4. Positions 18-19 (Form Length) ΓòÉΓòÉΓòÉ
  2242.  
  2243. Entry        Explanation 
  2244. FL           Form length. 
  2245.  
  2246. Use positions 18 and 19 to indicate that the preceding entry (positions 15 
  2247. through 17) is the form length.  Positions 18 and 19 must contain the entry FL 
  2248. if positions 15 through 17 contain an entry. 
  2249.  
  2250. Changing the form length does not require recompiling the program. The override 
  2251. to the compiled value can be specified by an OS/400 system override command. 
  2252.  
  2253.  
  2254. ΓòÉΓòÉΓòÉ 1.6.1.5. Positions 20-22 (Overflow Line Number) ΓòÉΓòÉΓòÉ
  2255.  
  2256. Entry        Explanation 
  2257. 2-112        The line number specified is the overflow line. 
  2258.  
  2259. Use positions 20 through 22 to specify the overflow line number. The overflow 
  2260. line number must be less than or equal to the form length.  The entry must end 
  2261. in position 22.  Leading zeros can be omitted.  When the line that is specified 
  2262. as the overflow line is printed, the overflow indicator turns on. In the OS/400 
  2263. system, changing the overflow line does not require recompiling the program. 
  2264. The override to the compiled value can be specified by an OS/400 system 
  2265. override command. 
  2266.  
  2267.  
  2268. ΓòÉΓòÉΓòÉ 1.6.1.6. Positions 23-24 (Overflow Line) ΓòÉΓòÉΓòÉ
  2269.  
  2270. Entry        Explanation 
  2271. OL           Overflow line. 
  2272.  
  2273. Use positions 23 and 24 to indicate that the preceding entry (positions 20 
  2274. through 22) is the overflow line number.  Positions 23 and 24 must contain OL 
  2275. if positions 20 through 22 contain an entry. 
  2276.  
  2277.  
  2278. ΓòÉΓòÉΓòÉ 1.6.1.7. Positions 25-74 (Reserved) ΓòÉΓòÉΓòÉ
  2279.  
  2280. Positions 25 through 74 must be blank. 
  2281.  
  2282.  
  2283. ΓòÉΓòÉΓòÉ 1.6.1.8. Positions 75-80 (Comments) ΓòÉΓòÉΓòÉ
  2284.  
  2285. Positions 75 through 80 can be used for comments, or left blank. These 
  2286. positions are not printed contiguously with positions 6-74 on the compiler 
  2287. listing. 
  2288.  
  2289.  
  2290. ΓòÉΓòÉΓòÉ 1.7. Input Specifications ΓòÉΓòÉΓòÉ
  2291.  
  2292. For a program described input file, input specifications describe the types of 
  2293. records within the file, the sequence of the types of records, the fields 
  2294. within a record, the data within the field, indicators based on the contents of 
  2295. the fields, control fields, fields used for matching records, and fields used 
  2296. for sequence checking. For an externally described file, input specifications 
  2297. are optional and can be used to add RPG/400 functions to the external 
  2298. description. Input specifications are also used to describe data structures and 
  2299. named constants. 
  2300.  
  2301. Entries on input specifications are divided into the following categories: 
  2302.  
  2303.  Record identification entries (positions 7 through 42), which describe the 
  2304.   input record and its relationship to other records in the file. 
  2305.  Field description entries (positions 43 through 70), which describe the 
  2306.   fields in the records.  Each field is described on a separate line, below its 
  2307.   corresponding record identification entry. 
  2308.  
  2309. For externally described files, entries on input specifications are divided 
  2310. into the following categories: 
  2311.  
  2312.  Record identification entries (positions 7 through 14, and 18 and 19), which 
  2313.   identify the record (the externally described record format) to which RPG/400 
  2314.   functions are to be added. 
  2315.  Field description entries (positions 21 through 30, 53 through 62, and 65 
  2316.   through 70), which describe the RPG/400 functions to be added to the fields 
  2317.   in the record.  Field description entries are written on the lines following 
  2318.   the corresponding record identification entries. 
  2319.  
  2320. For data structures, entries on input specifications are divided into the 
  2321. following categories: 
  2322.  
  2323.  Data structure statements (positions 7 through 12, 17 through 30, and 44 
  2324.   through 51), which define data structures. 
  2325.  Data structure subfield specifications (positions 8, and 21 through 58), 
  2326.   which describe the subfields of the data structures.  Data structure subfield 
  2327.   specifications are written on the lines following the data structure 
  2328.   statements. 
  2329.  
  2330. Detailed information for the input specifications is given in: 
  2331.  
  2332.  Entries for program described files 
  2333.  Entries for externally described files 
  2334.  Entries for data structures 
  2335.  Entries for named constants. 
  2336.  
  2337.  
  2338. ΓòÉΓòÉΓòÉ 1.7.1. Program Described Files ΓòÉΓòÉΓòÉ
  2339.  
  2340.  Position 6 (Form Type) 
  2341.  Record Identification Entries 
  2342.  Field Description Entries 
  2343.  
  2344.  
  2345. ΓòÉΓòÉΓòÉ 1.7.1.1. Position 6 (Form Type) ΓòÉΓòÉΓòÉ
  2346.  
  2347. An I must appear in position 6 to identify this line as an input specification 
  2348. statement. 
  2349.  
  2350.  
  2351. ΓòÉΓòÉΓòÉ 1.7.2. Record Identification Entries ΓòÉΓòÉΓòÉ
  2352.  
  2353. Record identification entries (positions 7 through 42) for a program described 
  2354. file describe the input record and its relationship to other records in the 
  2355. file. 
  2356.  
  2357.  Positions 7-14 (File Name) 
  2358.  Positions 14-16 (Logical Relationship) 
  2359.  Positions 15-16 (Sequence) 
  2360.  
  2361.    - Alphabetic Entries 
  2362.    - Numeric Entries 
  2363.  
  2364.  Position 17 (Number) 
  2365.  Position 18 (Option) 
  2366.  Positions 19-20 (Record Identifying Indicator, or **) 
  2367.  
  2368.    - Indicators 
  2369.    - Lookahead Fields 
  2370.  
  2371.  Positions 21-41 (Record Identification Codes) 
  2372.  
  2373.    - Positions 21-24, 28-31, and 35-38 (Position) 
  2374.    - Positions 25, 32, and 39 (Not) 
  2375.    - Positions 26, 33, and 40 (Code Part) 
  2376.    - Character (C) 
  2377.    - Zone (Z) 
  2378.    - Digit (D) 
  2379.    - Positions 27, 34, and 41 (Character) 
  2380.    - AND Relationship 
  2381.    - OR Relationship 
  2382.  
  2383.  Position 42 (Reserved) 
  2384.  
  2385.  
  2386. ΓòÉΓòÉΓòÉ 1.7.2.1. Positions 7-14 (File Name) ΓòÉΓòÉΓòÉ
  2387.  
  2388. Entry                Explanation 
  2389. A valid file name    Same file name that appears on the file description 
  2390.                      specifications for the input file. 
  2391.  
  2392. Enter the name of the file to be described in these positions.  This name must 
  2393. be the same name defined for the file on the file description specifications. 
  2394. This file must be an input file, an update file, or a combined file.  The file 
  2395. name must be entered on the first record identification line for each file and 
  2396. can be entered on subsequent record identification lines for that file.  All 
  2397. entries describing one input file must appear together; they cannot be mixed 
  2398. with entries for other files. 
  2399.  
  2400.  
  2401. ΓòÉΓòÉΓòÉ 1.7.2.2. Positions 14-16 (Logical Relationship) ΓòÉΓòÉΓòÉ
  2402.  
  2403. Entry       Explanation 
  2404. AND         More than three identification codes are used. 
  2405. OR          Two or more record types have common fields. 
  2406.  
  2407. An unlimited number of AND/OR lines can be used. For more information see AND 
  2408. Relationship and OR Relationship. 
  2409.  
  2410.  
  2411. ΓòÉΓòÉΓòÉ 1.7.2.3. Positions 15-16 (Sequence) ΓòÉΓòÉΓòÉ
  2412.  
  2413. Entry                           Explanation 
  2414. Any two alphabetic characters   The program does not check for special 
  2415.                                 sequence. 
  2416. Any two-digit number            The program checks for special sequence within 
  2417.                                 the group. 
  2418.  
  2419. The numeric sequence entry combined with the number (position 17) and option 
  2420. (position 18) entries causes the program to check the sequence of input records 
  2421. within a file. If the sequence is not correct, control passes to the RPG/400 
  2422. exception/error handling routine. If AND or OR lines are specified, the 
  2423. sequence entry is made on the main record line of the group, not on the AND or 
  2424. OR lines. 
  2425.  
  2426. Alphabetic and numeric entries can be made for different records (different 
  2427. record identification lines) in the same file, but records with alphabetic 
  2428. entries must be specified before records with numeric entries. 
  2429.  
  2430.  
  2431. ΓòÉΓòÉΓòÉ 1.7.2.3.1. Alphabetic Entries ΓòÉΓòÉΓòÉ
  2432.  
  2433. Enter any two alphabetic characters in these positions when no sequence 
  2434. checking is to be done.  It is common programming practice to specify these 
  2435. codes in a sequence that aids in program documentation. However, it is not 
  2436. necessary to use unique alphabetic entries. 
  2437.  
  2438.  
  2439. ΓòÉΓòÉΓòÉ 1.7.2.3.2. Numeric Entries ΓòÉΓòÉΓòÉ
  2440.  
  2441. Enter a unique numeric code in positions 15 and 16 if one record type must be 
  2442. read before another record type in a file. Numeric entries must be in ascending 
  2443. order, starting with 01, but need not be consecutive.  When a numeric entry is 
  2444. used, the appropriate entries must be made in positions 17 and 18. 
  2445.  
  2446. To specify sequence checking, each record type must have a record 
  2447. identification code, and the record types must be numbered in the order in 
  2448. which they should appear. This order is checked as the records are read. If a 
  2449. record type is out of sequence, control passes to the RPG/400 exception/error 
  2450. handling routine. 
  2451.  
  2452. Sequence numbers ensure only that all records of each record type precede the 
  2453. records of senior sequence numbered record types. The sequence numbers do not 
  2454. ensure that records within a record type are in any certain order. Sequence 
  2455. numbers are unrelated to control levels and do not provide for checking data in 
  2456. fields of a record for a special sequence.  Use positions 61 and 62 (matching 
  2457. fields) to indicate that data in fields of a record should be checked for a 
  2458. special sequence. 
  2459.  
  2460.  
  2461. ΓòÉΓòÉΓòÉ 1.7.2.4. Position 17 (Number) ΓòÉΓòÉΓòÉ
  2462.  
  2463. Entry        Explanation 
  2464. Blank        The program does not check record types for a special sequence 
  2465.              (positions 15 and 16 have alphabetic entries). 
  2466. 1            Only one record of this type can be present in the sequenced 
  2467.              group. 
  2468. N            One or more records of this type can be present in the sequenced 
  2469.              group. 
  2470.  
  2471. This entry must be used when a numeric entry is made in positions 15 and 16. If 
  2472. an alphabetic entry is made in positions 15 and 16, this entry must be blank. 
  2473.  
  2474.  
  2475. ΓòÉΓòÉΓòÉ 1.7.2.5. Position 18 (Option) ΓòÉΓòÉΓòÉ
  2476.  
  2477. Entry        Explanation 
  2478. Blank        The record type must be present if sequence checking is specified. 
  2479. O            The record type is optional (that is, it may or may not be 
  2480.              present) if sequence checking is specified. 
  2481.  
  2482. This entry must be blank if positions 15 and 16 contain an alphabetic entry. 
  2483.  
  2484. Sequence checking of record types has no meaning when all record types within a 
  2485. file are specified as optional (alphabetic entry in positions 15 and 16 or O 
  2486. entry in position 18). 
  2487.  
  2488.  
  2489. ΓòÉΓòÉΓòÉ 1.7.2.6. Positions 19-20 (Record Identifying Indicator, or **) ΓòÉΓòÉΓòÉ
  2490.  
  2491. Entry            Explanation 
  2492. Blank            No indicator is used. 
  2493. 01-99            General indicator. 
  2494. L1-L9 or LR      Control level indicator used for a record identifying 
  2495.                  indicator. 
  2496. H1-H9            Halt indicator. 
  2497. U1-U8            External indicator. 
  2498. RT               Return indicator. 
  2499. **               Lookahead field (not an indicator). Lookahead can be used only 
  2500.                  with a primary or secondary file. 
  2501.  
  2502. The indicators specified in these positions are used in conjunction with the 
  2503. record identification codes (positions 21 through 41). 
  2504.  
  2505.  
  2506. ΓòÉΓòÉΓòÉ 1.7.2.6.1. Indicators ΓòÉΓòÉΓòÉ
  2507.  
  2508. Positions 19 and 20 associate an indicator with the record type defined on this 
  2509. line. The normal entry is one of the indicators 01 to 99; however, the control 
  2510. level indicators L1 through L9 and LR can be used to cause certain total steps 
  2511. to be processed. If a control level indicator is specified, lower control level 
  2512. indicators are not set on.  The halt indicators H1 through H9 can be used to 
  2513. stop processing.  The return indicator (RT) is used to return to the calling 
  2514. program. 
  2515.  
  2516. When a record is selected for processing and satisfies the conditions indicated 
  2517. by the record identification codes, the appropriate record identifying 
  2518. indicator is set on. This indicator can be used to condition calculation and 
  2519. output operations.  Record identifying indicators can be set on or set off by 
  2520. the programmer. However, at the end of the cycle, all record identifying 
  2521. indicators are set off before another record is selected. 
  2522.  
  2523.  
  2524. ΓòÉΓòÉΓòÉ 1.7.2.6.2. Lookahead Fields ΓòÉΓòÉΓòÉ
  2525.  
  2526. The entry of ** is used for the lookahead function.  This function lets you 
  2527. look at information in the next record in a file.  You can look not only at the 
  2528. file currently selected for processing but also at other files present but not 
  2529. selected during this cycle. 
  2530.  
  2531. Field description lines must contain From and To entries in the record, a field 
  2532. name, and decimal positions if the field is numeric. Note that a lookahead 
  2533. field may not be specified as a field name or as a data structure name on Input 
  2534. Specifications or as a Result Field on Calculation Specifications. 
  2535.  
  2536. Positions 15 and 16 must contain an alphabetic entry.  The lookahead fields are 
  2537. defined in positions 53 through 58 of the lines following the line containing 
  2538. ** in positions 19 and 20.  Positions 59 through 74 must be blank. 
  2539.  
  2540. Any or all of the fields in a record can be defined as lookahead fields.  This 
  2541. definition applies to all records in the file, regardless of their type. If a 
  2542. field is used both as a lookahead field and as a normal input field, it must be 
  2543. defined twice with different names. 
  2544.  
  2545. The lookahead function can be specified only for primary and secondary files 
  2546. and can be specified only once for a file. It cannot be used for full 
  2547. procedural files (identified by an F in position 16 of the file description 
  2548. specifications), or with AND or OR lines. 
  2549.  
  2550. When a record is being processed from a combined file or an update file, the 
  2551. data in the lookahead field is the same as the data in the record being 
  2552. processed, not the data in the next record. 
  2553.  
  2554. The lookahead function causes information in the file information data 
  2555. structure to be updated with data pertaining to the lookahead record, not to 
  2556. the current primary record. 
  2557.  
  2558. If an array element is specified as a lookahead field, the entire array is 
  2559. classified as a lookahead field. 
  2560.  
  2561. Lookahead fields are filled with nines when all records in the file have been 
  2562. processed so that the end of the file can be recognized. 
  2563.  
  2564.  
  2565. ΓòÉΓòÉΓòÉ 1.7.2.7. Positions 21-41 (Record Identification Codes) ΓòÉΓòÉΓòÉ
  2566.  
  2567. Entries in positions 21 through 41 identify each record type in the input file. 
  2568. One to three identification codes can be entered on each specification line. 
  2569. More than three record identification codes can be specified on additional 
  2570. lines with the AND/OR relationship. If the file contains only one record type, 
  2571. the identification codes can be left blank; however, a record identifying 
  2572. indicator entry (positions 19 and 20) and a sequence entry (positions 15 and 
  2573. 16) must be made. 
  2574.  
  2575. Three sets of entries can be made in positions 21 through 41: 21 through 27, 28 
  2576. through 34, and 35 through 41. Each set is divided into four groups: position, 
  2577. not, code part, and character. 
  2578.  
  2579. The following table shows which categories use which positions in each set. 
  2580.  
  2581. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  2582. Γöé CATEGORY   Γöé 21-27    Γöé 28-34    Γöé 35-41  Γöé
  2583. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2584. Γöé Position   Γöé 21-24    Γöé 28-31    Γöé 35-38  Γöé
  2585. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2586. Γöé Not        Γöé 25       Γöé 32       Γöé 39     Γöé
  2587. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2588. Γöé Code Part  Γöé 26       Γöé 33       Γöé 40     Γöé
  2589. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2590. Γöé Character  Γöé 27       Γöé 34       Γöé 41     Γöé
  2591. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  2592.  
  2593. Entries in these sets need not be in sequence.  For example, an entry can be 
  2594. made in positions 28 through 34 without requiring an entry in positions 21 
  2595. through 27. Entries for record identification codes are not necessary if input 
  2596. records within a file are of the same type.  An input specification containing 
  2597. no record identification code defines the last record type for the file, thus 
  2598. allowing the handling of any record types that are undefined.  If no record 
  2599. identification codes are satisfied, control passes to the RPG/400 
  2600. exception/error handling routine. 
  2601.  
  2602.  
  2603. ΓòÉΓòÉΓòÉ 1.7.2.7.1. Positions 21-24, 28-31, and 35-38 (Position) ΓòÉΓòÉΓòÉ
  2604.  
  2605. Entry        Explanation 
  2606. Blank        No record identification code is present. 
  2607. 1-9999       The position that contains the record identification code in the 
  2608.              record. 
  2609.  
  2610. In these positions enter the position that contains the record identification 
  2611. code in each record.  The position containing the code must be within the 
  2612. record length specified for the file. This entry must be right-adjusted, but 
  2613. leading zeros can be omitted. 
  2614.  
  2615.  
  2616. ΓòÉΓòÉΓòÉ 1.7.2.7.2. Positions 25, 32, and 39 (Not) ΓòÉΓòÉΓòÉ
  2617.  
  2618. Entry        Explanation 
  2619. Blank        Record identification code must be present. 
  2620. N            Record identification code must not be present. 
  2621.  
  2622. Enter an N in this position if the code described must not be present in the 
  2623. specified record position. 
  2624.  
  2625.  
  2626. ΓòÉΓòÉΓòÉ 1.7.2.7.3. Positions 26, 33, and 40 (Code Part) ΓòÉΓòÉΓòÉ
  2627.  
  2628. Entry        Explanation 
  2629. C            Entire character 
  2630. Z            Zone portion of character 
  2631. D            Digit portion of character. 
  2632.  
  2633. This entry specifies what part of the character in the record identification 
  2634. code is to be tested. 
  2635.  
  2636.  
  2637. ΓòÉΓòÉΓòÉ 1.7.2.7.3.1. Character (C) ΓòÉΓòÉΓòÉ
  2638.  
  2639. The C entry indicates that the complete structure (zone and digit) of the 
  2640. character is to be tested. 
  2641.  
  2642.  
  2643. ΓòÉΓòÉΓòÉ 1.7.2.7.3.2. Zone (Z) ΓòÉΓòÉΓòÉ
  2644.  
  2645. The Z entry indicates that the zone portion of the character is to be tested. 
  2646. The zone entry causes the four high-order bits of the character entry (position 
  2647. 27) to be compared with the zone portion of the character in the record 
  2648. position specified in the position entry (positions 21 through 24). The 
  2649. following three special cases are exceptions: 
  2650.  
  2651.  The hexadecimal representation of an & (ampersand) is 50. However, when an 
  2652.   ampersand is coded in the character entry, it is treated as if its 
  2653.   hexadecimal representation were C0, that is, as if it had the same zone as A 
  2654.   through I.  An ampersand in the input data satisfies two zone checks: one for 
  2655.   a hexadecimal 5 zone, the other for a hexadecimal C zone. 
  2656.  
  2657.  The hexadecimal representation of a - (minus sign) is 60.  However, when a 
  2658.   minus sign is coded in the character entry, it is treated as if its 
  2659.   hexadecimal representation were D0, that is, as if it had the same zone as J 
  2660.   through R. A minus sign in the input data satisfies two zone checks: one for 
  2661.   a hexadecimal 6 zone, the other for a hexadecimal D zone. 
  2662.  
  2663.  The hexadecimal representation of a blank is 40. However, when a blank is 
  2664.   coded in the character entry, it is treated as if its hexadecimal 
  2665.   representation were F0, that is, as if it had the same zone as 0 through 9. A 
  2666.   blank in the input data satisfies two zone checks: one for a hexadecimal 4 
  2667.   zone, the other for a hexadecimal F zone. 
  2668.  
  2669.  
  2670. ΓòÉΓòÉΓòÉ 1.7.2.7.3.3. Digit (D) ΓòÉΓòÉΓòÉ
  2671.  
  2672. The D entry indicates that the digit portion of the character is to be tested. 
  2673. The four low-order bits of the character are compared with the character 
  2674. specified by the position entry. 
  2675.  
  2676.  
  2677. ΓòÉΓòÉΓòÉ 1.7.2.7.4. Positions 27, 34, and 41 (Character) ΓòÉΓòÉΓòÉ
  2678.  
  2679. In this position enter the identifying character that is to be compared with 
  2680. the character in the position specified in the input record. 
  2681.  
  2682. The check for record type always starts with the first record type specified. 
  2683. If data in a record satisfies more than one set of record identification codes, 
  2684. the first record type satisfied determines the record types. 
  2685.  
  2686. When more than one record type is specified for a file, the record 
  2687. identification codes should be coded so that each input record has a unique set 
  2688. of identification codes. 
  2689.  
  2690.  
  2691. ΓòÉΓòÉΓòÉ 1.7.2.7.5. AND Relationship ΓòÉΓòÉΓòÉ
  2692.  
  2693. The AND relationship is used when more than three record identification codes 
  2694. identify a record. 
  2695.  
  2696. To use the AND relationship, enter at least one record identification code on 
  2697. the first line and enter the remaining record identification codes on the 
  2698. following lines with AND coded in positions 14 through 16 for each additional 
  2699. line used.  Positions 7 through 13, 17 through 20, and 42 through 74 of each 
  2700. line with AND in positions 14 through 16 must be blank. Sequence, and 
  2701. record-identifying-indicator entries are made in the first line of the group 
  2702. and cannot be specified in the additional lines. 
  2703.  
  2704. An unlimited number of AND/OR lines can be used on the input specifications. 
  2705.  
  2706.  
  2707. ΓòÉΓòÉΓòÉ 1.7.2.7.6. OR Relationship ΓòÉΓòÉΓòÉ
  2708.  
  2709. The OR relationship is used when two or more record types have common fields. 
  2710.  
  2711. To use the OR relationship, enter OR in positions 14 and 15.  Positions 7 
  2712. through 13, 16 through 18, and 42 through 74 must be blank. A record 
  2713. identifying indicator can be entered in positions 19 and 20. If the indicator 
  2714. entry is made and the record identification codes on the OR line are satisfied, 
  2715. the indicator specified in positions 19 and 20 on that line is set on. If no 
  2716. indicator entry is made, the indicator on the preceding line is set on. 
  2717.  
  2718. An unlimited number of AND/OR lines can be used on the input specifications. 
  2719.  
  2720.  
  2721. ΓòÉΓòÉΓòÉ 1.7.2.8. Position 42 (Reserved) ΓòÉΓòÉΓòÉ
  2722.  
  2723. Position 42 must be blank. 
  2724.  
  2725.  
  2726. ΓòÉΓòÉΓòÉ 1.7.3. Field Description Entries ΓòÉΓòÉΓòÉ
  2727.  
  2728. The field description entries (positions 43 through 74) must follow the record 
  2729. identification entries (positions 7 through 42) for each file. 
  2730.  
  2731.  Position 43 (Data Format) 
  2732.  Positions 44-51 (Field Location) 
  2733.  Position 52 (Decimal Positions) 
  2734.  Positions 53-58 (Field Name) 
  2735.  Positions 59-60 (Control Level) 
  2736.  Positions 61-62 (Matching Fields) 
  2737.  Positions 63-64 (Field Record Relation) 
  2738.  Positions 65-70 (Field Indicators - Program Described) 
  2739.  Positions 71-74 (Reserved) 
  2740.  Positions 75-80 (Comments) 
  2741.  
  2742.  
  2743. ΓòÉΓòÉΓòÉ 1.7.3.1. Position 43 (Data Format) ΓòÉΓòÉΓòÉ
  2744.  
  2745. Entry        Explanation 
  2746. Blank        The input field is in zoned decimal format or is a character 
  2747.              field. 
  2748. P            The input field is in packed decimal format. 
  2749. B            The input field is in binary format. 
  2750. L            The numeric input field has a preceding (left) plus or minus sign. 
  2751. R            The number input field has a following (right) plus or minus sign. 
  2752.  
  2753. The entry in position 43 specifies the format of the data in the records in the 
  2754. file.  This entry has no effect on the format used for internal processing of 
  2755. the input field in the program. 
  2756.  
  2757. See Chapter 9 in the RPG/400* User's Guide for information on internal field 
  2758. formats. 
  2759.  
  2760.  
  2761. ΓòÉΓòÉΓòÉ 1.7.3.2. Positions 44-51 (Field Location) ΓòÉΓòÉΓòÉ
  2762.  
  2763. Entry                        Explanation 
  2764. Two 1- to 4-digit numbers    Beginning of a field (from) and end of a field 
  2765.                              (to). 
  2766.  
  2767. This entry describes the location and size of each field in the input record. 
  2768. Positions 44 through 47 specify the location of the field's beginning position; 
  2769. positions 48 through 51 specify the location of the field's end position.  To 
  2770. define a single-position field, enter the same number in positions 44 through 
  2771. 47 and in positions 48 through 51. Numeric entries must be right-adjusted; 
  2772. leading zeros can be omitted. 
  2773.  
  2774. The maximum number of positions in the input record for each type of field is 
  2775. as follows: 
  2776.  
  2777. Number of Positions           Type of Field 
  2778. 30                            Zoned decimal numeric (30 digits) 
  2779. 16                            Packed numeric (30 digits) 
  2780. 4                             Binary (9 digits) 
  2781. 256                           Character (256 characters) 
  2782. 31                            Numeric with leading or trailing sign (30 digits) 
  2783. 9999                          Data structure. 
  2784.  
  2785. For arrays, enter the beginning position of the array in positions 44 through 
  2786. 47 and the ending position in positions 48 through 51. The array length must be 
  2787. an integral multiple of the length of an element.  The From-To position does 
  2788. not have to account for all the elements in the array. The placement of data 
  2789. into the array starts with the first element. 
  2790.  
  2791.  
  2792. ΓòÉΓòÉΓòÉ 1.7.3.3. Position 52 (Decimal Positions) ΓòÉΓòÉΓòÉ
  2793.  
  2794. Entry        Explanation 
  2795. Blank        Character field 
  2796. 0-9          Number of decimal positions in numeric field. 
  2797.  
  2798. This entry, used with the data format entry in position 43, describes the 
  2799. format of the field. This entry indicates whether the field described on this 
  2800. line is a character field or a numeric field. If the field is numeric, an entry 
  2801. must be made.  The number of decimal positions specified for a numeric field 
  2802. cannot exceed the length of the field.  For an array or an array element, this 
  2803. entry must be the same as the entry made on the extension specifications 
  2804. (position 44 or 56) for the array. (If this entry is blank for a numeric array 
  2805. or array element, the decimal positions specified in the extension 
  2806. specification are used.) 
  2807.  
  2808.  
  2809. ΓòÉΓòÉΓòÉ 1.7.3.4. Positions 53-58 (Field Name) ΓòÉΓòÉΓòÉ
  2810.  
  2811. Entry             Explanation 
  2812. Symbolic name     Field name, data structure name, data structure subfield 
  2813.                   name, array name, array element, PAGE, PAGE1-PAGE7, *IN, 
  2814.                   *INxx, or *IN,xx. 
  2815.  
  2816. These positions name the fields of an input record that are used in an RPG/400 
  2817. program.  This name must follow the rules for symbolic names. 
  2818.  
  2819. To refer to an entire array on the input specifications, enter the array name 
  2820. in positions 53 through 58.  If an array name is entered in positions 53 
  2821. through 58, control level (positions 59 and 60), matching fields (positions 61 
  2822. and 62), and field indicators (positions 65 through 70) must be blank. 
  2823.  
  2824. To refer to an element of an array, specify the array name, followed by a 
  2825. comma, followed by an index.  The index is either a numeric field with zero 
  2826. decimal positions or the actual number of the array element to be used. The 
  2827. value of the index can vary from 1 to n, where n is the number of elements 
  2828. within the array. 
  2829.  
  2830.  
  2831. ΓòÉΓòÉΓòÉ 1.7.3.5. Positions 59-60 (Control Level) ΓòÉΓòÉΓòÉ
  2832.  
  2833. Entry        Explanation 
  2834. Blank        This field is not a control field. Control level indicators cannot 
  2835.              be used with full procedural files. 
  2836. L1-L9        This field is a control field. 
  2837.  
  2838. Positions 59 and 60 indicate the fields that are used as control fields.  A 
  2839. change in the contents of a control field causes all operations conditioned by 
  2840. that control level indicator and by all lower level indicators to be processed. 
  2841.  
  2842. A split control field is a control field that is made up of more than one 
  2843. field, each having the same control level indicator. The first field specified 
  2844. with that control level indicator is placed in the high-order position of the 
  2845. split control field, and the last field specified with the same control level 
  2846. indicator is placed in the low-order position of the split control field. 
  2847.  
  2848.  
  2849. ΓòÉΓòÉΓòÉ 1.7.3.6. Positions 61-62 (Matching Fields) ΓòÉΓòÉΓòÉ
  2850.  
  2851. Entry        Explanation 
  2852. Blank        This field is not a match field. 
  2853. M1-M9        This field is a match field. 
  2854.  
  2855. This entry is used to match the records of one file with those of another or to 
  2856. sequence check match fields within one file.  Match fields can be specified 
  2857. only for fields in primary and secondary files. 
  2858.  
  2859. Match fields within a record are designated by an M1 through M9 code entered in 
  2860. positions 61 and 62 of the appropriate field description specification line.  A 
  2861. maximum of nine match fields can be specified. 
  2862.  
  2863. The match field codes M1 through M9 can be assigned in any sequence.  For 
  2864. example, M3 can be defined on the line before M1, or M1 need not be defined at 
  2865. all. 
  2866.  
  2867. When more than one match field code is used for a record, all fields can be 
  2868. considered as one large field. M1 or the lowest code used is the rightmost or 
  2869. low-order position of the field. M9 or the highest code used is the leftmost or 
  2870. high-order position of the field. 
  2871.  
  2872. Entries in position 26 (alternate collating sequence) and position 43 (file 
  2873. translation) of the control specification can be used to alter the collating 
  2874. sequence for match fields. 
  2875.  
  2876. If match fields are specified for only a single sequential file (input, update, 
  2877. or combined), match fields within the file are sequence checked. The MR 
  2878. indicator is not set on and cannot be used in the program.  An out-of-sequence 
  2879. record causes the RPG/400 exception/error handling routine to be given control. 
  2880.  
  2881. In addition to sequence checking, match fields are used to match records from 
  2882. the primary file with those from secondary files. 
  2883.  
  2884.  
  2885. ΓòÉΓòÉΓòÉ 1.7.3.7. Positions 63-64 (Field Record Relation) ΓòÉΓòÉΓòÉ
  2886.  
  2887. Entry        Explanation 
  2888. Blank        The field is common to all record types. 
  2889. 01-99        General indicators. 
  2890. L1-L9        Control level indicators. 
  2891. MR           Matching record indicator. 
  2892. U1-U8        External indicators. 
  2893. H1-H9        Halt indicators. 
  2894. RT           Return indicator. 
  2895.  
  2896. Field record relation indicators are used to associate fields within a 
  2897. particular record type when that record type is one of several in an OR 
  2898. relationship. This entry reduces the number of lines that must be written. 
  2899.  
  2900. The field described on a line is extracted from the record by the RPG/400 
  2901. program only when the indicator coded in positions 63 and 64 is on or when 
  2902. positions 63 and 64 are blank. When positions 63 and 64 are blank, the field is 
  2903. common to all record types defined by the OR relationship. 
  2904.  
  2905. Field record relation indicators can be used with control level fields 
  2906. (positions 59 and 60) and matching fields (positions 61 and 62). 
  2907.  
  2908.  
  2909. ΓòÉΓòÉΓòÉ 1.7.3.8. Positions 65-70 (Field Indicators - Program Described) ΓòÉΓòÉΓòÉ
  2910.  
  2911. Entry        Explanation 
  2912. Blank        No indicator specified 
  2913. 01-99        General indicators 
  2914. H1-H9        Halt indicator 
  2915. U1-U8        External indicators 
  2916. RT           Return indicator. 
  2917.  
  2918. Entries in positions 65 through 70 test the status of a field or of an array 
  2919. element as it is read into the program.  Field indicators are specified on the 
  2920. same line as the field to be tested.  Depending on the status of the field 
  2921. (plus, minus, zero, or blank), the appropriate indicator is set on and can be 
  2922. used to condition later specifications. The same indicator can be specified in 
  2923. two positions, but it should not be used for all three positions.  Field 
  2924. indicators cannot be used with arrays that are not indexed or look-ahead 
  2925. fields. 
  2926.  
  2927. Positions 65 and 66 (plus) and positions 67 and 68 (minus) are valid for 
  2928. numeric fields only.  Positions 69 and 70 can be used to test a numeric field 
  2929. for zeros or a character field for blanks. 
  2930.  
  2931. The field indicators are set on if the field or array element meets the 
  2932. condition specified when the record is read.  Each field indicator is related 
  2933. to only one record type; therefore, the indicators are not reset (on or off) 
  2934. until the related record is read again or until the indicator is defined in 
  2935. some other specification. 
  2936.  
  2937.  
  2938. ΓòÉΓòÉΓòÉ 1.7.3.9. Positions 71-74 (Reserved) ΓòÉΓòÉΓòÉ
  2939.  
  2940. Positions 71 through 74 must be blank. 
  2941.  
  2942.  
  2943. ΓòÉΓòÉΓòÉ 1.7.3.10. Positions 75-80 (Comments) ΓòÉΓòÉΓòÉ
  2944.  
  2945. Positions 75 through 80 can be used for comments, or left blank. These 
  2946. positions are not printed contiguously with positions 6-74 on the compiler 
  2947. listing. 
  2948.  
  2949.  
  2950. ΓòÉΓòÉΓòÉ 1.7.4. Externally Described Files ΓòÉΓòÉΓòÉ
  2951.  
  2952.  Position 6 (Form Type) 
  2953.  Record Identification Entries 
  2954.  Field Description Entries 
  2955.  
  2956.  
  2957. ΓòÉΓòÉΓòÉ 1.7.4.1. Position 6 (Form Type) ΓòÉΓòÉΓòÉ
  2958.  
  2959. An I must appear in position 6 to identify this line as an input specifications 
  2960. statement. 
  2961.  
  2962.  
  2963. ΓòÉΓòÉΓòÉ 1.7.5. Record Identification Entries ΓòÉΓòÉΓòÉ
  2964.  
  2965.  Positions 7-14 (Record Name) 
  2966.  Positions 15-18 (Reserved) 
  2967.  Positions 19-20 (Record Identifying Indicator) 
  2968.  Positions 21-41 (Record Identification Code) 
  2969.  Positions 42-74 (Reserved) 
  2970.  Positions 75-80 (Comments) 
  2971.  
  2972. When the description of an externally described file is retrieved by the 
  2973. compiler, the record definitions are also retrieved.  To refer to the record 
  2974. definitions, specify the record format name in the input, calculation, and 
  2975. output specifications of the program.  Input specifications for an externally 
  2976. described file are required if: 
  2977.  
  2978.  Record identifying indicators are to be specified. 
  2979.  A field within a record is to be renamed for the program. 
  2980.  Control level or matching field indicators are to be used. 
  2981.  Field indicators are to be used. 
  2982.  
  2983. The field description specifications must immediately follow the record 
  2984. identification specification for an externally described file. 
  2985.  
  2986. A record line for an externally described file defines the beginning of the 
  2987. override specifications for the record.  All specifications following the 
  2988. record line are part of the record override until another record format name or 
  2989. file name is found in positions 7 through 14 of the input specifications.  All 
  2990. record lines that pertain to an externally described file must appear together; 
  2991. they cannot be mixed with entries for other files. 
  2992.  
  2993.  
  2994. ΓòÉΓòÉΓòÉ 1.7.5.1. Positions 7-14 (Record Name) ΓòÉΓòÉΓòÉ
  2995.  
  2996. Enter one of the following: 
  2997.  
  2998.  The external name of the record format. (The file name cannot be used for an 
  2999.   externally described file.) 
  3000.  The RPG/400 name specified by the RENAME option on the file description 
  3001.   specifications continuation line if the external record format was renamed. 
  3002.   A record format name can appear only once in positions 7 through 14 of the 
  3003.   input specifications for a program. 
  3004.  
  3005.  
  3006. ΓòÉΓòÉΓòÉ 1.7.5.2. Positions 15-18 (Reserved) ΓòÉΓòÉΓòÉ
  3007.  
  3008. Positions 15 through 18 must be blank. 
  3009.  
  3010.  
  3011. ΓòÉΓòÉΓòÉ 1.7.5.3. Positions 19-20 (Record Identifying Indicator) ΓòÉΓòÉΓòÉ
  3012.  
  3013. The specification of record identifying indicators in these positions is 
  3014. optional but, if present, follows the rules as described under Program 
  3015. Described Files except for look-ahead specifications, which are not allowed for 
  3016. an externally described file. 
  3017.  
  3018.  
  3019. ΓòÉΓòÉΓòÉ 1.7.5.4. Positions 21-41 (Record Identification Code) ΓòÉΓòÉΓòÉ
  3020.  
  3021. Positions 21 through 41 must be blank. Record format names are used to 
  3022. determine the record types used in an externally described file. 
  3023.  
  3024.  
  3025. ΓòÉΓòÉΓòÉ 1.7.5.5. Positions 42-74 (Reserved) ΓòÉΓòÉΓòÉ
  3026.  
  3027. Positions 42-74 must be blank. 
  3028.  
  3029.  
  3030. ΓòÉΓòÉΓòÉ 1.7.5.6. Positions 75-80 (Comments) ΓòÉΓòÉΓòÉ
  3031.  
  3032. Positions 75-80 can be used for comments, or left blank. These positions are 
  3033. not printed contiguously with positions 6-74 on the compiler listing. 
  3034.  
  3035.  
  3036. ΓòÉΓòÉΓòÉ 1.7.6. Field Description Entries ΓòÉΓòÉΓòÉ
  3037.  
  3038.  Positions 7-20 (Reserved) 
  3039.  Positions 21-30 (External Field Name) 
  3040.  Positions 31-52 (Reserved) 
  3041.  Positions 53-58 (Field Name) 
  3042.  Positions 59-60 (Control Level) 
  3043.  Positions 61-62 (Matching Fields) 
  3044.  Positions 63-64 (Reserved) 
  3045.  Positions 65-70 (Externally Described Field Indicators) 
  3046.  Positions 71-74 (Reserved) 
  3047.  Positions 75-80 (Comments) 
  3048.  
  3049. The field description specifications for an externally described file can be 
  3050. used to rename a field within a record for a program or to specify control 
  3051. level, field indicator, and match field functions.  The field definitions 
  3052. (attributes) are retrieved from the externally described file and cannot be 
  3053. changed by the program.  If the attributes of a field are not valid to an 
  3054. RPG/400 program (such as numeric length greater than 30 digits), the field 
  3055. cannot be used. Diagnostic checking is done on fields contained in an external 
  3056. record format in the same way as for source statements. 
  3057.  
  3058.  
  3059. ΓòÉΓòÉΓòÉ 1.7.6.1. Positions 7-20 (Reserved) ΓòÉΓòÉΓòÉ
  3060.  
  3061. Positions 7 through 20 must be blank. 
  3062.  
  3063.  
  3064. ΓòÉΓòÉΓòÉ 1.7.6.2. Positions 21-30 (External Field Name) ΓòÉΓòÉΓòÉ
  3065.  
  3066. If a field within a record in an externally described file is to be renamed, 
  3067. enter the external name of the field in these positions.  A field may have to 
  3068. be renamed because the external name is longer than 6 characters or because the 
  3069. name is the same as a field name specified in the program and two different 
  3070. names are required. 
  3071.  
  3072.  
  3073. ΓòÉΓòÉΓòÉ 1.7.6.3. Positions 31-52 (Reserved) ΓòÉΓòÉΓòÉ
  3074.  
  3075. Positions 31 through 52 must be blank. 
  3076.  
  3077.  
  3078. ΓòÉΓòÉΓòÉ 1.7.6.4. Positions 53-58 (Field Name) ΓòÉΓòÉΓòÉ
  3079.  
  3080. The field name entry is made only when it is required for the RPG/400 function 
  3081. (such as control levels) added to the external description.  The field name 
  3082. entry contains one of the following: 
  3083.  
  3084.  The name of the field as defined in the external record description (if 6 
  3085.   characters or less). 
  3086.  The name specified to be used in the program that replaced the external name 
  3087.   specified in positions 21 through 30. 
  3088.  
  3089. The field name must follow the rules for using symbolic names. 
  3090.  
  3091.  
  3092. ΓòÉΓòÉΓòÉ 1.7.6.5. Positions 59-60 (Control Level) ΓòÉΓòÉΓòÉ
  3093.  
  3094. This entry indicates whether the field is to be used as a control field in the 
  3095. program. 
  3096.  
  3097. Entry        Explanation 
  3098. Blank        This field is not a control field. 
  3099. L1-L9        This field is a control field. 
  3100.  
  3101. Note:   For externally described files, split control fields are combined in 
  3102. the order in which the fields are specified on the data description 
  3103. specifications (DDS), not in the order in which the fields are specified on the 
  3104. input specifications. 
  3105.  
  3106.  
  3107. ΓòÉΓòÉΓòÉ 1.7.6.6. Positions 61-62 (Matching Fields) ΓòÉΓòÉΓòÉ
  3108.  
  3109. This entry indicates whether the field is to be used as a match field. 
  3110.  
  3111. Entry        Explanation 
  3112. Blank        This field is not a match field. 
  3113. M1-M9        This field is a match field. 
  3114.  
  3115. See Positions 61-62 (Matching Fields) for more information on match fields. 
  3116.  
  3117.  
  3118. ΓòÉΓòÉΓòÉ 1.7.6.7. Positions 63-64 (Reserved) ΓòÉΓòÉΓòÉ
  3119.  
  3120. Positions 63 and 64 must be blank. 
  3121.  
  3122.  
  3123. ΓòÉΓòÉΓòÉ 1.7.6.8. Positions 65-70 (Externally Described Field Indicators) ΓòÉΓòÉΓòÉ
  3124.  
  3125. Entry        Explanation 
  3126. Blank        No indicator specified 
  3127. 01-99        General indicators 
  3128. H1-H9        Halt indicators 
  3129. U1-U8        External indicators 
  3130. RT           Return indicator. 
  3131.  
  3132. See Positions 65-70 (Field Indicators - Program Described) for more 
  3133. information. 
  3134.  
  3135.  
  3136. ΓòÉΓòÉΓòÉ 1.7.6.9. Positions 71-74 (Reserved) ΓòÉΓòÉΓòÉ
  3137.  
  3138. Positions 71 through 74 must be blank. 
  3139.  
  3140.  
  3141. ΓòÉΓòÉΓòÉ 1.7.6.10. Positions 75-80 (Comments) ΓòÉΓòÉΓòÉ
  3142.  
  3143. Positions 75 through 80 can be used for comments, or left blank. These 
  3144. positions are not printed contiguously with positions 6-74 on the compiler 
  3145. listing. 
  3146.  
  3147.  
  3148. ΓòÉΓòÉΓòÉ 1.7.7. Data Structure Specifications ΓòÉΓòÉΓòÉ
  3149.  
  3150. A data structure can be used to: 
  3151.  
  3152.  Allow the division of a field into subfields without using the MOVE or MOVEL 
  3153.   operations. 
  3154.  Operate on a subfield and change the contents of a subfield. 
  3155.  Redefine the same internal area more than once using different data formats. 
  3156.  
  3157. Data structures are defined on the input specifications the same way records 
  3158. are defined. The record specification line contains the data structure 
  3159. statement (DS in positions 19 and 20) and the data structure name (optional). 
  3160. The field specification lines contain the subfield specifications for the data 
  3161. structure. 
  3162.  
  3163. Data structure specifications must follow the input specifications for records. 
  3164. All entries describing a data structure and its subfields must appear together. 
  3165.  
  3166. For more detail see Data Structure Specification Entries. 
  3167.  
  3168.  
  3169. ΓòÉΓòÉΓòÉ 1.7.8. Data Structure Specification Entries ΓòÉΓòÉΓòÉ
  3170.  
  3171.  Position 6 (Form Type) 
  3172.  Positions 7-12 (Data Structure Name) 
  3173.  Positions 13-16 (Reserved) 
  3174.  Position 17 (External Description) 
  3175.  Position 18 (Option) 
  3176.  Positions 19-20 (Record Identifying Indicator) 
  3177.  Positions 21-30 (External File Name) 
  3178.  Positions 31-43 (Reserved) 
  3179.  Positions 44-47 (Data Structure Occurrences) 
  3180.  Positions 48-51 (Length) 
  3181.  Positions 52-74 (Reserved) 
  3182.  Positions 75-80 (Comments) 
  3183.  
  3184.  
  3185. ΓòÉΓòÉΓòÉ 1.7.8.1. Position 6 (Form Type) ΓòÉΓòÉΓòÉ
  3186.  
  3187. Position 6 must contain an I for input specifications. 
  3188.  
  3189.  
  3190. ΓòÉΓòÉΓòÉ 1.7.8.2. Positions 7-12 (Data Structure Name) ΓòÉΓòÉΓòÉ
  3191.  
  3192. Positions 7 through 12 can contain the name of the data structure being 
  3193. defined. The data structure name is optional, and is limited to 6 characters. 
  3194. A data structure name must follow the rules for using symbolic names. A data 
  3195. structure name can be specified anywhere a character field can be specified. If 
  3196. the data structure is externally described and positions 21-30 are blank, this 
  3197. entry must contain the name of an externally described file. 
  3198.  
  3199.  
  3200. ΓòÉΓòÉΓòÉ 1.7.8.3. Positions 13-16 (Reserved) ΓòÉΓòÉΓòÉ
  3201.  
  3202. Positions 13 through 16 must be blank. 
  3203.  
  3204.  
  3205. ΓòÉΓòÉΓòÉ 1.7.8.4. Position 17 (External Description) ΓòÉΓòÉΓòÉ
  3206.  
  3207. Entry        Explanation 
  3208. Blank        Subfield definitions for this data structure follow this 
  3209.              specification. 
  3210. E            Subfield definitions are described externally. Positions 7 through 
  3211.              12 must contain the name of an externally described file if 
  3212.              positions 21 through 30 are blank.  The file name must be limited 
  3213.              to 6 characters. 
  3214.  
  3215.  
  3216. ΓòÉΓòÉΓòÉ 1.7.8.5. Position 18 (Option) ΓòÉΓòÉΓòÉ
  3217.  
  3218. Entry        Explanation 
  3219. Blank        This data structure is not a program status or data area data 
  3220.              structure, and this data structure is not globally initialized. 
  3221. I            Data structure initialization. All subfields in the data structure 
  3222.              are initialized; characters to blank, numerics to zero, in the 
  3223.              order in which they are defined, during program initialization. 
  3224. S            This data structure is the program status data structure.  Only 
  3225.              one data structure can be specified as the program status data 
  3226.              structure. 
  3227. U            This is a data area data structure. The external data area (named 
  3228.              in positions 7 through 12) is retrieved when the program starts 
  3229.              and rewritten when the program ends. If you put blanks in 
  3230.              positions 7 through 12, the local data area is used. 
  3231.  
  3232.  
  3233. ΓòÉΓòÉΓòÉ 1.7.8.6. Positions 19-20 (Record Identifying Indicator) ΓòÉΓòÉΓòÉ
  3234.  
  3235. Positions 19 and 20 must contain DS to indicate a data structure. 
  3236.  
  3237.  
  3238. ΓòÉΓòÉΓòÉ 1.7.8.7. Positions 21-30 (External File Name) ΓòÉΓòÉΓòÉ
  3239.  
  3240. Entry        Explanation 
  3241. Blank        The data structure subfields are defined in the program. 
  3242. File name    This is the name of the file whose first record format contains 
  3243.              the field descriptions used as the subfield descriptions for this 
  3244.              data structure. 
  3245.  
  3246.  
  3247. ΓòÉΓòÉΓòÉ 1.7.8.8. Positions 31-43 (Reserved) ΓòÉΓòÉΓòÉ
  3248.  
  3249. Positions 31 through 43 must be blank. 
  3250.  
  3251.  
  3252. ΓòÉΓòÉΓòÉ 1.7.8.9. Positions 44-47 (Data Structure Occurrences) ΓòÉΓòÉΓòÉ
  3253.  
  3254. Entry        Explanation 
  3255. Blank        This is not a multiple-occurrence data structure. 
  3256. 1-9999       The number (right-adjusted) indicating the number of occurrences 
  3257.              of a multiple-occurrence data structure. 
  3258.  
  3259. These positions must be blank if the data structure is the program status data 
  3260. structure (indicated by an S in position 18), a file information data structure 
  3261. (INFDS), or a data area data structure. 
  3262.  
  3263.  
  3264. ΓòÉΓòÉΓòÉ 1.7.8.10. Positions 48-51 (Length) ΓòÉΓòÉΓòÉ
  3265.  
  3266. Entry        Explanation 
  3267. Blank        Length of the data structure is either the length specified on the 
  3268.              input field specifications if the data structure is an input field 
  3269.              or the highest To position specified for a subfield within the 
  3270.              data structure if the data structure is not an input field. 
  3271. 1-9999       Length of the data structure. 
  3272.  
  3273. The length of the data structure can be specified in positions 48 through 51. 
  3274. This entry is optional but, if used, must be right-adjusted.  If this entry is 
  3275. not made, the length of the data structure is one of the following: 
  3276.  
  3277.  The length specified on the input field specifications if the data structure 
  3278.   name is an input field. 
  3279.  The highest To position specified for a subfield within the data structure if 
  3280.   the data structure name is not an input field. 
  3281.  
  3282.  
  3283. ΓòÉΓòÉΓòÉ 1.7.8.11. Positions 52-74 (Reserved) ΓòÉΓòÉΓòÉ
  3284.  
  3285. Positions 52 through 74 must be blank. 
  3286.  
  3287.  
  3288. ΓòÉΓòÉΓòÉ 1.7.8.12. Positions 75-80 (Comments) ΓòÉΓòÉΓòÉ
  3289.  
  3290. Positions 75 through 80 may be used for comments or left blank. These positions 
  3291. are not printed contiguously with positions 6-74 on the compiler listing. 
  3292.  
  3293.  
  3294. ΓòÉΓòÉΓòÉ 1.7.9. Data Structure Subfield Specifications ΓòÉΓòÉΓòÉ
  3295.  
  3296. Specifications for subfields, if used, must follow the data structure 
  3297. specification statement to which they apply. 
  3298.  
  3299.  Position 7 (Reserved) 
  3300.  Position 8 (Initialization Option) 
  3301.  Positions 9-20 (Reserved) 
  3302.  Positions 21-30 (External Field Name) 
  3303.  Positions 21-42 (Initialization Value) 
  3304.  Positions 31-42 (Reserved) 
  3305.  Position 43 (Internal Data Format) 
  3306.  Positions 44-51 (Field Location) 
  3307.  Position 52 (Decimal Positions) 
  3308.  Positions 53-58 (Field Name) 
  3309.  Positions 59-74 (Reserved) 
  3310.  Positions 75-80 (Comments) 
  3311.  
  3312.  
  3313. ΓòÉΓòÉΓòÉ 1.7.9.1. Position 7 (Reserved) ΓòÉΓòÉΓòÉ
  3314.  
  3315. Position 7 must be blank. 
  3316.  
  3317.  
  3318. ΓòÉΓòÉΓòÉ 1.7.9.2. Position 8 (Initialization Option) ΓòÉΓòÉΓòÉ
  3319.  
  3320. Entry        Explanation 
  3321. Blank        No subfield initialization. 
  3322. I            Subfield is initialized to value specified in positions 21 to 42. 
  3323.  
  3324.  
  3325. ΓòÉΓòÉΓòÉ 1.7.9.3. Positions 9-20 (Reserved) ΓòÉΓòÉΓòÉ
  3326.  
  3327. Positions 9 through 20 must be blank. 
  3328.  
  3329.  
  3330. ΓòÉΓòÉΓòÉ 1.7.9.4. Positions 21-30 (External Field Name) ΓòÉΓòÉΓòÉ
  3331.  
  3332. To rename a subfield in an externally described data structure, specify the 
  3333. external name in positions 21 through 30, and specify the name to be used in 
  3334. the program in positions 53 through 58.  The remaining positions must be blank. 
  3335.  
  3336.  
  3337. ΓòÉΓòÉΓòÉ 1.7.9.5. Positions 21-42 (Initialization Value) ΓòÉΓòÉΓòÉ
  3338.  
  3339. If a subfield is to be initialized, specify a literal value or a named constant 
  3340. in these positions.  If no value is specified and position 8 contains I, the 
  3341. subfield is initialized to zero or blanks, depending on the field type. The 
  3342. value may be continued on the next line. See Named Constant Continuation 
  3343. Specifications for more information on continuation. 
  3344.  
  3345. See the RPG/400* User's Guide for more information on how to specify the 
  3346. initialization value. 
  3347.  
  3348.  
  3349. ΓòÉΓòÉΓòÉ 1.7.9.6. Positions 31-42 (Reserved) ΓòÉΓòÉΓòÉ
  3350.  
  3351. Positions 31 through 42 must be blank, if an external field name is specified 
  3352. in positions 21 to 30. 
  3353.  
  3354.  
  3355. ΓòÉΓòÉΓòÉ 1.7.9.7. Position 43 (Internal Data Format) ΓòÉΓòÉΓòÉ
  3356.  
  3357. Entry        Explanation 
  3358. Blank        Subfield is in zoned decimal format or is character data if 
  3359.              position 52 is blank. 
  3360. P            Subfield is in packed decimal format. 
  3361. B            Subfield is in binary format. 
  3362.  
  3363. Note:   Unlike the external data format field, the entry determines the 
  3364.         internal format of the data. 
  3365.  
  3366.  
  3367. ΓòÉΓòÉΓòÉ 1.7.9.8. Positions 44-51 (Field Location) ΓòÉΓòÉΓòÉ
  3368.  
  3369. Entry                         Explanation 
  3370. Two 1- to 4-digit numbers     Beginning of a subfield (from) and end of a 
  3371.                               subfield (to). 
  3372. Keywords                      For the program status data structure or for a 
  3373.                               file information data structure, special keywords 
  3374.                               define the location of the subfields in the data 
  3375.                               structures. Keywords for the program status data 
  3376.                               structure are *STATUS, *PROGRAM, *PARMS, and 
  3377.                               *ROUTINE. Keywords for the file information data 
  3378.                               structure are *FILE, *RECORD, *OPCODE, *STATUS, 
  3379.                               and *ROUTINE. 
  3380.  
  3381. Positions 44-47 are the From position.  Positions 48-51 are the To position. 
  3382. Both From and To must be right-justified, and leading zeroes may be omitted. 
  3383.  
  3384.  
  3385. ΓòÉΓòÉΓòÉ 1.7.9.9. Position 52 (Decimal Positions) ΓòÉΓòÉΓòÉ
  3386.  
  3387. Entry        Explanation 
  3388. Blank        Character subfield 
  3389. 0-9          Number of decimal positions in a numeric subfield. 
  3390.  
  3391. Position 52, along with position 43, determines the format of the subfield.  An 
  3392. entry must be made in position 52 for a numeric subfield. 
  3393.  
  3394.  
  3395. ΓòÉΓòÉΓòÉ 1.7.9.10. Positions 53-58 (Field Name) ΓòÉΓòÉΓòÉ
  3396.  
  3397. In positions 53 through 58, enter the name of the subfield that is being 
  3398. defined. The name can be an array name, but cannot be an array element name. 
  3399.  
  3400.  
  3401. ΓòÉΓòÉΓòÉ 1.7.9.11. Positions 59-74 (Reserved) ΓòÉΓòÉΓòÉ
  3402.  
  3403. Positions 59 through 74 must be blank. 
  3404.  
  3405.  
  3406. ΓòÉΓòÉΓòÉ 1.7.9.12. Positions 75-80 (Comments) ΓòÉΓòÉΓòÉ
  3407.  
  3408. Positions 75 through 80 can be used for comments, or left blank. These 
  3409. positions are not printed contiguously with positions 6-74 on the compiler 
  3410. listing. 
  3411.  
  3412.  
  3413. ΓòÉΓòÉΓòÉ 1.7.10. Named Constant Specifications ΓòÉΓòÉΓòÉ
  3414.  
  3415.  Positions 7-20 (Reserved) 
  3416.  Positions 21-42 (Constant) 
  3417.  Position 43 (Data Type) 
  3418.  Positions 44-52 (Reserved) 
  3419.  Positions 53-58 (Constant Name) 
  3420.  Positions 59-74 (Reserved) 
  3421.  
  3422.  
  3423. ΓòÉΓòÉΓòÉ 1.7.10.1. Positions 7-20 (Reserved) ΓòÉΓòÉΓòÉ
  3424.  
  3425. Positions 7 through 20 must be blank. 
  3426.  
  3427.  
  3428. ΓòÉΓòÉΓòÉ 1.7.10.2. Positions 21-42 (Constant) ΓòÉΓòÉΓòÉ
  3429.  
  3430. In positions 21-42 enter the constant or edit word being declared. The constant 
  3431. may be continued on subsequent lines by coding a hyphen as the last character. 
  3432. For character named constants the hyphen replaces the ending quote. A continued 
  3433. numeric constant must result in a valid decimal number with at most 30 digits, 
  3434. a maximum of 9 being to the right of the decimal point. Named constants can be 
  3435. declared anywhere in the input specifications. 
  3436.  
  3437.  
  3438. ΓòÉΓòÉΓòÉ 1.7.10.3. Position 43 (Data Type) ΓòÉΓòÉΓòÉ
  3439.  
  3440. Entry        Explanation 
  3441. C            Type of name is constant 
  3442. Blank        Constant continuation line 
  3443.  
  3444.  
  3445. ΓòÉΓòÉΓòÉ 1.7.10.4. Positions 44-52 (Reserved) ΓòÉΓòÉΓòÉ
  3446.  
  3447. Positions 44-52 must be blank. 
  3448.  
  3449.  
  3450. ΓòÉΓòÉΓòÉ 1.7.10.5. Positions 53-58 (Constant Name) ΓòÉΓòÉΓòÉ
  3451.  
  3452. Positions 53-58 contain the name of the constant. The normal rules for RPG/400 
  3453. names apply. 
  3454.  
  3455.  
  3456. ΓòÉΓòÉΓòÉ 1.7.10.6. Positions 59-74 (Reserved) ΓòÉΓòÉΓòÉ
  3457.  
  3458. Positions 59-74 must be blank. 
  3459.  
  3460.  
  3461. ΓòÉΓòÉΓòÉ 1.7.11. Named Constant Continuation Specifications ΓòÉΓòÉΓòÉ
  3462.  
  3463.  Positions 7-20 (Reserved) 
  3464.  Positions 21-42 (Constant) 
  3465.  Positions 43-74 (Reserved) 
  3466.  
  3467.  
  3468. ΓòÉΓòÉΓòÉ 1.7.11.1. Positions 7-20 (Reserved) ΓòÉΓòÉΓòÉ
  3469.  
  3470. Positions 7 through 20 must be blank. 
  3471.  
  3472. See Named Constant Examples 
  3473.  
  3474.  
  3475. ΓòÉΓòÉΓòÉ 1.7.11.2. Positions 21-42 (Constant) ΓòÉΓòÉΓòÉ
  3476.  
  3477. In positions 21-42 enter the constant or edit word being continued. A character 
  3478. or transparent literal constant may be continued over as many lines as desired 
  3479. so long as the total length of the constant does not exceed 256 characters. A 
  3480. continued numeric constant must result in a valid decimal number with at most 
  3481. 30 digits, a maximum of 9 being to the right of the decimal point. 
  3482.  
  3483. See Named Constant Examples 
  3484.  
  3485.  
  3486. ΓòÉΓòÉΓòÉ 1.7.11.3. Positions 43-74 (Reserved) ΓòÉΓòÉΓòÉ
  3487.  
  3488. Positions 43-74 must be blank. 
  3489.  
  3490. See Named Constant Examples 
  3491.  
  3492.  
  3493. ΓòÉΓòÉΓòÉ 1.7.11.3.1. Named Constant Examples ΓòÉΓòÉΓòÉ
  3494.  
  3495.  
  3496. Named Constant Examples
  3497.  
  3498. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  3499. I..............Namedconstant+++++++++C.........Fldnme.............
  3500. I*
  3501. I*The following is an example of a character constant:
  3502. I              'MICKEY'              C         MOUSE
  3503. I*
  3504. I*The following is an example of a continued character constant:
  3505. I*
  3506. I              'ABCDEF-              C         CHAR
  3507. I              'GHIJK'
  3508. I*
  3509. I*The following is an example of a numeric constant:
  3510. I*
  3511. I              123456789             C         INTEGER
  3512. I*
  3513. I*
  3514. I*The following is an example of a continued numeric constant:
  3515. I*
  3516. I              123456-               C         NUM
  3517. I              789
  3518. I*
  3519. I*The following is an example of a hexadecimal constant:
  3520. I*
  3521. I              X'010203'             C         HEX1
  3522. I*
  3523. I*The following is an example of a continued hexadecimal constant:
  3524. I*
  3525. I              X'010-                C         HEX2
  3526. I              '202'
  3527. I*
  3528. I*The following is an example of a continued transparent
  3529. I*constant.  The Shift Out (SO) and Shift In (SI) characters
  3530. I*are represented by o and i.  The value of the combined literal
  3531. I*is 'oK1K2K3K4K5i' if the transparent literal option is specified
  3532. I*(1 in position 57 of the control specification).
  3533. I*
  3534. I              'oK1K2K3i-            C         TRANS
  3535. I              'oK4K5i'
  3536.  
  3537.  
  3538. ΓòÉΓòÉΓòÉ 1.8. Calculation Specifications ΓòÉΓòÉΓòÉ
  3539.  
  3540. Calculation specifications indicate the operations to be done on the data in a 
  3541. program.  Two general rules govern the writing of calculation entries: 
  3542.  
  3543.  Each operation is specified on one line, except when there are AND/OR lines 
  3544.   in the calculation. 
  3545.  Calculation entries must be grouped in the following order: 
  3546.  
  3547.    - Detail calculations 
  3548.    - Total calculations 
  3549.    - Subroutines. 
  3550.  
  3551. Calculations within the groups must be specified in the order in which they are 
  3552. to be done. 
  3553.  
  3554. Each calculation specifications statement is divided into three parts that 
  3555. specify the following: 
  3556.  
  3557.  When calculations are to be done:  The conditioning indicators specified in 
  3558.   positions 7 through 17 determine when and under what conditions the 
  3559.   calculations are to be done. 
  3560.  What kind of calculations are to be done:  The entries specified in positions 
  3561.   18 through 53 determine the kind of calculations to be done, specify the data 
  3562.   (such as fields or files) upon which the operation is to be done, and specify 
  3563.   the field that is to contain the results of the calculation. 
  3564.  What tests are to be made on the results of the operation: Indicators 
  3565.   specified in positions 54 through 59 are used to test the results of the 
  3566.   calculations and can condition subsequent calculations or output operations. 
  3567.   The resulting indicator positions have various uses, depending on the 
  3568.   operation code. 
  3569.  
  3570. The calculation specifications are entered on the RPG/400 Calculation 
  3571. Specifications. See Operation Codes for details on how these positions must be 
  3572. specified for individual calculation operations. 
  3573.  
  3574. The calculation specification can also be used to enter SQL statements into an 
  3575. RPG/400 program. See RPG/400* User's Guide and SQL/400* Reference for more 
  3576. information. 
  3577.  
  3578.  
  3579. ΓòÉΓòÉΓòÉ 1.8.1. Calculation Specification Statement ΓòÉΓòÉΓòÉ
  3580.  
  3581.  Position 6 (Form Type) 
  3582.  Positions 7-8 (Control Level) 
  3583.  
  3584.    - Control Level Indicators 
  3585.    - Last Record Indicator 
  3586.    - Subroutine Identifier 
  3587.    - AND/OR Lines Identifier 
  3588.  
  3589.  Positions 9-17 (Indicators) 
  3590.  Positions 18-27 (Factor 1) 
  3591.  Positions 28-32 (Operation) 
  3592.  Positions 33-42 (Factor 2) 
  3593.  Positions 43-48 (Result Field) 
  3594.  Positions 49-51 (Field Length) 
  3595.  Position 52 (Decimal Positions) 
  3596.  Position 53 (Operation Extender) 
  3597.  Positions 54-59 (Resulting Indicators) 
  3598.  Positions 60-74 (Comments) 
  3599.  Positions 75-80 (Comments) 
  3600.  
  3601.  
  3602. ΓòÉΓòÉΓòÉ 1.8.1.1. Position 6 (Form Type) ΓòÉΓòÉΓòÉ
  3603.  
  3604. A C must appear in position 6 to identify this line as a calculation 
  3605. specifications statement. 
  3606.  
  3607.  
  3608. ΓòÉΓòÉΓòÉ 1.8.1.2. Positions 7-8 (Control Level) ΓòÉΓòÉΓòÉ
  3609.  
  3610. Entry        Explanation 
  3611. Blank        The calculation operation is done at detail calculation time for 
  3612.              each program cycle if the indicators in positions 9 through 17 
  3613.              allow it; or the calculation is part of a subroutine. 
  3614. L0           The calculation operation is done at total calculation time for 
  3615.              each program cycle. 
  3616. L1-L9        The calculation operation is done when the appropriate control 
  3617.              break occurs at total calculation time, or when the indicator is 
  3618.              set on. 
  3619. LR           The calculation operation is done after the last record has been 
  3620.              processed or after the LR indicator has been set on. 
  3621. SR           The calculation operation is part of an RPG/400 subroutine.  A 
  3622.              blank entry is also valid for calculations that are part of a 
  3623.              subroutine. 
  3624. AN, OR       Indicators on more than one line condition the calculation. 
  3625.  
  3626.  
  3627. ΓòÉΓòÉΓòÉ 1.8.1.2.1. Control Level Indicators ΓòÉΓòÉΓòÉ
  3628.  
  3629. The L0 entry is used in positions 7 and 8 to indicate that the calculation is 
  3630. to be done during total time and is not dependent on the occurrence of a 
  3631. control break. 
  3632.  
  3633. If indicators L1 through L9 are specified in positions 7 and 8, the calculation 
  3634. is processed at total time only when the specified indicator is on.  Remember 
  3635. that, if L1 through L9 are set on by a control break, all lower level 
  3636. indicators are also set on.  If positions 7 and 8 are blank, the calculation is 
  3637. done at detail time, is a statement within a subroutine, or is a declarative 
  3638. statement. 
  3639.  
  3640. The following operations can be specified within total calculations with 
  3641. positions 7 and 8 blank: PLIST, PARM, KLIST, KFLD, TAG, DEFN, and ELSE. 
  3642. (Conditioning indicators in positions 9 through 17 are not allowed with these 
  3643. operations.) In addition, all the preceding operations except TAG and ELSE can 
  3644. be specified anywhere within the calculations, even between an ENDSR operation 
  3645. of one subroutine and the BEGSR operation of the next subroutine or after the 
  3646. ENDSR operation for the last subroutine. 
  3647.  
  3648.  
  3649. ΓòÉΓòÉΓòÉ 1.8.1.2.2. Last Record Indicator ΓòÉΓòÉΓòÉ
  3650.  
  3651. The LR Indicator, if specified in positions 7 and 8, causes the calculation to 
  3652. be done during the last total time. 
  3653.  
  3654. If there is a primary file but no secondary files in the program, the LR 
  3655. indicator is set on after the last input record has been read, the calculations 
  3656. specified for the record have been done, and the detail output for the last 
  3657. record read has been completed. 
  3658.  
  3659. If there is more than one input file (primary and secondary), the RPG/400 
  3660. programmer determines which files are to be checked for end-of-file by entering 
  3661. an E in position 17 of the file description specifications. LR is set on when 
  3662. all files with an end-of-file specification have been completely read, when 
  3663. detail output for the last record in these files has been completed, and after 
  3664. all matching secondary records have been processed. 
  3665.  
  3666. When the LR indicator is set on after the last input record has been read, the 
  3667. control level indicators L1 through L9 are also set on.  If the indicators L1 
  3668. through L9 have not been defined by an entry in positions 59 and 60 of the 
  3669. input specifications or by *INxx when used in a result field, the indicators 
  3670. are set on when LR is on, but they cannot be used in other specifications. 
  3671.  
  3672.  
  3673. ΓòÉΓòÉΓòÉ 1.8.1.2.3. Subroutine Identifier ΓòÉΓòÉΓòÉ
  3674.  
  3675. An SR entry in positions 7 and 8 indicates that the specification is part of a 
  3676. subroutine.  The SR entry is not required. Subroutine lines must appear after 
  3677. the total calculation specifications.  The operation codes BEGSR and ENDSR 
  3678. serve as delimiters for a subroutine. 
  3679.  
  3680.  
  3681. ΓòÉΓòÉΓòÉ 1.8.1.2.4. AND/OR Lines Identifier ΓòÉΓòÉΓòÉ
  3682.  
  3683. Positions 7 and 8 can contain AN or OR to define additional indicators 
  3684. (positions 9 through 17) for a calculation.  Indicators in positions 9 through 
  3685. 17 contained in one line are always in an AND relationship. Indicators 
  3686. contained on more than one line can be a combination of AND and OR 
  3687. relationships.  A maximum of seven AND/OR lines can be specified in one group. 
  3688.  
  3689. The entry in positions 7 and 8 of the line immediately preceding an AND/OR line 
  3690. or a group of AND/OR lines determines when the calculation is to be processed. 
  3691. The entry in positions 7 and 8 on the first line of a group applies to all 
  3692. AND/OR lines in the group.  A control level indicator (L1 through L9, L0, or 
  3693. LR) is entered for total calculations, an SR or blanks for subroutines, and a 
  3694. blank for detail calculations. 
  3695.  
  3696.  
  3697. ΓòÉΓòÉΓòÉ 1.8.1.3. Positions 9-17 (Indicators) ΓòÉΓòÉΓòÉ
  3698.  
  3699. Entry            Explanation 
  3700. Blank            The operation is processed on every record if the condition 
  3701.                  specified in positions 7 and 8 is satisfied. 
  3702. 01-99            General indicators. 
  3703. KA-KN, KP-KY     Function key indicators. 
  3704. L1-L9            Control level indicators. 
  3705. LR               Last record indicator. 
  3706. MR               Matching record indicator. 
  3707. H1-H9            Halt indicators. 
  3708. RT               Return indicator. 
  3709. U1-U8            External indicators. 
  3710. OA-OG, OV        Overflow indicator. 
  3711.  
  3712. Positions 10 and 11, 13 and 14, and 16 and 17 contain indicators that are 
  3713. tested to determine if a particular calculation is to be processed. A blank in 
  3714. positions 9, 12, and 15 designates that the indicator must be on for a 
  3715. calculation to be done. An N in positions 9, 12, and 15 designates that the 
  3716. associated indicator must be off for a calculation to be done. 
  3717.  
  3718. One to three indicators can be entered in positions 9 through 17 on one line. 
  3719. Indicators on the same line are in an AND relationship.  The AND relationship 
  3720. means that all three indicator conditions must be satisfied before the 
  3721. calculation can take place. If fewer than three indicators are specified, 
  3722. entries need not be made in sequence; that is, an indicator can be specified in 
  3723. positions 16 and 17, and positions 10 through 15 can be blank. When more than 
  3724. three indicators are needed to condition a calculation, AND/OR must be used. 
  3725. Seven is the maximum number of AND/OR lines that can be specified on 
  3726. calculation specifications. Positions 9 through 17 can contain a combination of 
  3727. the type of indicators discussed in the preceding text. 
  3728.  
  3729.  
  3730. ΓòÉΓòÉΓòÉ 1.8.1.4. Positions 18-27 (Factor 1) ΓòÉΓòÉΓòÉ
  3731.  
  3732. Factor 1 names a field or gives actual data (literals) or RPG/400 special words 
  3733. (*NAMVAR DEFN) on which an operation is to be done. The entry must begin in 
  3734. position 18. The entries that are valid for factor 1 depend on the operation 
  3735. code specified in positions 28 through 32. For the specific entries for factor 
  3736. 1 for a particular operation code, see Operation Codes. With some operation 
  3737. codes, a colon can be used to separate parts of the factor, but must be 
  3738. preceded by and followed by a valid entry. 
  3739.  
  3740.  
  3741. ΓòÉΓòÉΓòÉ 1.8.1.5. Positions 28-32 (Operation) ΓòÉΓòÉΓòÉ
  3742.  
  3743. Positions 28 through 32 specify the kind of operation to be done using factor 
  3744. 1, factor 2, and the result field entries.  The operation code must begin in 
  3745. position 28. For further information on the operation codes, see Operation 
  3746. Codes. For a list of the operation codes, see Operation Codes List. 
  3747.  
  3748. The program processes the operations in the order specified on the calculation 
  3749. specifications form. 
  3750.  
  3751.  
  3752. ΓòÉΓòÉΓòÉ 1.8.1.6. Positions 33-42 (Factor 2) ΓòÉΓòÉΓòÉ
  3753.  
  3754. Factor 2 names a field or gives the actual data (literals) on which a 
  3755. calculation is to be done. For the file operation codes, factor 2 names a file 
  3756. or record format to be used. The entry must begin in position 33. The entries 
  3757. that are valid for factor 2 depend on the operation code specified in positions 
  3758. 28 through 32. With some operation codes, a colon can be used to separate parts 
  3759. of the factor, but must be preceded by and followed by a valid entry. For the 
  3760. specific entries for factor 2 for a particular operation code, see Operation 
  3761. Codes. 
  3762.  
  3763.  
  3764. ΓòÉΓòÉΓòÉ 1.8.1.7. Positions 43-48 (Result Field) ΓòÉΓòÉΓòÉ
  3765.  
  3766. The result field names the field that contains the result of the calculation 
  3767. operation specified in positions 28 through 32.  Array elements are treated as 
  3768. fields. A look-ahead field, user date special word a literal, or a named 
  3769. constant cannot appear as the result field of a calculation. See Operation 
  3770. Codes for the result field rules for individual operation codes. 
  3771.  
  3772.  
  3773. ΓòÉΓòÉΓòÉ 1.8.1.8. Positions 49-51 (Field Length) ΓòÉΓòÉΓòÉ
  3774.  
  3775. Entry        Explanation 
  3776. 1-30         Numeric field length. 
  3777. 1-256        Character field length. 
  3778. Blank        The result field is defined elsewhere. 
  3779.  
  3780. Positions 49 through 51 specify the length of the result field. This entry is 
  3781. optional, but can be used to define a field not defined elsewhere in the 
  3782. program.  These definitions of the field entries are allowed if the result 
  3783. field contains a field name. 
  3784.  
  3785. The entry specifies the number of positions to be reserved for the result 
  3786. field. The entry must be right-adjusted. The unpacked length (number of digits) 
  3787. must be specified for numeric fields. 
  3788.  
  3789. If the length of an arithmetic result to the left of the decimal point exceeds 
  3790. the specified length, the excess leftmost digits and any excess decimal 
  3791. positions are dropped.  No diagnostic message occurs if the result is 
  3792. truncated. 
  3793.  
  3794. If the result field is defined elsewhere in the program, no entry is required 
  3795. for the length.  However, if the length is specified, and if the result field 
  3796. is defined elsewhere, the length must be the same as the previously defined 
  3797. length. 
  3798.  
  3799. If half-adjustment is specified in position 53 of the calculation 
  3800. specifications, the entries for field length (positions 49 through 51) and 
  3801. decimal positions (position 52) refer to the length of the result field after 
  3802. half-adjustment. 
  3803.  
  3804.  
  3805. ΓòÉΓòÉΓòÉ 1.8.1.9. Position 52 (Decimal Positions) ΓòÉΓòÉΓòÉ
  3806.  
  3807. Entry        Explanation 
  3808. Blank        The result field is character data or has been defined elsewhere 
  3809.              in the program. 
  3810. 0-9          Number of decimal positions in a numeric result field. 
  3811.  
  3812. Position 52 indicates the number of positions to the right of the decimal in a 
  3813. numeric result field.  If the numeric result field contains no decimal 
  3814. positions, enter a '0' (zero).  This position must be blank if the result field 
  3815. is character data.  This position can be left blank if the result field is 
  3816. numeric but was described by input or calculation specifications or in an 
  3817. external description.  In this case, field length (positions 49 through 51) 
  3818. must also be left blank.  The number of decimal positions specified cannot 
  3819. exceed the length of the field. 
  3820.  
  3821.  
  3822. ΓòÉΓòÉΓòÉ 1.8.1.10. Position 53 (Operation Extender) ΓòÉΓòÉΓòÉ
  3823.  
  3824. Entry        Explanation 
  3825. Blank        No operation extension supplied. 
  3826. H            Half adjust. 
  3827. N            Record is read but not locked. 
  3828. P            Pad the result field with blanks. 
  3829.  
  3830. The operation extenders are single-character entries that provide additional 
  3831. attributes to the operations that they accompany. Operation extenders are 
  3832. specified in position 53 of calculation specifications. 
  3833.  
  3834. An H indicates whether the contents of the result field are to be half adjusted 
  3835. (rounded). Half-adjusting is done by adding 5 (-5 if the field is negative) one 
  3836. position to the right of the last specified decimal position in the result 
  3837. field. The half adjust entry is allowed only with arithmetic operations, but 
  3838. not with an MVR operation or with a DIV operation followed by the MVR 
  3839. operation. Half adjust can be specified only if the number of decimal positions 
  3840. in the generated result is greater than the number of decimal positions in the 
  3841. result field. Resulting indicators are set according to the value of the result 
  3842. field after half-adjusting has been done. 
  3843.  
  3844. An N in a READ, READE, READP, REDPE, or CHAIN operation on an update disk file 
  3845. indicates that a record is to be read, but not locked. If no value is 
  3846. specified, the default action of locking occurs. 
  3847.  
  3848. A P indicates that, for CAT, SUBST, MOVEA, MOVEL, or XLATE, the result field is 
  3849. padded on the right after executing the instruction if the result field is 
  3850. longer than the result of the operation. Padding is done from the left for 
  3851. MOVE. 
  3852.  
  3853.  
  3854. ΓòÉΓòÉΓòÉ 1.8.1.11. Positions 54-59 (Resulting Indicators) ΓòÉΓòÉΓòÉ
  3855.  
  3856. These positions can be used, for example, to test the value of a result field 
  3857. after the completion of an operation, or to indicate an end-of-file, error, or 
  3858. record-not-found condition.  The resulting indicator positions have different 
  3859. uses, depending on the operation code specified. See the individual operation 
  3860. codes in Operation Codes for a description of the associated resulting 
  3861. indicators.  For arithmetic operations, the result field is tested only after 
  3862. the field is truncated and half-adjustment is done (if specified).  The setting 
  3863. of indicators depends on the results of the tests specified. 
  3864.  
  3865. Entry               Explanation 
  3866. Blank               No resulting indicator specified 
  3867. 01-99               General indicators 
  3868. KA-KN, KP-KY        Function key indicators 
  3869. H1-H9               Halt indicators 
  3870. L1-L9               Control level indicators 
  3871. LR                  Last record indicator 
  3872. OA-OG, OV           Overflow indicators 
  3873. U1-U8               External indicators 
  3874. RT                  Return indicator. 
  3875.  
  3876. Resulting indicators cannot be used when the result field uses a non-indexed 
  3877. array. 
  3878.  
  3879. If the same indicator is used as a resulting indicator on more than one 
  3880. calculation specification, the last calculation specification processed 
  3881. determines the status of that indicator. 
  3882.  
  3883. Remember the following points when specifying resulting indicators: 
  3884.  
  3885.  When the calculation operation is done, the specified resulting indicators 
  3886.   are set off, and, if a condition specified by a resulting indicator is 
  3887.   satisfied, that indicator is set on. 
  3888.  When a control level indicator (L1 through L9) is set on, the lower level 
  3889.   indicators are not set on. 
  3890.  When a halt indicator (H1 through H9) is set on, the program ends unless the 
  3891.   halt indicator is set off before the indicator is tested. 
  3892.  
  3893.  
  3894. ΓòÉΓòÉΓòÉ 1.8.1.12. Positions 60-74 (Comments) ΓòÉΓòÉΓòÉ
  3895.  
  3896. Positions 60 through 74 of each calculation specification line can be used for 
  3897. comments to document the purpose of that calculation. 
  3898.  
  3899.  
  3900. ΓòÉΓòÉΓòÉ 1.8.1.13. Positions 75-80 (Comments) ΓòÉΓòÉΓòÉ
  3901.  
  3902. Positions 75 through 80 can be used for comments, or left blank. These 
  3903. positions are not printed contiguously with positions 6-74 on the compiled 
  3904. listing. 
  3905.  
  3906.  
  3907. ΓòÉΓòÉΓòÉ 1.9. Output Specifications ΓòÉΓòÉΓòÉ
  3908.  
  3909. Output specifications describe the record and the format of fields in a program 
  3910. described output file and when the record is to be written.  Output 
  3911. specifications are optional for an externally described file. Output 
  3912. specifications can be divided into two categories: record identification and 
  3913. control (positions 7 through 37), and field description and control (positions 
  3914. 23 through 70).  These specifications are entered on the RPG/400 Output 
  3915. Specifications. 
  3916.  
  3917. Detailed information for the output specifications is given in: 
  3918.  
  3919.  Entries for program described files 
  3920.  Entries for externally described files 
  3921.  
  3922.  
  3923. ΓòÉΓòÉΓòÉ 1.9.1. Program Described Files ΓòÉΓòÉΓòÉ
  3924.  
  3925.  Position 6 (Form Type) 
  3926.  Record Identification and Control Entries 
  3927.  Field Description and Control Entries 
  3928.  
  3929.  
  3930. ΓòÉΓòÉΓòÉ 1.9.1.1. Position 6 (Form Type) ΓòÉΓòÉΓòÉ
  3931.  
  3932. An O must appear in position 6 to identify this line as an output 
  3933. specifications statement. 
  3934.  
  3935.  
  3936. ΓòÉΓòÉΓòÉ 1.9.2. Record Identification and Control Entries ΓòÉΓòÉΓòÉ
  3937.  
  3938.  Positions 7-14 (File Name) 
  3939.  Positions 14-16 (Logical Relationship) 
  3940.  Position 15 (Type - Program Described File) 
  3941.  Positions 16-18 (Record Addition/Deletion) 
  3942.  Position 16 (Fetch Overflow/Release) 
  3943.  
  3944.    - Fetch Overflow 
  3945.    - Release 
  3946.  
  3947.  Positions 17-22 (Space and Skip) 
  3948.  Position 17 (Space Before) 
  3949.  Position 18 (Space After) 
  3950.  Positions 19-20 (Skip Before) 
  3951.  Positions 21-22 (Skip After) 
  3952.  Positions 23-31 (File Record ID Indicators) 
  3953.  Positions 32-37 (EXCPT Name) 
  3954.  
  3955. Entries in positions 7 through 37 identify the output records that make up the 
  3956. files, provide the correct spacing on printed reports, and determine under what 
  3957. conditions the records are to be written. 
  3958.  
  3959.  
  3960. ΓòÉΓòÉΓòÉ 1.9.2.1. Positions 7-14 (File Name) ΓòÉΓòÉΓòÉ
  3961.  
  3962. Entry               Explanation 
  3963. A valid file name   Same file name that appears on the file description 
  3964.                     specifications for the output file. 
  3965.  
  3966. Specify the file name on the first line that defines an output record for the 
  3967. file.  The file name specified must be the same file name assigned to the 
  3968. output, update, or combined file on the file description specifications.  If 
  3969. records from files are interspersed on the output specifications, the file name 
  3970. must be specified each time the file changes. 
  3971.  
  3972. For files specified as output, update, combined or input with ADD, at least one 
  3973. output specification is required unless an explicit file operation code with a 
  3974. data structure name specified in the result field is used in the calculations. 
  3975. For example, a WRITE operation does not require output specifications. 
  3976.  
  3977.  
  3978. ΓòÉΓòÉΓòÉ 1.9.2.2. Positions 14-16 (Logical Relationship) ΓòÉΓòÉΓòÉ
  3979.  
  3980. Entry        Explanation 
  3981. AND or OR    AND/OR indicates a relationship between lines of output 
  3982.              indicators. AND/OR lines are valid for output records, but not for 
  3983.              fields. 
  3984.  
  3985. Positions 14 through 16 specify AND/OR lines for output operations. To specify 
  3986. this relationship, enter AND/OR in positions 14 through 16 on each additional 
  3987. line following the line containing the file name. At least one indicator must 
  3988. be specified on each AND line. For an AND relationship and fetch overflow 
  3989. position 16 must be specified on the first line only (file name line).  A fetch 
  3990. overflow entry is required on OR lines for record types requiring the fetch 
  3991. overflow routine. 
  3992.  
  3993. Positions 17 through 22 (spacing and skipping) must be blank on an AND line. 
  3994. In an OR relationship, positions 17 through 22 can be used; if they are blank, 
  3995. the definitions from the preceding line are used. Positions 7 through 13 must 
  3996. be blank when AND/OR is specified. 
  3997.  
  3998. An unlimited number of AND/OR lines can be specified on the output 
  3999. specifications. 
  4000.  
  4001.  
  4002. ΓòÉΓòÉΓòÉ 1.9.2.3. Position 15 (Type - Program Described File) ΓòÉΓòÉΓòÉ
  4003.  
  4004. Entry        Explanation 
  4005. H or D       Detail records usually contain data that comes directly from the 
  4006.              input record or that is the result of calculations processed at 
  4007.              detail time. Heading records usually contain constant identifying 
  4008.              information such as titles, column headings, page number, and 
  4009.              date. No distinction is made between heading and detail records. 
  4010.              The H/D specifications are available to help the programmer 
  4011.              document the program. 
  4012. T            Total records usually contain data that is the end result of 
  4013.              specific calculations on several detail records. 
  4014. E            Exception records are written during calculation time.  Exception 
  4015.              records can be specified only when the operation code EXCPT is 
  4016.              used.  See Operation Codes for further information on the EXCPT 
  4017.              operation code. 
  4018.  
  4019. Position 15 indicates the type of record to be written.  Position 15 must have 
  4020. an entry for every output record. Heading (H) and detail (D) lines are both 
  4021. processed as detail records.  No special sequence is required for coding the 
  4022. output records; however, all lines of each record type (H, D, T, or E) are 
  4023. handled at separate times within the program cycle. 
  4024.  
  4025.  
  4026. ΓòÉΓòÉΓòÉ 1.9.2.4. Positions 16-18 (Record Addition/Deletion) ΓòÉΓòÉΓòÉ
  4027.  
  4028. Entry        Explanation 
  4029. ADD          Add a record to the file or subfile. 
  4030. DEL          Delete the last record read from the file.  The deleted record 
  4031.              cannot be retrieved; the record is deleted from the system. 
  4032.  
  4033. An entry of ADD is valid for input, output, or update files. DEL is valid for 
  4034. update DISK files only. 
  4035.  
  4036. Note:   The file description specifications for a file using the ADD function 
  4037. for DISK files must have an A in position 66. 
  4038.  
  4039. This entry must appear on the same line that contains the record type (H, D, T, 
  4040. E) specification (position 15). If an OR line is used following an ADD or DEL 
  4041. entry, this entry applies to the OR line also. 
  4042.  
  4043.  
  4044. ΓòÉΓòÉΓòÉ 1.9.2.5. Position 16 (Fetch Overflow/Release) ΓòÉΓòÉΓòÉ
  4045.  
  4046. Entry        Explanation 
  4047. Blank        Must be blank for all files except printer files (PRINTER 
  4048.              specified in positions 40 through 46 of the file description 
  4049.              specifications). If position 16 is blank for printer files, 
  4050.              overflow is not fetched. 
  4051. F            Fetch overflow. 
  4052. R            Release a device (workstation) after output. 
  4053.  
  4054.  
  4055. ΓòÉΓòÉΓòÉ 1.9.2.5.1. Fetch Overflow ΓòÉΓòÉΓòÉ
  4056.  
  4057. An F in position 16 specifies fetch overflow for the printer file defined on 
  4058. this line.  This file must be a printer file that has overflow lines.  Fetch 
  4059. overflow is processed only when an overflow occurs and when all conditions 
  4060. specified by the indicators in positions 23 through 31 are satisfied.  An 
  4061. overflow indicator cannot be specified on the same line as fetch overflow. 
  4062.  
  4063. If an overflow indicator has not been specified in positions 33 and 34 of the 
  4064. file description specifications for a printer file, the compiler assigns one to 
  4065. the file. An overflow line is generated by the compiler for the file, except 
  4066. when no other output records exist for the file or when the printer uses 
  4067. externally described data. This compiler-generated overflow can be fetched. 
  4068.  
  4069. Overflow lines can be written during detail, total, or exception output time. 
  4070. When the fetch overflow is specified, only overflow output associated with the 
  4071. file containing the processed fetch is output. The fetch overflow entry (F) is 
  4072. required on each OR line for record types that require the overflow routine. 
  4073. The fetch overflow routine does not automatically advance forms. 
  4074.  
  4075. The form length and overflow line can be specified on the line counter 
  4076. specifications, in the printer device file, or through an OS/400 override 
  4077. command. 
  4078.  
  4079.  
  4080. ΓòÉΓòÉΓòÉ 1.9.2.5.2. Release ΓòÉΓòÉΓòÉ
  4081.  
  4082. After an output operation is complete, the device used in the operation is 
  4083. released if you have specified an R in position 16 of the corresponding output 
  4084. specifications. See the REL (Release) operation for further information on 
  4085. releasing devices. 
  4086.  
  4087.  
  4088. ΓòÉΓòÉΓòÉ 1.9.2.6. Positions 17-22 (Space and Skip) ΓòÉΓòÉΓòÉ
  4089.  
  4090. Use positions 17 through 22 to specify line spacing and skipping for a printer 
  4091. file.  Spacing refers to advancing one line at a time, and skipping refers to 
  4092. jumping from one print line to another. 
  4093.  
  4094. If spacing and skipping are specified for the same line, the spacing and 
  4095. skipping operations are processed in the following sequence: 
  4096.  
  4097. Skip before 
  4098. Space before 
  4099. Print a line 
  4100. Skip after 
  4101. Space after. 
  4102.  
  4103. If PRTCTL (printer control option) is not specified on the file description 
  4104. specifications, an entry must be made in one of the following positions when 
  4105. the device is PRINTER: 17 (space before), 18 (space after), 19 and 20 (skip 
  4106. before), or 21 and 22 (skip after). If a space/skip entry is left blank, the 
  4107. particular function with the blank entry (such as space before or space after) 
  4108. does not occur.  If entries are made in position 17 (space before) or in 
  4109. positions 19 through 22 (skip before and skip after) and no entry is made in 
  4110. position 18 (space after), no space occurs after printing.  When PRTCTL is 
  4111. specified, it is used only on records with blanks specified in positions 17 
  4112. through 22. 
  4113.  
  4114. If a skip before or a skip after a line on a new page is specified, but the 
  4115. printer is on that line, the skip does not occur. 
  4116.  
  4117.  
  4118. ΓòÉΓòÉΓòÉ 1.9.2.7. Position 17 (Space Before) ΓòÉΓòÉΓòÉ
  4119.  
  4120. Entry        Explanation 
  4121. 0 or Blank   No spacing 
  4122. 1            Single spacing 
  4123. 2            Double spacing 
  4124. 3            Triple spacing. 
  4125.  
  4126.  
  4127. ΓòÉΓòÉΓòÉ 1.9.2.8. Position 18 (Space After) ΓòÉΓòÉΓòÉ
  4128.  
  4129. Entry        Explanation 
  4130. 0 or Blank   No spacing 
  4131. 1            Single spacing 
  4132. 2            Double spacing 
  4133. 3            Triple spacing. 
  4134.  
  4135.  
  4136. ΓòÉΓòÉΓòÉ 1.9.2.9. Positions 19-20 (Skip Before) ΓòÉΓòÉΓòÉ
  4137.  
  4138. Entry        Explanation 
  4139. 0 or Blank   No skipping occurs. 
  4140. 01-99        Skip to lines 1 to 99 before printing for printer files. 
  4141. A0-A9        Skip to lines 100 to 109 before printing for printer files. 
  4142. B0-B2        Skip to lines 110 to 112 before printing for printer files. 
  4143.  
  4144.  
  4145. ΓòÉΓòÉΓòÉ 1.9.2.10. Positions 21-22 (Skip After) ΓòÉΓòÉΓòÉ
  4146.  
  4147. Entry        Explanation 
  4148. 0 or Blank   No skipping occurs. 
  4149. 01-99        Skip to lines 1 to 99 after printing for printer files. 
  4150. A0-A9        Skip to lines 100 to 109 after printing for printer files. 
  4151. B0-B2        Skip to lines 110 to 112 after printing for printer files. 
  4152.  
  4153.  
  4154. ΓòÉΓòÉΓòÉ 1.9.2.11. Positions 23-31 (File Record ID Indicators) ΓòÉΓòÉΓòÉ
  4155.  
  4156.  
  4157.  
  4158. Entry                 Explanation 
  4159. Blank                 The line or field is output every time the record 
  4160.                       (heading, detail, total, or exception) is checked for 
  4161.                       output. 
  4162. 01-99                 A general indicator that is used as a resulting 
  4163.                       indicator, field indicator, or record identifying 
  4164.                       indicator. 
  4165. KA-KN, KP-KY          Function key indicators. 
  4166. L1-L9                 Control level indicators. 
  4167. H1-H9                 Halt indicators. 
  4168. U1-U8                 External indicator set before running the program or set 
  4169.                       as a result of a calculation operation. 
  4170. OA-OG, OV             Overflow indicator previously assigned to this file. 
  4171. MR                    Matching record indicator. 
  4172. LR                    Last record indicator. 
  4173. RT                    Return indicator. 
  4174. 1P                    First-page indicator.  Valid only on heading or detail 
  4175.                       lines. 
  4176.  
  4177. Conditioning indicators are not required on output lines. If conditioning 
  4178. indicators are not specified, the line is output every time that record is 
  4179. checked for output.  Up to three indicators can be entered on one specification 
  4180. line to control when a record or a particular field within a record is written. 
  4181. The indicators that condition the output are coded in positions 24 and 25, 27 
  4182. and 28, and 30 and 31.  When an N is entered in positions 23, 26, or 29, the 
  4183. indicator in the associated position must be off for the line or field to be 
  4184. written.  Otherwise, the indicator must be on for the line or field to be 
  4185. written. 
  4186.  
  4187. If more than one indicator is specified on one line, all indicators are 
  4188. considered to be in an AND relationship. 
  4189.  
  4190. If the output record must be conditioned by more than three indicators in an 
  4191. AND relationship, enter the letters AND in positions 14 through 16 of the 
  4192. following line and specify the additional indicators in positions 23 through 31 
  4193. on that line. 
  4194.  
  4195. For an AND relationship, fetch overflow (position 16) can only be specified on 
  4196. the first line.  Positions 17 through 22 (spacing and skipping) must be blank 
  4197. for all AND lines. 
  4198.  
  4199. An overflow indicator must be defined on the file description specifications 
  4200. (positions 33 and 34) before it can be used as a conditioning indicator.  If a 
  4201. line is to be conditioned as an overflow line, the overflow indicator must 
  4202. appear on the main specification line or on the OR line. If an overflow 
  4203. indicator is used on an AND line, the line is not treated as an overflow line, 
  4204. but the overflow indicator is checked before the line is written. In this case, 
  4205. the overflow indicator is treated like any other output indicator. 
  4206.  
  4207. If the output record is to be written when any one of two or more sets of 
  4208. conditions exist (an OR relationship), enter the letters OR in positions 14 and 
  4209. 15 of the following specification line, and specify the additional OR 
  4210. indicators on that line. 
  4211.  
  4212. When an OR line is specified for a printer file, the skip and space entries 
  4213. (positions 17 through 22) can all be blank, in which case the space and skip 
  4214. entries of the preceding line are used.  If they differ from the preceding 
  4215. line, enter space and skip entries on the OR line. If fetch overflow (position 
  4216. 16) is used, it must be specified on each OR line. 
  4217.  
  4218.  
  4219. ΓòÉΓòÉΓòÉ 1.9.2.12. Positions 32-37 (EXCPT Name) ΓòÉΓòÉΓòÉ
  4220.  
  4221. When the record type is an exception record (indicated by an E in position 15), 
  4222. a name can be placed in these positions of the record line.  The EXCPT 
  4223. operation can specify the name assigned to a group of the records to be output. 
  4224. This name is called an EXCPT name. An EXCPT name must follow the rules for 
  4225. using symbolic names. A group of any number of output records can use the same 
  4226. EXCPT name, and the records do not have to be consecutive records. 
  4227.  
  4228. When the EXCPT operation is specified without an EXCPT name, only those 
  4229. exception records without an EXCPT name are checked and written if the 
  4230. conditioning indicators are satisfied. 
  4231.  
  4232. When the EXCPT operation specifies an EXCPT name, only the exception records 
  4233. with that name are checked and written if the conditioning indicators are 
  4234. satisfied. 
  4235.  
  4236. The EXCPT name is specified on the main record line and applies to all AND/OR 
  4237. lines. 
  4238.  
  4239. If an exception record with an EXCPT name is conditioned by an overflow 
  4240. indicator, the record is written only during the overflow portion of the 
  4241. RPG/400 cycle or during fetch overflow. The record is not written at the time 
  4242. the EXCPT operation is processed. 
  4243.  
  4244. An EXCPT operation with no fields can be used to release a record lock in a 
  4245. file.  The UNLCK operation can also be used for this purpose. In the following 
  4246. figure, the record lock in file RCDA is released by the EXCPT operation. 
  4247.  
  4248.  
  4249. Record Lock in File Released by EXCPT Operation
  4250.  
  4251. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  4252. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  4253. C*
  4254. C           KEY       CHAINRCDA
  4255. C                     EXCPTRELESE
  4256. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  4257. O
  4258. O*
  4259. ORCDA       E              RELESE
  4260. O*                    (no fields)
  4261.  
  4262.  
  4263. ΓòÉΓòÉΓòÉ 1.9.3. Field Description and Control Entries ΓòÉΓòÉΓòÉ
  4264.  
  4265. Entries in positions 23 through 70 determine under what conditions and in what 
  4266. format fields of a record are to be written. 
  4267.  
  4268. Each field is described on a separate line.  No entries are permitted in 
  4269. positions 7 through 22 of a field description line.  Field description and 
  4270. control information for a field begins on the line following the record 
  4271. identification line. 
  4272.  
  4273.  Positions 23-31 (File Field Description Indicators) 
  4274.  Positions 32-37 (Field Name) 
  4275.  
  4276.    - Field Names, Blanks, Tables and Arrays 
  4277.    - PAGE, PAGE1-PAGE7 
  4278.    - *PLACE 
  4279.    - User Date Reserved Words 
  4280.    - *IN, *INxx, *IN,xx 
  4281.  
  4282.  Position 38 (Edit Codes) 
  4283.  Position 39 (Blank After) 
  4284.  Positions 40-43 (End Position) 
  4285.  Position 44 (Data Format) 
  4286.  Positions 45-70 (Constant or Edit Word) 
  4287.  
  4288.    - Constants 
  4289.    - Edit Words 
  4290.    - Format Name 
  4291.  
  4292.  Positions 71-74 (Reserved) 
  4293.  Positions 75-80 (Comments) 
  4294.  
  4295.  
  4296. ΓòÉΓòÉΓòÉ 1.9.3.1. Positions 23-31 (File Field Description Indicators) ΓòÉΓòÉΓòÉ
  4297.  
  4298.  
  4299. Indicators specified on the field description lines determine whether a field 
  4300. is to be included in the output record, except for PAGE reserved fields. See 
  4301. PAGE, PAGE1-PAGE7 for information on how output indicators affect the PAGE 
  4302. fields. The same types of indicators can be used to control fields as are used 
  4303. to control records, see Positions 23-31 (File Record ID Indicators). Indicators 
  4304. used to condition field descriptions lines cannot be specified in an AND/OR 
  4305. relationship. Conditioning indicators cannot be specified on format name 
  4306. specifications for program described WORKSTN files. 
  4307.  
  4308.  
  4309. ΓòÉΓòÉΓòÉ 1.9.3.2. Positions 32-37 (Field Name) ΓòÉΓòÉΓòÉ
  4310.  
  4311. In positions 32 through 37, use one of the following entries to specify each 
  4312. field that is to be written out: 
  4313.  
  4314.  A field name 
  4315.  Blanks if a constant is specified in positions 45 through 70 
  4316.  A table name, array name, or array element 
  4317.  A named constant 
  4318.  The RPG/400 reserved words PAGE, PAGE1 through PAGE7, *PLACE, UDATE, *DATE, 
  4319.   UDAY, *DAY, UMONTH, *MONTH, UYEAR, *YEAR, *IN, *INxx, or *IN,xx 
  4320.  A data structure name or data structure subfield name. 
  4321.  
  4322.  
  4323. ΓòÉΓòÉΓòÉ 1.9.3.2.1. Field Names, Blanks, Tables and Arrays ΓòÉΓòÉΓòÉ
  4324.  
  4325. The field names used must be defined in the program. Do not enter a field name 
  4326. if a constant or edit word is used in positions 45 through 70. If a field name 
  4327. is entered in positions 32 through 37, positions 7 through 22 must be blank. 
  4328.  
  4329. Fields can be specified in any order because the sequence in which they appear 
  4330. on the output records is determined by the entry in positions 40 through 43. 
  4331. If fields overlap, the last field specified is the only field completely 
  4332. written. 
  4333.  
  4334. When a non-indexed array name is specified, the entire array is written. An 
  4335. array name with a constant index or variable index causes one element to be 
  4336. written. When a table name is specified, the element last found in a LOKUP 
  4337. (Look Up) operation is written. The first element of a table is written if no 
  4338. successful LOKUP operation was done. 
  4339.  
  4340. The conditions for a field and the conditions for the record it is contained in 
  4341. must be satisfied before the field is written out. 
  4342.  
  4343.  
  4344. ΓòÉΓòÉΓòÉ 1.9.3.2.2. PAGE, PAGE1-PAGE7 ΓòÉΓòÉΓòÉ
  4345.  
  4346. To use automatic page numbering, code PAGE in positions 32 through 35 as the 
  4347. name of the output field. Indicators specified in positions 23 though 31 do not 
  4348. condition the field, but rather control the resetting of the PAGE field. When 
  4349. indicators are specified and their conditions are met, the PAGE field is set to 
  4350. zero and incremented by 1 before output; when the conditions are not met, the 
  4351. PAGE field is incremented by 1 and then output.  If page numbers are needed for 
  4352. several output files (or for different numbering within one file), the entries 
  4353. PAGE1 through PAGE7 can be used. The PAGE fields are automatically 
  4354. zero-suppressed by the Z edit code. 
  4355.  
  4356. For more information on the PAGE reserved words, see RPG/400 Words with Special 
  4357. Functions. 
  4358.  
  4359.  
  4360. ΓòÉΓòÉΓòÉ 1.9.3.2.3. *PLACE ΓòÉΓòÉΓòÉ
  4361.  
  4362. *PLACE is an RPG/400 reserved word that is used to repeat data in an output 
  4363. record. Fields or constants that have been specified on previous specification 
  4364. lines can be repeated in the output record without having the field and end 
  4365. positions named on a new specification line. When *PLACE is coded in positions 
  4366. 32 through 37, all data between the first position and the highest end position 
  4367. previously specified for a field in that output record is repeated until the 
  4368. end position specified in the output record on the *PLACE specification line is 
  4369. reached.  The end position specified on the *PLACE specification line must be 
  4370. at least twice the highest end position of the group of fields to be 
  4371. duplicated. *PLACE can be used with any type of output. Blank after (position 
  4372. 39), editing (positions 38, 45 through 70), data format (position 44), and 
  4373. relative end positions cannot be used with *PLACE. 
  4374.  
  4375.  
  4376. ΓòÉΓòÉΓòÉ 1.9.3.2.4. User Date Reserved Words ΓòÉΓòÉΓòÉ
  4377.  
  4378. The user date reserved words (UDATE, *DATE, UDAY, *DAY, UMONTH *MONTH, UYEAR, 
  4379. *YEAR) allow the programmer to supply a date for the program at run time.  For 
  4380. more information on the user date reserved words, see Rules for User Date. 
  4381.  
  4382.  
  4383. ΓòÉΓòÉΓòÉ 1.9.3.2.5. *IN, *INxx, *IN,xx ΓòÉΓòÉΓòÉ
  4384.  
  4385. The reserved words *IN, *INxx and *IN,xx allow the programmer to refer to and 
  4386. manipulate RPG/400 indicators as data. 
  4387.  
  4388.  
  4389. ΓòÉΓòÉΓòÉ 1.9.3.3. Position 38 (Edit Codes) ΓòÉΓòÉΓòÉ
  4390.  
  4391. Entry                    Explanation 
  4392. Blank                    No edit code is used. 
  4393. 1-9, A-D, J-Q, X, Y, Z   Numeric fields are zero-suppressed and punctuated 
  4394.                          according to a predefined pattern without the use of 
  4395.                          edit words. 
  4396.  
  4397. Position 38 is used to specify edit codes that suppress leading zeros in a 
  4398. numeric field or to punctuate a numeric field without using an edit word. 
  4399. Allowable entries are 1 through 9, A through D, J through Q, X, Y, Z, and 
  4400. blank. 
  4401.  
  4402. Edit codes 5 through 9 are user-defined edit codes and are defined externally 
  4403. by an OS/400 function. The edit code is determined at compilation time. 
  4404. Subsequent changes to a user-defined edit code will not affect the editing by 
  4405. the RPG/400 compiler unless the program is recompiled. 
  4406.  
  4407. For more information see Simple Edit Codes and Combination Edit Codes. 
  4408.  
  4409.  
  4410. ΓòÉΓòÉΓòÉ 1.9.3.4. Position 39 (Blank After) ΓòÉΓòÉΓòÉ
  4411.  
  4412. Entry        Explanation 
  4413. Blank        The field is not reset. 
  4414. B            The field specified in positions 32 through 37 is reset to blank 
  4415.              or zero after the output operation is complete. 
  4416.  
  4417. Position 39 is used to reset a numeric field to zeros or a character field to 
  4418. blanks.  If the field is conditioned by indicators in positions 23 through 31, 
  4419. the blank after is also conditioned. This position must be blank for 
  4420. look-ahead, user date special words, *PLACE, named constants, and constants. 
  4421.  
  4422. Resetting fields to zeros is useful when totals are accumulated and written for 
  4423. each control group in a program. After the total is accumulated and written for 
  4424. one control group, the total field can be reset to zeros before accumulation 
  4425. begins on the total for the next control group. 
  4426.  
  4427. If blank after (position 39) is specified for a field to be written more than 
  4428. once, the B should be entered on the last line specifying output for that 
  4429. field, or else the field named may be set to blanks or zeros after the field is 
  4430. written to the output record. 
  4431.  
  4432.  
  4433. ΓòÉΓòÉΓòÉ 1.9.3.5. Positions 40-43 (End Position) ΓòÉΓòÉΓòÉ
  4434.  
  4435. Entry        Explanation 
  4436. 1-n          End position 
  4437. K1-K8        Length of format name for WORKSTN file. 
  4438.  
  4439. Positions 40 through 43 define the end position of a field or constant on the 
  4440. output record, or define the length of the data description specifications 
  4441. record format name for a program described WORKSTN file. 
  4442.  
  4443. The K identifies the entry as a length rather than an end position, and the 
  4444. number following the K indicates the length of the record format name.  For 
  4445. example, if the format name is CUSPMT, the entry in positions 42 and 43 is K6. 
  4446. Leading zeros are permitted following the K, and the entry must be 
  4447. right-adjusted. 
  4448.  
  4449. Valid entries for end positions are blanks, +nnn, -nnn, and nnnn. All entries 
  4450. in these positions must end in position 43. Enter the position of the rightmost 
  4451. character of the field or constant. The end position must not exceed the record 
  4452. length for the file. 
  4453.  
  4454. If an entire array is to be written, enter the end position of the last element 
  4455. in the array in positions 40 through 43.  If the array is to be edited, be 
  4456. careful when specifying the end position to allow enough positions to write all 
  4457. edited elements.  Each element is edited according to the edit code or edit 
  4458. word. 
  4459.  
  4460. The +nnn or -nnn entry specifies the placement of the field or constant 
  4461. relative to the end position of the previous field. The sign must be in 
  4462. position 40.  The number (nnn) must be right-adjusted, but leading zeros are 
  4463. not required. To calculate the end position, use these formulas: 
  4464.  
  4465. EP = PEP +nnn + FL
  4466.  
  4467. EP = PEP -nnn + FL
  4468.  
  4469. EP is the calculated end position. PEP is the previous end position.  For the 
  4470. first field specification in the record, PEP is equal to zero. FL is the length 
  4471. of the field after editing, or the length of the constant specified in this 
  4472. specification. The use of +nnn is equivalent to placing nnn positions between 
  4473. the fields.  A -nnn causes an overlap of the fields by nnn positions. For 
  4474. example, if the previous end position (PEP) is 6, the number of positions to be 
  4475. placed between the fields (nnn) is 5, and the field length (FL) is 10, the end 
  4476. position (EP) equals 21. 
  4477.  
  4478. When *PLACE is used, an actual end position must be specified; it cannot be 
  4479. blank or a displacement. 
  4480.  
  4481. An entry of blank is treated as an entry of +000. No positions separate the 
  4482. fields. 
  4483.  
  4484.  
  4485. ΓòÉΓòÉΓòÉ 1.9.3.6. Position 44 (Data Format) ΓòÉΓòÉΓòÉ
  4486.  
  4487. Entry        Explanation 
  4488. Blank        The field is to be written in zoned decimal numeric or character 
  4489.              format; numeric data is edited, or a constant is specified on this 
  4490.              line. 
  4491. P            The field is to be written in packed decimal format. 
  4492. B            The field is to be written in binary format. 
  4493. L            The numeric output field is to have a preceding (left) plus or 
  4494.              minus sign. 
  4495. R            The numeric output field is to have a following (right) plus or 
  4496.              minus sign. 
  4497.  
  4498. This position must be blank if editing is specified. 
  4499.  
  4500. The entry in position 44 specifies the format of the data in the records in the 
  4501. file.  This entry has no effect on the format used for internal processing of 
  4502. the output field in the program. 
  4503.  
  4504.  
  4505. ΓòÉΓòÉΓòÉ 1.9.3.7. Positions 45-70 (Constant or Edit Word) ΓòÉΓòÉΓòÉ
  4506.  
  4507. Positions 45 through 70 are used to specify a constant, a format name, or an 
  4508. edit word for a program described file. 
  4509.  
  4510.  
  4511. ΓòÉΓòÉΓòÉ 1.9.3.7.1. Constants ΓòÉΓòÉΓòÉ
  4512.  
  4513. Constants consist of character data (literals) that does not change from one 
  4514. processing of the program to the next. A constant is the actual data used in 
  4515. the output record rather than a name representing the location of the data. 
  4516.  
  4517. A constant of up to 24 characters can be placed in positions 45 through 70. 
  4518. The constant must begin in position 46 (apostrophe in position 45), and it must 
  4519. end with an apostrophe even if it contains only numeric characters.  Any 
  4520. apostrophe used within the constant must be entered twice; however, only one 
  4521. apostrophe appears when the constant is written out.  The field name (positions 
  4522. 32 through 37) must be blank. Instead of entering a constant, you can use a 
  4523. named constant containing a maximum of 256 characters. 
  4524.  
  4525.  
  4526. ΓòÉΓòÉΓòÉ 1.9.3.7.2. Edit Words ΓòÉΓòÉΓòÉ
  4527.  
  4528. An edit word specifies the punctuation of numeric fields, including the 
  4529. printing of dollar signs, commas, periods, and sign status. See Parts of an 
  4530. Edit Word for details. 
  4531.  
  4532.  
  4533. ΓòÉΓòÉΓòÉ 1.9.3.7.3. Format Name ΓòÉΓòÉΓòÉ
  4534.  
  4535. The name of the data description specifications record format that is used by a 
  4536. program described WORKSTN file must be specified in positions 45 through 54. 
  4537. One format name is required for each output record for the WORKSTN file; 
  4538. specifying more than one format name per record is not allowed.  Conditioning 
  4539. indicators cannot be specified on format name specifications for program 
  4540. described WORKSTN files. The format name must be enclosed in apostrophes. You 
  4541. must also enter Kn in positions 40 through 43, where n is the length of the 
  4542. format name.  For example, if the format name is 'CUSPMT', enter K6 in 
  4543. positions 42 and 43. A named constant can also be used. 
  4544.  
  4545.  
  4546. ΓòÉΓòÉΓòÉ 1.9.3.8. Positions 71-74 (Reserved) ΓòÉΓòÉΓòÉ
  4547.  
  4548. Positions 71 through 74 must be blank. 
  4549.  
  4550.  
  4551. ΓòÉΓòÉΓòÉ 1.9.3.9. Positions 75-80 (Comments) ΓòÉΓòÉΓòÉ
  4552.  
  4553. Positions 75 through 80 can be used for comments, or left blank. 
  4554.  
  4555.  
  4556. ΓòÉΓòÉΓòÉ 1.9.4. Externally Described Files ΓòÉΓòÉΓòÉ
  4557.  
  4558.  Position 6 (Form Type) 
  4559.  Record Identification and Control Entries 
  4560.  Field Description and Control Entries 
  4561.  
  4562.  
  4563. ΓòÉΓòÉΓòÉ 1.9.4.1. Position 6 (Form Type) ΓòÉΓòÉΓòÉ
  4564.  
  4565. An O must appear in position 6 to identify this line as an output 
  4566. specifications statement. 
  4567.  
  4568.  
  4569. ΓòÉΓòÉΓòÉ 1.9.5. Record Identification and Control Entries ΓòÉΓòÉΓòÉ
  4570.  
  4571. Output specifications for an externally described file are optional.  Entries 
  4572. in positions 7 through 37 of the record identification line identify the record 
  4573. format and determine under what conditions the records are to be written. 
  4574.  
  4575.  Positions 7-14 (Record Name) 
  4576.  Positions 14-16 (External Logical Relationship) 
  4577.  Position 15 (Type - Externally Described File) 
  4578.  Position 16 (Release) 
  4579.  Positions 16-18 (Record Addition) 
  4580.  Positions 16-22 (Fetch Overflow/Space/Skip) 
  4581.  Positions 23-31 (External File Record ID Indicators) 
  4582.  Positions 32-37 (EXCPT Name) 
  4583.  
  4584.  
  4585. ΓòÉΓòÉΓòÉ 1.9.5.1. Positions 7-14 (Record Name) ΓòÉΓòÉΓòÉ
  4586.  
  4587. Entry                         Explanation 
  4588. A valid record format name    A record format name must be specified for an 
  4589.                               externally described file. 
  4590.  
  4591.  
  4592. ΓòÉΓòÉΓòÉ 1.9.5.2. Positions 14-16 (External Logical Relationship) ΓòÉΓòÉΓòÉ
  4593.  
  4594. Entry        Explanation 
  4595. AND or OR    AND/OR indicates a relationship between lines of output 
  4596.              indicators. AND/OR lines are valid for output records, but not for 
  4597.              fields. 
  4598.  
  4599. See Positions 14-16 (Logical Relationship) for more information. 
  4600.  
  4601.  
  4602. ΓòÉΓòÉΓòÉ 1.9.5.3. Position 15 (Type - Externally Described File) ΓòÉΓòÉΓòÉ
  4603.  
  4604. Entry        Explanation 
  4605. H or D       Detail records 
  4606. T            Total records 
  4607. E            Exception records. 
  4608.  
  4609. Position 15 indicates the type of record to be written. See Position 15 (Type - 
  4610. Program Described File) for more information. 
  4611.  
  4612.  
  4613. ΓòÉΓòÉΓòÉ 1.9.5.4. Position 16 (Release) ΓòÉΓòÉΓòÉ
  4614.  
  4615. Entry        Explanation 
  4616. R            Release a device after output. 
  4617.  
  4618. See Release for more information. 
  4619.  
  4620.  
  4621. ΓòÉΓòÉΓòÉ 1.9.5.5. Positions 16-18 (Record Addition) ΓòÉΓòÉΓòÉ
  4622.  
  4623. Entry        Explanation 
  4624. ADD          Add a record to a file. 
  4625. DEL          Delete an existing record from the file. 
  4626.  
  4627. For more information on record addition, see Positions 16-18 (Record 
  4628. Addition/Deletion). 
  4629.  
  4630.  
  4631. ΓòÉΓòÉΓòÉ 1.9.5.6. Positions 16-22 (Fetch Overflow/Space/Skip) ΓòÉΓòÉΓòÉ
  4632.  
  4633. The fetch overflow, space, and skip entries for an externally described file 
  4634. must be blank.  Space and skip entries for an externally described printer file 
  4635. are specified in the data description specifications. 
  4636.  
  4637.  
  4638. ΓòÉΓòÉΓòÉ 1.9.5.7. Positions 23-31 (External File Record ID Indicators) ΓòÉΓòÉΓòÉ
  4639.  
  4640. Output indicators for externally described files are specified in the same way 
  4641. as those for program described files. The overflow indicators OA-OG, OV are not 
  4642. valid for externally described files.  For more information on output 
  4643. indicators, see Positions 23-31 (File Record ID Indicators). 
  4644.  
  4645.  
  4646. ΓòÉΓòÉΓòÉ 1.9.5.8. Positions 32-37 (EXCPT Name) ΓòÉΓòÉΓòÉ
  4647.  
  4648. An EXCPT name can be specified in these positions for an exception record line. 
  4649. See Positions 32-37 (EXCPT Name) for more information. 
  4650.  
  4651.  
  4652. ΓòÉΓòÉΓòÉ 1.9.6. Field Description and Control Entries ΓòÉΓòÉΓòÉ
  4653.  
  4654. For externally described files, the only valid field description and control 
  4655. entries are conditioning indicators (positions 23 through 31), field name 
  4656. (positions 32 through 37), and blank after (position 39). 
  4657.  
  4658.  Positions 23-31 (External Field Description Indicators) 
  4659.  Positions 32-37 (Field Name) 
  4660.  Position 38 (Edit Codes) 
  4661.  Position 39 (Blank After) 
  4662.  Positions 40-43 (End Position) 
  4663.  Position 44 (Data Format) 
  4664.  Positions 45-70 (Constant or Edit Word) 
  4665.  Positions 71-74 (Reserved) 
  4666.  Positions 75-80 (Comments) 
  4667.  
  4668.  
  4669. ΓòÉΓòÉΓòÉ 1.9.6.1. Positions 23-31 (External Field Description Indicators) ΓòÉΓòÉΓòÉ
  4670.  
  4671. Indicators specified on the field description lines determine whether a field 
  4672. is to be included in the output record. The same types of indicators can be 
  4673. used to control fields as are used to control records. See Positions 23-31 
  4674. (File Record ID Indicators) for more information. 
  4675.  
  4676.  
  4677. ΓòÉΓòÉΓòÉ 1.9.6.2. Positions 32-37 (Field Name) ΓòÉΓòÉΓòÉ
  4678.  
  4679. Entry            Explanation 
  4680. Valid field name A field name specified for an externally described file must 
  4681.                  be present in the external description unless the external 
  4682.                  name was renamed for the program. 
  4683. *ALL             Specifies the inclusion of all the fields in the record. 
  4684.  
  4685. For externally described files, only the fields specified are placed in the 
  4686. output record. *ALL can be specified to include all the fields in the record. 
  4687. If *ALL is specified, no other field description lines can be specified for 
  4688. that record.  In particular, you cannot specify a B (blank after) in position 
  4689. 39. 
  4690.  
  4691. For an update record, only those fields specified in the output field 
  4692. specifications and meeting the conditions specified by the output indicators 
  4693. are placed in the output record to be rewritten.  The values that were read are 
  4694. used to rewrite all other fields. 
  4695.  
  4696. For the creation of a new record, the fields specified are placed in the output 
  4697. record.  Those fields not specified or not meeting the conditions specified by 
  4698. the output indicators are written as zeros or blanks, depending on the data 
  4699. format specified in the external description. 
  4700.  
  4701.  
  4702. ΓòÉΓòÉΓòÉ 1.9.6.3. Position 38 (Edit Codes) ΓòÉΓòÉΓòÉ
  4703.  
  4704. Position 38 must be blank because edit codes for externally described files are 
  4705. specified in the data description specifications. 
  4706.  
  4707.  
  4708. ΓòÉΓòÉΓòÉ 1.9.6.4. Position 39 (Blank After) ΓòÉΓòÉΓòÉ
  4709.  
  4710. Entry        Explanation 
  4711. Blank        The field is not reset. 
  4712. B            The field specified in positions 32 through 37 is reset to blanks 
  4713.              or zeros after the output operation is complete.  Do not specify 
  4714.              *ALL in positions 32 through 37. 
  4715.  
  4716. For more information on blank after, see Position 39 (Blank After). 
  4717.  
  4718.  
  4719. ΓòÉΓòÉΓòÉ 1.9.6.5. Positions 40-43 (End Position) ΓòÉΓòÉΓòÉ
  4720.  
  4721. These positions must be blank because the field is placed in the output record 
  4722. in the positions specified by the data description specifications. 
  4723.  
  4724.  
  4725. ΓòÉΓòÉΓòÉ 1.9.6.6. Position 44 (Data Format) ΓòÉΓòÉΓòÉ
  4726.  
  4727. This position must be blank because the data format is defined in the data 
  4728. description specifications. 
  4729.  
  4730.  
  4731. ΓòÉΓòÉΓòÉ 1.9.6.7. Positions 45-70 (Constant or Edit Word) ΓòÉΓòÉΓòÉ
  4732.  
  4733. These positions must be blank because editing is specified in the data 
  4734. description specifications.  If a constant is to be placed in an externally 
  4735. described file, it must be done by a calculation operation. 
  4736.  
  4737.  
  4738. ΓòÉΓòÉΓòÉ 1.9.6.8. Positions 71-74 (Reserved) ΓòÉΓòÉΓòÉ
  4739.  
  4740. Positions 71 through 74 must be blank. 
  4741.  
  4742.  
  4743. ΓòÉΓòÉΓòÉ 1.9.6.9. Positions 75-80 (Comments) ΓòÉΓòÉΓòÉ
  4744.  
  4745. Positions 75 through 80 can be used for comments, or left blank. 
  4746.  
  4747.  
  4748. ΓòÉΓòÉΓòÉ 1.10. Operation Codes ΓòÉΓòÉΓòÉ
  4749.  
  4750. The RPG/400 programming language allows you to do many different types of 
  4751. operations on your data.  Operation codes, which are entered on the calculation 
  4752. specifications, indicate the operation to be done. Usually they are 
  4753. abbreviations of the name of the operation. 
  4754.  
  4755. For a list of the operation codes, see Operation Codes List. 
  4756.  
  4757.  
  4758. ΓòÉΓòÉΓòÉ 1.10.1. Arithmetic Operations ΓòÉΓòÉΓòÉ
  4759.  
  4760.  
  4761. The arithmetic operations are: 
  4762.  
  4763.  ADD (Add) 
  4764.  DIV (Divide) 
  4765.  MULT (Multiply) 
  4766.  MVR (Move Remainder) 
  4767.  SQRT (Square Root) 
  4768.  SUB (Subtract) 
  4769.  XFOOT (Summing the Elements of an Array) 
  4770.  Z-ADD (Zero and Add) 
  4771.  Z-SUB (Zero and Subtract). 
  4772.  
  4773. For examples of arithmetic operations, see Figure "Summary of Arithmetic 
  4774. Operations". 
  4775.  
  4776. Remember the following when specifying arithmetic operations: 
  4777.  
  4778.  Arithmetic operations can be done only on numeric fields (including numeric 
  4779.   subfields, numeric arrays, numeric array elements, numeric table elements, 
  4780.   numeric named constants, numeric figurative constants, and numeric literals). 
  4781.  Arithmetic operations are done on data in packed decimal format. Data 
  4782.   maintained in other formats is converted to or from packed decimal format. 
  4783.  Decimal alignment is done for all arithmetic operations. Even though 
  4784.   truncation can occur, the position of the decimal point in the result field 
  4785.   is not affected. 
  4786.  An arithmetic operation does not change factor 1 and factor 2 unless they are 
  4787.   the same as the result field. 
  4788.  Any data placed in the result field replaces the data that was there. 
  4789.  The result field must be large enough to accommodate the results of the 
  4790.   arithmetic operation because an RPG/400 program does not cause an error on an 
  4791.   arithmetic overflow. If the result field is not large enough to accommodate 
  4792.   the results, digits are dropped from either or both ends, depending on the 
  4793.   location of the decimal point. 
  4794.  If you use conditioning indicators, it is your responsibility to ensure that 
  4795.   the DIV operation occurs immediately before the MVR operation.  If the MVR 
  4796.   operation occurs before the DIV operation, undesirable results occur. An 
  4797.   error message may be issued. 
  4798.  Half adjust (position 53) can be specified for all the arithmetic operations 
  4799.   except for the MVR operation or for a DIV operation immediately followed by 
  4800.   an MVR operation. 
  4801.  
  4802. For arithmetic operations in which all three fields are used: 
  4803.  
  4804.  Factor 1, factor 2, and the result field can be three different fields. 
  4805.  Factor 1, factor 2, and the result field can all be the same field. 
  4806.  Factor 1 and factor 2 can be the same field but different from the result 
  4807.   field. 
  4808.  Either factor 1 or factor 2 can be the same as the result field. 
  4809.  
  4810. The length of any field specified in an arithmetic operation cannot exceed 30 
  4811. digits. If the result exceeds 30 digits, digits are dropped from either or both 
  4812. ends, depending on the location of the decimal point. 
  4813.  
  4814. All arithmetic operations are done algebraically. 
  4815.  
  4816. The results of all operations are signed (a plus sign is a hexadecimal F and a 
  4817. minus sign is a hexadecimal D) according to the following rules. The sign is in 
  4818. the zone portion of the low-order byte. 
  4819.  
  4820. For information on using arrays with arithmetic operations, see Specifying an 
  4821. Array in Calculations. 
  4822.  
  4823. Addition: If factor 1 and factor 2 have like signs, the result field sign is 
  4824. the same. If factor 1 and factor 2 have unlike signs, the result field sign is 
  4825. the same as the sign of the factor with the larger absolute value. 
  4826.  
  4827. Subtraction: Change the sign of factor 2, and apply the rules for addition. 
  4828.  
  4829. Multiplication: If factor 1 and factor 2 have like signs, the result field sign 
  4830. is plus (+). If factor 1 and factor 2 have unlike signs, the result field sign 
  4831. is minus (-). 
  4832.  
  4833. Division: If factor 1 and factor 2 have like signs, the result field sign is 
  4834. plus (+).  If factor 1 and factor 2 have unlike signs, the result field sign is 
  4835. minus (-).  The sign of the remainder is the same as the factor 1 sign. 
  4836.  
  4837. For the ADD, SUB, MULT, and DIV operations, factor 1 is not required. If factor 
  4838. 1 is not specified, the operation is done as though factor 1 and the result 
  4839. field were the same field. 
  4840.  
  4841.  
  4842. ΓòÉΓòÉΓòÉ 1.10.1.1. Arithmetic Operations Examples ΓòÉΓòÉΓòÉ
  4843.  
  4844.  
  4845. Summary of Arithmetic Operations
  4846.  
  4847. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  4848. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++*
  4849. C*  Before the operations are processed, the field values are:
  4850. C*       A = 1.00       G = 2.77
  4851. C*       B = 10.0       H = 70
  4852. C*       C = 32         J = .6
  4853. C*       D = -20        K = 25
  4854. C*       E = 6.         L = 1.0, 1.7, -1.1              RESULTS
  4855. C*       F = 10.0                                       -------
  4856. C                     ADD  1         A       30         002
  4857. C           B         ADD  C         V       52         042.00
  4858. C           B         ADD  D         V                  -10.00
  4859. C*
  4860. C                     Z-ADDC         V                  032.00
  4861. C*
  4862. C                     SUB  1         E       30         005
  4863. C           C         SUB  B         W       51         0022.0
  4864. C           C         SUB  D         W                  0052.0
  4865. C*
  4866. C                     Z-SUBC         W                  -0032.0
  4867. C*
  4868. C                     MULT E         F       30         060
  4869. C           B         MULT G         X       84         0027.7000
  4870. C           B         MULT D         X                  -200.0000
  4871. C*
  4872. C                     DIV  B         H       30         007
  4873. C           C         DIV  J         Y       62         0053.33
  4874. C*
  4875. C                     MVR            Z       53         00.020
  4876. C*
  4877. C                     SQRT K         Z                  05.000
  4878. C*
  4879. C                     XFOOTL         Z                  01.600
  4880.  
  4881.  
  4882. ΓòÉΓòÉΓòÉ 1.10.2. Array Operations ΓòÉΓòÉΓòÉ
  4883.  
  4884. The array operations are: 
  4885.  
  4886.  LOKUP (Look Up) 
  4887.  MOVEA (Move Array) 
  4888.  SORTA (Sort an Array) 
  4889.  XFOOT (Summing the Elements of an Array). 
  4890.  
  4891. See each operation for an explanation of its function. 
  4892.  
  4893.  
  4894. ΓòÉΓòÉΓòÉ 1.10.3. Bit Operations ΓòÉΓòÉΓòÉ
  4895.  
  4896. The bit operations are: 
  4897.  
  4898.  BITOF (Set Bits Off) 
  4899.  BITON (Set Bits On) 
  4900.  TESTB (Test Bit). 
  4901.  
  4902. The BITOF and BITON operations allow you to turn off and on specific bits in a 
  4903. field specified in the result field. The specified field must be a one-position 
  4904. character field. 
  4905.  
  4906. The TESTB operation compares the bits identified in factor 2 with the 
  4907. corresponding bits in the field named as the result field. 
  4908.  
  4909. In these operations, if factor 2 contains a 1-byte hexadecimal literal, the 
  4910. bits in the factor 2 entry will affect the result field entry in the same way a 
  4911. 1-byte character field would affect it. 
  4912.  
  4913. Note:   You can also format one or more characters at a time using move 
  4914. operations with hexadecimal literals. See Move Operations for more detail. 
  4915.  
  4916.  
  4917. ΓòÉΓòÉΓòÉ 1.10.4. Branching Operations ΓòÉΓòÉΓòÉ
  4918.  
  4919. The branching operations are: 
  4920.  
  4921.  CABxx (Compare and Branch) 
  4922.  ENDSR (End of Subroutine) 
  4923.  EXCPT (Calculation Time Output) 
  4924.  GOTO (Go To) 
  4925.  ITER (Iterate) 
  4926.  LEAVE (Leave a Do Group) 
  4927.  TAG (Tag). 
  4928.  
  4929. The GOTO operation (when used with a TAG operation) allows branching. For 
  4930. example: 
  4931.  
  4932.  Several operations can be skipped when certain conditions occur. 
  4933.  Certain operations can be done for several, but not all, record types. 
  4934.  Several operations can be repeated. 
  4935.  
  4936. The EXCPT operation allows records to be written during calculation time 
  4937. instead of at output time. 
  4938.  
  4939. The TAG operation names the label that identifies the destination of a GOTO or 
  4940. CABxx operation. 
  4941.  
  4942. The ITER operation transfers control from within a DO-group to the ENDDO 
  4943. statement of the DO-group. 
  4944.  
  4945. The LEAVE operation is similar to the ITER operation; however, LEAVE transfers 
  4946. control to the statement following the ENDDO operation. 
  4947.  
  4948. See each operation for an explanation of its function. 
  4949.  
  4950.  
  4951. ΓòÉΓòÉΓòÉ 1.10.5. Call Operations ΓòÉΓòÉΓòÉ
  4952.  
  4953. The call operations are: 
  4954.  
  4955.  CALL (Call a Program) 
  4956.  FREE (Deactivate a Program) 
  4957.  PARM (Identify Parameters) 
  4958.  PLIST (Identify a Parameter List) 
  4959.  RETRN (Return to Caller). 
  4960.  
  4961. The CALL, FREE, and RETRN operations allow an RPG/400 program to transfer 
  4962. control to other programs. With the CALL, FREE, and RETRN function, the PLIST 
  4963. and PARM operations can be used to allow the calling and called programs to 
  4964. address the same data. 
  4965.  
  4966. See each operation for an explanation of its function. 
  4967.  
  4968.  
  4969. ΓòÉΓòÉΓòÉ 1.10.6. Compare Operations ΓòÉΓòÉΓòÉ
  4970.  
  4971. The compare operations are: 
  4972.  
  4973.  ANDxx (And) 
  4974.  COMP (Compare) 
  4975.  CABxx (Compare and Branch) 
  4976.  CASxx (Conditionally Invoke Subroutine) 
  4977.  DOUxx (Do Until) 
  4978.  DOWxx (Do While) 
  4979.  IFxx (If) 
  4980.  ORxx (Or) 
  4981.  WHxx (When True Then Select). 
  4982.  
  4983. In the ANDxx, CABxx, CASxx, DOUxx, DOWxx, IFxx, ORxx, and WHxx operations, xx 
  4984. can be: 
  4985.  
  4986. xx           Meaning 
  4987. GT           Factor 1 is greater than factor 2. 
  4988. LT           Factor 1 is less than factor 2. 
  4989. EQ           Factor 1 is equal to factor 2. 
  4990. NE           Factor 1 is not equal to factor 2. 
  4991. GE           Factor 1 is greater than or equal to factor 2. 
  4992. LE           Factor 1 is less than or equal to factor 2. 
  4993. Blanks       Unconditional processing (CASxx or CABxx). 
  4994.  
  4995. The compare operations test fields for certain conditions. Resulting indicators 
  4996. assigned in positions 54 through 59 are set according to the results of the 
  4997. operation, or a branch occurs based on the results of the operation.  No fields 
  4998. are changed by these operations. 
  4999.  
  5000. Remember the following when using the compare operations: 
  5001.  
  5002.  If numeric fields are compared, fields of unequal length are aligned at the 
  5003.   implied decimal point. The fields are filled with zeros to the left and/or 
  5004.   right of the decimal point making the field lengths and number of decimal 
  5005.   positions equal for comparison. 
  5006.  
  5007.  If character fields are compared, fields of unequal length are aligned to 
  5008.   their leftmost character.  The shorter field is filled with blanks to equal 
  5009.   the length of the longer field so that the field lengths are equal for 
  5010.   comparison. 
  5011.  
  5012.  All numeric comparisons are algebraic. A plus (+) value is always greater 
  5013.   than a minus (-) value. 
  5014.  
  5015.  Blanks within numeric fields are assumed to be zeros. 
  5016.  
  5017.  Numeric fields are converted to packed decimal format, if necessary, before 
  5018.   they are compared. 
  5019.  
  5020.  If an alternate collating sequence (position 26 of the control specification) 
  5021.   has been specified for the comparison of character fields, the fields are 
  5022.   converted to the alternate sequence and then compared.  If *HIVAL and *LOVAL 
  5023.   are used to set up the comparison, the alternate collating sequence may alter 
  5024.   the value before the compare operation. However, the actual field value will 
  5025.   not change. 
  5026.  
  5027.  A character field cannot be compared with a numeric field. 
  5028.  
  5029.  An array name cannot be specified in a compare operation, but an array 
  5030.   element may be specified. 
  5031.  
  5032.  The ANDxx and ORxx operations can be used with DOUxx, DOWxx, IFxx, and WHxx. 
  5033.  
  5034.  
  5035. ΓòÉΓòÉΓòÉ 1.10.7. Data-Area Operations ΓòÉΓòÉΓòÉ
  5036.  
  5037. The data area operations are: 
  5038.  
  5039.  IN (Retrieve a Data Area) 
  5040.  OUT (Write a Data Area) 
  5041.  UNLCK (Unlock a Data Area or Release a Record). 
  5042.  
  5043. The IN and OUT operations allow you to retrieve and write one or all data areas 
  5044. in a program, depending on the factor 2 entry. 
  5045.  
  5046. The IN and OUT operations also allow you to control the locking or unlocking of 
  5047. a data area. When a data area is locked, it can be read but not updated by 
  5048. other programs. 
  5049.  
  5050. The following lock states are used: 
  5051.  
  5052.  For an IN operation with *LOCK specified, an exclusive allow read lock state 
  5053.   is placed on the data area. 
  5054.  For an OUT or UNLCK operation, the exclusive allow read lock state is 
  5055.   released. 
  5056.  
  5057. During the actual transfer of data into or out of a data area, there is a 
  5058. system-internal lock on the data area. If several users are contending for the 
  5059. same data area, a user may get an error message indicating that the data area 
  5060. is not available. 
  5061.  
  5062. Remember the following when using the IN, OUT, and UNLCK operations: 
  5063.  
  5064.  A data-area operation cannot be done on a data area that is not defined to 
  5065.   the operating system. 
  5066.  Before the IN, OUT, and UNLCK operations can be done on a data area, you must 
  5067.   specify that data area in the result field of an *NAMVAR DEFN statement. 
  5068.   (For further information on the DEFN statement, see DEFN (Field Definition).) 
  5069.  The data-area operations can be done on a data-area data structure that is 
  5070.   implicitly retrieved only if the data-area data structure name is specified 
  5071.   in the result field of an *NAMVAR DEFN statement. 
  5072.  A locked data area cannot be updated or locked by another RPG/400 program; 
  5073.   however, the data area can be retrieved in your own program by an IN 
  5074.   operation with factor 1 blank. 
  5075.  A data-area name cannot be the name of a multiple-occurrence data structure, 
  5076.   an input record field, an array, an array element, or a table. 
  5077.  A data area cannot be the subfield of a multiple occurrence data structure, a 
  5078.   data-area data structure, a program-status data structure, a file-information 
  5079.   data structure (INFDS), or a data structure that appears on an *NAMVAR DEFN 
  5080.   statement. 
  5081.  
  5082. A data structure defined with a U in position 18 of the input specifications 
  5083. form indicates that the data structure is a data area.  The data area is 
  5084. automatically read and locked at program initialization time, and the contents 
  5085. of the data structure are written to the data area when the program ends with 
  5086. LR on. 
  5087.  
  5088. Specify *LDA in factor 2 of a *NAMVAR DEFN statement to define the LDA data 
  5089. structure. 
  5090.  
  5091. Use the *NAMVAR DEFN operation with *PDA in factor 2 to define the name in the 
  5092. result field as the PDA data area.  The result field follows the current 
  5093. conventions for *NAMVAR DEFN. 
  5094.  
  5095.  
  5096. ΓòÉΓòÉΓòÉ 1.10.8. Declarative Operations ΓòÉΓòÉΓòÉ
  5097.  
  5098. The declarative operations do not cause action to occur; they can be specified 
  5099. anywhere within calculations. The control level entry (positions 7 and 8) can 
  5100. be blank or can contain an entry to group the statements within the appropriate 
  5101. section of the program.  The control level entry is for documentation purposes 
  5102. only. The declarative operations are: 
  5103.  
  5104.  DEFN (Field Definition) 
  5105.  KFLD (Define Parts of a Key) 
  5106.  KLIST (Define a Composite Key) 
  5107.  PARM (Identify Parameters) 
  5108.  PLIST (Identify a Parameter List) 
  5109.  TAG (Tag). 
  5110.  
  5111. The DEFN operation either defines a field based on the attributes (length and 
  5112. decimal positions) of another field or defines a field as a data area. 
  5113.  
  5114. The KLIST and KFLD operations are used to indicate the name by which a 
  5115. composite key field may be referred and the fields that compose the composite 
  5116. key.  A composite key is a key that contains a list of key fields. It is built 
  5117. from left to right, with the first KFLD specified being the leftmost 
  5118. (high-order) field of the composite key. 
  5119.  
  5120. The PLIST and PARM operations are used with the CALL operation to allow a 
  5121. called program access to parameters from a calling program. 
  5122.  
  5123. The TAG operation names the destination of a branching operation such as GOTO 
  5124. or CABxx. 
  5125.  
  5126.  
  5127. ΓòÉΓòÉΓòÉ 1.10.9. File Operations ΓòÉΓòÉΓòÉ
  5128.  
  5129.  
  5130.  
  5131. The file operation codes are: 
  5132.  
  5133.  ACQ (Acquire) 
  5134.  CHAIN (Random Retrieval from a File) 
  5135.  CLOSE (Close Files) 
  5136.  COMIT (Commit) 
  5137.  DELET (Delete Record) 
  5138.  EXCPT (Calculation Time Output) 
  5139.  EXFMT (Write/Then Read Format) 
  5140.  FEOD (Force End of Data) 
  5141.  FORCE (Force a Certain File to Be Read Next Cycle) 
  5142.  NEXT (Next) 
  5143.  OPEN (Open File for Processing) 
  5144.  POST (Post) 
  5145.  READ (Read a Record) 
  5146.  READC (Read Next Changed Record) 
  5147.  READE (Read Equal Key) 
  5148.  READP (Read Prior Record) 
  5149.  REDPE (Read Prior Equal) 
  5150.  REL (Release) 
  5151.  ROLBK (Roll Back) 
  5152.  SETGT (Set Greater Than) 
  5153.  SETLL (Set Lower Limit) 
  5154.  UNLCK (Unlock a Data Area or Release a Record) 
  5155.  UPDAT (Modify Existing Record) 
  5156.  WRITE (Create New Records). 
  5157.  
  5158. File operations can be used with both program described and externally 
  5159. described files (F or E respectively in position 19 of the file description 
  5160. specifications). 
  5161.  
  5162. When an externally described file is used with certain file operations, a 
  5163. record format name, rather than a file name, can be specified in factor 2. 
  5164. Thus, the processing operation code retrieves and/or positions the file at a 
  5165. record format of the specified type according to the rules of the calculation 
  5166. operation code used. 
  5167.  
  5168. When the OVRDBF command is used with the MBR (*ALL) parameter specified, the 
  5169. SETLL, SETGT and CHAIN operations only process the current file member.  For 
  5170. more information, refer to the Programming:  Data Base Guide. 
  5171.  
  5172. The WRITE and UPDAT operations that specify a program described file name in 
  5173. factor 2 must have a data structure name specified in the result field. The 
  5174. CHAIN, READ, READE, READP, and REDPE operations that specify a program 
  5175. described file name in factor 2 may have a data structure name specified in the 
  5176. result field.  With the CHAIN, READ, READE, READP, and REDPE operations, data 
  5177. is transferred directly between the file and the data structure, bypassing the 
  5178. normal field extract function.  Thus, no record identifying or field indicators 
  5179. are set on as a result of an input operation to a data structure.  If all input 
  5180. and output operations to the file have a data structure specified in the result 
  5181. field, input and output specifications are not required. However, the data 
  5182. structure must be defined on the input specifications. If an input operation 
  5183. (CHAIN, EXFMT, READ, READC, READE, READP, REDPE) does not retrieve a record 
  5184. because no record was found, because an error occurred in the operation, or 
  5185. because the last record was already retrieved (end of file), then no data is 
  5186. extracted and all fields in the program remain unchanged. 
  5187.  
  5188. If you specify an N in position 53 of a CHAIN, READ, READE, READP, or REDPE 
  5189. operation for an update disk file, a record is read without locking.  If no 
  5190. value is specified in position 53, the record is locked if the file is an 
  5191. update disk file. 
  5192.  
  5193. Exception/errors that occur during file operations can be handled by the 
  5194. programmer (by coding an error indicator or specifying a file-error 
  5195. subroutine), or by the RPG/400 error handler. 
  5196.  
  5197.  
  5198. ΓòÉΓòÉΓòÉ 1.10.10. Indicator-Setting Operations ΓòÉΓòÉΓòÉ
  5199.  
  5200. The SETON (Set On) and SETOF (Set Off) operations set (on or off) indicators 
  5201. specified in positions 54 through 59. At least one resulting indicator must be 
  5202. specified in these positions. Remember the following when setting indicators: 
  5203.  
  5204.  The 1P, MR, KA through KN, and KP through KY indicators cannot be set on by 
  5205.   the SETON operation. 
  5206.  The 1P and MR indicators cannot be set off by the SETOF operation. 
  5207.  Setting L1 through L9 on or off with a SETON or SETOF operation does not 
  5208.   automatically set any lower control level indicators. 
  5209.  
  5210.  
  5211. ΓòÉΓòÉΓòÉ 1.10.11. Information Operations ΓòÉΓòÉΓòÉ
  5212.  
  5213. The information operations are: 
  5214.  
  5215.  DEBUG (Debug Function) 
  5216.  DUMP (Program Dump) 
  5217.  SHTDN (Shut Down) 
  5218.  TIME (Time of Day). 
  5219.  
  5220. The DEBUG operation writes the following information that you can use to debug 
  5221. an RPG/400 program: 
  5222.  
  5223.  The source statement sequence number of the DEBUG operation 
  5224.  The contents of factor 1 (if factor 1 is specified) that identifies the DEBUG 
  5225.   written information 
  5226.  All indicators that are on at the time the operation is encountered 
  5227.  The contents of the result field (if the result field contains an entry). 
  5228.  
  5229. The information is sent to the file named in factor 2, or, if factor 2 is 
  5230. blank, the information is sent to a system defined file. 
  5231.  
  5232. The DUMP operation provides a dump of all indicators, fields, data structures, 
  5233. arrays, and tables used in a program. 
  5234.  
  5235. The SHTDN operation allows the program to determine whether the system operator 
  5236. has requested shutdown.  If so, the resulting indicator that must be specified 
  5237. in positions 54 and 55 is set on. 
  5238.  
  5239. The TIME operation allows the program to access the system time of day and 
  5240. system date at any time during program running. 
  5241.  
  5242.  
  5243. ΓòÉΓòÉΓòÉ 1.10.12. Initialization Operations ΓòÉΓòÉΓòÉ
  5244.  
  5245. The initialization operations provide run-time clearing and resetting of all 
  5246. elements in a structure (record format, data structure, array, or table) or a 
  5247. variable (field, subfield, or indicator). 
  5248.  
  5249. The initialization operations are: 
  5250.  
  5251.  CLEAR (Clear) 
  5252.  RESET (Reset). 
  5253.  
  5254. The CLEAR operation sets all elements in a structure or variable to zero, 
  5255. blank, or '0', depending on the field type (numeric, character, or indicator). 
  5256. This allows you to clear structures globally, instead of element by element. 
  5257.  
  5258. The RESET operation sets all elements in a structure or variable to their 
  5259. initial values (the values they had at the end of the initialization step in 
  5260. the program cycle). 
  5261.  
  5262. The RESET operation is used with data structure initialization and the 
  5263. initialization subroutine (*INZSR).  You can use both data structure 
  5264. initialization and the *INZSR to set the initial value of a variable. The 
  5265. initial value will be used to set the variable if it appears in factor 2 of a 
  5266. RESET operation. 
  5267.  
  5268. When these operation codes are applied to record formats, only fields which are 
  5269. output are affected. See CLEAR (Clear) and RESET (Reset) for more detail. 
  5270.  
  5271. For more information see "Initialization" in Chapter 9 of the RPG/400* User's 
  5272. Guide. 
  5273.  
  5274.  
  5275. ΓòÉΓòÉΓòÉ 1.10.13. Message Operation ΓòÉΓòÉΓòÉ
  5276.  
  5277. The message operation DSPLY (Display Function) allows communication between the 
  5278. program and the system console or between the program and the display 
  5279. workstation that requested the program. 
  5280.  
  5281.  
  5282. ΓòÉΓòÉΓòÉ 1.10.14. Move Operations ΓòÉΓòÉΓòÉ
  5283.  
  5284. The move operations are: 
  5285.  
  5286.  MOVE (Move) 
  5287.  MOVEA (Move Array) 
  5288.  MOVEL (Move Left). 
  5289.  
  5290. Move operations transfer all or part of factor 2 to the result field.  Factor 2 
  5291. remains unchanged.  Factor 1 must be blank. Resulting indicators can be 
  5292. specified in positions 54 through 59., except for the MOVE and MOVEL operations 
  5293. if the result field is an array, or for the MOVEA operation if the result field 
  5294. is an array or array element. 
  5295.  
  5296. In the move operations, factor 2 and the result field are generally of the same 
  5297. type (both numeric or both character). However, you can use the move operations 
  5298. to change numeric fields to character fields and character fields to numeric 
  5299. fields.  To change a numeric field to a character field, enter the name of the 
  5300. numeric field in factor 2 and specify a character result field.  To change a 
  5301. character field to a numeric field, enter the name of the character field in 
  5302. factor 2 and specify a numeric result field. 
  5303.  
  5304. When a character field is moved into a numeric result field, the digit portion 
  5305. of each character is converted to its corresponding numeric character and then 
  5306. moved to the result field.  Blanks are transferred as zeros.  For the MOVE 
  5307. operation, the zone portion of the rightmost character is converted to its 
  5308. corresponding sign and moved to the rightmost position of the numeric result 
  5309. field. It becomes the sign of the field. (See Figure "MOVE Operation" for an 
  5310. example.)  For the MOVEL operation, the zone portion of the rightmost character 
  5311. of factor 2 is converted and used as the sign of the result field (unless 
  5312. factor 2 is shorter than the result field) whether or not the rightmost 
  5313. character is included in the move operation. (See Figure "MOVEL Operation" for 
  5314. an example.) 
  5315.  
  5316. If move operations are specified to move data into numeric fields, the decimal 
  5317. positions specified for the factor 2 field are ignored. For example, if 1.00 is 
  5318. moved into a three-position numeric field with one decimal position, the result 
  5319. is 10.0. 
  5320.  
  5321. If you specify P in position 53 for a move operation, the result field is 
  5322. padded from the right for MOVEL and MOVEA and from the left for MOVE. The pad 
  5323. characters are blank for character, 0 for numeric and '0' for indicator. The 
  5324. padding takes place after the operation. If you use MOVE or MOVEL to move a 
  5325. field to an array, each element of the array will be padded. If you use these 
  5326. operations to move an array to an array and the result contains more elements 
  5327. than the factor 2 array, the same padding takes place but the extra elements 
  5328. are not affected. A MOVEA operation with an array name in the result field will 
  5329. pad the last element affected by the operation plus all subsequent elements. 
  5330.  
  5331. When resulting indicators are specified for move operations, the result field 
  5332. determines which indicator is set on. If the result field is a character field, 
  5333. only the resulting indicator in positions 58 and 59 can be specified. This 
  5334. indicator is set on if the result field is all blanks. When the result field is 
  5335. numeric, all three resulting indicator positions may be used. These indicators 
  5336. are set on as follows: 
  5337.  
  5338. High (54-55)    Set on if the result field is greater than 0. 
  5339. Low (56-57)     Set on if the result field is less than 0. 
  5340. Equal (58-59)   Set on if the result field is equal to 0. 
  5341.  
  5342.  
  5343. ΓòÉΓòÉΓòÉ 1.10.15. Move Zone Operations ΓòÉΓòÉΓòÉ
  5344.  
  5345. The move zone operations are: 
  5346.  
  5347.  MHHZO (Move High to High Zone) 
  5348.  MHLZO (Move High to Low Zone) 
  5349.  MLHZO (Move Low to High Zone) 
  5350.  MLLZO (Move Low to Low Zone). 
  5351.  
  5352. The move zone operations move only the zone portion of a character. 
  5353.  
  5354. A minus (-) sign in a move zone operation does not result in a negative 
  5355. character in the result field, because a minus sign is represented by a 
  5356. hexadecimal 60 internally and a D zone is required for a negative character. 
  5357. Characters J through R have D zones and can be used to obtain a negative value 
  5358.  
  5359. (J = hexadecimal D1, ..., R = hexadecimal D9).
  5360.  
  5361. Note:   Whenever the word high is used in a move zone operation, the field 
  5362. involved must be a character field; whenever low is used, the field involved 
  5363. can be either a character or a numeric field. 
  5364.  
  5365.  
  5366. Function of MOVE Zone Operations
  5367.  
  5368. Character Γöé     Γöé     Γöé     Γöé     Γöé     Γöé Factor
  5369.     Γöé     Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Two
  5370.     Γöé     ΓööΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÿ
  5371.     Γöé      ΓöéΓöé         MLHZO        ΓöéΓöé
  5372.     Γöé MHHZOΓöéΓöéΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿΓöéMLLZO
  5373.     Γöé      ΓöéΓööΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉΓöé
  5374.     Γöé      ΓöéΓöîΓöÿ        MHLZO        ΓöéΓöé
  5375.     Γöé                            
  5376.     Γöé     Γöé     Γöé     Γöé     Γöé     Γöé     Γöé
  5377.          Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé Result
  5378. Character ΓööΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÿ Field
  5379.  
  5380.  
  5381. Character Γöé     Γöé     Γöé     Γöé     Γöé     Γöé Factor
  5382.     Γöé     Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Two
  5383.     Γöé     ΓööΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÿ
  5384.     Γöé      Γöé                        Γöé
  5385.     Γöé      Γöé                        ΓöéMLLZO
  5386.     Γöé      ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉΓöé
  5387.     Γöé                 MHLZO        ΓöéΓöé
  5388.     Γöé                              
  5389.     Γöé     Γöé     Γöé     Γöé     Γöé     Γöé     Γöé
  5390.          Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé Result
  5391.  Numeric  ΓööΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÿ Field
  5392.  
  5393.  
  5394.  Numeric  Γöé     Γöé     Γöé     Γöé     Γöé     Γöé Factor
  5395.     Γöé     Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Two
  5396.     Γöé     ΓööΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÿ
  5397.     Γöé                 MLHZO        ΓöéΓöé
  5398.     Γöé      ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿΓöéMLLZO
  5399.     Γöé      Γöé                        Γöé
  5400.     Γöé      Γöé                        Γöé
  5401.     Γöé                              
  5402.     Γöé     Γöé     Γöé     Γöé     Γöé     Γöé     Γöé
  5403.          Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé Result
  5404. Character ΓööΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÿ Field
  5405.  
  5406.  
  5407. Numeric  Γöé     Γöé     Γöé     Γöé     Γöé     Γöé Factor
  5408.    Γöé     Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Two
  5409.    Γöé     ΓööΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÿ
  5410.    Γöé                               Γöé
  5411.    Γöé                               ΓöéMLLZO
  5412.    Γöé                               Γöé
  5413.    Γöé                               Γöé
  5414.    Γöé                               
  5415.    Γöé     Γöé     Γöé     Γöé     Γöé     Γöé     Γöé
  5416.         Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé  Γöé Result
  5417. Numeric  ΓööΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÿ Field
  5418.  
  5419.  
  5420. ΓòÉΓòÉΓòÉ 1.10.16. String Operations ΓòÉΓòÉΓòÉ
  5421.  
  5422. The string operations include concatenation, scanning, substringing, 
  5423. translation, and verification. String operations can only be used on character 
  5424. fields. 
  5425.  
  5426. The string operations are: 
  5427.  
  5428.  CAT (Concatenate Two Character Strings) 
  5429.  CHECK (Check Characters) 
  5430.  CHEKR (Check Reverse) 
  5431.  SCAN (Scan Character String) 
  5432.  SUBST (Substring) 
  5433.  XLATE (Translate). 
  5434.  
  5435. The CAT operation concatenates two character strings to form one. 
  5436.  
  5437. The CHECK and CHEKR operations verify that each character in factor 2 is among 
  5438. the valid characters in factor 1. CHECK verifies from left to right and CHEKR 
  5439. from right to left. 
  5440.  
  5441. The SCAN operation scans a base character string for occurrences of a second 
  5442. specified character string. 
  5443.  
  5444. The SUBST operation extracts a specified character string from a base character 
  5445. string. 
  5446.  
  5447. The XLATE operation translates characters in factor 2 according to the from and 
  5448. to strings in factor 1. 
  5449.  
  5450. Note:   Figurative constants cannot be used in the factor 1, factor 2, or 
  5451. result fields. No overlapping in a data structure is allowed for factor 1 and 
  5452. the result field, or factor 2 and the result field. 
  5453.  
  5454. In the string operations, factor 1 and factor 2 may have two parts. If both 
  5455. parts are specified, they must be separated by a colon. This option applies to 
  5456. all but the CAT, CHECK, CHEKR, and SUBST operations (where it applies only to 
  5457. factor 2). 
  5458.  
  5459. If you specify P in position 53 for the CAT, SUBST, or XLATE operations, the 
  5460. result field is padded from the right with blanks after the operation. 
  5461.  
  5462. See each operation for a more detailed explanation. 
  5463.  
  5464.  
  5465. ΓòÉΓòÉΓòÉ 1.10.17. Structured Programming Operations ΓòÉΓòÉΓòÉ
  5466.  
  5467.  
  5468.  
  5469. The structured programming operations are: 
  5470.  
  5471.  ANDxx (And) 
  5472.  CASxx (Conditionally Invoke Subroutine) 
  5473.  DO (Do) 
  5474.  DOUxx (Do Until) 
  5475.  DOWxx (Do While) 
  5476.  ELSE (Else) 
  5477.  ENDyy (End a Group) 
  5478.  IFxx (If) 
  5479.  ITER (Iterate) 
  5480.  LEAVE (Leave a Do Group) 
  5481.  ORxx (Or) 
  5482.  OTHER (Otherwise Select) 
  5483.  SELEC (Begin a Select Group) 
  5484.  WHxx (When True Then Select). 
  5485.  
  5486. The DO operation allows the processing of a group of calculations zero or more 
  5487. times starting with the value in factor 1, incrementing each time by a value on 
  5488. the associated ENDDO operation until the limit specified in factor 2 is 
  5489. reached. 
  5490.  
  5491. The DOUxx operation allows the processing of a group of calculations one or 
  5492. more times based on the results of comparing factor 1 and factor 2. The end of 
  5493. a DOUxx operation is indicated by an ENDDO operation. 
  5494.  
  5495. The DOWxx operation allows the processing of a group of calculations zero or 
  5496. more times based on the results of comparing factor 1 and factor 2. The end of 
  5497. a DOWxx operation is indicated by an ENDDO operation. 
  5498.  
  5499. The LEAVE operation interrupts control flow prematurely and transfers control 
  5500. to the statement following the ENDDO operation of an iterative structured 
  5501. group.  The ITER operation causes the next loop iteration to occur immediately. 
  5502.  
  5503. An IFxx operation allows the processing of a group of calculations based on the 
  5504. results of comparing factor 1 and factor 2. The ELSE operation allows you to 
  5505. specify a group of calculations to be processed if the IFxx condition is not 
  5506. satisfied. The end of an IFxx group is indicated by ENDIF. 
  5507.  
  5508. The SELEC, WHxx, and OTHER group of operations are used to conditionally 
  5509. process one of several alternative sequences of operations.  The beginning of 
  5510. the select group is indicated by the SELEC operation. The WHxx operations are 
  5511. used to choose the operation sequence to process. The OTHER operation is used 
  5512. to indicate an operation sequence that is processed when none of the WHxx 
  5513. conditions are fulfilled.  The end of the select group is indicated by the 
  5514. ENDSL operation. 
  5515.  
  5516. The ANDxx and ORxx operations are used with the DOUxx, DOWxx, WHxx, and IFxx 
  5517. operations to specify a more complex condition than the comparison of a single 
  5518. factor 1 and factor 2 pair. The ANDxx operation has higher precedence than the 
  5519. ORxx operation. 
  5520.  
  5521.  
  5522. Example of AND/OR Precedence
  5523.  
  5524. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  5525. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  5526. C*
  5527. C* In the following example, indicator 25 will be set on only if the
  5528. C* first two conditions are true or the third condition is true.
  5529. C* Algebraically, this would be represented as:
  5530. C* ( ( (FIELDA > FIELDB) & (FIELDA >= FIELDC) ) | (FIELDA < FIELDD) )
  5531. C*
  5532. C           FIELDA    IFGT FIELDB
  5533. C           FIELDA    ANDGEFIELDC
  5534. C           FIELDA    ORLT FIELDD
  5535. C                     SETON                     25
  5536. C                     ENDIF
  5537.  
  5538. The CASxx operation allows a subroutine to be conditionally selected for 
  5539. processing. An ENDCS operation ends a CASxx group. For more information about 
  5540. the CASxx operation, see Compare Operations. 
  5541.  
  5542. A DO, DOUxx, DOWxx, IFxx, or SELEC operation (with or without ANDxx or ORxx 
  5543. operations), and an ENDyy operation, delimit a structured group. The ENDDO 
  5544. operation ends each DO, DOUxx, and DOWxx group or causes the structured group 
  5545. to be reprocessed until the specified ending conditions are met. The SELEC must 
  5546. end with an ENDSL. An IFxx operation and an IFxx operation with an ELSE 
  5547. operation must end with an ENDIF operation. Using END gives you the same 
  5548. results as using ENDIF, ENDSL, or ENDDO. 
  5549.  
  5550. The rules for making the comparison on the ANDxx, DOUxx, DOWxx, IFxx, ORxx and 
  5551. WHxx operation codes are the same as those given under Compare Operations. 
  5552.  
  5553. In the ANDxx, CASxx, DOUxx, DOWxx, IFxx, ORxx, and WHxx operations, xx can be: 
  5554.  
  5555. xx           Meaning 
  5556. GT           Factor 1 is greater than factor 2. 
  5557. LT           Factor 1 is less than factor 2. 
  5558. EQ           Factor 1 is equal to factor 2. 
  5559. NE           Factor 1 is not equal to factor 2. 
  5560. GE           Factor 1 is greater than or equal to factor 2. 
  5561. LE           Factor 1 is less than or equal to factor 2. 
  5562. Blanks       Unconditional processing (CASxx only). 
  5563.  
  5564. In the ENDyy operation, yy can be: 
  5565.  
  5566. yy           Meaning 
  5567. CS           End for CASxx operation. 
  5568. DO           End for DO, DOUxx, and DOWxx operation. 
  5569. IF           End for IFxx operation. 
  5570. SL           End for SELEC operation. 
  5571. Blanks       End for any structured operation. 
  5572.  
  5573. Note:   The yy in the ENDyy operation is optional. 
  5574.  
  5575. If a structured group, in this case a do group, contains another complete 
  5576. structured group, together they form a nested structured group. Structured 
  5577. groups can be nested to a maximum depth of 100 levels. The following is an 
  5578. example of nested structured groups, three levels deep: 
  5579.  
  5580. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇDO
  5581. Γöé     ΓöîΓöÇΓöÇΓöÇDO
  5582. Γöé     ΓööΓöÇΓöÇΓöÇENDDO
  5583. Γöé  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇIFxx
  5584. Γöé  Γöé  ΓöîΓöÇΓöÇΓöÇSELEC
  5585. Γöé  Γöé  Γöé   WHxx
  5586. Γöé  Γöé  ΓööΓöÇΓöÇΓöÇENDSL
  5587. Γöé  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇELSE
  5588. Γöé  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇENDIF
  5589. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇENDDO
  5590.  
  5591. Remember the following when specifying structured groups: 
  5592.  
  5593.  Each nested structured group must be completely contained within the outer 
  5594.   level structured group. 
  5595.  Each structured group must contain one of a DO, DOUxx, DOWxx, IFxx, or SELEC 
  5596.   operation and its associated ENDyy operation. 
  5597.  A structured group can be contained in detail, total, or subroutine 
  5598.   calculations, but it cannot be split among them. 
  5599.  Branching into a structured group from outside the structured group may cause 
  5600.   undesirable results. 
  5601.  
  5602.  
  5603. ΓòÉΓòÉΓòÉ 1.10.18. Subroutine Operations ΓòÉΓòÉΓòÉ
  5604.  
  5605. An RPG/400 subroutine is a group of calculation specification statements in a 
  5606. program that can be processed several times in that program. The RPG/400 
  5607. subroutine operations are: 
  5608.  
  5609.  BEGSR (Beginning of Subroutine) 
  5610.  ENDSR (End of Subroutine) 
  5611.  EXSR (Invoke Subroutine) 
  5612.  CASxx (Conditionally Invoke Subroutine). 
  5613.  
  5614. RPG/400 subroutine specifications must follow all other calculation operations 
  5615. that can be processed for a program; however, the PLIST, PARM, KLIST, KFLD, and 
  5616. DEFN operations may be specified between an ENDSR operation (the end of one 
  5617. subroutine) and a BEGSR operation (the beginning of another subroutine) or 
  5618. after all subroutines.  A subroutine can be called from any point in the 
  5619. calculation operations.  Subroutine lines can be identified by SR in positions 
  5620. 7 and 8. The only valid entries in positions 7 and 8 of a subroutine line are 
  5621. SR, AN, OR, or blanks. 
  5622.  
  5623. For information on how to code a subroutine, see Coding Subroutines. 
  5624.  
  5625.  
  5626. ΓòÉΓòÉΓòÉ 1.10.19. Test Operations ΓòÉΓòÉΓòÉ
  5627.  
  5628. The test operations are: 
  5629.  
  5630.  TESTB (Test Bit) 
  5631.  TESTN (Test Numeric) 
  5632.  TESTZ (Test Zone). 
  5633.  
  5634. The TESTx operations allow you to test character fields specified in the result 
  5635. field. 
  5636.  
  5637.  
  5638. ΓòÉΓòÉΓòÉ <hidden> Operation Codes List ΓòÉΓòÉΓòÉ
  5639.  
  5640. The contents of the operation field on the referenced line are not valid. The 
  5641. valid operation codes are: 
  5642.  
  5643.  ACQ (Acquire) 
  5644.  ADD (Add) 
  5645.  ANDxx (And) 
  5646.  BEGSR (Beginning of Subroutine) 
  5647.  BITOF (Set Bits Off) 
  5648.  BITON (Set Bits On) 
  5649.  CABxx (Compare and Branch) 
  5650.  CALL (Call a Program) 
  5651.  CASxx (Conditionally Invoke Subroutine) 
  5652.  CAT (Concatenate Two Character Strings) 
  5653.  CHAIN (Random Retrieval from a File) 
  5654.  CHECK (Check Characters) 
  5655.  CHEKR (Check Reverse) 
  5656.  CLEAR (Clear) 
  5657.  CLOSE (Close Files) 
  5658.  COMIT (Commit) 
  5659.  COMP (Compare) 
  5660.  DEBUG (Debug Function) 
  5661.  DEFN (Field Definition) 
  5662.  DELET (Delete Record) 
  5663.  DIV (Divide) 
  5664.  DO (Do) 
  5665.  DOUxx (Do Until) 
  5666.  DOWxx (Do While) 
  5667.  DSPLY (Display Function) 
  5668.  DUMP (Program Dump) 
  5669.  ELSE (Else) 
  5670.  ENDyy (End a Group) 
  5671.  ENDSR (End of Subroutine) 
  5672.  EXCPT (Calculation Time Output) 
  5673.  EXFMT (Write/Then Read Format) 
  5674.  EXSR (Invoke Subroutine) 
  5675.  FEOD (Force End of Data) 
  5676.  FORCE (Force a Certain File to Be Read Next Cycle) 
  5677.  FREE (Deactivate a Program) 
  5678.  GOTO (Go To) 
  5679.  IFxx (If) 
  5680.  IN (Retrieve a Data Area) 
  5681.  ITER (Iterate) 
  5682.  KFLD (Define Parts of a Key) 
  5683.  KLIST (Define a Composite Key) 
  5684.  LEAVE (Leave a Do Group) 
  5685.  LOKUP (Look Up) 
  5686.  MHHZO (Move High to High Zone) 
  5687.  MHLZO (Move High to Low Zone) 
  5688.  MLHZO (Move Low to High Zone) 
  5689.  MLLZO (Move Low to Low Zone) 
  5690.  MOVE (Move) 
  5691.  MOVEA (Move Array) 
  5692.  MOVEL (Move Left) 
  5693.  MULT (Multiply) 
  5694.  MVR (Move Remainder) 
  5695.  NEXT (Next) 
  5696.  OCUR (Set/Get Occurrence of a Data Structure) 
  5697.  OPEN (Open File for Processing) 
  5698.  ORxx (Or) 
  5699.  OTHER (Otherwise Select) 
  5700.  OUT (Write a Data Area) 
  5701.  PARM (Identify Parameters) 
  5702.  PLIST (Identify a Parameter List) 
  5703.  POST (Post) 
  5704.  READ (Read a Record) 
  5705.  READC (Read Next Changed Record) 
  5706.  READE (Read Equal Key) 
  5707.  READP (Read Prior Record) 
  5708.  REDPE (Read Prior Equal) 
  5709.  REL (Release) 
  5710.  RESET (Reset) 
  5711.  RETRN (Return to Caller) 
  5712.  ROLBK (Roll Back) 
  5713.  SCAN (Scan Character String) 
  5714.  SELEC (Begin a Select Group) 
  5715.  SETGT (Set Greater Than) 
  5716.  SETLL (Set Lower Limit) 
  5717.  SETOF (Set Off) 
  5718.  SETON (Set On) 
  5719.  SHTDN (Shut Down) 
  5720.  SORTA (Sort an Array) 
  5721.  SQRT (Square Root) 
  5722.  SUB (Subtract) 
  5723.  SUBST (Substring) 
  5724.  TAG (Tag) 
  5725.  TESTB (Test Bit) 
  5726.  TESTN (Test Numeric) 
  5727.  TESTZ (Test Zone) 
  5728.  TIME (Time of Day) 
  5729.  UNLCK (Unlock a Data Area or Release a Record) 
  5730.  UPDAT (Modify Existing Record) 
  5731.  WHxx (When True Then Select) 
  5732.  WRITE (Create New Records) 
  5733.  XFOOT ( Summing the Elements of an Array) 
  5734.  XLATE (Translate) 
  5735.  Z-ADD (Zero and Add) 
  5736.  Z-SUB (Zero and Subtract) 
  5737.  
  5738.  
  5739. ΓòÉΓòÉΓòÉ 1.10.20. Operation Codes List ΓòÉΓòÉΓòÉ
  5740.  
  5741. The operation codes are: 
  5742.  
  5743.  ACQ (Acquire) 
  5744.  ADD (Add) 
  5745.  ANDxx (And) 
  5746.  BEGSR (Beginning of Subroutine) 
  5747.  BITOF (Set Bits Off) 
  5748.  BITON (Set Bits On) 
  5749.  CABxx (Compare and Branch) 
  5750.  CALL (Call a Program) 
  5751.  CASxx (Conditionally Invoke Subroutine) 
  5752.  CAT (Concatenate Two Character Strings) 
  5753.  CHAIN (Random Retrieval from a File) 
  5754.  CHECK (Check Characters) 
  5755.  CHEKR (Check Reverse) 
  5756.  CLEAR (Clear) 
  5757.  CLOSE (Close Files) 
  5758.  COMIT (Commit) 
  5759.  COMP (Compare) 
  5760.  DEBUG (Debug Function) 
  5761.  DEFN (Field Definition) 
  5762.  DELET (Delete Record) 
  5763.  DIV (Divide) 
  5764.  DO (Do) 
  5765.  DOUxx (Do Until) 
  5766.  DOWxx (Do While) 
  5767.  DSPLY (Display Function) 
  5768.  DUMP (Program Dump) 
  5769.  ELSE (Else) 
  5770.  ENDyy (End a Group) 
  5771.  ENDSR (End of Subroutine) 
  5772.  EXCPT (Calculation Time Output) 
  5773.  EXFMT (Write/Then Read Format) 
  5774.  EXSR (Invoke Subroutine) 
  5775.  FEOD (Force End of Data) 
  5776.  FORCE (Force a Certain File to Be Read Next Cycle) 
  5777.  FREE (Deactivate a Program) 
  5778.  GOTO (Go To) 
  5779.  IFxx (If) 
  5780.  IN (Retrieve a Data Area) 
  5781.  ITER (Iterate) 
  5782.  KFLD (Define Parts of a Key) 
  5783.  KLIST (Define a Composite Key) 
  5784.  LEAVE (Leave a Do Group) 
  5785.  LOKUP (Look Up) 
  5786.  MHHZO (Move High to High Zone) 
  5787.  MHLZO (Move High to Low Zone) 
  5788.  MLHZO (Move Low to High Zone) 
  5789.  MLLZO (Move Low to Low Zone) 
  5790.  MOVE (Move) 
  5791.  MOVEA (Move Array) 
  5792.  MOVEL (Move Left) 
  5793.  MULT (Multiply) 
  5794.  MVR (Move Remainder) 
  5795.  NEXT (Next) 
  5796.  OCUR (Set/Get Occurrence of a Data Structure) 
  5797.  OPEN (Open File for Processing) 
  5798.  ORxx (Or) 
  5799.  OTHER (Otherwise Select) 
  5800.  OUT (Write a Data Area) 
  5801.  PARM (Identify Parameters) 
  5802.  PLIST (Identify a Parameter List) 
  5803.  POST (Post) 
  5804.  READ (Read a Record) 
  5805.  READC (Read Next Changed Record) 
  5806.  READE (Read Equal Key) 
  5807.  READP (Read Prior Record) 
  5808.  REDPE (Read Prior Equal) 
  5809.  REL (Release) 
  5810.  RESET (Reset) 
  5811.  RETRN (Return to Caller) 
  5812.  ROLBK (Roll Back) 
  5813.  SCAN (Scan Character String) 
  5814.  SELEC (Begin a Select Group) 
  5815.  SETGT (Set Greater Than) 
  5816.  SETLL (Set Lower Limit) 
  5817.  SETOF (Set Off) 
  5818.  SETON (Set On) 
  5819.  SHTDN (Shut Down) 
  5820.  SORTA (Sort an Array) 
  5821.  SQRT (Square Root) 
  5822.  SUB (Subtract) 
  5823.  SUBST (Substring) 
  5824.  TAG (Tag) 
  5825.  TESTB (Test Bit) 
  5826.  TESTN (Test Numeric) 
  5827.  TESTZ (Test Zone) 
  5828.  TIME (Time of Day) 
  5829.  UNLCK (Unlock a Data Area or Release a Record) 
  5830.  UPDAT (Modify Existing Record) 
  5831.  WHxx (When True Then Select) 
  5832.  WRITE (Create New Records) 
  5833.  XFOOT (Summing the Elements of an Array) 
  5834.  XLATE (Translate) 
  5835.  Z-ADD (Zero and Add) 
  5836.  Z-SUB (Zero and Subtract) 
  5837.  
  5838.  
  5839. ΓòÉΓòÉΓòÉ 1.10.20.1. ACQ (Acquire) ΓòÉΓòÉΓòÉ
  5840.  
  5841. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  5842. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  5843. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  5844. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5845. Γöé ACQ     Γöé Device name   Γöé WORKSTN file    Γöé          Γöé  _ ER _ Γöé
  5846. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  5847.  
  5848. The ACQ operation acquires the program device specified in factor 1 for the 
  5849. WORKSTN file specified in factor 2.  If the device is available, ACQ attaches 
  5850. it to the file. If it is not available or is already attached to the file, an 
  5851. error occurs. If an indicator is specified in positions 56 and 57, the 
  5852. indicator is set on.  If no indicator is specified, but the INFSR subroutine is 
  5853. specified, the INFSR receives control when an error/exception occurs.  If no 
  5854. indicator or INFSR subroutine is specified, the default error/exception handler 
  5855. receives control when an error/exception occurs. 
  5856.  
  5857. No input or output operation occurs when the ACQ operation is processed. ACQ 
  5858. must only be used with a multiple device file. See the section on 
  5859. "Multiple-Device Files" in the chapter about using WORKSTN files in the 
  5860. RPG/400* User's Guide. 
  5861.  
  5862.  
  5863. ΓòÉΓòÉΓòÉ 1.10.20.2. ADD (Add) ΓòÉΓòÉΓòÉ
  5864.  
  5865. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  5866. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  5867. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  5868. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5869. Γöé ADD(1/2)Γöé Addend        Γöé Addend          Γöé Sum      Γöé  + - Z  Γöé
  5870. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  5871.  
  5872. If factor 1 is specified, the ADD operation adds it to factor 2 and places the 
  5873. sum in the result field.  If factor 1 is not specified, the contents of factor 
  5874. 2 are added to the result field and the sum is placed in the result field. 
  5875. Factor 1 and factor 2 must be numeric and can contain one of: an array, array 
  5876. element, constant, field name, literal, subfield, or table name. For the rules 
  5877. for specifying an ADD operation, see Arithmetic Operations. 
  5878.  
  5879.  
  5880. ADD Operations
  5881.  
  5882. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  5883. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  5884. C*
  5885. C* The value 1 is added to RECNO.
  5886. C                     ADD  1         RECNO
  5887. C* The contents of EHWRK are added to CURHRS.
  5888. C                     ADD  EHWRK     CURHRS
  5889. C* The contents of OVRTM and REGHRS are added together and
  5890. C* placed in TOTPAY.
  5891. C           OVRTM     ADD  REGHRS    TOTPAY
  5892.  
  5893.  
  5894. ΓòÉΓòÉΓòÉ 1.10.20.3. ANDxx (And) ΓòÉΓòÉΓòÉ
  5895.  
  5896. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  5897. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  5898. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  5899. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5900. Γöé ANDXX   Γöé Comparand     Γöé Comparand       Γöé          Γöé         Γöé
  5901. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  5902.  
  5903. If you specify this optional operation, it must immediately follow a ANDxx, 
  5904. DOUxx, DOWxx, IFxx, ORxx, or WHxx operation. With ANDxx, you can specify a 
  5905. complex condition for the DOUxx, DOWxx, IFxx, and WHxx operations. The ANDxx 
  5906. operation has higher precedence than the ORxx operation. 
  5907.  
  5908. The control level entry (positions 7 and 8) can be blank or can contain an L1 
  5909. through L9 indicator, an LR indicator, or an L0 entry to group the statement 
  5910. within the appropriate section of the program. The control level entry must be 
  5911. the same as the control level entry for the associated DOUxx, DOWxx, IFxx, or 
  5912. WHxx operation. Conditioning indicator entries (positions 9 through 17) are not 
  5913. permitted. 
  5914.  
  5915. Factor 1 and factor 2 must contain a literal, a named constant, a figurative 
  5916. constant, a table name, an array element, a data structure name, or a field 
  5917. name. Factor 1 and factor 2 must be either both character data or both numeric 
  5918. data. The comparison of factor 1 and factor 2 follows the same rules as those 
  5919. given for the compare operations.  See Compare Operations. 
  5920.  
  5921.  
  5922. ANDxx Operations
  5923.  
  5924. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  5925. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  5926. C*
  5927. C* If ACODE is equal to A and indicator 50 is on, the MOVE
  5928. C* and WRITE operations are processed.
  5929. C           ACODE     IFEQ 'A'
  5930. C           *IN50     ANDEQ*ON
  5931. C                     MOVE 'A'       ACREC
  5932. C                     WRITERCRSN
  5933. C* If the previous conditions were not met but ACODE is equal
  5934. C* to A, indicator 50 is off, and ACREC is equal to D, the
  5935. C* following MOVE operation is processed.
  5936. C                     ELSE
  5937. C           ACODE     IFEQ 'A'
  5938. C           *IN50     ANDEQ*OFF
  5939. C           ACREC     ANDEQ'D'
  5940. C                     MOVE 'A'       ACREC
  5941. C                     ENDIF
  5942. C                     ENDIF
  5943.  
  5944.  
  5945. ΓòÉΓòÉΓòÉ 1.10.20.4. BEGSR (Beginning of Subroutine) ΓòÉΓòÉΓòÉ
  5946.  
  5947. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  5948. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  5949. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  5950. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5951. Γöé BEGSR   Γöé Subroutine    Γöé                 Γöé          Γöé         Γöé
  5952. Γöé         Γöé name          Γöé                 Γöé          Γöé         Γöé
  5953. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  5954.  
  5955. The BEGSR operation identifies the beginning of an RPG/400 subroutine. Factor 1 
  5956. contains the subroutine name. You must specify the same name in factor 2 of the 
  5957. EXSR operation referring to the subroutine, in the result field of the CASxx 
  5958. operation referring to the subroutine, or in the entry of an INFSR file 
  5959. continuation option if the subroutine is a file-error subroutine. The control 
  5960. level entry (positions 7 and 8) can be SR or blank. Conditioning indicator 
  5961. entries are not permitted. 
  5962.  
  5963. Every subroutine must have a unique symbolic name. The keyword *PSSR used in 
  5964. factor 1 specifies that this is a program exception/error subroutine to handle 
  5965. program-detected exception/errors. Only one subroutine can be defined by this 
  5966. keyword. *INZSR in factor 1 specifies a subroutine to be run during the 
  5967. initialization step. Only one subroutine can be defined *INZSR. 
  5968.  
  5969. See Figure "Example of Coding Subroutines" for an example of coding 
  5970. subroutines; see Subroutine Operations for general information on subroutine 
  5971. operations. 
  5972.  
  5973.  
  5974. ΓòÉΓòÉΓòÉ 1.10.20.5. BITOF (Set Bits Off) ΓòÉΓòÉΓòÉ
  5975.  
  5976. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  5977. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  5978. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  5979. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5980. Γöé BITOF   Γöé               Γöé Bit numbers     Γöé Char-    Γöé         Γöé
  5981. Γöé         Γöé               Γöé                 Γöé acter    Γöé         Γöé
  5982. Γöé         Γöé               Γöé                 Γöé field    Γöé         Γöé
  5983. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  5984.  
  5985. The BITOF operation causes bits identified in factor 2 to be set off (set to 0) 
  5986. in the result field.  Bits not identified in factor 2 remain unchanged. 
  5987. Therefore, when using BITOF to format a character, you should use both BITON 
  5988. and BITOF: BITON to specify the bits to be set on (=1), and BITOF to specify 
  5989. the bits to be set off (=0). Unless you explicitly set on or off all the bits 
  5990. in the character, you might not get the character you want. 
  5991.  
  5992. Factor 2 can contain: 
  5993.  
  5994.  Bit numbers 0-7:  From 1 to 8 bits can be set off per operation.  They are 
  5995.   identified by the numbers 0 through 7. (0 is the leftmost bit.) Enclose the 
  5996.   bit numbers in apostrophes, and begin the entry in position 33. For example, 
  5997.   to set off bits 0, 2, and 5, enter '025' in factor 2. 
  5998.  Field name: You can specify the name of a one-position character field, table 
  5999.   element, or array element in factor 2. The bits that are on in the field, 
  6000.   table element, or array element are set off in the result field; bits that 
  6001.   are off are not affected. 
  6002.  Hexadecimal literal or named constant: You can specify a 1-byte hexadecimal 
  6003.   literal or hexadecimal named constant. Bits that are on in factor 2 are set 
  6004.   off in the result field; bits that are off are not affected. 
  6005.  Named constant:  A character named constant up to eight positions long 
  6006.   containing the bit numbers to be set off. 
  6007.  
  6008. In the result field, specify a one-position character field. It can be an array 
  6009. element if each element in the array is a one-position character field. 
  6010.  
  6011. See Figure "BITON and BITOF Operations" for an example of the BITOF operation. 
  6012.  
  6013.  
  6014. ΓòÉΓòÉΓòÉ 1.10.20.6. BITON (Set Bits On) ΓòÉΓòÉΓòÉ
  6015.  
  6016. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6017. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  6018. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  6019. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6020. Γöé BITON   Γöé               Γöé Bit numbers     Γöé Char-    Γöé         Γöé
  6021. Γöé         Γöé               Γöé                 Γöé acter    Γöé         Γöé
  6022. Γöé         Γöé               Γöé                 Γöé field    Γöé         Γöé
  6023. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6024.  
  6025. The BITON operation causes bits identified in factor 2 to be set on (set to 1) 
  6026. in the result field.  Bits not identified in factor 2 remain unchanged. 
  6027. Therefore, when using BITON to format a character, you should use both BITON 
  6028. and BITOF: BITON to specify the bits to be set on (=1), and BITOF to specify 
  6029. the bits to be set off (=0). Unless you explicitly set on or off all the bits 
  6030. in the character, you might not get the character you want. 
  6031.  
  6032. Factor 2 can contain: 
  6033.  
  6034.  Bit numbers 0-7:  From 1 to 8 bits can be set on per operation. They are 
  6035.   identified by the numbers 0 through 7. (0 is the leftmost bit.) Enclose the 
  6036.   bit numbers in apostrophes, and begin the entry in position 33. For example, 
  6037.   to set bits 0, 2, and 5 on, enter '025' in factor 2. 
  6038.  Field name: You can specify the name of a one-position character field, table 
  6039.   element, or array element in factor 2. The bits that are on in the field, 
  6040.   table element, or array element are set on in the result field; bits that are 
  6041.   off are not affected. 
  6042.  Hexadecimal literal or named constant: You can specify a 1-byte hexadecimal 
  6043.   literal. Bits that are on in factor 2 are set on in the result field; bits 
  6044.   that are off are not affected. 
  6045.  Named constant:  A character named constant up to eight positions long 
  6046.   containing the bit numbers to be set on. 
  6047.  
  6048. In the result field, specify a one-position character field. It can be an array 
  6049. element if each element in the array is a one-position character field. 
  6050.  
  6051. Figure "BITON and BITOF Operations" illustrates uses of the BITON operation. 
  6052.  
  6053.  
  6054. ΓòÉΓòÉΓòÉ 1.10.20.6.1. BITON and BITOF Examples ΓòÉΓòÉΓòÉ
  6055.  
  6056. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  6057. I..............Namedconstant+++++++++C.........Fldnme......... ....
  6058. I              '01234567'            C         BITNC
  6059. I              X'0F'                 C         HEXNC
  6060. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  6061. C*
  6062. C*  Before the operations are processed, the bit settings are:
  6063. C*                FLDA = 00000000
  6064. C*                FLDB = 00000000
  6065. C*                FLDC = 11111111
  6066. C*                FLDD = 11000000
  6067. C*                FLDE = 11000000
  6068. C*                FLDF = 10000001
  6069. C*                FLDG = 11111111                       AFTER
  6070. C*                FLDH = 00000000                     OPERATIONS
  6071. C*                FLDI = 11001010                     ----------
  6072. C*
  6073. C                     BITON'04567'   FLDA             = 10001111
  6074. C                     BITON'3'       FLDB             = 00010000
  6075. C                     BITON'3'       FLDC             = 11111111
  6076. C                     BITON'3'       FLDD             = 11010000
  6077. C                     BITONFLDE      FLDF             = 11000001
  6078. C                     BITONX'01'     FLDH             = 00000001
  6079. C*
  6080. C                     BITOF'0'       FLDG             = 01111111
  6081. C*
  6082. C                     BITOFBITNC     FLDI             = 00001110
  6083. C                     BITONHEXNC     FLDI             = 00001111
  6084.  
  6085. BITON and BITOF Operations 
  6086.  
  6087.  
  6088. ΓòÉΓòÉΓòÉ 1.10.20.7. CABxx (Compare and Branch) ΓòÉΓòÉΓòÉ
  6089.  
  6090. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6091. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  6092. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  6093. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6094. Γöé CABXX   Γöé Comparand     Γöé Comparand       Γöé Label    Γöé  HI LO  Γöé
  6095. Γöé         Γöé               Γöé                 Γöé          Γöé    EQ   Γöé
  6096. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6097.  
  6098. The CABxx operation compares factor 1 with factor 2.  If the condition 
  6099. specified by xx is true, the program branches to the TAG operation associated 
  6100. with the label specified in the result field. Otherwise, the program continues 
  6101. with the next operation in the sequence. If the result field is not specified, 
  6102. the resulting indicators (positions 54-59) are set accordingly, and the program 
  6103. continues with the next operation in the sequence. 
  6104.  
  6105. You can specify conditioning indicators. Factor 1 and factor 2 must contain a 
  6106. character literal, a numeric literal, a named constant, a figurative constant, 
  6107. a field name, a table name, an array element, or a data structure name. Both 
  6108. the factor 1 and the factor 2 entries must be character data, or both must be 
  6109. numeric. 
  6110.  
  6111. The CABxx operation can specify a branch: 
  6112.  
  6113.  To a previous or a succeeding specification line 
  6114.  From a detail calculation line to another detail calculation line 
  6115.  From a total calculation line to another total calculation line 
  6116.  From a detail calculation line to a total calculation line 
  6117.  From a subroutine to a detail calculation line or a total calculation line. 
  6118.  
  6119. The CABxx operation cannot specify a branch from outside a subroutine to a TAG 
  6120. or ENDSR operation within that subroutine. Branching from one part of the 
  6121. RPG/400 logic cycle to another may result in an endless loop. You must ensure 
  6122. that the logic of your program does not produce undesirable results. The label 
  6123. specified in the result field must be associated with a unique TAG operation 
  6124. and must be a unique symbolic name. 
  6125.  
  6126. Resulting indicators are optional. When specified, they are set to reflect the 
  6127. results of the compare operation.  For example, the HI indicator is set when 
  6128. F1>F2, LO is set when F1<F2, and EQ is set when F1=F2. 
  6129.  
  6130. See Compare Operations for the rules for comparing factor 1 with factor 2. 
  6131. Figure "CABxx Operations" illustrates uses of the CABxx operation. 
  6132.  
  6133.  
  6134. ΓòÉΓòÉΓòÉ 1.10.20.7.1. CABxx Example ΓòÉΓòÉΓòÉ
  6135.  
  6136. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  6137. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  6138. C*
  6139. C*         The field values are:
  6140. C*         FLDA = 100.00
  6141. C*         FLDB = 105.00
  6142. C*         FLDC = ABC
  6143. C*         FLDD = ABCDE
  6144. C*
  6145. C*          Branch to TAGX.
  6146. C           FLDA      CABLTFLDB      TAGX
  6147. C*
  6148. C*          Branch to TAGX.
  6149. C           FLDA      CABLEFLDB      TAGX
  6150. C*
  6151. C*          Branch to TAGX; indicator 16 is off.
  6152. C           FLDA      CABLEFLDB      TAGX       16
  6153. C*
  6154. C*          Branch to TAGX; indicator 17 is off, indicator 18 is on.
  6155. C           FLDA      CAB  FLDB      TAGX       1718
  6156. C*
  6157. C*          Branch to TAGX; indicator 19 is on.
  6158. C           FLDA      CAB  FLDA      TAGX           19
  6159. C*
  6160. C*          No branch occurs.
  6161. C           FLDA      CABEQFLDB      TAGX
  6162. C*
  6163. C*          No branch occurs; indicator 20 is on.
  6164. C           FLDA      CABEQFLDB      TAGX         20
  6165. C*
  6166. C*          No branch occurs; indicator 21 is off.
  6167. C           FLDC      CABEQFLDD      TAGX       21
  6168. C           TAGX      TAG
  6169.  
  6170. CABxx Operations 
  6171.  
  6172.  
  6173. ΓòÉΓòÉΓòÉ 1.10.20.8. CALL (Call a Program) ΓòÉΓòÉΓòÉ
  6174.  
  6175. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6176. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  6177. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  6178. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6179. Γöé CALL    Γöé               Γöé Program name    Γöé Plist    Γöé _ ER LR Γöé
  6180. Γöé         Γöé               Γöé                 Γöé name     Γöé         Γöé
  6181. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6182.  
  6183. The CALL operation passes control to the program specified in factor 2. 
  6184.  
  6185. Factor 2 must contain a character entry specifying the name of the program to 
  6186. be called. If you specify the library name, it must be immediately followed by 
  6187. a slash and then the program name (for example, 'LIB/PROG'.). Factor 2 must 
  6188. contain the name of a field, a literal, a named constant, or an array element 
  6189. that contains the name of the program to be called and that optionally contains 
  6190. the name of the library in which the program is located. If a library is not 
  6191. specified, the library list is used to find the program. 
  6192.  
  6193. The total length of a literal, including the slash, cannot exceed 8 characters. 
  6194. The total length of a field or named constant, including the slash, cannot 
  6195. exceed 21 characters. If either the program or the library name exceeds 10 
  6196. characters, it is truncated to 10 characters. The program name is used exactly 
  6197. as specified in the literal, field, named constant, or array element to 
  6198. determine the program to be called. Any blanks found before or after the slash 
  6199. are included in the program or library name. If the first or last character in 
  6200. the entry is a slash, a blank library or program name, respectively, is 
  6201. assumed. (Lowercase characters are not shifted to uppercase. A name enclosed in 
  6202. quotation marks, for example, "ABC", always includes the quotation marks as 
  6203. part of the name of the program to be called.) *LIBL and *CURLIB are not 
  6204. supported. 
  6205.  
  6206. Program references are grouped to avoid the overhead of resolving to the target 
  6207. program. All references (using a CALL or FREE operation) to a specific program 
  6208. using a named constant or literal are grouped so that the program is resolved 
  6209. to only once, and all subsequent references to that program (by way of named 
  6210. constant or literal only) do not cause a resolve to recur. 
  6211.  
  6212. The references are grouped if both the program and the library name are 
  6213. identical. All program references by variable name are grouped by the variable 
  6214. name. When a program reference is made with a variable, its current value is 
  6215. compared to the value used on the previous program reference operation that 
  6216. used that variable.  If the value did not change, no resolve is done. If it did 
  6217. change, a resolve is done to the new program specified. If your program depends 
  6218. on a resolve taking place on a reference by variable name, code a FREE 
  6219. operation using that variable name.  This causes a subsequent reference, using 
  6220. that variable, to resolve to the program whether or not the value has changed. 
  6221. Note that this rule applies only to references using a variable name. 
  6222. References using a named constant or literal are never re-resolved, and they do 
  6223. not affect whether or not a program reference by variable is re-resolved. 
  6224. Figure "Example of Grouping of Program References" illustrates the grouping of 
  6225. program references. 
  6226.  
  6227.  
  6228. ΓòÉΓòÉΓòÉ 1.10.20.8.1. CALL Example ΓòÉΓòÉΓòÉ
  6229.  
  6230.  
  6231. Example of Grouping of Program References
  6232.  
  6233. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  6234. I..............Namedconstant+++++++++C.........Fldnme......... ....
  6235. I              'LIB1/PGM1'           C         CALLA
  6236. I              'PGM1'                C         CALLB
  6237. I              'LIB/PGM2'            C         CALLC
  6238. I*
  6239.  
  6240. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  6241. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  6242. C*
  6243. C                     CALL CALLA
  6244. C*
  6245. C* The following two calls will be grouped together because both
  6246. C* have the same program name (PGM1) and the same library name
  6247. C* (none).  Note that these will not be grouped with the call using
  6248. C* CALLA above because CALLA has a different library name specified
  6249. C* (LIB1).
  6250. C*
  6251. C                     CALL 'PGM1'
  6252. C                     CALL CALLB
  6253. C*
  6254. C* The following two program references will be grouped together
  6255. C* because both have the same program name (PGM2) and the same
  6256. C* library name (LIB).
  6257. C*
  6258. C                     CALL 'LIB/PGM2'
  6259. C                     FREE CALLC
  6260. C*
  6261. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  6262. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  6263. C*
  6264. C* The first call in the program using CALLV below will result in
  6265. C* a resolve being done for the variable CALLV to the program PGM1.
  6266. C* This is independent of any calls by a literal or named constant
  6267. C* to PGM1 that may have already been done in the program.  The
  6268. C* second call using CALLV will not result in a resolve to PGM1
  6269. C* because the value of CALLV has not changed.  The call following
  6270. C* the free operation will result in a resolve taking place because
  6271. C* the free operation will force that to occur.  Note that the free
  6272. C* operation itself will not result in a resolve occurring. (That
  6273. C* is, that operation will use the current program object pointer
  6274. C* for calls using variable CALLV.)
  6275. C*
  6276. C                     MOVE 'PGM1'    CALLV  21
  6277. C                     CALL CALLV
  6278. C                     CALL CALLV
  6279. C                     FREE CALLV
  6280. C                     CALL CALLV
  6281.  
  6282. In the result field, specify the name of a PLIST to communicate values between 
  6283. the calling program and the called program.  The result field can be blank if 
  6284. the called program does not access parameters or if the PARM statements 
  6285. directly follow the CALL operation. 
  6286.  
  6287. Positions 54 and 55 must be blank. Any valid resulting indicator can be 
  6288. specified in positions 56 and 57 to be set on for an error returned from the 
  6289. called program and in positions 58 and 59 to be set on if the called program is 
  6290. an RPG/400 program that returns with the LR indicator on. 
  6291.  
  6292. The DSPPGMREF command is a CL command that is used to display information about 
  6293. the external references made by a program. A referenced program is referenced 
  6294. on a CALL operation only.  Using DSPPGMREF, you can query the names of programs 
  6295. called by way of named constants or literals. To make this information 
  6296. available to DSPPGMREF, recompile your program. 
  6297.  
  6298. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  6299. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  6300. C*  The CALL operation calls PROGA and allows PROGA to access
  6301. C*  FLDA and FLDB, defined elsewhere. PROGA is processed using the
  6302. C*  contents of FLDA and FLDB.  After PROGA is processed, control
  6303. C*  returns to the next statement to be processed after the last
  6304. C*  PARM statement.
  6305. C*
  6306. C*
  6307. C                     CALL 'PROGA'
  6308. C                     PARM           FLDA
  6309. C                     PARM           FLDB
  6310.  
  6311. CALL Operation 
  6312.  
  6313.  
  6314. ΓòÉΓòÉΓòÉ 1.10.20.9. CASxx (Conditionally Invoke Subroutine) ΓòÉΓòÉΓòÉ
  6315.  
  6316. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6317. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  6318. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  6319. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6320. Γöé CASXX   Γöé Comparand     Γöé Comparand       Γöé Subrou-  Γöé  HI LO  Γöé
  6321. Γöé         Γöé               Γöé                 Γöé tine     Γöé    EQ   Γöé
  6322. Γöé         Γöé               Γöé                 Γöé name     Γöé         Γöé
  6323. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6324.  
  6325. The CASxx operation allows you to conditionally select a subroutine for 
  6326. processing. The selection is based on the relationship between factor 1 and 
  6327. factor 2, as specified by xx. If the relationship denoted by xx exists between 
  6328. factor 1 and factor 2, the subroutine specified in the result field is 
  6329. processed. 
  6330.  
  6331. You can specify conditioning indicators. Factor 1 and factor 2 can contain a 
  6332. literal, a named constant, a figurative constant, a field name, a table name, 
  6333. an array element, a data structure name, or blanks (blanks are valid only if xx 
  6334. is blank and no resulting indicators are specified in positions 54 through 59). 
  6335. If factor 1 and factor 2 are not blanks, both must be character data, or both 
  6336. must be numeric. In a CASbb operation, factor 1 and factor 2 are required only 
  6337. if resulting indicators are specified in positions 54 through 59. 
  6338.  
  6339. The result field must contain the name of a valid RPG/400 subroutine, including 
  6340. *PSSR, the program exception/error subroutine, and *INZSR, the program 
  6341. initialization subroutine. If the relationship denoted by xx exists between 
  6342. factor 1 and factor 2, the subroutine specified in the result field is 
  6343. processed.  If the relationship denoted by xx does not exist, the program 
  6344. continues with the next CASxx operation in the CAS group. A CAS group can 
  6345. contain only CASxx operations. An ENDCS operation must follow the last CASxx 
  6346. operation to denote the end of the CAS group.  After the subroutine is 
  6347. processed, the program continues with the next operation to be processed 
  6348. following the ENDCS operation, unless the subroutine passes control to a 
  6349. different operation. 
  6350.  
  6351. The CASbb operation with no resulting indicators specified in positions 54 
  6352. through 59 is functionally identical to an EXSR operation, because it causes 
  6353. the unconditional running of the subroutine named in the result field of the 
  6354. CASbb operation. Any CASxx operations that follow an unconditional CASbb 
  6355. operation in the same CAS group are never tested.  Therefore, the normal 
  6356. placement of the unconditional CASbb operation is after all other CASxx 
  6357. operations in the CAS group. 
  6358.  
  6359. You cannot use conditioning indicators on the ENDCS operation for a CAS group. 
  6360.  
  6361. See Compare Operations for further rules for the CASxx operation. Figure "CASxx 
  6362. Operation" shows the coding for a group of CASxx operations. 
  6363.  
  6364.  
  6365. ΓòÉΓòÉΓòÉ 1.10.20.9.1. CASxx Example ΓòÉΓòÉΓòÉ
  6366.  
  6367. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  6368. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  6369. C*
  6370. C*  The CASGE operation compares FIELDA with FIELDB.  If FIELDA is
  6371. C*  greater than or equal to FIELDB, SUBR01 is processed and the
  6372. C*  program continues with the operation after the ENDCS operation.
  6373. C*
  6374. C           FIELDA    CASGEFIELDB    SUBR01
  6375. C*
  6376. C*  If FIELDA is not greater than or equal to FIELDB, the program
  6377. C*  next compares FIELDA with FIELDC.  If FIELDA is equal to FIELDC,
  6378. C*  SUBR02 is processed and the program continues with the operation
  6379. C*  after the ENDCS operation.
  6380. C*
  6381. C           FIELDA    CASEQFIELDC    SUBR02
  6382. C*
  6383. C*  If FIELDA is not equal to FIELDC, the CAS operation causes SUBR03
  6384. C*  to be processed before the program continues with the operation
  6385. C*  after the ENDCS operation.
  6386. C*  The CAS statement is used to provide a subroutine if none of
  6387. C*  the previous CASxx operations have been met.
  6388. C*
  6389. C                     CAS            SUBR03
  6390. C*
  6391. C*  The ENDCS operation denotes the end of the CAS group.
  6392. C*
  6393. C                     ENDCS
  6394.  
  6395. CASxx Operation 
  6396.  
  6397.  
  6398. ΓòÉΓòÉΓòÉ 1.10.20.10. CAT (Concatenate Two Character Strings) ΓòÉΓòÉΓòÉ
  6399.  
  6400. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6401. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  6402. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  6403. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6404. Γöé CAT (P) Γöé Source string Γöé Source string   Γöé Target   Γöé         Γöé
  6405. Γöé         Γöé 1             Γöé 2: number of    Γöé string   Γöé         Γöé
  6406. Γöé         Γöé               Γöé blanks          Γöé          Γöé         Γöé
  6407. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6408.  
  6409. The CAT operation concatenates the character string specified in factor 2 to 
  6410. the end of the character string specified in factor 1 and places it in the 
  6411. result field. If no factor 1 is specified, factor 2 is concatenated to the end 
  6412. of the result field string. 
  6413.  
  6414. Factor 1 can contain a character string, which can be one of: a field name, 
  6415. array element, named constant, data structure name, table name, or literal. If 
  6416. factor 1 is not specified, the result field is used. In the following 
  6417. discussion, references to factor 1 apply to the result field if factor 1 is not 
  6418. specified. 
  6419.  
  6420. Factor 2 must contain a character string, and may contain the number of blanks 
  6421. to be inserted between the concatenated strings. Its format is the character 
  6422. string, followed by a colon, followed by the number of blanks. The character 
  6423. string portion can contain one of: a field name, array element, named constant, 
  6424. data structure name, table name, literal, or data structure subfield name. The 
  6425. number of blanks portion must be numeric with zero decimal positions, and can 
  6426. contain one of: a named constant, array element, literal, table name, or field 
  6427. name. 
  6428.  
  6429. If a colon is specified, the number of blanks must be specified. If no colon is 
  6430. specified, concatenation occurs with the trailing blanks, if any, in factor 1, 
  6431. or the result field if factor 1 is not specified. 
  6432.  
  6433. If the number of blanks, N, is specified, factor 1 is copied to the result 
  6434. field left-justified. If factor 1 is not specified the result field string is 
  6435. used. Then N blanks are added following the last nonblank character. Then 
  6436. factor 2 is appended to this result.  Leading blanks in factor 2 are not 
  6437. counted when N blanks are added to the result; they are just considered to be 
  6438. part of factor 2. 
  6439.  
  6440. If the number of blanks is not specified, the trailing and leading blanks of 
  6441. factor 1 and factor 2 are included in the result. If the number of blanks is 
  6442. specified, however, the trailing blanks of factor 1 are ignored and only as 
  6443. many blanks as specified are included in the result between the last nonblank 
  6444. character in factor 1 and the first character of factor 2. Leading blanks in 
  6445. factor 2 are always included. For example, if you have: 
  6446.  
  6447.    C      'bMIKEbb'  CAT  'bbSMITHb':1  Name
  6448. the value of the result field after this statement is executed is: 
  6449.  
  6450.           'bMIKEbbbSMITHb'
  6451.  
  6452. Note:   The leading blanks in factors 1 and 2 and the trailing blanks in factor 
  6453. 2 are placed in the result unchanged. Since one was specified as the number of 
  6454. blanks, factor 1 was copied left justified to the result field, a blank was 
  6455. added following the rightmost nonblank character, and factor 2 was appended to 
  6456. the result. Since factor 2 had two leading blanks, the total number of blanks 
  6457. between the two now concatenated fields is three. 
  6458.  
  6459. The result field must be character, and can contain one of: a field name, array 
  6460. element, data structure name, or table name. Its length should be the length of 
  6461. factor 1 and factor 2 combined plus any intervening blanks; if it is not, 
  6462. truncation occurs from the right. 
  6463.  
  6464. A P specified in the operation extender field (position 53) indicates that the 
  6465. result field should be padded on the right with blanks after the concatenation 
  6466. occurs if the result field is longer than the result of the operation. If 
  6467. padding is not specified, only the leftmost part of the field is affected. 
  6468.  
  6469. At run time, if the number of blanks is fewer than zero, the compiler defaults 
  6470. the number of blanks to zero. 
  6471.  
  6472. Figurative constants cannot be used in the factor 1, factor 2, or result 
  6473. fields. No overlapping is allowed in a data structure for factor 1 and the 
  6474. result field, or for factor 2 and the result field. 
  6475.  
  6476. See Figure "CAT Operation" for examples of the CAT operation. 
  6477.  
  6478.  
  6479. ΓòÉΓòÉΓòÉ 1.10.20.10.1. CAT Examples ΓòÉΓòÉΓòÉ
  6480.  
  6481. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  6482. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  6483. C*
  6484. C* CAT concatenates LAST to NAME and inserts one blank as specified
  6485. C* in factor 2.  TEMP contains 'Mr.bSmith'.
  6486. C                     MOVE 'Mr.   '  NAME    6
  6487. C                     MOVE 'Smith '  LAST    6
  6488. C           NAME      CAT  LAST:1    TEMP    9
  6489. C*
  6490. C* CAT concatenates 'RPG' to STRING and places 'RPG/400' in TEMP.
  6491. C                     MOVE '/400'    STRING  4
  6492. C           'RPG'     CAT  STRING    TEMP    7
  6493. C*
  6494. C* The following example is the same as the previous example except
  6495. C* that TEMP is defined as a 10 byte field.  P in position 53
  6496. C* specifies that blanks will be used in the rightmost positions
  6497. C* of the result field that the concatenation result, 'RPG/400',
  6498. C* does not fill.  As a result, TEMP contains 'RPG/400bbb'
  6499. C* after concatenation.
  6500. C                     MOVE *ALL'*'   TEMP   10
  6501. C                     MOVE '/400'    STRING  4
  6502. C           'RPG'     CAT  STRING    TEMP      P
  6503. C*
  6504. C* After this CAT operation, the field TEMP contains 'RPG/4'.
  6505. C* Because the field TEMP was not large enough, truncation occurred.
  6506. C                     MOVE '/400'    STRING  4
  6507. C           'RPG'     CAT  STRING    TEMP    5
  6508. C*
  6509. C* Note that the trailing blanks of NAME are not included because
  6510. C* NUM=0.  The field TEMP contains 'RPGIIIbbbb'.
  6511. C                     MOVE 'RPG   '  NAME    5
  6512. C                     MOVE 'III   '  LAST    5
  6513. C                     Z-ADD0         NUM     10
  6514. C           NAME      CAT  LAST:NUM  TEMP    10P
  6515.  
  6516. CAT Operation 
  6517.  
  6518. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  6519. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  6520. C*
  6521. C* The following example shows leading blanks in factor 2.  After
  6522. C* the CAT the RESULT contains 'MR.bSMITH'.
  6523. C*
  6524. C                     MOVE 'MR.'     NAME    3
  6525. C                     MOVE ' SMITH'  FIRST   6
  6526. C           NAME      CAT  FIRST     RESULT  9
  6527. C*
  6528. C*  The following example shows the use of CAT without factor 1.
  6529. C*  FLD2 is a 9 character string.  Prior to the concatenation, it
  6530. C*  contains 'ABCbbbbbb.' FLD1 contains 'XYZ'.  After the
  6531. C*  concatenation FLD2 contains 'ABCbbXYZb'.
  6532. C*
  6533. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  6534. C                     MOVE 'ABC'     FLD2    9 P
  6535. C                     MOVE 'XYZ'     FLD1
  6536. C                     CAT  FLD1:2    FLD2
  6537.  
  6538. CAT Operation 
  6539.  
  6540.  
  6541. ΓòÉΓòÉΓòÉ 1.10.20.11. CHAIN (Random Retrieval from a File) ΓòÉΓòÉΓòÉ
  6542.  
  6543. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6544. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  6545. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  6546. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6547. Γöé CHAIN   Γöé Search argu-  Γöé File name       Γöé Data     Γöé NR ER _ Γöé
  6548. Γöé (N)     Γöé ment          Γöé                 Γöé struc-   Γöé         Γöé
  6549. Γöé         Γöé               Γöé                 Γöé ture     Γöé         Γöé
  6550. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6551.  
  6552. The CHAIN operation retrieves a record from a full procedural file (F in 
  6553. position 16 of the file description specifications), sets a record identifying 
  6554. indicator on (if specified on the input specifications), and places the data 
  6555. from the record into the input fields. 
  6556.  
  6557. Factor 1, the search argument, must contain the key or relative record number 
  6558. used to retrieve the record. If access is by key, factor 1 can be a field name, 
  6559. a named constant, a figurative constant, or a literal. In addition, a KLIST 
  6560. (Define a Composite Key) name can be specified in factor 1 for an externally 
  6561. described file. If access is by relative record number, factor 1 must contain 
  6562. an integer literal or a numeric field with zero decimal positions. 
  6563.  
  6564. Factor 2 specifies the file or record format name that is to be read. A record 
  6565. format name is valid with an externally described file. If factor 2 is a file 
  6566. name and access is by key, the CHAIN operation retrieves the first record that 
  6567. matches the search argument. 
  6568.  
  6569. If factor 2 is a record format name and access is by key, the CHAIN operation 
  6570. retrieves the first record of the specified record type whose key matches the 
  6571. search argument.  If no record is found of the specified record type that 
  6572. matches the search argument, a no-record-found condition exists. 
  6573.  
  6574. You can specify a data-structure name in the result field only if the file 
  6575. named in factor 2 is a program described file (identified by an F in position 
  6576. 19 of the file description specification). When you specify a data-structure 
  6577. name in the result field, the CHAIN operation retrieves the first record whose 
  6578. record identifier matches the search argument in factor 1 and places it in the 
  6579. data structure. See File Operations for information on transferring data 
  6580. between the file and the data structure. 
  6581.  
  6582. For a WORKSTN file, the CHAIN operation retrieves a subfile record. 
  6583.  
  6584. For a multiple device file, you must specify a record format in factor 2.  Data 
  6585. is read from the program device identified by the field specified in the ID 
  6586. entry of the file specifications continuation line. If there is no such entry, 
  6587. data is read from the device for the last successful input operation to the 
  6588. file. 
  6589.  
  6590. If the file is specified as input, all records are read without locks and 
  6591. position 53 must be blank.  If the file is specified as update, all records are 
  6592. locked if position 53 is blank. 
  6593.  
  6594. If you are reading from an update disk file, you can specify an N in position 
  6595. 53 to indicate that no lock should be placed on the record when it is read. See 
  6596. the RPG/400* User's Guide for more information. 
  6597.  
  6598. Positions 54 and 55 must contain an indicator that is set on if no record in 
  6599. the file matches the search argument.  Positions 56 and 57 can contain an 
  6600. indicator to be set on if the CHAIN operation is not completed successfully. 
  6601. Positions 58 and 59 must be blank. 
  6602.  
  6603. When the CHAIN operation is successful, the file specified in factor 2 is 
  6604. positioned such that a subsequent read operation retrieves the next sequential 
  6605. record following the retrieved record. When the CHAIN operation is not 
  6606. completed successfully (for example, an error occurs or no record is found), 
  6607. the file specified in factor 2 must be repositioned (for example, by a CHAIN or 
  6608. SETLL operation) before a subsequent read operation can be done on that file. 
  6609.  
  6610. If an update (on the calculation or output specifications) is done on the file 
  6611. specified in factor 2 immediately after a successful CHAIN operation to that 
  6612. file, the last record retrieved is updated. 
  6613.  
  6614. Figure "CHAIN Operation with a File Name in Factor 2" and Figure "CHAIN 
  6615. Operation with a Record Format Name and with No Lock" illustrate uses of the 
  6616. CHAIN operation. 
  6617.  
  6618.  
  6619. ΓòÉΓòÉΓòÉ 1.10.20.11.1. CHAIN Examples (File Name and Record Format Name) ΓòÉΓòÉΓòÉ
  6620.  
  6621. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  6622. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  6623. C*
  6624. C*  The CHAIN operation retrieves the first record from the file,
  6625. C*  FILEX, that has a key field with the same value as the search
  6626. C*  argument KEY (factor 1).
  6627. C*
  6628. C           KEY       CHAINFILEX                60    INDICATOR 60
  6629. C*                                                    IF NOT FOUND
  6630. C*
  6631. C*  If a record with a key value equal to the search argument is not
  6632. C*  found, indicator 60 is set on and the GOTO operation conditioned
  6633. C*  by indicator 60 is processed.  If a record is found with a key
  6634. C*  value equal to the search argument, the program continues with
  6635. C*  the calculations after the GOTO operation.
  6636. C*
  6637. C   60                GOTO NOTFND
  6638.  
  6639. CHAIN Operation with a File Name in Factor 2 
  6640.  
  6641. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  6642. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  6643. C*
  6644. C*  The CHAIN operation uses the value contained in the search
  6645. C*  argument KEY to retrieve a record of the record type REC1 from
  6646. C*  an externally described file. If no record is found of the
  6647. C*  specified type that has a key field equal to the search
  6648. C*  argument, indicator 72 is set on.  A complex key with a KLIST is
  6649. C*  used to retrieve records from files that have a composite key.
  6650. C*  If a record of the specified type is found that has a key field
  6651. C*  equal to the search argument, the calculations after the GOTO
  6652. C*  operation are processed.
  6653. C*
  6654. C           KEY       CHAINREC1                 72    INDICATOR 72
  6655. C*                                                    IF NOT FOUND
  6656. C           KEY       KLIST
  6657. C                     KFLD           FLD1
  6658. C                     KFLD           FLD2
  6659. C           *IN72     IFEQ *OFF
  6660. C*
  6661. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  6662. C*
  6663. C*  The UPDAT operation modifies all the fields in the REC1 record.
  6664. C*
  6665. C                     UPDATREC1                       UPDATE
  6666. C                     ENDIF
  6667. C*
  6668. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  6669. C*
  6670. C*  The following example shows a CHAIN with no lock.
  6671. C*
  6672. C                     MOVE 3         KEY
  6673. C           KEY       CHAININPUT               N
  6674.  
  6675. CHAIN Operation with a Record Format Name and with No Lock 
  6676.  
  6677.  
  6678. ΓòÉΓòÉΓòÉ 1.10.20.12. CHECK (Check Characters) ΓòÉΓòÉΓòÉ
  6679.  
  6680. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6681. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  6682. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  6683. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6684. Γöé CHECK   Γöé Comparator    Γöé Base            Γöé Left-    Γöé _ ER FD Γöé
  6685. Γöé         Γöé string        Γöé string:start    Γöé position Γöé         Γöé
  6686. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6687.  
  6688. The CHECK operation verifies that each character in the base string (factor 2) 
  6689. is among the characters indicated in the comparator string (factor 1). 
  6690. Verifying begins at the leftmost character of factor 2 and continues character 
  6691. by character, from left to right. Each character of the base string is compared 
  6692. with the characters of factor 1.  If a match for a character in factor 2 exists 
  6693. in factor 1, the next base string character is verified.  If a match is not 
  6694. found, an integer value is placed in the result field to indicate the position 
  6695. of the incorrect character. 
  6696.  
  6697. You can specify a start position in factor 2, separating it from the base 
  6698. string by a colon. The start position is optional and defaults to 1. If the 
  6699. start position is greater than 1, the value in the result field is relative to 
  6700. the leftmost position in the base string, regardless of the start position. 
  6701.  
  6702. The operation stops checking when it finds the first incorrect character or 
  6703. when the end of the base string is encountered. If no incorrect characters are 
  6704. found, the result field is set to zero. 
  6705.  
  6706. If the result field is an array, the operation continues checking after the 
  6707. first incorrect character is found for as many occurrences as there are 
  6708. elements in the array. If there are more array elements than incorrect 
  6709. characters, all of the remaining elements are set to zeros. 
  6710.  
  6711. Factor 1 must be character, and can contain one of:  a field name, array 
  6712. element, named constant, data structure name, data structure subfield, literal, 
  6713. or table name. 
  6714.  
  6715. Factor 2 must contain either the base string or the base string, followed by a 
  6716. colon, followed by the start location. The base string portion of factor 2 must 
  6717. be character, and can contain: a field name, array element, named constant, 
  6718. data-structure name, literal, or table name. The start location portion of 
  6719. factor 2 must be numeric with no decimal positions, and can be a named 
  6720. constant, array element, field name, literal, or table name. If no start 
  6721. location is specified, a value of 1 is used. 
  6722.  
  6723. The result field can be a numeric variable, numeric array element, numeric 
  6724. table name, or numeric array. Define the field or array specified with no 
  6725. decimal positions. The result field is an optional field; if you do not specify 
  6726. it, you must specify the found indicator in position 58-59. 
  6727.  
  6728. Figurative constants cannot be used in the factor 1, factor 2, or result 
  6729. fields. No overlapping is allowed in a data structure for factor 1 and the 
  6730. result field or for factor 2 and the result field. 
  6731.  
  6732. Any valid indicator can be specified in positions 7 to 17. 
  6733.  
  6734. The indicator in positions 56-57 is turned on if an error occurs. The indicator 
  6735. in positions 58-59 is turned on if any incorrect characters are found. 
  6736.  
  6737. Figure "CHECK Operation" shows examples of the CHECK operation. 
  6738.  
  6739.  
  6740. ΓòÉΓòÉΓòÉ 1.10.20.12.1. CHECK Examples ΓòÉΓòÉΓòÉ
  6741.  
  6742.  
  6743. CHECK Operation
  6744.  
  6745. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  6746. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  6747. C*
  6748. C* Because factor 1 is a blank, CHECK indicates the position
  6749. C* of the first nonblank character.  If STRING contains 'bbbthe',
  6750. C* NUM will contain the value 4.
  6751. C*
  6752. C           ' '       CHECKSTRING    NUM     20
  6753. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  6754. I..............Namedconstant+++++++++C.........Fldnme......... ....
  6755. I*
  6756. I* After the following example, N=6 and the found indicator 90
  6757. I* is on.  Because the start position is 2, the first nonnumeric
  6758. I* character found is the '.'.
  6759. I*
  6760. I              '0123456789'          C         DIGITS
  6761. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  6762. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  6763. C*
  6764. C                     MOVE '$2000.'  SALARY
  6765. C           DIGITS    CHECKSALARY:2  N              90
  6766.  
  6767.  
  6768. CHECK Operation
  6769.  
  6770. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  6771. I..............Namedconstant+++++++++C.........Fldnme......... ....
  6772. I*
  6773. I* The following example checks that FIELD contains only the letters
  6774. I* A to J.  As a result, ARRAY=(136000) after the CHECK operation.
  6775. I* Indicator 90 turns on.
  6776. I*
  6777. I              'ABCDEFGHIJ'          C         LETTER
  6778. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  6779. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  6780. C*
  6781. C                     MOVE '1A=BC*'  FIELD   8
  6782. C           LETTER    CHECKFIELD     ARRAY          90
  6783. C*
  6784. C* In the following example, because FIELD contains only the
  6785. C* letters A to J, ARRAY=(000000).  Indicator 90 turns off.
  6786. C*
  6787. C                     MOVE 'FGFGFG'  FIELD   8
  6788. C           LETTER    CHECKFIELD     ARRAY          90
  6789.  
  6790.  
  6791. ΓòÉΓòÉΓòÉ 1.10.20.13. CHEKR (Check Reverse) ΓòÉΓòÉΓòÉ
  6792.  
  6793. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6794. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  6795. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  6796. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6797. Γöé CHEKR   Γöé Comparator    Γöé Base            Γöé Right-   Γöé _ ER FD Γöé
  6798. Γöé         Γöé string        Γöé string:start    Γöé position Γöé         Γöé
  6799. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6800.  
  6801. The CHEKR operation verifies that each character in the base string (factor 2) 
  6802. is among the characters indicated in the comparator string (factor 1). 
  6803. Verifying begins at the rightmost character of factor 2 and continues character 
  6804. by character, from right to left. Each character of the base string is compared 
  6805. with the characters of factor 1.  If a match for a character in factor 2 exists 
  6806. in factor 1, the next source character is verified.  If a match is not found, 
  6807. an integer value is placed in the result field to indicate the position of the 
  6808. incorrect character. Although checking is done from the right, the position 
  6809. placed in the result field will be relative to the left. 
  6810.  
  6811. You can specify a start position in factor 2, separating it from the base 
  6812. string by a colon. The start position is optional and defaults to the length of 
  6813. the string. The value in the result field is relative to the leftmost position 
  6814. in the source string, regardless of the start position. 
  6815.  
  6816. If the result field is not an array, the operation stops checking when it finds 
  6817. the first incorrect character or when the end of the base string is 
  6818. encountered. If no incorrect characters are found, the result field is set to 
  6819. zero. 
  6820.  
  6821. If the result field is an array, the operation continues checking after the 
  6822. first incorrect character is found for as many occurrences as there are 
  6823. elements in the array. If there are more array elements than incorrect 
  6824. characters, all of the remaining elements are set to zeros. 
  6825.  
  6826. Factor 1 must be character, and can contain one of:  a field name, array 
  6827. element, named constant, data structure name, data structure subfield, literal, 
  6828. or table name. 
  6829.  
  6830. Factor 2 must contain either the base string or the base string, followed by a 
  6831. colon, followed by the start location. The base string portion of factor 2 must 
  6832. be character, and can contain: a field name, array element, named constant, 
  6833. data structure name, data structure subfield name, literal, or table name.  The 
  6834. start location portion of factor 2 must be numeric with no decimal positions, 
  6835. and can be a named constant, array element, field name, literal, or table name. 
  6836. If no start location is specified, the length of the string is used. 
  6837.  
  6838. The result field can be a numeric variable, numeric array element, numeric 
  6839. table name, or numeric array. Define the field or array specified with no 
  6840. decimal positions. The result field is an optional field; if you do not specify 
  6841. it, you must specify the found indicator in position 58-59. 
  6842.  
  6843. Figurative constants cannot be used in the factor 1, factor 2, or result 
  6844. fields. No overlapping is allowed in a data structure for factor 1 and the 
  6845. result field, or for factor 2 and the result field. 
  6846.  
  6847. Any valid indicator can be specified in positions 7 to 17. 
  6848.  
  6849. The indicator in positions 56-57 is turned on if an error occurs. The indicator 
  6850. in positions 58-59 is turned on if any incorrect characters are found. 
  6851.  
  6852. Figure "CHEKR Operation" shows examples of the CHEKR operation. 
  6853.  
  6854.  
  6855. ΓòÉΓòÉΓòÉ 1.10.20.13.1. CHEKR Examples ΓòÉΓòÉΓòÉ
  6856.  
  6857.  
  6858. CHEKR Operation
  6859.  
  6860. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  6861. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  6862. C*
  6863. C* Because factor 1 is a blank character, CHEKR indicates the
  6864. C* position of the first nonblank character.  This use of CHEKR
  6865. C* allows you to determine the length of a string.  If STRING
  6866. C* contains 'ABCDEF   ', NUM will contain the value 6.
  6867. C*
  6868. C           ' '       CHEKRSTRING    NUM     20
  6869. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  6870. I..............Namedconstant+++++++++C.........Fldnme......... ....
  6871. I*
  6872. I* After the following example, N=1 and the found indicator 90
  6873. I* is on. Because the start position is 5, the operation begins
  6874. I* with the rightmost 0 and the first nonnumeric found is the '$'.
  6875. I*
  6876. I              '0123456789'          C         DIGITS
  6877. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  6878. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  6879. C*
  6880. C                     MOVE '$2000.'  SALARY  6
  6881. C           DIGITS    CHEKRSALARY:5  N              90
  6882.  
  6883. E*
  6884. E* The following example checks that FIELD contains only the letters
  6885. E* A to J.  As a result, ARRAY=(876310) after the CHEKR operation.
  6886. E* Indicator 90 turns on.
  6887. E*
  6888. E....FromfileTofile++Name++N/rN/tbLenPDSArrnamLenPDSComments
  6889. E                    ARRAY       6  1 0
  6890. I..............Namedconstant+++++++++C.........Fldnme......... ....
  6891. I              'ABCDEFGHIJ'          C         LETTER
  6892. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  6893. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  6894. C*
  6895. C                     MOVE '1A=BC***'FIELD   8
  6896. C           LETTER    CHEKRFIELD     ARRAY          90
  6897.  
  6898.  
  6899. ΓòÉΓòÉΓòÉ 1.10.20.14. CLEAR (Clear) ΓòÉΓòÉΓòÉ
  6900.  
  6901. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6902. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  6903. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  6904. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6905. Γöé CLEAR   Γöé *NOKEY        Γöé Structure or    Γöé          Γöé         Γöé
  6906. Γöé         Γöé               Γöé Variable        Γöé          Γöé         Γöé
  6907. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6908.  
  6909. The CLEAR operation sets elements in a structure (record format, data 
  6910. structure, array, or table) or a variable (field, subfield, or indicator), to 
  6911. zero, blank or '0', depending on field type (numeric, character, or indicator). 
  6912. It allows you to clear structures on a global basis, as well as element by 
  6913. element, during run time. 
  6914.  
  6915. Factor 1 must be blank unless factor 2 contains a DISK record format name; in 
  6916. which case, it can contain *NOKEY to indicate that all fields except key fields 
  6917. are to be cleared. 
  6918.  
  6919. Factor 2 contains the structure or variable that is set to zero, blank, or '0'. 
  6920. It can contain:  a record-format name, data-structure name, array name, table 
  6921. name, field name, subfield, array element, or indicator name. If you specify a 
  6922. record-format name or data structure, all fields are cleared in the order they 
  6923. are defined within the structure. If you have partially overlapping fields of 
  6924. different definitions, data that is not valid could exist in numeric fields. 
  6925. With a multiple-occurrence data structure, only those fields in the current 
  6926. occurrence are cleared. If you specify a table name, the current table element 
  6927. is cleared; if an array name, the entire array is cleared. If you specify an 
  6928. array element (including indicators) in factor 2 using an array index, only the 
  6929. element specified is cleared. 
  6930.  
  6931. Note that when the CLEAR operation is applied to a record-format name, only 
  6932. output fields in the record format are affected. For WORKSTN file record 
  6933. formats, only fields with a usage of output or both are affected. All 
  6934. field-conditioning indicators are affect by this operation. Fields in DISK, 
  6935. SEQ, or PRINTER file record formats are affected only if those record formats 
  6936. are output in the program. Input-only fields are not affected by the CLEAR 
  6937. operation. By definition, they assume new values at the next input operation. 
  6938.  
  6939. For more information see "Initialization" in chapter 9 of the RPG/400* User's 
  6940. Guide. 
  6941.  
  6942. Figure "CLEAR Operation" shows an example of the CLEAR operation. 
  6943.  
  6944.  
  6945. ΓòÉΓòÉΓòÉ 1.10.20.14.1. CLEAR Example ΓòÉΓòÉΓòÉ
  6946.  
  6947. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  6948. I....................................PFromTo++DField+L1M1FrPlMnZr...
  6949. I*
  6950. I*  In the following example, CLEAR sets all subfields in the data
  6951. I*  structure DS1 to their defaults, CHAR to blank, NUM to zero.
  6952. IDS1         DS
  6953. I                                        2   50NUM
  6954. I                                       20  30 CHAR
  6955. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  6956. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  6957. C*
  6958. C                     CLEARDS1
  6959.  
  6960. CLEAR Operation 
  6961.  
  6962. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  6963. A* FLD1 and FLD2 are defined as output fields and can be
  6964. A* affected by the CLEAR operation.  Indicator 10 can also be
  6965. A* changed by the CLEAR operation even though it conditions an
  6966. A* input only field because field indicators are all treated
  6967. A* as output fields.
  6968. A*
  6969. AAN01N02N03T.Name++++++RLen++TDpBLinPosFunctions++++++++++++++++++++*
  6970. A          R FMT01
  6971. A  10        FLD1          10A  I  2 30
  6972. A            FLD2          10A  O  3 30
  6973. A            FLD3          10A  B  4 30
  6974. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  6975. FFilenameIPEAF....RlenLK1AIOvKlocEDevice+......KExit++Entry+A....U1.
  6976. FWORKSTN CF  E                    WORKSTN
  6977. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  6978. I..............Namedconstant+++++++++C.........Fldnme......... ....
  6979. I              'INPUT DATA'          C         IN
  6980. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  6981. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  6982. C                     CLEARFMT01
  6983. C                     WRITEFMT01
  6984. C*
  6985. C* The program will loop until PF03 is pressed.
  6986. C*
  6987. C           *IN03     DOWEQ'0'
  6988. C                     READ FMT01                    LR
  6989. C*
  6990. C* PF04 will transfer input fields to output fields.
  6991. C*
  6992. C           *IN04     IFEQ '1'
  6993. C                     MOVELFLD003    FLD002
  6994. C                     MOVELFLD001    FLD003
  6995. C                     CLEAR*IN04
  6996. C                     ENDIF
  6997. C                     MOVELIN        FLD001
  6998. C*
  6999. C* When PF11 is pressed, all the fields in the record format
  7000. C* defined as output or both will be reset to the values they
  7001. C* held after the initialization step.
  7002. C*
  7003. C           *IN11     IFEQ '1'
  7004. C                     RESETFMT01
  7005. C                     CLEAR*IN11
  7006. C                     ENDIF
  7007. C* When PF12 is pressed, all the fields in the record
  7008. C* format defined as output or both will be cleared.
  7009. C*
  7010. C           *IN12     IFEQ '1'
  7011. C                     CLEARFMT01
  7012. C                     CLEAR*IN12
  7013. C                     ENDIF
  7014. C  N03                WRITEFMT01
  7015. C                     ENDDO
  7016. C                     SETON                     LR
  7017.  
  7018. Field Initialization for the CLEAR Record Format 
  7019.  
  7020.  
  7021. ΓòÉΓòÉΓòÉ 1.10.20.15. CLOSE (Close Files) ΓòÉΓòÉΓòÉ
  7022.  
  7023. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7024. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  7025. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  7026. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7027. Γöé CLOSE   Γöé               Γöé File name       Γöé          Γöé  _ ER _ Γöé
  7028. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7029.  
  7030. The explicit CLOSE operation closes one or more files or devices and 
  7031. disconnects them from the program. The file cannot be used again in the program 
  7032. unless you specify an explicit OPEN for that file. A CLOSE operation to an 
  7033. already closed file does not produce an error. 
  7034.  
  7035. Factor 2 names the file to be closed. You can specify the keyword *ALL in 
  7036. factor 2 to close all the files at once. You cannot specify an array or table 
  7037. file (identified by a T in position 16 of the file description specifications) 
  7038. in factor 2. 
  7039.  
  7040. You can specify a resulting indicator in positions 56 and 57 to be set on if 
  7041. the CLOSE operation is not completed successfully. Positions 54, 55, 58, and 59 
  7042. must be blank. 
  7043.  
  7044. Multiple CLOSE operations to a file already closed are valid.  A second close 
  7045. to the same file has no effect on that file. 
  7046.  
  7047. If an array or table is to be written to an output file (specified in positions 
  7048. 19 through 26 of the extension specifications), the array or table dump does 
  7049. not occur if the file is closed (by a CLOSE operation) at LR time when the file 
  7050. is written. If the file is closed, it must be reopened for the dump to occur. 
  7051.  
  7052. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  7053. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  7054. C*
  7055. C*  The explicit CLOSE operation closes FILEB.
  7056. C*
  7057. C                     CLOSEFILEB
  7058. C*
  7059. C*  The explicit CLOSE *ALL operation closes all files in the
  7060. C*  program.  To reopen the files, you must specify an explicit
  7061. C*  OPEN for each file.  If the CLOSE operation is not completed
  7062. C*  completed successfully, indicator 17 is set on and the
  7063. C*  program branches to the label specified in the GOTO statement.
  7064. C                     CLOSE*ALL                   17
  7065. C   17                GOTO NOCOMP                     CLOSE FAILED
  7066. C                     :
  7067. C                     :
  7068. C                     :
  7069. C           NOCOMP    TAG
  7070.  
  7071. CLOSE Operation 
  7072.  
  7073.  
  7074. ΓòÉΓòÉΓòÉ 1.10.20.16. COMIT (Commit) ΓòÉΓòÉΓòÉ
  7075.  
  7076. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7077. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  7078. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  7079. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7080. Γöé COMIT   Γöé Boundary      Γöé                 Γöé          Γöé  _ ER _ Γöé
  7081. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7082.  
  7083. The COMIT operation: 
  7084.  
  7085.  Makes all the changes to your files that have been specified in output 
  7086.   operations since the previous COMIT or ROLBK (Roll Back) operation (or since 
  7087.   the beginning of operations under commitment control if there has been no 
  7088.   previous COMIT or ROLBK operation). 
  7089.  Releases all the record locks for files you have under commitment control. 
  7090.  
  7091. The file changes and the record-lock releases apply to all the files you have 
  7092. under commitment control, whether the changes have been requested by the 
  7093. program issuing the COMIT operation, or by another program in the same routing 
  7094. step. The program issuing the COMIT operation does not need to have any files 
  7095. under commitment control. The COMIT operation does not change the file 
  7096. position. 
  7097.  
  7098. Commitment control starts when the COMIT operation is executed or when the CL 
  7099. command STRCMTCTL is executed. See the chapter on "Commitment Control" in the 
  7100. RPG/400* User's Guide for more information. 
  7101.  
  7102. In factor 1, you can specify a literal, named constant, array element, table 
  7103. name, data structure, or data structure subfield to identify the boundary 
  7104. between the changes made by this COMIT operation and subsequent changes. If you 
  7105. leave factor 1 blank, the identifier is null. 
  7106.  
  7107. The optional indicator in positions 56 and 57 is set on if the operation is not 
  7108. completed successfully.  For example, the indicator is set on if commitment 
  7109. control is not active. 
  7110.  
  7111.  
  7112. ΓòÉΓòÉΓòÉ 1.10.20.17. COMP (Compare) ΓòÉΓòÉΓòÉ
  7113.  
  7114. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7115. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  7116. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  7117. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7118. Γöé COMP    Γöé Comparand     Γöé Comparand       Γöé          Γöé  HI LO  Γöé
  7119. Γöé         Γöé               Γöé                 Γöé          Γöé    EQ   Γöé
  7120. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7121.  
  7122. The COMP operation compares factor 1 with factor 2. Factor 1 and factor 2 can 
  7123. contain a literal, a named constant, a field name, a table name, an array 
  7124. element, a data structure, or a figurative constant. Factor 1 and factor 2 must 
  7125. be either both character or both numeric. As a result of the comparison, 
  7126. indicators are set on as follows: 
  7127.  
  7128. High: (54-55)   Factor 1 is greater than factor 2. 
  7129. Low: (56-57)   Factor 1 is less than factor 2. 
  7130. Equal: (58-59)  Factor 1 equals factor 2. 
  7131.  
  7132. You must specify at least one resulting indicator in positions 54 through 59. 
  7133. Do not specify the same indicator for all three conditions. When specified, the 
  7134. resulting indicators are set on or off (for each cycle) to reflect the results 
  7135. of the compare. 
  7136.  
  7137. For further rules for the COMP operation, see Compare Operations. 
  7138.  
  7139. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  7140. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  7141. C*
  7142. C*  Initial field values are:
  7143. C*                    FLDA = 100.00
  7144. C*                    FLDB = 105.00
  7145. C*                    FLDC = 100.00
  7146. C*                    FLDD = ABC
  7147. C*                    FLDE = ABCDE
  7148. C*
  7149. C*  Indicator 12 is set on; indicators 11 and 13 are set off.
  7150. C           FLDA      COMP FLDB                 111213
  7151. C*
  7152. C*  Indicator 15 is set on; indicator 14 is set off.
  7153. C           FLDA      COMP FLDB                 141516
  7154. C*
  7155. C*  Indicator 19 is set on; indicator 17 is set off.
  7156. C           FLDA      COMP FLDC                 171819
  7157. C*
  7158. C*  Indicator 21 is set on; indicators 20 and 22 are set off
  7159. C           FLDD      COMP FLDE                 202122
  7160.  
  7161. COMP Operation 
  7162.  
  7163.  
  7164. ΓòÉΓòÉΓòÉ 1.10.20.18. DEBUG (Debug Function) ΓòÉΓòÉΓòÉ
  7165.  
  7166. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7167. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  7168. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  7169. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7170. Γöé DEBUG   Γöé Identifier    Γöé Output file     Γöé Debug    Γöé         Γöé
  7171. Γöé         Γöé               Γöé                 Γöé info     Γöé         Γöé
  7172. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7173.  
  7174. The DEBUG operation helps the programmer debug a program that is not working 
  7175. properly. One or more records containing information helpful for finding 
  7176. programming errors are written as a result of this operation. You can use the 
  7177. DEBUG operation independently of or in combination with the OS/400 testing and 
  7178. debugging functions. 
  7179.  
  7180. You can specify the operation at any point or at several points in the 
  7181. calculation specifications. Whenever the program encounters the DEBUG 
  7182. operation, one or more records are written. The first record contains the 
  7183. source-statement sequence number of the DEBUG operation in the program, factor 
  7184. 1 if any, and a list of all indicators that were on at the time the DEBUG 
  7185. operation was encountered. It can contain the contents of a field, an array 
  7186. element, a table element, or a literal that identifies the written information 
  7187. that describes the DEBUG operation. The contents of factor 1 identify the 
  7188. written information that describes the DEBUG operation. It can contain a field 
  7189. name, an array element, a table name, a named constant, or a literal. The 
  7190. length of the specified field can be from 1 to 8 characters. Factor 1 cannot 
  7191. contain a figurative constant. If factor 1 contains an entry, the sequence 
  7192. number and the contents of the entry are written to the first record. If factor 
  7193. 1 is not used, the source statement sequence number of the DEBUG operation is 
  7194. written to the first record. 
  7195.  
  7196. Factor 2 can contain the name of the output file to which the DEBUG output is 
  7197. written. This file must have a record length of at least 80 positions. Only 
  7198. program-defined output files are allowed with the DEBUG operation;  externally 
  7199. described files are not permitted. If factor 2 is blank, the output goes to the 
  7200. display work station that requested the program (the requester). The same entry 
  7201. must appear in factor 2 of all DEBUG operations in a program. 
  7202.  
  7203. The contents of the result field are written to a separate record. The result 
  7204. field can contain a field name, an array name, a table name, or a KLIST (Define 
  7205. a Composite Key) name. 
  7206.  
  7207. If factor 1 and the result field are not specified, only the indicators and the 
  7208. source statement sequence number of the DEBUG operation are written. 
  7209.  
  7210. Note:   If a KLIST is specified in the result field of a DEBUG operation, all 
  7211. numeric fields in the KLIST are printed or displayed in zoned decimal format. 
  7212.  
  7213. The DEBUG operation is performed only if a 1 is specified in position 15 of the 
  7214. control specification. Otherwise, the DEBUG statement is checked for errors at 
  7215. compile time, but the DEBUG operation is not processed at run time. 
  7216.  
  7217.  
  7218. ΓòÉΓòÉΓòÉ 1.10.20.18.1. Records Written for DEBUG ΓòÉΓòÉΓòÉ
  7219.  
  7220. For a DEBUG operation, one record is always written in the following format: 
  7221.  
  7222. Positions    Information 
  7223. 1-8          DEBUG= 
  7224. 9-16         Source statement sequence number of the DEBUG operation code in 
  7225.              the program. This entry permits you to identify the individual 
  7226.              DEBUG operation (if more than one is used) without making an entry 
  7227.              in factor 1. 
  7228. 17-18        Blank. 
  7229. 19-26        Contents of factor 1, if specified. 
  7230. 27           Minus (-) sign if factor 1 contains a negative value.  Blank if 
  7231.              factor 1 contains a positive value. 
  7232. 28           Blank. 
  7233. 29-43        The words INDICATORS ON= 
  7234. 44           Blank. 
  7235. 45-47, ...   The names of all indicators that are on, each separated by a 
  7236.              blank. If more than one record is needed to write all the 
  7237.              indicators, positions 1 through 43 are used only by the first 
  7238.              record. The indicators are written starting in position 45 of the 
  7239.              remaining records. 
  7240.  
  7241.              Note:   If an indicator contains a character that is not valid 
  7242.              (not '0' or '1'), the indicator is listed followed by the 
  7243.              hexadecimal representation of the value in the indicator. For 
  7244.              example, if indicators 01 and 88 are on, and indicator 33 contains 
  7245.              the character A, the indicator line appears as: ON = 01 33 (C1) 
  7246.              88. 
  7247.  
  7248. When the result field contains an entry, a separate record is written in the 
  7249. following format: 
  7250.  
  7251. Positions             Information 
  7252. 1-14                  The words FIELD VALUE= 
  7253. 15- (any position)    The contents of the result field. The first 66 characters 
  7254.                       of the result field are written in positions 15 through 
  7255.                       80 of this record.  If the field is greater than 66 
  7256.                       characters, the additional characters are written in 
  7257.                       positions 15 through 80 of additional records. 
  7258.  
  7259. Numeric fields are written out in unpacked format and are zero-suppressed.  The 
  7260. sign is always written to the right of the field; a minus (-) sign is written 
  7261. to the right of negative fields, and a blank is written to the right of 
  7262. positive fields.  Zero fields are written with the last zero and the sign.  No 
  7263. other editing is done. If the result field is an array name, the elements are 
  7264. written in order, one record for each element.  When a multiple occurrence data 
  7265. structure is specified, only the current occurrence is written. 
  7266.  
  7267.  
  7268. ΓòÉΓòÉΓòÉ 1.10.20.19. DEFN (Field Definition) ΓòÉΓòÉΓòÉ
  7269.  
  7270. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7271. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  7272. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  7273. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7274. Γöé DEFN    Γöé *LIKE         Γöé Referenced      Γöé Defined  Γöé         Γöé
  7275. Γöé         Γöé               Γöé field           Γöé field    Γöé         Γöé
  7276. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7277. Γöé DEFN    Γöé *NAMVAR       Γöé Internal        Γöé External Γöé         Γöé
  7278. Γöé         Γöé               Γöé program area    Γöé data     Γöé         Γöé
  7279. Γöé         Γöé               Γöé                 Γöé area     Γöé         Γöé
  7280. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7281.  
  7282. Depending on the factor 1 entry, the declarative DEFN operation can do either 
  7283. of the following: 
  7284.  
  7285.  Define a field based on the attributes (length and decimal positions) of 
  7286.   another field. 
  7287.  Define a field as a data area. 
  7288.  
  7289. You can specify the DEFN operation anywhere within calculations. The control 
  7290. level entry (positions 7 and 8) can be blank or can contain an L1 through L9 
  7291. indicator, the LR indicator, or an L0 entry to group the statement within the 
  7292. appropriate section of the program. The control level entry is used for 
  7293. documentation only.  Conditioning indicator entries (positions 9 through 17) 
  7294. are not permitted. See *LIKE DEFN and *NAMVAR DEFN. 
  7295.  
  7296. See Figure "DEFN Operation" for examples of the DEFN operation. 
  7297.  
  7298.  
  7299. ΓòÉΓòÉΓòÉ 1.10.20.19.1. *LIKE DEFN ΓòÉΓòÉΓòÉ
  7300.  
  7301. The DEFN (Field Definition) operation with *LIKE in factor 1 defines a field 
  7302. based upon the attributes (length and decimal positions) of another field. 
  7303.  
  7304. Factor 2 must contain the name of the field being referenced, and the result 
  7305. field must contain the name of the field being defined.  The field specified in 
  7306. factor 2 , which can be defined in the program or externally, provides the 
  7307. attributes for the field being defined.  Factor 2 cannot be a literal or a 
  7308. named constant.  If factor 2 is an array, an array element, or a table name, 
  7309. the attributes of an element of the array or table are used to define the 
  7310. field. The result field cannot be an array, an array element, a data structure, 
  7311. or a table name. 
  7312.  
  7313. You can use positions 49 through 51 (field length) to make the result field 
  7314. entry longer or shorter than the factor 2 entry.  A plus sign (+) in position 
  7315. 49 indicates a length increase; a minus sign (-) in position 49 indicates a 
  7316. length decrease.  Positions 50 and 51 can contain the increase or decrease in 
  7317. length (right-adjusted) or can be blank.  If positions 49 through 51 are blank, 
  7318. the result field entry is defined with the same length as the factor 2 entry. 
  7319. You cannot change the number of decimal positions for the field being defined. 
  7320.  
  7321. See Figure "DEFN Operation" for examples of *LIKE DEFN. 
  7322.  
  7323.  
  7324. ΓòÉΓòÉΓòÉ 1.10.20.19.2. *NAMVAR DEFN ΓòÉΓòÉΓòÉ
  7325.  
  7326. The DEFN (Field Definition) operation with *NAMVAR in factor 1 associates a 
  7327. field, a data structure, a data-structure subfield, or a data-area data 
  7328. structure (within your RPG/400 program) with an AS/400 data area (outside your 
  7329. RPG/400 program). 
  7330.  
  7331. In factor 2, specify the external name of a data area. Use *LDA for the name of 
  7332. the local data area or use *PDA for the Program Initialization Parameters (PIP) 
  7333. data area. If you leave factor 2 blank, the result field entry is both the 
  7334. RPG/400 name and the external name of the data area. 
  7335.  
  7336. In the result field, specify the name of one of the following that you have 
  7337. defined in your program: a field, a data structure, a data structure subfield, 
  7338. or a data-area data structure. You use this name with the IN and OUT operations 
  7339. to retrieve data from and write data to the data area specified in factor 2. 
  7340. When you specify a data-area data structure in the result field, the RPG/400 
  7341. program implicitly retrieves data from the data area at program start and 
  7342. writes data to the data area when the program ends. 
  7343.  
  7344. The result field entry must not be the name of a file, a program-status data 
  7345. structure, a file-information data structure (INFDS), a multiple-occurrence 
  7346. data structure, an input record field, an array, an array element, or a table. 
  7347. It cannot be the name of a subfield of a multiple-occurrence data structure, of 
  7348. a data area data structure, of a program-status data structure, of a 
  7349. file-information data structure (INFDS), or of a data structure that appears on 
  7350. a *NAMVAR DEFN statement. 
  7351.  
  7352. In positions 49 through 52, you can define the length and number of decimal 
  7353. positions for the entry in the result field.  These specifications must match 
  7354. those for the external description of the data area specified in factor 2. The 
  7355. local data area is character data of length 1024, but within your program you 
  7356. can access the local data area as if it has a length of 1024 or less. 
  7357.  
  7358. See Figure "DEFN Operation" for examples of the *NAMVAR DEFN statement. 
  7359.  
  7360.  
  7361. ΓòÉΓòÉΓòÉ 1.10.20.19.3. DEFN Examples ΓòÉΓòÉΓòÉ
  7362.  
  7363.  
  7364. DEFN Operation
  7365.  
  7366. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  7367. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  7368. *
  7369. C*  FLDA is a 7-position character field.
  7370. C*  FLDB is a 5-digit field with 2 decimal positions.
  7371. C*
  7372. C*
  7373. C*  FLDP is a 7-position character field.
  7374. C           *LIKE     DEFN FLDA      FLDP
  7375. C*
  7376. C*  FLDQ is a 9-position character field.
  7377. C           *LIKE     DEFN FLDA      FLDQ  + 2
  7378. C*
  7379. C*  FLDR is a 6-position character field.
  7380. C           *LIKE     DEFN FLDA      FLDR  - 1
  7381. C*
  7382. C*  FLDS is a 5-position numeric field with 2 decimal positions.
  7383. C           *LIKE     DEFN FLDB      FLDS
  7384. C*
  7385. C*  FLDT is a 6-position numeric field with 2 decimal positions.
  7386. C           *LIKE     DEFN FLDB      FLDT  + 1
  7387. C*
  7388. C*  FLDU is a 3-position numeric field with 2 decimal positions.
  7389. C           *LIKE     DEFN FLDB      FLDU  - 2
  7390. C*
  7391. C*  FLDX is a 3-position numeric field with 2 decimal positions.
  7392. C           *LIKE     DEFN FLDU      FLDX
  7393.  
  7394. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  7395. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  7396. C*
  7397. C*  If specified, the attributes (length and decimal positions) of
  7398. C*  the data area (TOTGRS) must be the same as those for the
  7399. C*  external data area.
  7400. C           *NAMVAR   DEFN           TOTGRS 102
  7401. C*
  7402. C*  The result field entry (TOTNET) is the name of the data area to
  7403. C*  be used within the RPG/400 program.  The factor 2 entry (TOTAL)
  7404. C*  is the name of the data area as defined to the system.
  7405. C           *NAMVAR   DEFN TOTAL     TOTNET
  7406. C*
  7407. C*  The result field entry (SAVTOT) is the name of the data area to
  7408. C*  be used within the RPG/400 program.  The factor 2 entry (*LDA)
  7409. C*  indicates the use of the local data area.
  7410. C           *NAMVAR   DEFN *LDA      SAVTOT
  7411.  
  7412.  
  7413. ΓòÉΓòÉΓòÉ 1.10.20.20. DELET (Delete Record) ΓòÉΓòÉΓòÉ
  7414.  
  7415. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7416. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  7417. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  7418. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7419. Γöé DELET   Γöé Search argu-  Γöé File name       Γöé          Γöé NR ER _ Γöé
  7420. Γöé         Γöé ment          Γöé                 Γöé          Γöé         Γöé
  7421. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7422.  
  7423. The DELET operation deletes a record from a database file. The file must be an 
  7424. update file (identified by a U in position 15. of the file description 
  7425. specifications) The deleted record can never be retrieved. 
  7426.  
  7427. If factor 1 contains no entry, the DELET operation deletes the current record 
  7428. (the last record retrieved). The record must have been locked by a previous 
  7429. input operation (for example, CHAIN or READ). 
  7430.  
  7431. Factor 1, the search argument, can contain a key or relative record number that 
  7432. identifies the record to be deleted.  If access is by key, factor 1 can be a 
  7433. field name, a named constant, or a literal. In addition, a KLIST name can be 
  7434. specified in factor 1 for an externally described file. If duplicate records 
  7435. exist for the key, only the first of the duplicate records is deleted from the 
  7436. file. If access is by relative record number, factor 1 must contain an integer 
  7437. literal or a numeric field with zero decimal positions. 
  7438.  
  7439. Factor 2 must contain the name of the update file or the name of a record 
  7440. format in the file from which a record is to be deleted.  A record format name 
  7441. is valid only with an externally described file. If factor 1 is not specified, 
  7442. the record format name must be the name of the last record read from the file; 
  7443. otherwise, an error occurs. 
  7444.  
  7445. If factor 1 has an entry, you must specify a resulting indicator in positions 
  7446. 54 and 55. If factor 1 does not have an entry, leave these positions blank. 
  7447. This indicator is set on if the record to be deleted is not found in the file. 
  7448. You can specify a resulting indicator in positions 56 and 57; it is set on if 
  7449. the DELET operation is not completed successfully. (For example, an 
  7450. unauthorized user tries to delete the record) Leave positions 58 and 59 blank. 
  7451.  
  7452. Under the OS/400 operating system, if a read operation is done on the file 
  7453. specified in factor 2 after a successful DELET operation to that file, the next 
  7454. record after the deleted record is obtained. 
  7455.  
  7456.  
  7457. ΓòÉΓòÉΓòÉ 1.10.20.21. DIV (Divide) ΓòÉΓòÉΓòÉ
  7458.  
  7459. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7460. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  7461. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  7462. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7463. Γöé DIV(1/2)Γöé Dividend      Γöé Divisor         Γöé Quotient Γöé  + - Z  Γöé
  7464. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7465.  
  7466. If factor 1 is specified, the DIV operation divides factor 1 by factor 2; 
  7467. otherwise, it divides the result field by factor 2. The quotient (result) is 
  7468. placed in the result field.  If factor 1 is 0, the result of the divide 
  7469. operation is 0. Factor 2 cannot be 0.  If it is, an error occurs and the 
  7470. RPG/400 exception/error handling routine receives control. When factor 1 is not 
  7471. specified, the result field (dividend) is divided by factor 2 (divisor), and 
  7472. the result (quotient) is placed in the result field. Factor 1 and factor 2 must 
  7473. be numeric; each can contain one of: an array, array element, field, figurative 
  7474. constant, literal, named constant, subfield, or table name. 
  7475.  
  7476. Any remainder resulting from the divide operation is lost unless the move 
  7477. remainder (MVR) operation is specified as the next operation. If you use 
  7478. conditioning indicators, you must ensure that the DIV operation is processed 
  7479. immediately before the MVR operation. If the MVR operation is processed before 
  7480. the DIV operation, undesirable results occur. If move remainder is the next 
  7481. operation, the result of the divide operation cannot be half-adjusted 
  7482. (rounded). 
  7483.  
  7484. For further rules for the DIV operation, see Arithmetic Operations. 
  7485.  
  7486. Figure "Summary of Arithmetic Operations" shows examples of the DIV operation. 
  7487.  
  7488.  
  7489. ΓòÉΓòÉΓòÉ 1.10.20.22. DO (Do) ΓòÉΓòÉΓòÉ
  7490.  
  7491. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7492. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  7493. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  7494. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7495. Γöé DO      Γöé Starting      Γöé Limit value     Γöé Index    Γöé         Γöé
  7496. Γöé         Γöé value         Γöé                 Γöé value    Γöé         Γöé
  7497. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7498.  
  7499. The DO operation begins a group of operations and indicates the number of times 
  7500. the group will be processed. To indicate the number of times the group of 
  7501. operations is to be processed, specify an index field, a starting value, and a 
  7502. limit value. An associated ENDDO statement marks the end of the group. For 
  7503. further information on DO groups, see Structured Programming Operations. 
  7504.  
  7505. In factor 1, specify a starting value with no decimal positions, using a 
  7506. numeric literal, named constant, or field name.  If you do not specify factor 
  7507. 1, the starting value is 1. 
  7508.  
  7509. In factor 2, specify the limit value with no decimal positions, using a numeric 
  7510. field name, literal, or named constant. If you do not specify factor 2, the 
  7511. limit value is 1. 
  7512.  
  7513. In the result field, specify a numeric field name that will contain the current 
  7514. index value. The result field must be large enough to contain the limit value 
  7515. plus the increment. If you do not specify an index field, one is generated for 
  7516. internal use. Any value in the index field is replaced by factor 1 when the DO 
  7517. operation begins. 
  7518.  
  7519. Factor 2 of the associated ENDDO operation specifies the value to be added to 
  7520. the index field. It can be a numeric literal or a numeric field with no decimal 
  7521. positions. If it is blank, the value to be added to the index field is 1. 
  7522.  
  7523. In addition to the DO operation itself, the conditioning indicators on the DO 
  7524. and ENDDO statements control the DO group.  The conditioning indicators on the 
  7525. DO statement control whether or not the DO operation begins. These indicators 
  7526. are checked only once, at the beginning of the DO loop. The conditioning 
  7527. indicators on the associated ENDDO statement control whether or not the DO 
  7528. group is repeated another time. These indicators are checked at the end of each 
  7529. loop. 
  7530.  
  7531. The DO operation follows these 7 steps: 
  7532.  
  7533.  1. If the conditioning indicators on the DO statement line are satisfied, the 
  7534.     DO operation is processed (step 2).  If the indicators are not satisfied, 
  7535.     control passes to the next operation to be processed following the 
  7536.     associated ENDDO statement (step 7). 
  7537.  2. The starting value (factor 1) is moved to the index field (result field) 
  7538.     when the DO operation begins. 
  7539.  3. If the index value is greater than the limit value, control passes to the 
  7540.     calculation operation following the associated ENDDO statement (step 7). 
  7541.     Otherwise, control passes to the first operation after the DO statement 
  7542.     (step 4). 
  7543.  4. Each of the operations in the DO group is processed. 
  7544.  5. If the conditioning indicators on the ENDDO statement are not satisfied, 
  7545.     control passes to the calculation operation following the associated ENDDO 
  7546.     statement (step 7). Otherwise, the ENDDO operation is processed (step 6). 
  7547.  6. The ENDDO operation is processed by adding the increment to the index 
  7548.     field.  Control passes to step 3. (Note that the conditioning indicators on 
  7549.     the DO statement are not tested again (step 1) when control passes to step 
  7550.     3.) 
  7551.  7. The statement after the ENDDO statement is processed when the conditioning 
  7552.     indicators on the DO or ENDDO statements are not satisfied (step 1 or 5), 
  7553.     or when the index value is greater than the limit value (step 3). 
  7554.  
  7555. Remember the following when specifying the DO operation: 
  7556.  
  7557.  The index, increment, limit value, and indicators can be modified within the 
  7558.   loop to affect the ending of the DO group. 
  7559.  A DO group cannot span both detail and total calculations. 
  7560.  
  7561. See LEAVE (Leave a Do Group) and ITER (Iterate) for information on how those 
  7562. operations affect a DO operation. 
  7563.  
  7564. See DO Examples 
  7565.  
  7566.  
  7567. ΓòÉΓòÉΓòÉ 1.10.20.22.1. DO Examples ΓòÉΓòÉΓòÉ
  7568.  
  7569.  
  7570. DO Operation
  7571.  
  7572. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  7573. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  7574. C*
  7575. C*  The DO group is processed 10 times when indicator 17 is on;
  7576. C*  it stops running when the index value in field X, the result
  7577. C*  field, is greater than the limit value (10) in factor 2.  When
  7578. C*  the DO group stops running, control passes to the operation
  7579. C*  immediately following the ENDDO operation.  Because factor 1
  7580. C*  in the DO operation is not specified, the starting value is 1.
  7581. C*  Because factor 2 of the ENDDO operation is not specified, the
  7582. C*  incrementing value is 1.
  7583. C   17                DO   10        X       30       DO 10 TIMES
  7584. C                      :
  7585. C                      :
  7586. C                     ENDDO
  7587. C*
  7588. C*  The DO group can be processed 10 times.  The DO group stops
  7589. C*  running when the index value in field X is greater than
  7590. C*  the limit value (20) in factor 2, or if indicator 50 is not on
  7591. C*  when the ENDDO operation is encountered.  When indicator 50
  7592. C*  is not on, the ENDDO operation is not processed; therefore,
  7593. C*  control passes to the operation following the ENDDO operation.
  7594. C*  The starting value of 2 is specified in factor 1 of the DO
  7595. C*  operation, and the incrementing value of 2 is specified in
  7596. C*  factor 2 of the ENDDO operation.
  7597. C*
  7598. C           2         DO   20        X       30       DO 10 TIMES
  7599. C                      :
  7600. C                      :
  7601. C                      :
  7602. C   50                ENDDO  2
  7603.  
  7604.  
  7605. ΓòÉΓòÉΓòÉ 1.10.20.23. DOUxx (Do Until) ΓòÉΓòÉΓòÉ
  7606.  
  7607. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7608. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  7609. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  7610. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7611. Γöé DOUXX   Γöé Comparand     Γöé Comparand       Γöé          Γöé         Γöé
  7612. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7613.  
  7614. The DOUxx operation begins a group of operations you want to process more than 
  7615. once (but always at least once).  An associated ENDDO statement marks the end 
  7616. of the group.  For further information on DO groups and the meaning of xx, see 
  7617. Structured Programming Operations. 
  7618.  
  7619. Factor 1 and factor 2 must contain a literal, a named constant, a field name, a 
  7620. table name, an array element, a figurative constant, or a data structure name. 
  7621. Factor 1 and factor 2 must be either both character or both numeric. 
  7622.  
  7623. On the DOUxx statement, you indicate a relationship xx. To specify a more 
  7624. complex condition, immediately follow the DOUxx statement with ANDxx or ORxx 
  7625. statements. The operations in the DO group are processed once, and then the 
  7626. group is repeated while the relationship exists between factor 1 and factor 2 
  7627. or the condition specified by a combined DOUxx, ANDxx, or ORxx operation 
  7628. exists. The group is always processed at least once even if the condition is 
  7629. not true at the start of the group. 
  7630.  
  7631. In addition to the DOUxx operation itself, the conditioning indicators on the 
  7632. DOUxx and ENDDO statements control the DO group. The conditioning indicators on 
  7633. the DOUxx statement control whether or not the DOUxx operation begins. The 
  7634. conditioning indicators on the associated ENDDO statement can cause a DO loop 
  7635. to end prematurely. 
  7636.  
  7637. The DOUxx operation follows these steps: 
  7638.  
  7639.  1. If the conditioning indicators on the DOUxx statement line are satisfied, 
  7640.     the DOUxx operation is processed (step 2). If the indicators are not 
  7641.     satisfied, control passes to the next operation that can be processed 
  7642.     following the associated ENDDO statement (step 6). 
  7643.  2. The DOUxx operation is processed by passing control to the next operation 
  7644.     that can be processed (step 3). The DOUxx operation does not compare factor 
  7645.     1 and factor 2 or test the specified condition at this point. 
  7646.  3. Each of the operations in the DO group is processed. 
  7647.  4. If the conditioning indicators on the ENDDO statement are not satisfied, 
  7648.     control passes to the next calculation operation following the associated 
  7649.     ENDDO statement (step 6).  Otherwise, the ENDDO operation is processed 
  7650.     (step 5). 
  7651.  5. The ENDDO operation is processed by comparing factor 1 and factor 2 of the 
  7652.     DOUxx operation or testing the condition specified by a combined operation. 
  7653.     If the relationship xx exists between factor 1 and factor 2 or the 
  7654.     specified condition exists, the DO group is finished and control passes to 
  7655.     the next calculation operation after the ENDDO statement (step 6).  If the 
  7656.     relationship xx does not exist between factor 1 and factor 2 or the 
  7657.     specified condition does not exist, the operations in the DO group are 
  7658.     repeated (step 3). 
  7659.  6. The statement after the ENDDO statement is processed when the conditioning 
  7660.     indicators on the DOUxx or ENDDO statements are not satisfied (steps 1 or 
  7661.     4), or when the relationship xx between factor 1 and factor 2 or the 
  7662.     specified condition exists at step 5. 
  7663.  
  7664. See LEAVE (Leave a Do Group) and ITER (Iterate) for information on how those 
  7665. operations affect a DOUxx operation. 
  7666.  
  7667. See DOUxx Examples. 
  7668.  
  7669.  
  7670. ΓòÉΓòÉΓòÉ 1.10.20.23.1. DOUxx Examples ΓòÉΓòÉΓòÉ
  7671.  
  7672.  
  7673. DOUxx Operations
  7674.  
  7675. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  7676. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  7677. C*
  7678. C*  The DOUEQ operation runs the operation within the DO group at
  7679. C*  least once.
  7680. C           FLDA      DOUEQFLDB
  7681. C*
  7682. C*  At the ENDDO operation, a test is processed to determine whether
  7683. C*  FLDA is equal to FLDB.  If FLDA does not equal FLDB, the
  7684. C*  preceding operations are processed again.  This loop continues
  7685. C*  processing until FLDA is equal to FLDB.  When FLDA is equal to
  7686. C*  FLDB, the program branches to the operation immediately
  7687. C*  following the ENDDO operation.
  7688. C                     SUB  1         FLDA
  7689. C                     ENDDO
  7690. C*
  7691. C*  The combined DOUEQ ANDEQ OREQ operation processes the operation
  7692. C*  within the DO group at least once.
  7693. C           FLDA      DOUEQFLDB
  7694. C           FLDC      ANDEQFLDD
  7695. C           FLDE      OREQ 100
  7696.  
  7697. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  7698. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  7699. C*
  7700. C*  At the ENDDO operation, a test is processed to determine whether
  7701. C*  the specified condition, FLDA equal to FLDB and FLDC equal to
  7702. C*  FLDD, exists.  If the condition exists, the program branches to
  7703. C*  the operation immediately following the ENDDO operation.  There
  7704. C*  is no need to test the OREQ condition, FLDE equal to 100, if the
  7705. C*  DOUEQ and ANDEQ conditions are met.  If the specified condition
  7706. C*  does not exist, the OREQ condition is tested.  If the OREQ
  7707. C*  condition is met, the program branches to the operation
  7708. C*  immediately following the ENDDO.  Otherwise, the operations
  7709. C*  following the OREQ operation are processed and then the program
  7710. C*  processes the conditional tests starting at the second DOUEQ
  7711. C*  operation.  If neither the DOUEQ and ANDEQ condition nor the
  7712. C*  OREQ condition is met, the operations following the OREQ
  7713. C*  operation are processed again.
  7714. C                     SUB  1         FLDA
  7715. C                     ADD  1         FLDC
  7716. C                     ADD  5         FLDE
  7717. C                     ENDDO
  7718.  
  7719.  
  7720. ΓòÉΓòÉΓòÉ 1.10.20.24. DOWxx (Do While) ΓòÉΓòÉΓòÉ
  7721.  
  7722. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7723. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  7724. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  7725. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7726. Γöé DOWXX   Γöé Comparand     Γöé Comparand       Γöé          Γöé         Γöé
  7727. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7728.  
  7729. The DOWxx operation begins a group of operations you want to process while the 
  7730. relationship xx exists between factor 1 and factor 2. To specify a more complex 
  7731. condition, immediately follow the DOWxx statement with ANDxx or ORxx 
  7732. statements. An associated ENDDO statement marks the end of the group. For 
  7733. further information on DO groups and the meaning of xx, see Structured 
  7734. Programming Operations. 
  7735.  
  7736. Factor 1 and factor 2 must contain a literal, a named constant, a figurative 
  7737. constant, a field name, a table name, an array element, or a data structure 
  7738. name. Factor 1 and factor 2 must be either both character or both numeric. The 
  7739. comparison of factor 1 and factor 2 follows the same rules as those given for 
  7740. the compare operations. See Compare Operations. 
  7741.  
  7742. In addition to the DOWxx operation itself, the conditioning indicators on the 
  7743. DOWxx and ENDDO statements control the DO group.  The conditioning indicators 
  7744. on the DOWxx statement control whether or not the DOWxx operation is begun. 
  7745. The conditioning indicators on the associated ENDDO statement control whether 
  7746. the DO group is repeated another time. 
  7747.  
  7748. The DOWxx operation follows these steps: 
  7749.  
  7750.  1. If the conditioning indicators on the DOWxx statement line are satisfied, 
  7751.     the DOWxx operation is processed (step 2).  If the indicators are not 
  7752.     satisfied, control passes to the next operation to be processed following 
  7753.     the associated ENDDO statement (step 6). 
  7754.  2. The DOWxx operation is processed by comparing factor 1 and factor 2 or 
  7755.     testing the condition specified by a combined DOWxx, ANDxx, or ORxx 
  7756.     operation. If the relationship xx between factor 1 and factor 2 or the 
  7757.     condition specified by a combined operation does not exist, the DO group is 
  7758.     finished and control passes to the next calculation operation after the 
  7759.     ENDDO statement (step 6).  If the relationship xx between factor 1 and 
  7760.     factor 2 or the condition specified by a combined operation exists, the 
  7761.     operations in the DO group are repeated (step 3). 
  7762.  3. Each of the operations in the DO group is processed. 
  7763.  4. If the conditioning indicators on the ENDDO statement are not satisfied, 
  7764.     control passes to the next operation to run following the associated ENDDO 
  7765.     statement (step 6).  Otherwise, the ENDDO operation is processed (step 5). 
  7766.  5. The ENDDO operation is processed by passing control to the DOWxx operation 
  7767.     (step 2).  (Note that the conditioning indicators on the DOWxx statement 
  7768.     are not tested again at step 1.) 
  7769.  6. The statement after the ENDDO statement is processed when the conditioning 
  7770.     indicators on the DOWxx or ENDDO statements are not satisfied (steps 1 or 
  7771.     4), or when the relationship xx between factor 1 and factor 2 of the 
  7772.     specified condition does not exist at step 2. 
  7773.  
  7774. See LEAVE (Leave a Do Group) and ITER (Iterate) for information on how those 
  7775. operations affect a DOWxx operation. 
  7776.  
  7777. See DOWxx Examples. 
  7778.  
  7779.  
  7780. ΓòÉΓòÉΓòÉ 1.10.20.24.1. DOWxx Examples ΓòÉΓòÉΓòÉ
  7781.  
  7782.  
  7783. DOWxx Operations
  7784.  
  7785. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  7786. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  7787. C*
  7788. C*  The DOWLT operation allows the operation within the DO group
  7789. C*  to be processed only if FLDA is less than FLDB.  If FLDA is
  7790. C*  not less than FLDB, the program branches to the operation
  7791. C*  immediately following the ENDDO operation.  If FLDA is less
  7792. C*  than FLDB, the operation within the DO group is processed.
  7793. C           FLDA      DOWLTFLDB
  7794. C*
  7795. C*  The ENDDO operation causes the program to branch to the first
  7796. C*  DOWLT operation where a test is made to determine whether FLDA
  7797. C*  is less than FLDB.  This loop continues processing until FLDA
  7798. C*  is equal to or greater than FLDB; then the program branches
  7799. C*  to the operation immediately following the ENDDO operation.
  7800. C                     MULT 2.08      FLDA
  7801. C                     ENDDO
  7802. C*  In this example, multiple conditions are tested.  The combined
  7803. C*  DOWLT ORLT operation allows the operation within the DO group
  7804. C*  to be processed only while FLDA is less than FLDB or FLDC. If
  7805. C*  neither specified condition exists, the program branches to
  7806. C*  the operation immediately following the ENDDO operation. If
  7807. C*  either of the specified conditions exists, the operation after
  7808. C*  the ORLT operation is processed.
  7809. C           FLDA      DOWLTFLDB
  7810. C           FLDA      ORLT FLDC
  7811. C*  The ENDDO operation causes the program to branch to the second
  7812. C*  DOWLT operation where a test determines whether specified
  7813. C*  conditions exist.  This loop continues until FLDA is equal to
  7814. C*  or greater than FLDB and FLDC; then the program branches to the
  7815. C*  operation immediately following the ENDDO operation.
  7816. C                     MULT 2.08      FLDA
  7817. C                     ENDDO
  7818.  
  7819.  
  7820. ΓòÉΓòÉΓòÉ 1.10.20.25. DSPLY (Display Function) ΓòÉΓòÉΓòÉ
  7821.  
  7822. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7823. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  7824. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  7825. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7826. Γöé DSPLY   Γöé Message iden- Γöé Output queue    Γöé Response Γöé  _ ER _ Γöé
  7827. Γöé         Γöé tifier        Γöé                 Γöé          Γöé         Γöé
  7828. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7829.  
  7830. The DSPLY operation allows the program to communicate with the display work 
  7831. station that requested the program.  The operation can display a message and 
  7832. accept a response. 
  7833.  
  7834. The value in factor 1 is used to create the message to be displayed. If factor 
  7835. 1 is specified, it can contain a field name, a literal, a named constant, a 
  7836. table name, or an array element whose value is used to create the message to be 
  7837. displayed. Factor 1 can also contain *M, followed by a message identifier that 
  7838. identifies the message to be retrieved from the message file, QUSERMSG. 
  7839. QUSERMSG must be in a library in the library list of the job receiving the 
  7840. message. 
  7841.  
  7842. The message identifier can be from 1 to 7 characters in length and can include 
  7843. an optional alphabetic prefix of 3 characters followed immediately by 1 to 4 
  7844. digits. If the alphabetic prefix is not specified, the default is USR. The 
  7845. numeric portion of the message identifier (1) must immediately follow either *M 
  7846. or the optional alphabetic prefix, (2) cannot include embedded blanks, and (3) 
  7847. must be left-adjusted (high-order zeros can be omitted). If the numeric portion 
  7848. of the message identifier is not specified, the default is 0000.  Valid 
  7849. examples are: 
  7850.  
  7851. Factor 1     Message 
  7852. Entry        Identifier 
  7853.              Used 
  7854. *M           USR0000 
  7855. *MABC        ABC0000 
  7856. *M1          USR0001 
  7857. *MABC5       ABC0005 
  7858.  
  7859. If specified, factor 2 can contain a character field, a literal, a named 
  7860. constant, a table name, or an array element whose value is the symbolic name of 
  7861. the object meant to receive the message and from which the optional response 
  7862. can be sent. Any queue name except a program message queue name can be the 
  7863. value contained in the factor 2 entry.  The queue must be declared to the 
  7864. OS/400 system before it can be specified in factor 2. (For information on how 
  7865. to create a queue, see the Programming:  Control Language Programmer's Guide.) 
  7866. There are two predefined queues: 
  7867.  
  7868. Queue        Value 
  7869. QSYSOPR      The message is sent to the system operator.  Note that the QSYSOPR 
  7870.              message queue severity level must be zero (00) to enable the DSPLY 
  7871.              operation to immediately display a message to the system operator. 
  7872. *EXT         The message is sent to the requester. 
  7873.  
  7874. Note:   For a batch job, if factor 2 is blank, the default is QSYSOPR. For an 
  7875. interactive job, if factor 2 is blank, the default is *EXT. 
  7876.  
  7877. The result field is optional. If it is specified, the response is placed in it. 
  7878. It can contain a field name, a table name, or an array element in which the 
  7879. response is placed. If no data is entered, the result field is unchanged. 
  7880.  
  7881. Positions 56 and 57 can contain an indicator to be set on if an error occurs on 
  7882. the operation. If an error occurs when the workstation user enters the 
  7883. response, the message is displayed again a maximum of five times. After the 
  7884. fifth display, the indicator in positions 56 and 57, if specified, is set on. 
  7885. If this indicator is not specified, the exception/error handling routine 
  7886. receives control. 
  7887.  
  7888. When you specify the DSPLY operation with no message identifier in factor 1, 
  7889. the operation functions as follows: 
  7890.  
  7891.  When factor 1 contains an entry and the result field is blank, the contents 
  7892.   of the factor 1 entry are displayed.  The program does not wait for a 
  7893.   response unless a display file with the parameter RSTDSP (*NO) specified was 
  7894.   used to display a format at the workstation. Then the program waits for the 
  7895.   user to press Enter. 
  7896.  When factor 1 is blank and the result field contains an entry, the contents 
  7897.   of the result field entry are displayed and the program waits for the user to 
  7898.   enter data for the response.  The reply is placed in the result field. 
  7899.  When both factor 1 and the result field contain entries, the contents of the 
  7900.   factor 1 and result field entries are combined and displayed.  The program 
  7901.   waits for the user to enter data for the response.  The response is placed in 
  7902.   the result field. 
  7903.  
  7904.   The maximum length of information that can be displayed is 52 characters. 
  7905.  
  7906. The format of the record written by the DSPLY operation with no message 
  7907. identifier in factor 1 follows: 
  7908.  
  7909. (1)The maximum length of information that can be displayed is
  7910. 52 characters.
  7911.  
  7912.  
  7913.                 Variable Length(1)                Variable Length(1)
  7914.                 ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ           ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7915.                                                                     
  7916.  
  7917. DSPLY
  7918.                                                                 
  7919.        ΓööΓöÇΓöÇΓöÇΓöÇΓöÿ   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ  ΓööΓöÇΓöÇΓöÇΓöÇΓöÿ   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7920.  
  7921.        blank        Contents of       blank      Contents of the result
  7922.                     factor 1 if                  field if both factor 1
  7923.                     it is                        and the result field
  7924.                     specified                    are specified.
  7925.                         or
  7926.                     contents of
  7927.                     the result field
  7928.                     if factor 1 is
  7929.                     not specified.
  7930.  
  7931.  
  7932.  
  7933. When you specify the DSPLY operation with a message identifier in factor 1, the 
  7934. operation functions as follows:  the message identified by the factor 1 entry 
  7935. is retrieved from QUSERMSG, the message is displayed, and the program waits for 
  7936. the user to respond by entering data if the result field is specified.  The 
  7937. response is placed in the result field. For information on how to format the 
  7938. display, see the Data Management Guide. 
  7939.  
  7940. When replying to a message, remember the following: 
  7941.  
  7942.  Numeric fields sent to the display are right-adjusted and zero-suppressed. 
  7943.  If a numeric field is keyed with a length greater than the number of digits 
  7944.   in the result field and the rightmost character is not a minus sign (-), an 
  7945.   error is detected and a second wait occurs.  The user must key in the field 
  7946.   again. 
  7947.  To enter a null response to the system operator queue (QSYSOPR), the user 
  7948.   must enter the characters *N and then press Enter. 
  7949.  Character fields are padded on the right with blanks after all characters are 
  7950.   keyed. 
  7951.  Numeric fields are right-adjusted and padded on the left with zeros after all 
  7952.   characters are keyed. 
  7953.  Lowercase characters are not converted to uppercase. 
  7954.  
  7955.  
  7956. ΓòÉΓòÉΓòÉ 1.10.20.26. DUMP (Program Dump) ΓòÉΓòÉΓòÉ
  7957.  
  7958. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7959. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  7960. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  7961. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7962. Γöé DUMP    Γöé Identifier    Γöé                 Γöé          Γöé         Γöé
  7963. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7964.  
  7965. The DUMP operation provides a dump (all fields, all files, indicators, data 
  7966. structures, arrays, and tables defined) of the program. It can be used 
  7967. independently of or in combination with the OS/400 testing and debugging 
  7968. functions. 
  7969.  
  7970. The contents of factor 1 identify the DUMP operation. It must contain a 
  7971. character entry that can be one of: a field name, literal, named constant, 
  7972. table name, or array element whose contents identify the dump. Factor 1 cannot 
  7973. contain a figurative constant. 
  7974.  
  7975. The program continues processing the next calculation statement following the 
  7976. DUMP operation. 
  7977.  
  7978. The DUMP operation is performed only if a 1 is specified in position 15 of the 
  7979. control specification. If the control specification entry is not made, the DUMP 
  7980. operation is checked for errors and the statement is printed on the listing, 
  7981. but the DUMP operation is not processed. 
  7982.  
  7983. If you have specified a POST operation code, with factor 1 blank, anywhere in 
  7984. your program, no file information data structures (INFDS) are updated until you 
  7985. do an appropriate POST operation. For up-to-date information, do a POST 
  7986. operation for each file before you do the DUMP operation. (This action is not 
  7987. required for a dump that the system does in response to an inquiry message.) 
  7988.  
  7989.  
  7990. ΓòÉΓòÉΓòÉ 1.10.20.27. ELSE (Else) ΓòÉΓòÉΓòÉ
  7991.  
  7992. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7993. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  7994. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  7995. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7996. Γöé ELSE    Γöé               Γöé                 Γöé          Γöé         Γöé
  7997. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7998.  
  7999. The ELSE operation is an optional part of the IFxx operation. If the IFxx 
  8000. comparison is met, the calculations before ELSE are processed; otherwise, the 
  8001. calculations after ELSE are processed. 
  8002.  
  8003. Within total calculations, the control level entry (positions 7 and 8) can be 
  8004. blank or can contain an L1 through L9 indicator, an LR indicator, or an L0 
  8005. entry to group the statement within the appropriate section of the program. The 
  8006. control level entry is for documentation purposes only. Conditioning indicator 
  8007. entries (positions 9 through 17) are not permitted. 
  8008.  
  8009. To close the IFxx/ELSE group use an ENDIF operation. 
  8010.  
  8011. Figure "IFxx/ENDIF and IFxx/ELSE/ENDIF Operations" shows an example of an ELSE 
  8012. operation with an IFxx operation. 
  8013.  
  8014.  
  8015. ΓòÉΓòÉΓòÉ 1.10.20.28. ENDyy (End a Group) ΓòÉΓòÉΓòÉ
  8016.  
  8017. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8018. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  8019. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  8020. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8021. Γöé END     Γöé               Γöé Increment value Γöé          Γöé         Γöé
  8022. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8023. Γöé ENDCS   Γöé               Γöé                 Γöé          Γöé         Γöé
  8024. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8025. Γöé ENDDO   Γöé               Γöé Increment value Γöé          Γöé         Γöé
  8026. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8027. Γöé ENDIF   Γöé               Γöé                 Γöé          Γöé         Γöé
  8028. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8029. Γöé ENDSL   Γöé               Γöé                 Γöé          Γöé         Γöé
  8030. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8031.  
  8032. The ENDyy operation ends a CASxx, DO, DOUxx, DOWxx, IFxx, or SELEC group of 
  8033. operations. 
  8034.  
  8035. The ENDyy operations are listed below: 
  8036.  
  8037. END       End a CASxx, DO, DOUxx, DOWxx, IFxx, or SELEC group 
  8038. ENDCS     End a CASxx group 
  8039. ENDDO     End a DO, DOUxx, or DOWxx group 
  8040. ENDIF     End an IFxx group 
  8041. ENDSL     End a SELEC group 
  8042.  
  8043. Factor 2 is allowed only on an ENDyy operation that delimits a DO group. It 
  8044. contains the incrementing value of the DO group. It can be positive or 
  8045. negative, must have no decimal positions, and can be one of: an array element, 
  8046. table name, data structure, field, named constant, or numeric literal. If 
  8047. factor 2 is not specified on the ENDDO, the increment defaults to 1. 
  8048.  
  8049. Conditioning indicators are optional for ENDDO and not allowed for ENDCS, 
  8050. ENDIF, and ENDSL. 
  8051.  
  8052. Resulting indicators are not allowed. Factor 1, factor 2, and the result field 
  8053. must all be blank for ENDCS, ENDIF,and ENDSL. 
  8054.  
  8055. If one ENDyy form is used with a different operation group (for example, ENDIF 
  8056. with a structured group), an error results at compilation time. 
  8057.  
  8058. See the CASxx, DO, DOUxx, DOWxx, IFxx, and SELEC operations for examples that 
  8059. use the ENDyy operation. 
  8060.  
  8061.  
  8062. ΓòÉΓòÉΓòÉ 1.10.20.29. ENDSR (End of Subroutine) ΓòÉΓòÉΓòÉ
  8063.  
  8064. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8065. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  8066. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  8067. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8068. Γöé ENDSR   Γöé Label         Γöé Return point    Γöé          Γöé         Γöé
  8069. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8070.  
  8071. The ENDSR operation defines the end of an RPG/400 subroutine and the return 
  8072. point to the main program. ENDSR must be the last statement in the subroutine. 
  8073. Factor 1 can contain a label that can be used as a point to which a GOTO 
  8074. operation within the subroutine can branch. The control level entry (positions 
  8075. 7 and 8) can be SR or blank. Conditioning indicator entries are not allowed. 
  8076.  
  8077. The ENDSR operation ends a subroutine and causes a branch back to the statement 
  8078. immediately following the EXSR operation unless the subroutine is a program 
  8079. exception/error subroutine (*PSSR) or a file exception/error subroutine 
  8080. (INFSR). For these subroutines, factor 2 of the ENDSR operation can contain an 
  8081. entry that specifies where control is to be returned following processing of 
  8082. the subroutine.  This entry can be a field name that contains a reserved 
  8083. keyword or a literal or named constant that is a reserved keyword. If a return 
  8084. point that is not valid is specified, the RPG/400 error handler receives 
  8085. control. 
  8086.  
  8087. See Figure "Example of Coding Subroutines" for an example of coding an RPG/400 
  8088. subroutine. 
  8089.  
  8090.  
  8091. ΓòÉΓòÉΓòÉ 1.10.20.30. EXCPT (Calculation Time Output) ΓòÉΓòÉΓòÉ
  8092.  
  8093. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8094. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  8095. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  8096. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8097. Γöé EXCPT   Γöé               Γöé EXCPT name      Γöé          Γöé         Γöé
  8098. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8099.  
  8100. The EXCPT operation has two major functions: 
  8101.  
  8102.  It allows records to be written during calculation time. 
  8103.  It allows a variable number of records to be written in one program cycle at 
  8104.   either detail calculation or total calculation time. 
  8105.  
  8106. See Figure "EXCPT Operation with/without Factor 2 Specified" for examples of 
  8107. the EXCPT operation. 
  8108.  
  8109. When specifying the EXCPT operation remember: 
  8110.  
  8111.  The exception records that are to be written during calculation time are 
  8112.   indicated by an E in position 15 of the output specifications. An EXCPT name, 
  8113.   which is the same name as specified in factor 2 of an EXCPT operation, can be 
  8114.   specified in positions 32 through 37 of the output specifications of the 
  8115.   exception records. 
  8116.  Only exception records, not heading, detail, or total records, can contain an 
  8117.   EXCPT name. 
  8118.  When the EXCPT operation with a name in factor 2 is processed, only those 
  8119.   exception records with the same EXCPT name are checked and written if the 
  8120.   conditioning indicators are satisfied. 
  8121.  When factor 2 is blank, only those exception records with no name in 
  8122.   positions 32 through 37 of the output specifications are checked and written 
  8123.   if the conditioning indicators are satisfied. 
  8124.  If an exception record is conditioned by an overflow indicator on the output 
  8125.   specification, the record is written only during the overflow portion of the 
  8126.   RPG/400 cycle or during fetch overflow. The record is not written at the time 
  8127.   the EXCPT operation is processed. 
  8128.  If an exception output is specified to a format that contains no fields, the 
  8129.   following occurs: 
  8130.  
  8131.    - If an output file is specified, a record is written with default values. 
  8132.    - If a record is locked, the system treats the operation as a request to 
  8133.      unlock the record. This is the alternative form of requesting an unlock. 
  8134.      The preferred method is with the UNLCK operation. 
  8135.  
  8136.  
  8137. ΓòÉΓòÉΓòÉ 1.10.20.30.1. EXCPT Examples ΓòÉΓòÉΓòÉ
  8138.  
  8139.  
  8140. EXCPT Operation with/without Factor 2 Specified
  8141.  
  8142. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  8143. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  8144. C*
  8145. C*  When the EXCPT operation with HDG specified in factor 2 is
  8146. C*  processed, all exception records with the EXCPT name HDG are
  8147. C*  written.  In this example, UDATE and PAGE would be printed
  8148. C*  and then the printer would space 2 lines.
  8149. C                     EXCPTHDG
  8150. C*
  8151. C*  When the EXCPT operation with no entry in factor 2 is
  8152. C*  processed, all exception records that do not have an EXCPT
  8153. C*  name specified in positions 32 through 37 are written if the
  8154. C*  conditioning indicators are satisfied.  Any exception records
  8155. C*  without conditioning indicators and without an EXCPT name
  8156. C*  are always written by an EXCPT operation with no entry in
  8157. C*  factor 2.  In this example,  if indicator 10 is on, TITLE and
  8158. C*  AUTH would be printed and then the printer would space 1 line.
  8159. C                     EXCPT
  8160. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  8161. OName++++DFBASbSaN01N02N03Excnam....................................
  8162. O*
  8163. O        E  1     10
  8164. O                         TITLE
  8165. O                         AUTH
  8166. O        E  2             HDG
  8167. O                         UDATE
  8168. O                         PAGE
  8169. O        E  1             DETAIL
  8170. O                         AUTH
  8171. O                         VERSNO
  8172.  
  8173.  
  8174. ΓòÉΓòÉΓòÉ 1.10.20.31. EXFMT (Write/Then Read Format) ΓòÉΓòÉΓòÉ
  8175.  
  8176. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8177. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  8178. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  8179. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8180. Γöé EXFMT   Γöé               Γöé Record format   Γöé          Γöé  _ ER _ Γöé
  8181. Γöé         Γöé               Γöé name            Γöé          Γöé         Γöé
  8182. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8183.  
  8184. The EXFMT operation is a combination of a WRITE followed by a READ to the same 
  8185. record format. EXFMT is valid only for a WORKSTN file defined as a full 
  8186. procedural (F in position 16 of the file description specifications) combined 
  8187. file (C in position 15 of the file description specifications) that is 
  8188. externally described (E in position 19. of the file description specifications) 
  8189.  
  8190. Factor 2 must contain the name of the record format to be written and then 
  8191. read. A resulting indicator can be specified in positions 56 and 57 to be set 
  8192. on if the EXFMT operation is not completed successfully. When the indicator is 
  8193. set on, the read portion of the operation is not processed (record identifying 
  8194. indicators and fields are not modified). Positions 54, 55, 58, and 59 must be 
  8195. blank. 
  8196.  
  8197. For the use of EXFMT with multiple device files, see the descriptions of the 
  8198. READ (by format name) and WRITE operations. 
  8199.  
  8200.  
  8201. ΓòÉΓòÉΓòÉ 1.10.20.32. EXSR (Invoke Subroutine) ΓòÉΓòÉΓòÉ
  8202.  
  8203. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8204. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  8205. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  8206. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8207. Γöé EXSR    Γöé               Γöé Subroutine name Γöé          Γöé         Γöé
  8208. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8209.  
  8210. The EXSR operation causes the RPG/400 subroutine named in factor 2 to be 
  8211. processed. The subroutine name must be a unique symbolic name and must appear 
  8212. as factor 1 of a BEGSR operation. The EXSR operation can appear anywhere in the 
  8213. calculation specifications. Whenever it appears, the subroutine that is named 
  8214. is processed. After operations in the subroutine are processed, the statement 
  8215. following the EXSR operation is processed except when a GOTO within the 
  8216. subroutine is given to a label outside the subroutine or when the subroutine is 
  8217. an exception/error subroutine with an entry in factor 2 of the ENDSR operation. 
  8218.  
  8219. *PSSR used in factor 2 specifies that the program exception/error subroutine is 
  8220. to be processed. *INZSR used in factor 2 specifies that the program 
  8221. initialization subroutine is to be processed. 
  8222.  
  8223. See Coding Subroutines for more information. 
  8224.  
  8225.  
  8226. ΓòÉΓòÉΓòÉ 1.10.20.33. Coding Subroutines ΓòÉΓòÉΓòÉ
  8227.  
  8228. An RPG/400 subroutine can be processed from any point in the calculation 
  8229. operations.  All RPG/400 operations can be processed within a subroutine, and 
  8230. these operations can be conditioned by any valid indicators in positions 9 
  8231. through 17. SR or blanks can appear in positions 7 and 8. Control level 
  8232. indicators (L1 through L9) cannot be used in these positions.  However, AND/OR 
  8233. lines within the subroutine can be indicated in positions 7 and 8. 
  8234.  
  8235. Fields used in a subroutine can be defined either in the subroutine or in the 
  8236. rest of the program.  In either instance, the fields can be used by both the 
  8237. main program and the subroutine. 
  8238.  
  8239. You can include a maximum of 254 subroutines in a program; however, a 
  8240. subroutine cannot contain another subroutine.  One subroutine can call another 
  8241. subroutine; that is, a subroutine can contain an EXSR or CASxx. However, an 
  8242. EXSR or CASxx specification within a subroutine cannot directly call itself. 
  8243. Indirect calls to itself through another subroutine should not be performed, 
  8244. because unpredictable results can occur. Use the GOTO and TAG operation codes 
  8245. if you want to branch to another point within the same subroutine. 
  8246.  
  8247. Subroutines do not have to be specified in the order they are used. Each 
  8248. subroutine must have a unique symbolic name and must contain a BEGSR and an 
  8249. ENDSR statement. 
  8250.  
  8251. The use of the GOTO (branching) operation is allowed within a subroutine. GOTO 
  8252. can specify the label on the ENDSR operation associated with that subroutine; 
  8253. it cannot specify the name of a BEGSR operation.  A GOTO outside the subroutine 
  8254. cannot be issued to a BEGSR, ENDSR, or TAG within a subroutine.  A GOTO within 
  8255. a subroutine can be issued to a TAG within either detail or total calculations. 
  8256.  
  8257. See Figure "Example of Coding Subroutines" for an example of coding a 
  8258. subroutine. 
  8259.  
  8260.  
  8261. ΓòÉΓòÉΓòÉ 1.10.20.33.1. Subroutine Coding Examples ΓòÉΓòÉΓòÉ
  8262.  
  8263.  
  8264. Example of Coding Subroutines
  8265.  
  8266. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  8267. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  8268. C*
  8269. C* For a subroutine, positions 7 and 8 can be blank or contain SR.
  8270. C*
  8271. C                         :
  8272. C                         :
  8273. C                     EXSR SUBRTB
  8274. C                         :
  8275. C                         :      CALCULATIONS
  8276. C                         :
  8277. CL2                   EXSR SUBRTA
  8278. C                         :
  8279. C                         :      CALCULATIONS
  8280. C                         :
  8281. C           SUBRTA    BEGSR
  8282. C                         :
  8283. C                         :      CALCULATIONS
  8284. C                         :
  8285. C*
  8286. C*  One subroutine can call another subroutine.
  8287. C*
  8288. C                     EXSR SUBRTC
  8289. C                         :
  8290. C                         :      CALCULATIONS
  8291. C                         :
  8292. C                     ENDSR
  8293. C           SUBRTB    BEGSR
  8294. C                         :      CALCULATIONS
  8295. C                         :
  8296. C                         :
  8297. C*
  8298. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  8299. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  8300. C*
  8301. C*  GOTO and TAG operations can be used within a subroutine.
  8302. C*
  8303. C           START     TAG
  8304. C                         :
  8305. C                         :      CALCULATIONS
  8306. C                         :
  8307. C   23                GOTO END
  8308. C                         :
  8309. C                         :      CALCULATIONS
  8310. C                         :
  8311. C   24                GOTO START
  8312. C           END       ENDSR
  8313. C           SUBRTC    BEGSR
  8314. C                         :
  8315. C                         :      CALCULATIONS
  8316. C                         :
  8317. C                     ENDSR
  8318. C*
  8319.  
  8320.  
  8321. ΓòÉΓòÉΓòÉ 1.10.20.34. FEOD (Force End of Data) ΓòÉΓòÉΓòÉ
  8322.  
  8323. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8324. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  8325. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  8326. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8327. Γöé FEOD    Γöé               Γöé File name       Γöé          Γöé  _ ER _ Γöé
  8328. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8329.  
  8330. The FEOD operation signals the logical end of data for a primary, secondary, or 
  8331. full procedural file. The FEOD function differs, depending on the file type and 
  8332. device. (For an explanation of how FEOD differs per file type and device, see 
  8333. the Database Guide, SC41-9659.) 
  8334.  
  8335. FEOD differs from the CLOSE operation: the program is not disconnected from the 
  8336. device or file; the file can be used again for subsequent file operations 
  8337. without an explicit OPEN operation being specified to the file. 
  8338.  
  8339. You can specify conditioning indicators. Factor 2 names the file to which FEOD 
  8340. is specified. You can specify a resulting indicator in positions 56 and 57 to 
  8341. be set on if the operation is not completed successfully. 
  8342.  
  8343. To process any further sequential operations to the file after the FEOD 
  8344. operation (for example, READ or READP), you must reposition the file. 
  8345.  
  8346.  
  8347. ΓòÉΓòÉΓòÉ 1.10.20.35. FORCE (Force a Certain File to Be Read Next Cycle) ΓòÉΓòÉΓòÉ
  8348.  
  8349. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8350. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  8351. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  8352. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8353. Γöé FORCE   Γöé               Γöé File name       Γöé          Γöé         Γöé
  8354. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8355.  
  8356. The FORCE operation allows selection of the file from which the next record is 
  8357. to be read. It can be used only for primary or secondary files. 
  8358.  
  8359. Factor 2 must contain the name of a file from which the next record is to be 
  8360. selected. 
  8361.  
  8362. If the FORCE operation is processed, the record is read at the start of the 
  8363. next program cycle. If more than one FORCE operation is processed during the 
  8364. same program cycle, all but the last is ignored. FORCE must be issued at detail 
  8365. time, not total time. 
  8366.  
  8367. FORCE operations override the multifile processing method by which the program 
  8368. normally selects records. However, the first record to be processed is always 
  8369. selected by the normal method. The remaining records can be selected by FORCE 
  8370. operations. For information on how the FORCE operation affects match-field 
  8371. processing, see -- Reference detlobj not found --. 
  8372.  
  8373. If FORCE is specified for a file that is at end of file, no record is retrieved 
  8374. from the file.  The program cycle determines the next record to be read. 
  8375.  
  8376.  
  8377. ΓòÉΓòÉΓòÉ 1.10.20.36. FREE (Deactivate a Program) ΓòÉΓòÉΓòÉ
  8378.  
  8379. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8380. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  8381. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  8382. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8383. Γöé FREE    Γöé               Γöé Program name    Γöé          Γöé  _ ER _ Γöé
  8384. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8385.  
  8386. The FREE operation removes a program from the list of activated programs, frees 
  8387. static storage, and ensures program initialization (first cycle processing) the 
  8388. next time the program is called. It does not close files or unlock data areas. 
  8389.  
  8390. Factor 2 contains the name of the program to be deactivated. It must contain 
  8391. the name of a field, named constant, literal, or array element that contains 
  8392. the name of the program to be deactivated. The entry in factor 2 must be 
  8393. character data; it can include a qualified name such as LIB/PGM. The name 
  8394. preceding the slash is the library that contains the program to be freed from 
  8395. the activated program list. Specify only the program name if you want to search 
  8396. the library list. The RPG/400 language uses the program name exactly as 
  8397. specified in the literal, field, or array element to determine the program to 
  8398. be called. (Lowercase characters are not shifted to uppercase, and a name 
  8399. enclosed in quotation marks (for example 'ABC') always includes the quotation 
  8400. marks as part of the name of the program to be freed.) *LIBL and *CURLIB are 
  8401. not supported (for example, '*LIBL/PROG'). 
  8402.  
  8403. You can specify any valid resulting indicator in positions 56 and 57 to be set 
  8404. on if FREE is not completed successfully. No error occurs if the program to be 
  8405. freed is not active (for example, the program does not exist). 
  8406.  
  8407. See the CALL (Call a Program) operation for details on how program references 
  8408. are grouped. 
  8409.  
  8410. Note:   Issuing a FREE operation and then a CALL operation to the same program 
  8411. reopens the program's files and may use additional temporary storage. 
  8412. Repeatedly issuing FREE and CALL operations to a program, without closing the 
  8413. program's files in between, may use enough temporary storage to degrade the 
  8414. system's performance, and ultimately cause an AS/400 machine check. This 
  8415. problem can be avoided if the files have shared open data paths SHARE(*YES). 
  8416. However, using SHARE(*YES) can cause other problems. Read the section on 
  8417. "Sharing an Open Data Path" in the RPG/400* User's Guide for complete details. 
  8418.  
  8419. Figure "CALL/FREE Operations" shows the FREE operation being used with the CALL 
  8420. operation. 
  8421.  
  8422.  
  8423. ΓòÉΓòÉΓòÉ 1.10.20.36.1. FREE Example ΓòÉΓòÉΓòÉ
  8424.  
  8425. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  8426. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  8427. C*
  8428. C*  When the CALL operation is processed, the data in the result
  8429. C*  fields of the parameter list can be accessed by PROGA.  The
  8430. C*  parameter list ends when the first calculation operation other
  8431. C*  than a PARM operation is encountered.
  8432. C                     CALL 'PROGA'
  8433. C                     PARM          FLDA    30
  8434. C                     PARM          FLDB    30
  8435. C                     PARM          FLDC    50
  8436. C*
  8437. C*  When the FREE operation is processed, PROGA is removed from the
  8438. C*  list of activated programs.  Removing it from the list ensures
  8439. C*  a fresh copy of all fields in PROGA the next time the program is
  8440. C*  called.  Indicator 55 is set on if the FREE operation is not
  8441. C*  completed successfully.
  8442. C*
  8443. C                     FREE 'PROGA'                55  55 = NO SUCCESS
  8444.  
  8445. CALL/FREE Operations 
  8446.  
  8447.  
  8448. ΓòÉΓòÉΓòÉ 1.10.20.37. GOTO (Go To) ΓòÉΓòÉΓòÉ
  8449.  
  8450. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8451. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  8452. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  8453. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8454. Γöé GOTO    Γöé               Γöé Label           Γöé          Γöé         Γöé
  8455. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8456.  
  8457. The GOTO operation allows calculation operations to be skipped by instructing 
  8458. the program to go to (or branch to) another calculation operation in the 
  8459. program. A TAG (Tag) operation names the destination of a GOTO operation. Use a 
  8460. GOTO operation to specify a branch: 
  8461.  
  8462.  To a previous or a succeeding specification line 
  8463.  From a detail calculation line to another detail calculation line 
  8464.  From a total calculation line to another total calculation line 
  8465.  From a detail calculation line to a total calculation line 
  8466.  From a subroutine to a detail calculation line or to a total calculation 
  8467.   line. 
  8468.  
  8469. A GOTO operation outside a subroutine cannot specify a branch to a TAG or ENDSR 
  8470. operation within that subroutine. 
  8471.  
  8472. A branch cannot be made from a total calculation line to a detail calculation 
  8473. line.  (A total calculation line is defined as one that is conditioned by a 
  8474. control level indicator in positions 7 and 8 of the calculation 
  8475. specifications.) 
  8476.  
  8477. Branching from one part of the RPG/400 logic cycle to another may result in an 
  8478. endless loop.  You are responsible for ensuring that the logic of your program 
  8479. does not produce undesirable results. 
  8480.  
  8481. Factor 2 must contain the label to which the program is to branch. This label 
  8482. is entered in factor 1 of a TAG or ENDSR operation.  The label must be a unique 
  8483. symbolic name. 
  8484.  
  8485. See Figure "GOTO and TAG Operations" for examples of the GOTO operation. 
  8486.  
  8487.  
  8488. ΓòÉΓòÉΓòÉ 1.10.20.37.1. GOTO Examples ΓòÉΓòÉΓòÉ
  8489.  
  8490. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  8491. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  8492. C*
  8493. C*  If indicator 10, 15, or 20 is on, the program branches to
  8494. C*  the TAG label specified in the GOTO operations.
  8495. C*  A branch within detail calculations.
  8496. C   10                GOTO RTN1
  8497. C*
  8498. C*  A branch from detail to total calculations.
  8499. C   15                GOTO RTN2
  8500. C*
  8501. C           RTN1      TAG
  8502. C*
  8503. C                      :         Calculations
  8504. C                      :
  8505. C
  8506. C   20                GOTO END
  8507. C*
  8508. C                      :
  8509. C                      :         Calculations
  8510. C                      :
  8511. C           END       TAG
  8512. C*  A branch within total calculations.
  8513. CL1                   GOTO RTN2
  8514. CL1
  8515. CL1         RTN2      TAG
  8516.  
  8517. GOTO and TAG Operations 
  8518.  
  8519.  
  8520. ΓòÉΓòÉΓòÉ 1.10.20.38. IFxx (If) ΓòÉΓòÉΓòÉ
  8521.  
  8522. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8523. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  8524. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  8525. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8526. Γöé IFXX    Γöé Comparand     Γöé Comparand       Γöé          Γöé         Γöé
  8527. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8528.  
  8529. The IFxx operation allows a group of calculations to be processed if a certain 
  8530. relationship, specified by xx, exists between factor 1 and factor 2. When ANDxx 
  8531. (And) and ORxx (Or) operations are used with IFxx, the group of calculations is 
  8532. performed if the condition specified by the combined operations exists.  (For 
  8533. the meaning of xx, see Structured Programming Operations.) 
  8534.  
  8535. You can use conditioning indicators. Factor 1 and factor 2 must contain a 
  8536. literal, a named constant, a figurative constant, a table name, an array 
  8537. element, a data structure name, or a field name. Both the factor 1 and factor 2 
  8538. entries must be character, or both must be numeric. 
  8539.  
  8540. If the relationship specified by the IFxx and any associated ANDxx or ORxx 
  8541. operations does not exist, control passes to the calculation operation 
  8542. immediately following the associated ENDIF operation.  If an ELSE (Else) 
  8543. operation is specified as well, control passes to the first calculation 
  8544. operation that can be processed following the ELSE operation. 
  8545.  
  8546. Conditioning indicator entries on the ENDIF operation associated with IFxx must 
  8547. be blank. 
  8548.  
  8549. An ENDIF statement must be used to close an IFxx group.  If an IFxx statement 
  8550. is followed by an ELSE statement, an ENDIF statement is required after the ELSE 
  8551. statement but not after the IFxx statement. 
  8552.  
  8553. You have the option of indenting DO statements, IF-ELSE clauses, and 
  8554. SELEC-WHxx-OTHER clauses for readability. 
  8555.  
  8556. Figure "IFxx/ENDIF and IFxx/ELSE/ENDIF Operations" illustrates uses of the IFxx 
  8557. operation. 
  8558.  
  8559.  
  8560. ΓòÉΓòÉΓòÉ 1.10.20.38.1. IFxx/ELSE/ENDIF Examples ΓòÉΓòÉΓòÉ
  8561.  
  8562.  
  8563. IFxx/ENDIF and IFxx/ELSE/ENDIF Operations
  8564.  
  8565. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  8566. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  8567. C*
  8568. C*  If FLDA equals FLDB, the calculation after the IFEQ operation
  8569. C*  is processed.  If FLDA does not equal FLDB, the program
  8570. C*  branches to the operation immediately following the ENDIF.
  8571. C           FLDA      IFEQ FLDB                       IF EQUAL
  8572. C                       :
  8573. C                       :
  8574. C                       :
  8575. C                     ENDIF
  8576. C*
  8577. C*  If FLDA equals FLDB, the calculation after the IFEQ operation
  8578. C*  is processed and control passes to the operation immediately
  8579. C*  following the ENDIF statement.  If FLDA does not equal FLDB,
  8580. C*  control passes to the ELSE statement and the calculation
  8581. C*  immediately following is processed.
  8582. C*
  8583. C           FLDA      IFEQ FLDB                       IF EQUAL
  8584. C                       :
  8585. C                       :
  8586. C                       :
  8587. C                     ELSE                            IF NOT EQUAL
  8588. C                       :
  8589. C                       :
  8590. C                       :
  8591. C                     ENDIF
  8592.  
  8593. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  8594. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  8595. C*
  8596. C*  If FLDA is equal to FLDB and greater than FLDC, or, if FLDD
  8597. C*  is equal to FLDE and greater than FLDF, the calculation
  8598. C*  after the ANDGT operation is processed.  If neither of the
  8599. C*  specified conditions exists, the program branches to the
  8600. C*  operation immediately following the ENDIF statement.
  8601. C           FLDA      IFEQ FLDB
  8602. C           FLDA      ANDGTFLDC
  8603. C           FLDD      OREQ FLDE
  8604. C           FLDD      ANDGTFLDF
  8605. C                       :
  8606. C                       :
  8607. C                       :
  8608. C                     ENDIF
  8609.  
  8610.  
  8611. ΓòÉΓòÉΓòÉ 1.10.20.39. IN (Retrieve a Data Area) ΓòÉΓòÉΓòÉ
  8612.  
  8613. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8614. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  8615. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  8616. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8617. Γöé IN      Γöé *LOCK         Γöé Data area name  Γöé          Γöé  _ ER _ Γöé
  8618. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8619.  
  8620. The IN operation retrieves a data area and optionally allows you to specify 
  8621. whether the data area is to be locked from update by another program. For a 
  8622. data area to be retrieved by the IN operation, it must be specified in the 
  8623. result field of an *NAMVAR DEFN statement. 
  8624.  
  8625. Factor 1 can contain the reserved word *LOCK or can be blank. *LOCK indicates 
  8626. that the data area cannot be updated or locked by another program until (1) an 
  8627. UNLCK (Unlock a Data Area or Release a Record) operation is processed, (2) an 
  8628. OUT (Write a Data Area) operation with no factor 1 entry is processed, or (3) 
  8629. the RPG/400 program implicitly unlocks the data area when the program ends. 
  8630.  
  8631. Factor 1 must be blank when factor 2 contains the name of the local data area 
  8632. or the Program Initialization Parameters (PIP) data area. 
  8633.  
  8634. You can specify a *LOCK IN statement for a data area that the program has 
  8635. locked. When factor 1 is blank, the lock status is the same as it was before 
  8636. the data area was retrieved: If it was locked, it remains locked; if unlocked, 
  8637. it remains unlocked. 
  8638.  
  8639. Factor 2 must be either the name of the data area to be retrieved or the 
  8640. reserved word *NAMVAR.  When *NAMVAR is specified, all data areas defined in 
  8641. the program are retrieved. If an error occurs on the retrieval of a data area 
  8642. (for example, a data area can be retrieved but cannot be locked), an error 
  8643. occurs on the IN operation and the RPG/400 exception/error handling routine 
  8644. receives control. If a program exception/error subroutine (*PSSR) is specified, 
  8645. the program status data structure contains information on the data area in 
  8646. error. If a message is issued to the requester, the message identifies the data 
  8647. area in error. 
  8648.  
  8649. You can specify a resulting indicator in positions 56 and 57 to be set on if an 
  8650. error occurs during the operation. Positions 54-55 and 58-59 must be blank. 
  8651.  
  8652. For further rules for the IN operation, see Data-Area Operations. See Figure 
  8653. "IN and OUT Operations" for an example of the IN operation. 
  8654.  
  8655.  
  8656. ΓòÉΓòÉΓòÉ 1.10.20.39.1. In and Out Example ΓòÉΓòÉΓòÉ
  8657.  
  8658. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  8659. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  8660. C*
  8661. C*  TOTAMT, TOTGRS, and TOTNET are defined as data areas.  The IN
  8662. C*  operation retrieves all the data areas defined in the program
  8663. C*  and locks them.  The program processes calculations, and at
  8664. C*  LR time it writes and unlocks all the data areas.
  8665. C*  The data areas can then be used by other programs.
  8666. C*
  8667. C           *LOCK     IN   *NAMVAR
  8668. C*
  8669. C                     ADD  AMOUNT    TOTAMT
  8670. C                     ADD  GROSS     TOTGRS
  8671. C                     ADD  NET       TOTNET
  8672. C*
  8673. CLR                   OUT  *NAMVAR
  8674. C*
  8675. C           *NAMVAR   DEFN           TOTAMT  82
  8676. C           *NAMVAR   DEFN           TOTGRS 102
  8677. C           *NAMVAR   DEFN           TOTNET 102
  8678.  
  8679. IN and OUT Operations 
  8680.  
  8681.  
  8682. ΓòÉΓòÉΓòÉ 1.10.20.40. ITER (Iterate) ΓòÉΓòÉΓòÉ
  8683.  
  8684. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8685. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  8686. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  8687. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8688. Γöé ITER    Γöé               Γöé                 Γöé          Γöé         Γöé
  8689. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8690.  
  8691. The ITER operation transfers control from within a do group to the ENDDO 
  8692. statement of the do group. It can be used in DO, DOUxx, and DOWxx loops to 
  8693. transfer control immediately to a loop ENDDO statement. It causes the next 
  8694. iteration of the loop to be executed immediately. ITER affects the innermost 
  8695. loop. 
  8696.  
  8697. If conditioning indicators are present on the ENDDO statement to which control 
  8698. is passed, and the condition is not satisfied, processing continues with the 
  8699. statement following the ENDDO operation. 
  8700.  
  8701. The LEAVE (Leave a Do Group) operation is similar to the ITER operation; 
  8702. however, LEAVE transfers control to the statement following the ENDDO 
  8703. operation. 
  8704.  
  8705.  
  8706. ITER Operation
  8707.  
  8708. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  8709. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  8710. C*
  8711. C* The following example uses a DOU loop containing a DOW loop.
  8712. C* The IF statement checks indicator 01.  If indicator 01 is ON,
  8713. C* the LEAVE operation is executed, transferring control out of
  8714. C* the innermost DOW loop to the Z-ADD instruction.  If indicator
  8715. C* 01 is not ON, subroutine PROC1 is processed.  Then indicator
  8716. C* 12 is checked.  If it is OFF, ITER transfers control to the
  8717. C* innermost ENDDO and the condition on the DOW is evaluated
  8718. C* again.  If indicator 12 is ON, subroutine PROC2 is processed.
  8719. C                      :
  8720. C           FLDA      DOUEQFLDB                        Outer loop
  8721. C                      :
  8722. C           NUM       DOWLT10                          Inner loop
  8723. C           *IN01     IFEQ *ON
  8724. C                     LEAVE
  8725. C                     ENDIF
  8726. C                     EXSR PROC1
  8727. C           *IN12     IFEQ *OFF
  8728. C                     ITER                             ITER
  8729. C                     ENDIF
  8730. C                     EXSR PROC2
  8731. C                     ENDDO                            Inner ENDDO
  8732. C                     Z-ADD20         RSLT    20       Z-ADD
  8733. C                      :
  8734. C                     ENDDO                            Outer ENDDO
  8735. C                      :
  8736. C*
  8737.  
  8738. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  8739. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  8740. C*
  8741. C* The following example uses a DOU loop containing a DOW loop.
  8742. C* The IF statement checks indicator 1. If indicator 1 is ON, the
  8743. C* MOVE operation is executed, followed by the LEAVE operation,
  8744. C* transferring control from the innermost DOW loop to the Z-ADD
  8745. C* instruction.  If indicator 1 is not ON, ITER transfers control
  8746. C* control to the innermost ENDDO and the condition on the DOW is
  8747. C* evaluated again.
  8748. C                      :
  8749. C           FLDA      DOUEQFLDB
  8750. C                      :
  8751. C           NUM       DOWLT10
  8752. C           *IN01     IFEQ *ON
  8753. C                     MOVE 'UPDATE'  FIELD  20
  8754. C                     LEAVE
  8755. C                     ELSE
  8756. C                     ITER
  8757. C                     ENDIF
  8758. C                     ENDDO                           Inner ENDDO
  8759. C                     Z-ADD20        RSLT    20
  8760. C                      :
  8761. C                     ENDDO
  8762. C                      :
  8763.  
  8764.  
  8765. ΓòÉΓòÉΓòÉ 1.10.20.41. KFLD (Define Parts of a Key) ΓòÉΓòÉΓòÉ
  8766.  
  8767. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8768. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  8769. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  8770. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8771. Γöé KFLD    Γöé               Γöé                 Γöé Key      Γöé         Γöé
  8772. Γöé         Γöé               Γöé                 Γöé field    Γöé         Γöé
  8773. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8774.  
  8775. The KFLD operation is a declarative operation that indicates that a field is 
  8776. part of a search argument identified by a KLIST name. 
  8777.  
  8778. The KFLD operation can be specified anywhere within calculations, including 
  8779. total calculations.  The control level entry (positions 7 and 8) can be blank 
  8780. or can contain an L1 through L9 indicator, an LR indicator, or an L0 entry to 
  8781. group the statement within the appropriate section of the program. 
  8782. Conditioning indicator entries (positions 9 through 17) are not permitted. 
  8783.  
  8784. The result field must contain the name of a field that is to be part of the 
  8785. search argument.  The result field cannot contain an array name or a table 
  8786. name.  Each KFLD field must agree in length, data type (character or numeric), 
  8787. and decimal position with the corresponding field in the composite key of the 
  8788. record or file. However, each KFLD field need not have the same name as the 
  8789. corresponding field in the composite key. The order the KFLD fields are 
  8790. specified in the KLIST determines which KFLD is associated with a particular 
  8791. field in the composite key.  For example, the first KFLD field following a 
  8792. KLIST operation is associated with the leftmost (high-order) field of the 
  8793. composite key. 
  8794.  
  8795. Figure "KLIST and KFLD Operations" shows an example of the KLIST operation with 
  8796. KFLD operations. 
  8797.  
  8798.  
  8799. ΓòÉΓòÉΓòÉ 1.10.20.42. KLIST (Define a Composite Key) ΓòÉΓòÉΓòÉ
  8800.  
  8801. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8802. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  8803. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  8804. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8805. Γöé KLIST   Γöé KLIST name    Γöé                 Γöé          Γöé         Γöé
  8806. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8807.  
  8808. The KLIST operation is a declarative operation that gives a name to a list of 
  8809. KFLDs. This list can be used as a search argument to retrieve records from 
  8810. files that have a composite key. 
  8811.  
  8812. You can specify a KLIST anywhere within calculations. The control level entry 
  8813. (positions 7 and 8) can be blank or can contain an L1 through L9 indicator, an 
  8814. LR indicator, or an L0 entry to group the statement within the appropriate 
  8815. section of the program. Conditioning indicator entries (positions 9 through 17) 
  8816. are not permitted.  Factor 1 must contain a unique name. 
  8817.  
  8818. Remember the following when specifying a KLIST operation: 
  8819.  
  8820.  If a search argument is composed of more than one field (a composite key), 
  8821.   you must specify a KLIST with multiple KFLDs. 
  8822.  A KLIST name can be specified as a search argument only for externally 
  8823.   described files. 
  8824.  A KLIST and its associated KFLD fields can appear anywhere in calculations. 
  8825.  A KLIST must be followed immediately by at least one KFLD. 
  8826.  A KLIST is ended when a non-KFLD operation is encountered. 
  8827.  A KLIST name can appear in factor 1 of a CHAIN, DELET, READE, REDPE, SETGT, 
  8828.   or SETLL operation. 
  8829.  The same KLIST name can be used as the search argument for multiple files, or 
  8830.   it can be used multiple times as the search argument for the same file. 
  8831.  
  8832. Figure "KLIST and KFLD Operations" shows an example of the KLIST operation. 
  8833.  
  8834.  
  8835. ΓòÉΓòÉΓòÉ 1.10.20.42.1. KLIST and KFLD Examples ΓòÉΓòÉΓòÉ
  8836.  
  8837. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  8838. A*  DDS source
  8839. A          R RECORD
  8840. A            FLDA           4
  8841. A            SHIFT          1  0
  8842. A            FLDB          10
  8843. A            CLOCK#         5  0
  8844. A            FLDC          10
  8845. A            DEPT           4
  8846. A            FLDD           8
  8847. A          K DEPT
  8848. A          K SHIFT
  8849. A          K CLOCK#
  8850. A*
  8851. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  8852. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  8853. C*
  8854. C*  The KLIST operation indicates the name, FILEKY, by which the
  8855. C*  search argument can be specified.
  8856. C           FILEKY    KLIST
  8857. C                     KFLD           DEPT
  8858. C                     KFLD           SHIFT
  8859. C                     KFLD           CLOCK#
  8860.  
  8861. KLIST and KFLD Operations 
  8862.  
  8863.  
  8864. ΓòÉΓòÉΓòÉ 1.10.20.43. LEAVE (Leave a Do Group) ΓòÉΓòÉΓòÉ
  8865.  
  8866. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8867. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  8868. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  8869. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8870. Γöé LEAVE   Γöé               Γöé                 Γöé          Γöé         Γöé
  8871. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8872.  
  8873. The LEAVE operation transfers control from within a do group to the statement 
  8874. following the ENDDO operation. 
  8875.  
  8876. You can use LEAVE within a DO, DOUxx, or DOWxx loop to transfer control 
  8877. immediately from the innermost loop to the statement following the innermost 
  8878. loop's ENDDO operation. Using LEAVE to leave a do group does not increment the 
  8879. index. 
  8880.  
  8881. In nested loops, LEAVE causes control to transfer "outwards" by one level only. 
  8882. LEAVE is not allowed outside a do group. 
  8883.  
  8884. The ITER (Iterate) operation is similar to the LEAVE operation; however, ITER 
  8885. transfers control to the ENDDO statement. 
  8886.  
  8887. Figure "LEAVE Operation" shows an example of the LEAVE operation. 
  8888.  
  8889.  
  8890. ΓòÉΓòÉΓòÉ 1.10.20.43.1. LEAVE Example ΓòÉΓòÉΓòÉ
  8891.  
  8892. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  8893. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  8894. C*
  8895. C* The following example uses an infinite loop.  When the user
  8896. C* types 'q', control transfers to the LEAVE operation, which in
  8897. C* turn transfers control out of the loop to the Z-ADD operation.
  8898. C*
  8899. C           2         DOWNE1
  8900. C                      :
  8901. C           ANSWER    IFEQ 'q'
  8902. C                     LEAVE
  8903. C                     ENDIF
  8904. C                      :
  8905. C                     ENDDO
  8906. C                     Z-ADDA         B
  8907. C*
  8908. C*
  8909. C* The following example uses a DOUxx loop containing a DOWxx.
  8910. C* The IF statement checks indicator 1. If it is ON, indicator
  8911. C* 99 is turned ON, control passes to the LEAVE operation and
  8912. C* out of the inner DOWxx loop.
  8913. C*
  8914. C* A second LEAVE instruction is then executed because indicator 99
  8915. C* is ON, which in turn transfers control out of the DOUxx loop.
  8916. C                      :
  8917. C           FLDA      DOUEQFLDB
  8918. C           NUM       DOWLT10
  8919. C           *IN01     IFEQ *ON
  8920. C                     SETON                     99
  8921. C                     LEAVE
  8922. C                       :
  8923. C                     ENDIF
  8924. C                     ENDDO
  8925. C  99                 LEAVE
  8926. C                       :
  8927. C                     ENDDO
  8928. C                       :
  8929.  
  8930. LEAVE Operation 
  8931.  
  8932.  
  8933. ΓòÉΓòÉΓòÉ 1.10.20.44. LOKUP (Look Up) ΓòÉΓòÉΓòÉ
  8934.  
  8935. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8936. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  8937. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  8938. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8939. Γöé LOKUP   Γöé               Γöé                 Γöé          Γöé         Γöé
  8940. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8941. Γöé (array) Γöé  Search argu- Γöé    Array name   Γöé          Γöé  HI LO  Γöé
  8942. Γöé         Γöé      ment     Γöé                 Γöé          Γöé    EQ   Γöé
  8943. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8944. Γöé (table) Γöé  Search argu- Γöé    Table name   Γöé   Table  Γöé  HI LO  Γöé
  8945. Γöé         Γöé      ment     Γöé                 Γöé   name   Γöé    EQ   Γöé
  8946. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8947.  
  8948. The LOKUP operation causes a search to be made for a particular element in an 
  8949. array or table.  Factor 1 is the search argument (data for which you want to 
  8950. find a match in the array or table named). It can be: a character or numeric 
  8951. literal, a field name, an array element, a table name, a named constant, or a 
  8952. figurative constant. 
  8953.  
  8954. If a table is named in factor 1, the search argument used is the element of the 
  8955. table last selected in a LOKUP operation, or it is the first element of the 
  8956. table if a previous LOKUP has not been processed.  The array or table to be 
  8957. searched is specified in factor 2. 
  8958.  
  8959. For a table LOKUP, the result field can contain the name of a second table from 
  8960. which an element (corresponding positionally with that of the first table) can 
  8961. be retrieved.  The name of the second table can be used to reference the 
  8962. element retrieved.  The result field must be blank if factor 2 contains an 
  8963. array name. 
  8964.  
  8965. Decimal alignment is not processed for LOKUP operations. 
  8966.  
  8967. Resulting indicators specify the search condition for LOKUP. One must be 
  8968. specified in positions 54 through 59 first to determine the search to be done 
  8969. and then to reflect the result of the search. Any specified indicator is set on 
  8970. only if the search is successful. No more than two indicators can be used. 
  8971. Resulting indicators can be assigned to equal and high or to equal and low. The 
  8972. program searches for an entry that satisfies either condition with equal given 
  8973. precedence; that is, if no equal entry is found, the nearest lower or nearest 
  8974. higher entry is selected. 
  8975.  
  8976. Resulting indicators can be assigned to equal and low, or equal and high. The 
  8977. LOKUP operation searches for an entry that satisfies either condition with 
  8978. equal given priority. 
  8979.  
  8980. High (54-55):  Instructs the program to find the entry that is nearest to, yet 
  8981. higher in sequence than, the search argument.  The first higher entry found 
  8982. sets the indicator assigned to high on. 
  8983. Low (56-57):  Instructs the program to find the entry that is nearest to, yet 
  8984. lower in sequence than, the search argument.  The first such entry found sets 
  8985. the indicator assigned to low on. 
  8986. Equal (58-59):  Instructs the program to find the entry equal to the search 
  8987. argument.  The first equal entry found sets the indicator assigned to equal on. 
  8988.  
  8989. When you use the LOKUP operation, remember: 
  8990.  
  8991.  The search argument and array element or table element must have the same 
  8992.   length and the same format (character or numeric). 
  8993.  When LOKUP is processed on an array and an index is used, the LOKUP begins 
  8994.   with the element specified by the index.  The index value is set to the 
  8995.   position number of the element located.  An error occurs if the index is 
  8996.   equal to zero or is higher than the number of elements in the array when the 
  8997.   search begins. The index is set equal to one if the search is unsuccessful. 
  8998.   If the index is a named constant, the index value will not change. 
  8999.  A search can be made for high, low, high and equal, or low and equal only if 
  9000.   a sequence is specified for the array or table in the extension 
  9001.   specifications.  For further information on the sequence entry, see Position 
  9002.   45 and 57 (Sequence). 
  9003.  No resulting indicator is set on if the search is not successful. 
  9004.  If only an equal indicator (positions 58-59) is used, the LOKUP operation 
  9005.   will search the entire array or table. If your array or table is in ascending 
  9006.   sequence and you want only an equal comparison, you can avoid searching the 
  9007.   entire array or table by specifying a high indicator. 
  9008.  The LOKUP operation can produce unexpected results when the array is not 
  9009.   strictly in ascending or descending sequence. 
  9010.  
  9011. Figure "LOKUP Operation with Arrays" shows examples of the LOKUP operation with 
  9012. arrays. 
  9013.  
  9014.  
  9015. ΓòÉΓòÉΓòÉ 1.10.20.44.1. LOKUP Example ΓòÉΓòÉΓòÉ
  9016.  
  9017.  
  9018. LOKUP Operation with Arrays
  9019.  
  9020. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  9021. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  9022. C*
  9023. C*  In this example, the programmer wants to know which element in
  9024. C*  ARY the LOKUP operation locates.  The Z-ADD operation sets the
  9025. C*  field X to 1.  The LOKUP starts at the element ARY that is
  9026. C*  indicated by field X and continues running until it finds the
  9027. C*  first element equal to SRCHWD.  The index value, X, is set to
  9028. C*  the position number of the element located.
  9029. C                     Z-ADD1         X       30
  9030. C           SRCHWD    LOKUPARY,X                    26      EQUAL
  9031. C*
  9032. C*  In this example, the programmer wants to know if an element
  9033. C*  is found that is equal to SRCHWD.  LOKUP searches ARY until it
  9034. C*  finds the first element equal to SRCHWD.  When this occurs,
  9035. C*  indicator 26 is set on.
  9036. C           SRCHWD    LOKUPARY                      26      EQUAL
  9037. C*
  9038. C*  The LOKUP starts at a variable index number specified by field
  9039. C*  X.  Field X does not have to set to 1 before the LOKUP
  9040. C*  operation.  When LOKUP locates the first element in ARY equal
  9041. C*  to SRCHWD, indicator 26 is set on.  The index value, X, is
  9042. C*  set to the position number of the element located.
  9043. C*
  9044. C           SRCHWD    LOKUPARY,X                    26      EQUAL
  9045.  
  9046.  
  9047. ΓòÉΓòÉΓòÉ 1.10.20.45. MHHZO (Move High to High Zone) ΓòÉΓòÉΓòÉ
  9048.  
  9049. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9050. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  9051. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  9052. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9053. Γöé MHHZO   Γöé               Γöé Source field    Γöé Target   Γöé         Γöé
  9054. Γöé         Γöé               Γöé                 Γöé field    Γöé         Γöé
  9055. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9056.  
  9057. The MHHZO operation moves the zone portion of a character from the leftmost 
  9058. zone in factor 2 to the leftmost zone in the result field. Factor 2 and the 
  9059. result field must both be defined as character fields.  For further information 
  9060. on the MHHZO operation, see Move Zone Operations. 
  9061.  
  9062. The function of the MHHZO operation is shown in Figure "Function of MOVE Zone 
  9063. Operations". 
  9064.  
  9065.  
  9066. ΓòÉΓòÉΓòÉ 1.10.20.46. MHLZO (Move High to Low Zone) ΓòÉΓòÉΓòÉ
  9067.  
  9068. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9069. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  9070. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  9071. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9072. Γöé MHLZO   Γöé               Γöé Source field    Γöé Target   Γöé         Γöé
  9073. Γöé         Γöé               Γöé                 Γöé field    Γöé         Γöé
  9074. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9075.  
  9076. The MHLZO operation moves the zone portion of a character from the leftmost 
  9077. zone in factor 2 to the rightmost zone in the result field. Factor 2 must be 
  9078. defined as a character field.  The result field can be character or numeric 
  9079. data.  For further information on the MHLZO operation, see Move Zone 
  9080. Operations. 
  9081.  
  9082. The function of the MHLZO operation is shown in Figure "Function of MOVE Zone 
  9083. Operations". 
  9084.  
  9085.  
  9086. ΓòÉΓòÉΓòÉ 1.10.20.47. MLHZO (Move Low to High Zone) ΓòÉΓòÉΓòÉ
  9087.  
  9088. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9089. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  9090. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  9091. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9092. Γöé MLHZO   Γöé               Γöé Source field    Γöé Target   Γöé         Γöé
  9093. Γöé         Γöé               Γöé                 Γöé field    Γöé         Γöé
  9094. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9095.  
  9096. The MLHZO operation moves the zone portion of a character from the rightmost 
  9097. zone in factor 2 to the leftmost zone in the result field. Factor 2 can be 
  9098. defined as a numeric field or as a character field, but the result field must 
  9099. be a character field. For further information on the MLHZO operation, see Move 
  9100. Zone Operations. 
  9101.  
  9102. The function of the MLHZO operation is shown in Figure "Function of MOVE Zone 
  9103. Operations". 
  9104.  
  9105.  
  9106. ΓòÉΓòÉΓòÉ 1.10.20.48. MLLZO (Move Low to Low Zone) ΓòÉΓòÉΓòÉ
  9107.  
  9108. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9109. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  9110. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  9111. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9112. Γöé MLLZO   Γöé               Γöé Source field    Γöé Target   Γöé         Γöé
  9113. Γöé         Γöé               Γöé                 Γöé field    Γöé         Γöé
  9114. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9115.  
  9116. The MLLZO operation moves the zone portion of a character from the rightmost 
  9117. zone in factor 2 to the rightmost zone in the result field. Factor 2 and the 
  9118. result field can be either character data or numeric data. For further 
  9119. information on the MLLZO, see Move Zone Operations. 
  9120.  
  9121. The function of the MLLZO operation is shown in Figure "Function of MOVE Zone 
  9122. Operations". 
  9123.  
  9124.  
  9125. ΓòÉΓòÉΓòÉ 1.10.20.49. MOVE (Move) ΓòÉΓòÉΓòÉ
  9126.  
  9127. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9128. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  9129. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  9130. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9131. Γöé MOVE    Γöé               Γöé Source field    Γöé Target   Γöé  + - ZB Γöé
  9132. Γöé (P)     Γöé               Γöé                 Γöé field    Γöé         Γöé
  9133. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9134.  
  9135. The MOVE operation transfers characters from factor 2 to the result field. 
  9136. Moving starts with the rightmost character of factor 2. 
  9137.  
  9138. If factor 2 is longer than the result field, the excess leftmost characters of 
  9139. factor 2 are not moved. If the result field is longer than factor 2, the excess 
  9140. leftmost characters in the result field are unchanged, unless padding is 
  9141. specified. 
  9142.  
  9143. You cannot specify resulting indicators if the result field is an array; you 
  9144. can specify them if it is an array element, or a nonarray field. 
  9145.  
  9146. If factor 2 is shorter than the length of the result field, a P specified in 
  9147. the operation extender position (position 53) causes the result field to be 
  9148. padded on the left after the move occurs. 
  9149.  
  9150. For further information on the MOVE operation, see Move Operations. It is 
  9151. summarized in Figure "MOVE Operation". 
  9152.  
  9153.  
  9154. ΓòÉΓòÉΓòÉ 1.10.20.49.1. Move Example ΓòÉΓòÉΓòÉ
  9155.  
  9156.  
  9157. MOVE Operation
  9158.  
  9159.                    Factor 2 Shorter Than Result Field
  9160.  
  9161.                Factor 2                         Result Field
  9162.                                                                 +
  9163.                P H 4 S N           Before MOVE  1 2 3 4 5 6 7 8 4
  9164. a. Character  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                      ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9165.       to       P H 4 S N           After MOVE   1 2 3 4 P H 4 S N
  9166.    Character  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                      ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9167.                                                                 +
  9168.                P H 4 S N           Before MOVE  1 2 3 4 5 6 7 8 4
  9169. b. Character  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                      ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9170.       to                                                        ΓöÇ
  9171.    Numeric     P H 4 S N           After MOVE   1 2 3 4 7 8 4 2 5
  9172.               ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                      ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9173.  
  9174.                1 2 7 8 4 2 5       Before MOVE  1 2 3 4 5 6 7 8 9
  9175. c. Numeric    ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9176.       to       1 2 7 8 4 2 5       After MOVE   1 2 1 2 7 8 4 2 5
  9177.    Numeric    ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9178.  
  9179.                1 2 7 8 4 2 5       Before Move  A C F G P H 4 S N
  9180. d. Numeric    ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9181.       to       1 2 7 8 4 2 5       After MOVE   A C 1 2 7 8 4 2 5
  9182.    Character  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9183.  
  9184.                    Factor 2 Longer Than Result Field
  9185.  
  9186.                Factor 2                         Result Field
  9187.  
  9188.                A C E G P H 4 S N   Before MOVE  5 6 7 8 4
  9189. a. Character  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ              ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9190.       to       A C E G P H 4 S N   After MOVE   P H 4 S N
  9191.    Character  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ              ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9192.                                                         +
  9193.                A C E G P H 4 S N   Before MOVE  5 6 7 8 4
  9194. b. Character  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ              ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9195.       to                                                ΓöÇ
  9196.    Numeric     A C E G P H 4 S N   After MOVE   7 8 4 2 5
  9197.               ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ              ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9198.  
  9199.                1 2 7 8 4 2 5       Before MOVE  5 6 7 4 8
  9200. c. Numeric    ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9201.       to       1 2 7 8 4 2 5       After MOVE   7 8 4 2 5
  9202.    Numeric    ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9203.  
  9204.                1 2 7 8 4 2 5       Before MOVE  P H 4 S N
  9205. d. Numeric    ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9206.       to       1 2 7 8 4 2 5       After MOVE   7 8 4 2 5
  9207.    Character  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9208.  
  9209.                    Factor 2 Shorter Than Result Field
  9210.                    With P in Operation Extender Field
  9211.  
  9212.                Factor 2                         Result Field
  9213.                                                                 +
  9214.                P H 4 S N           Before MOVE  1 2 3 4 5 6 7 8 4
  9215. a. Character  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                      ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9216.       to       P H 4 S N           After MOVE           P H 4 S N
  9217.    Character  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                      ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9218.                                                                 +
  9219.                P H 4 S N           Before MOVE  1 2 3 4 5 6 7 8 4
  9220. b. Character  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                      ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9221.       to                                                        ΓöÇ
  9222.    Numeric     P H 4 S N           After MOVE   0 0 0 0 7 8 4 2 5
  9223.               ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                      ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9224.  
  9225.                1 2 7 8 4 2 5       Before MOVE  1 2 3 4 5 6 7 8 9
  9226. c. Numeric    ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9227.       to       1 2 7 8 4 2 5       After MOVE   0 0 1 2 7 8 4 2 5
  9228.    Numeric    ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9229.  
  9230.                1 2 7 8 4 2 5       Before Move  A C F G P H 4 S N
  9231. d. Numeric    ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9232.       to       1 2 7 8 4 2 5       After MOVE       1 2 7 8 4 2 5
  9233.    Character  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9234.  
  9235.                    Factor 2 and Result Field Same Length
  9236.  
  9237.                Factor 2                         Result Field
  9238.  
  9239.                P H 4 S N           Before MOVE  5 6 7 8 4
  9240. a. Character  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                      ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9241.       to       P H 4 S N           After MOVE   P H 4 S N
  9242.    Character  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                      ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9243.  
  9244.                P H 4 S N           Before MOVE  5 6 7 8 4
  9245. b. Character  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                      ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9246.       to                                                ΓöÇ
  9247.    Numeric     P H 4 S N           After MOVE   7 8 4 2 5
  9248.               ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                      ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9249.                        ΓöÇ
  9250.                7 8 4 2 5           Before MOVE  A L T 5 F
  9251. c. Numeric    ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                      ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9252.       to               ΓöÇ                                ΓöÇ
  9253.    Numeric     7 8 4 2 5           After MOVE   7 8 4 2 5
  9254.               ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                      ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9255.  
  9256.                        ΓöÇ
  9257.                7 8 4 2 5           Before MOVE  A L T 5 F
  9258. d. Numeric    ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                      ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9259.       to               ΓöÇ
  9260.    Character   7 8 4 2 5           After MOVE   7 8 4 2 N
  9261.               ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                      ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9262.       +                   ΓöÇ
  9263. Note: 4 = letter D ,  and 5 = letter N.
  9264.  
  9265.  
  9266. ΓòÉΓòÉΓòÉ 1.10.20.50. MOVEA (Move Array) ΓòÉΓòÉΓòÉ
  9267.  
  9268. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9269. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  9270. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  9271. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9272. Γöé MOVEA   Γöé               Γöé Source          Γöé Target   Γöé  + - ZB Γöé
  9273. Γöé (P)     Γöé               Γöé                 Γöé          Γöé         Γöé
  9274. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9275.  
  9276. The MOVEA operation transfers character or numeric values from factor 2 to the 
  9277. result field. (Certain restrictions apply when moving numeric values.) Factor 2 
  9278. or the result field must contain an array. Factor 2 and the result field cannot 
  9279. specify the same array even if the array is indexed. 
  9280.  
  9281. You can use MOVEA with a packed, binary, zoned, or character array. You can: 
  9282.  
  9283.  Move several contiguous character array elements to a single character field 
  9284.  Move a single character field to several contiguous character array elements 
  9285.  Move contiguous array elements to contiguous elements of another array. 
  9286.  
  9287. Movement of data starts with the first element of an array if the array is not 
  9288. indexed or with the element specified if the array is indexed. The movement of 
  9289. data ends when the last array element is moved or filled. When the result field 
  9290. contains the indicator array, all indicators affected by the MOVEA operation 
  9291. are noted in the cross-reference listing. 
  9292.  
  9293. The coding for and results of MOVEA operations are shown in Figure "MOVEA 
  9294. Operation". See Character MOVEA Operations and Numeric MOVEA Operations for 
  9295. more information. 
  9296.  
  9297.  
  9298. ΓòÉΓòÉΓòÉ 1.10.20.50.1. Character MOVEA Operations ΓòÉΓòÉΓòÉ
  9299.  
  9300. Both factor 2 and the result field must be defined as character. 
  9301.  
  9302. On a character MOVEA operation, movement of data ends when the number of 
  9303. characters moved equals the shorter length of the fields specified by factor 2 
  9304. and the result field; therefore, the character MOVEA operation could end in the 
  9305. middle of an array element. 
  9306.  
  9307.  
  9308. ΓòÉΓòÉΓòÉ 1.10.20.50.2. Numeric MOVEA Operations ΓòÉΓòÉΓòÉ
  9309.  
  9310. Moves are only valid between fields and array elements with the same numeric 
  9311. length defined. Factor 2 and the result field entries can specify numeric 
  9312. fields, numeric array elements, or numeric arrays; at least one must be an 
  9313. array or array element. The numeric types can be binary, packed decimal, or 
  9314. zoned decimal but need not be the same between factor 2 and the result field. 
  9315.  
  9316. Factor 2 can contain a numeric literal if the result field entry specifies a 
  9317. numeric array or numeric array-element: 
  9318.  
  9319.  The numeric literal cannot contain a decimal point. 
  9320.  The length of the numeric literal cannot be greater than the element length 
  9321.   of the array or array element specified in the result field. 
  9322.  
  9323. Decimal positions are ignored during the move and need not correspond. Numeric 
  9324. values are not converted to account for the differences in the defined number 
  9325. of decimal places. 
  9326.  
  9327. The figurative constants *BLANK, *ALL, *ON and *OFF are not valid in factor 2 
  9328. of a MOVEA operation on a numeric array. 
  9329.  
  9330.  
  9331. ΓòÉΓòÉΓòÉ 1.10.20.50.3. General MOVEA Operations ΓòÉΓòÉΓòÉ
  9332.  
  9333. If you need to use a MOVEA operation in your application, but  restrictions on 
  9334. numeric MOVEA operations prevent you, you might be able to use character MOVEA 
  9335. operations. If the numeric array is in zoned decimal format: 
  9336.  
  9337.  Define the numeric array as a subfield of a data structure 
  9338.  Redefine the numeric array in the data structure as a character array. 
  9339.  
  9340. If a figurative constant is specified with MOVEA, the length of the constant 
  9341. generated is equal to the portion of the array specified. For figurative 
  9342. constants in numeric arrays, the element boundaries are ignored except for the 
  9343. sign that is put in each array element. Examples are: 
  9344.  
  9345.  MOVEA *BLANK ARR,X 
  9346.  
  9347.   Beginning with element X, the remainder of ARR will contain blanks. 
  9348.  
  9349.  MOVEA *ALL'XYZ' ARR,X 
  9350.  
  9351.   ARR has 4-byte character elements. Element boundaries are ignored, as is 
  9352.   always the case with character MOVEA. Beginning with element X, the remainder 
  9353.   of the array will contain 'XYZXYZXYZXYZ. . .'. 
  9354.  
  9355. Note that the results of MOVEA are different from those of the MOVE example 
  9356. above. 
  9357.  
  9358. For both character and numeric MOVEA operations, you can specify a P in 
  9359. position 53 to pad the result from the right. 
  9360.  
  9361. For further information on the MOVEA operation, see Move Operations. 
  9362.  
  9363.  
  9364. MOVEA Operation
  9365.  
  9366. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  9367. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  9368. C                     MOVEAARRX      ARRY
  9369. C*  Array-to-array move.  No indexing; different length array,
  9370. C*  same element length.
  9371.  
  9372.             ARRX                              ARRY
  9373.     Γöé1Γöé2Γöé3Γöé4Γöé5Γöé6Γöé7Γöé8Γöé9Γöé0Γöé  Before ΓöéAΓöéAΓöéBΓöéBΓöéCΓöéCΓöéDΓöéDΓöéEΓöéEΓöéFΓöéFΓöé
  9374.     ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ  MOVEA  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9375.      Γöé Γöé                           Γöé Γöé
  9376.      ΓööΓö¼Γöÿ                           ΓööΓö¼Γöÿ
  9377.       Γöé                             Γöé
  9378.      One Element                   One Element
  9379.       Γöé                             Γöé
  9380.      ΓöîΓö┤ΓöÉ                           ΓöîΓö┤ΓöÉ
  9381.      Γöé Γöé                           Γöé Γöé
  9382.     Γöé1Γöé2Γöé3Γöé4Γöé5Γöé6Γöé7Γöé8Γöé9Γöé0Γöé  After  Γöé1Γöé2Γöé3Γöé4Γöé5Γöé6Γöé7Γöé8Γöé9Γöé0ΓöéFΓöéFΓöé
  9383.     ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ  MOVEA  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9384.     Γöé                   Γöé         Γöé                   Γöé
  9385.     ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ         ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9386.               Γöé                             
  9387.               ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9388.  
  9389. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  9390. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  9391. C                     MOVEAARRX      ARRY,3
  9392. C*  Array-to-array move with index result field.
  9393.  
  9394.             ARRX                              ARRY
  9395.     Γöé1Γöé2Γöé3Γöé4Γöé5Γöé6Γöé7Γöé8Γöé9Γöé0Γöé  Before ΓöéAΓöéAΓöéBΓöéBΓöéCΓöéCΓöéDΓöéDΓöéEΓöéEΓöé
  9396.     ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ  MOVEA  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9397.      Γöé Γöé                           Γöé Γöé
  9398.      ΓööΓö¼Γöÿ                           ΓööΓö¼Γöÿ
  9399.       Γöé                             Γöé
  9400.      One Element                   One Element
  9401.       Γöé                             Γöé
  9402.      ΓöîΓö┤ΓöÉ                           ΓöîΓö┤ΓöÉ
  9403.      Γöé Γöé                           Γöé Γöé
  9404.     Γöé1Γöé2Γöé3Γöé4Γöé5Γöé6Γöé7Γöé8Γöé9Γöé0Γöé  After  ΓöéAΓöéAΓöéBΓöéBΓöé1Γöé2Γöé3Γöé4Γöé5Γöé6Γöé
  9405.     ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ  MOVEA  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9406.     Γöé           Γöé                         Γöé           Γöé
  9407.     ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ                         ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9408.           Γöé                                     
  9409.           ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9410.  
  9411. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  9412. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  9413. C                     MOVEAARRX      ARRY
  9414. C*  Array-to-array move, no indexing and different length array
  9415. C*  elements.
  9416.  
  9417.             ARRX                              ARRY
  9418.     Γöé1Γöé2Γöé3Γöé4Γöé5Γöé6Γöé7Γöé8Γöé9Γöé0Γöé  Before ΓöéAΓöéAΓöéAΓöéBΓöéBΓöéBΓöéCΓöéCΓöéCΓöéDΓöéDΓöéDΓöé
  9419.     ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ  MOVEA  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9420.      Γöé Γöé                           Γöé   Γöé
  9421.      ΓööΓö¼Γöÿ                           ΓööΓöÇΓö¼ΓöÇΓöÿ
  9422.       Γöé                              Γöé
  9423.      One Element                   One Element
  9424.       Γöé                              Γöé
  9425.      ΓöîΓö┤ΓöÉ                           ΓöîΓöÇΓö┤ΓöÇΓöÉ
  9426.      Γöé Γöé                           Γöé   Γöé
  9427.     Γöé1Γöé2Γöé3Γöé4Γöé5Γöé6Γöé7Γöé8Γöé9Γöé0Γöé  After  Γöé1Γöé2Γöé3Γöé4Γöé5Γöé6Γöé7Γöé8Γöé9Γöé0ΓöéDΓöéDΓöé
  9428.     ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ  MOVEA  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9429.     Γöé                   Γöé         Γöé                   Γöé
  9430.     ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ         ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9431.               Γöé                             
  9432.               ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9433.  
  9434. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  9435. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  9436. C                     MOVEAARRX,4    ARRY
  9437. C*  Array-to-array move, index factor 2 with different length array
  9438. C*  elements.
  9439.  
  9440.             ARRX                              ARRY
  9441.     Γöé1Γöé2Γöé3Γöé4Γöé5Γöé6Γöé7Γöé8Γöé9Γöé0Γöé  Before ΓöéAΓöéAΓöéAΓöéBΓöéBΓöéBΓöéCΓöéCΓöéCΓöéDΓöéDΓöéDΓöé
  9442.     ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ  MOVEA  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9443.      Γöé Γöé                           Γöé   Γöé
  9444.      ΓööΓö¼Γöÿ                           ΓööΓöÇΓö¼ΓöÇΓöÿ
  9445.       Γöé                              Γöé
  9446.      One Element                   One Element
  9447.       Γöé                              Γöé
  9448.      ΓöîΓö┤ΓöÉ                           ΓöîΓöÇΓö┤ΓöÇΓöÉ
  9449.      Γöé Γöé                           Γöé   Γöé
  9450.     Γöé1Γöé2Γöé3Γöé4Γöé5Γöé6Γöé7Γöé8Γöé9Γöé0Γöé  After  Γöé7Γöé8Γöé9Γöé0ΓöéBΓöéBΓöéCΓöéCΓöéCΓöéDΓöéDΓöéDΓöé
  9451.     ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ  MOVEA  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9452.                 Γöé       Γöé         Γöé       Γöé
  9453.                 ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ         ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9454.                     Γöé                 
  9455.                     ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9456.  
  9457. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  9458. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  9459. C                     MOVEAFIELDA    ARRY
  9460. C*  Field-to-array move, no indexing on array.
  9461.  
  9462.             FIELDA                            ARRY
  9463.     Γöé1Γöé2Γöé3Γöé4Γöé5Γöé6Γöé7Γöé        Before Γöé9Γöé8Γöé6Γöé5Γöé4Γöé3Γöé2Γöé1Γöé0ΓöéAΓöéBΓöéCΓöé
  9464.     ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ        MOVEA  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9465.                                    Γöé   Γöé
  9466.                                    ΓööΓöÇΓö¼ΓöÇΓöÿ
  9467.                                      Γöé
  9468.                                    One Element
  9469.                                      Γöé
  9470.                                    ΓöîΓöÇΓö┤ΓöÇΓöÉ
  9471.                                    Γöé   Γöé
  9472.     Γöé1Γöé2Γöé3Γöé4Γöé5Γöé6Γöé7Γöé        After  Γöé1Γöé2Γöé3Γöé4Γöé5Γöé6Γöé7Γöé1Γöé0ΓöéAΓöéBΓöéCΓöé
  9473.     ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ        MOVEA  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9474.     Γöé             Γöé               Γöé             Γöé
  9475.     ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ               ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9476.            Γöé                             
  9477.            ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9478.  
  9479. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  9480. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  9481. C*
  9482. C* In the following example, N=3.  Array-to-field move with variable
  9483. C* indexing.
  9484. C                     MOVEAARRX,N    FIELD
  9485. C*
  9486.  
  9487.             ARRX                                FIELD
  9488.     Γöé0Γöé1Γöé0ΓöéAΓöé0Γöé2Γöé0ΓöéBΓöé0Γöé3Γöé0ΓöéCΓöé   Before    Γöé0Γöé1Γöé0ΓöéAΓöé
  9489.     ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ   MOVEA     ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9490.      Γöé Γöé
  9491.      ΓööΓö¼Γöÿ
  9492.       Γöé
  9493.      One Element
  9494.       Γöé
  9495.      ΓöîΓö┤ΓöÉ
  9496.      Γöé Γöé
  9497.     Γöé0Γöé1Γöé0ΓöéAΓöé0Γöé2Γöé0ΓöéBΓöé0Γöé3Γöé0ΓöéCΓöé   After      Γöé0Γöé2Γöé0ΓöéBΓöé
  9498.     ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ   MOVEA      ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9499.             Γöé       Γöé                      Γöé       Γöé
  9500.             ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ                      ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9501.                 Γöé                              
  9502.                 ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9503.  
  9504. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  9505. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  9506. C                     MOVEAARRB      ARRZ
  9507. C*
  9508. C* An array-to-array move showing numeric elements.
  9509.  
  9510.       Γöé1.0 Γöé1.1 Γöé1.2 Γöé1.3Γöé  Before MOVEA  Γöé2.0 Γöé3.0 Γöé4.0 Γöé5.0 Γöé6.0Γöé
  9511.       ΓööΓöÇΓö¼ΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÿ                ΓööΓöÇΓö¼ΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÿ
  9512.         One Element                         One Element
  9513.         Γöé                                   Γöé
  9514.         Γöé                                   Γöé
  9515.       Γöé1.0 Γöé1.1 Γöé1.2 Γöé1.3Γöé  After MOVEA   Γöé1.0 Γöé1.1 Γöé1.2 Γöé1.3 Γöé6.0Γöé
  9516.       ΓööΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÿ                ΓööΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÿ
  9517.  
  9518. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  9519. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  9520. C                     MOVEAARRX      ARRY      P
  9521. C*  Array-to-array move.  No indexing; different length array with
  9522. C*  same element length.
  9523.  
  9524.             ARRX                              ARRY
  9525.     Γöé1Γöé2Γöé3Γöé4Γöé5Γöé6Γöé7Γöé8Γöé9Γöé0Γöé  Before ΓöéAΓöéAΓöéBΓöéBΓöéCΓöéCΓöéDΓöéDΓöéEΓöéEΓöéFΓöéFΓöé
  9526.     ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ  MOVEA  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9527.      Γöé Γöé                           Γöé Γöé
  9528.      ΓööΓö¼Γöÿ                           ΓööΓö¼Γöÿ
  9529.       Γöé                             Γöé
  9530.      One Element                   One Element
  9531.       Γöé                             Γöé
  9532.      ΓöîΓö┤ΓöÉ                           ΓöîΓö┤ΓöÉ
  9533.      Γöé Γöé                           Γöé Γöé
  9534.     Γöé1Γöé2Γöé3Γöé4Γöé5Γöé6Γöé7Γöé8Γöé9Γöé0Γöé  After  Γöé1Γöé2Γöé3Γöé4Γöé5Γöé6Γöé7Γöé8Γöé9Γöé0Γöé Γöé Γöé
  9535.     ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ  MOVEA  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9536.     Γöé                   Γöé         Γöé                   Γöé
  9537.     ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ         ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9538.               Γöé                             
  9539.               ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9540.  
  9541. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  9542. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  9543. C                     MOVEAARRB      ARRZ      P
  9544. C*
  9545. C* An array-to-array move showing numeric elements with padding.
  9546.  
  9547.       Γöé1.0 Γöé1.1 Γöé1.2 Γöé1.3Γöé  Before MOVEA  Γöé2.0 Γöé3.0 Γöé4.0 Γöé5.0 Γöé6.0Γöé
  9548.       ΓööΓöÇΓö¼ΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÿ                ΓööΓöÇΓö¼ΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÿ
  9549.         One Element                         One Element
  9550.         Γöé                                   Γöé
  9551.         Γöé                                   Γöé
  9552.       Γöé1.0 Γöé1.1 Γöé1.2 Γöé1.3Γöé  After MOVEA   Γöé1.0 Γöé1.1 Γöé1.2 Γöé1.3 Γöé0.0Γöé
  9553.       ΓööΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÿ                ΓööΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÿ
  9554.  
  9555. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  9556. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  9557. C                     MOVEAARRX,3    ARRY      P
  9558. C*  Array-to-array move.  No indexing; different length array with
  9559. C*  same element length.
  9560.  
  9561.             ARRX                              ARRY
  9562.     ΓöéPΓöéPΓöéPΓöéQΓöéQΓöéQΓöéRΓöéRΓöéRΓöé       Before ΓöéAΓöéAΓöéBΓöéBΓöéCΓöéCΓöéDΓöéDΓöéEΓöéEΓöéFΓöéFΓöé
  9563.     ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ       MOVEA  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9564.      Γöé   Γöé                            Γöé Γöé
  9565.      ΓööΓöÇΓö¼ΓöÇΓöÿ                            ΓööΓö¼Γöÿ
  9566.        Γöé                               Γöé
  9567.      One Element                   One Element
  9568.        Γöé                               Γöé
  9569.      ΓöîΓöÇΓö┤ΓöÇΓöÉ                            ΓöîΓö┤ΓöÉ
  9570.      Γöé   Γöé                            Γöé Γöé
  9571.     ΓöéPΓöéPΓöéPΓöéQΓöéQΓöéQΓöéRΓöéRΓöéRΓöé       After  ΓöéRΓöéRΓöéRΓöé Γöé Γöé Γöé Γöé Γöé Γöé Γöé Γöé Γöé
  9572.     ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ       MOVEA  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9573.     Γöé                 Γöé              Γöé                   Γöé
  9574.     ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ              ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9575.              Γöé                                
  9576.              ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9577.  
  9578.  
  9579. ΓòÉΓòÉΓòÉ 1.10.20.51. MOVEL (Move Left) ΓòÉΓòÉΓòÉ
  9580.  
  9581. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9582. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  9583. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  9584. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9585. Γöé MOVEL   Γöé               Γöé Source field    Γöé Target   Γöé  + - ZB Γöé
  9586. Γöé (P)     Γöé               Γöé                 Γöé field    Γöé         Γöé
  9587. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9588.  
  9589. The MOVEL operation transfers characters from factor 2 to the result field. 
  9590. Moving begins with the leftmost character in factor 2. You cannot specify 
  9591. resulting indicators if the result field is an array. You can specify them if 
  9592. the result field is an array element, or a nonarray field. 
  9593.  
  9594. When data is moved to a numeric field, the sign (+ or -) of the result field is 
  9595. retained except when factor 2 is as long as or longer than the result field. In 
  9596. this case, the sign of factor 2 is used as the sign of the result field. 
  9597.  
  9598. If factor 2 is longer than the result field, the excess rightmost characters of 
  9599. factor 2 are not moved. If the result field is longer than factor 2, the excess 
  9600. rightmost characters in the result field are unchanged, unless padding is 
  9601. specified. 
  9602.  
  9603. The MOVEL operation is summarized in Figure "MOVEL Operation". 
  9604.  
  9605. A summary of the rules for MOVEL operation for four conditions based on field 
  9606. lengths: 
  9607.  
  9608.  1. Factor 2 is the same length as the result field: 
  9609.  
  9610.     a) If factor 2 and the result field are numeric, the sign is moved with the 
  9611.        rightmost position. 
  9612.     b) If factor 2 is numeric and the result field is character, the sign is 
  9613.        moved with the rightmost position. 
  9614.     c) If factor 2 is character and the result field is numeric, a minus zone 
  9615.        is moved into the rightmost position of the result field if the zone 
  9616.        from the rightmost position of factor 2 is a hexadecimal D (minus zone). 
  9617.        However, if the zone from the rightmost position of factor 2 is not a 
  9618.        hexadecimal D, a positive zone is moved into the rightmost position of 
  9619.        the result field.  Digit portions are converted to their corresponding 
  9620.        numeric characters. If the digit portions are not valid digits, a data 
  9621.        exception error occurs. 
  9622.     d) If factor 2 and the result field are character, all characters are 
  9623.        moved. 
  9624.  
  9625.  2. Factor 2 is longer than the result field: 
  9626.  
  9627.     a) If factor 2 and the result field are numeric, the sign from the 
  9628.        rightmost position of factor 2 is moved into the rightmost position of 
  9629.        the result field. 
  9630.     b) If factor 2 is numeric and the result field is character, the result 
  9631.        field contains only numeric characters. 
  9632.     c) If factor 2 is character and the result field is numeric, a minus zone 
  9633.        is moved into the rightmost position of the result field if the zone 
  9634.        from the rightmost position of factor 2 is a hexadecimal D (minus zone). 
  9635.        However, if the zone from the rightmost position of factor 2 is not a 
  9636.        hexadecimal D, a positive zone is moved into the rightmost position of 
  9637.        the result field. Other result field positions contain only numeric 
  9638.        characters. 
  9639.     d) If factor 2 and the result field are character, only the number of 
  9640.        characters needed to fill the result field are moved. 
  9641.  
  9642.  3. Factor 2 is shorter than the result field: 
  9643.  
  9644.     a) If factor 2 is either numeric or character and the result field is 
  9645.        numeric, the digit portion of factor 2 replaces the contents of the 
  9646.        leftmost positions of the result field.  The sign in the rightmost 
  9647.        position of the result field is not changed. 
  9648.     b) If factor 2 is either numeric or character and the result field is 
  9649.        character data, the characters in factor 2 replace the equivalent number 
  9650.        of leftmost positions in the result field. No change is made in the zone 
  9651.        of the rightmost position of the result field. 
  9652.  
  9653.  4. Factor 2 is shorter than the result field and P is specified in the 
  9654.     operation extender field: 
  9655.  
  9656.     a) The move is performed as described above. 
  9657.     b) The result field is padded from the right. See Move Operations for more 
  9658.        information on the rules for padding. 
  9659.  
  9660. For further information on the MOVEL operation, see Move Operations. 
  9661.  
  9662.  
  9663. ΓòÉΓòÉΓòÉ 1.10.20.51.1. MOVEL Example ΓòÉΓòÉΓòÉ
  9664.  
  9665.  
  9666. MOVEL Operation
  9667.  
  9668.                    Factor 2 and Result Field Same Length
  9669.  
  9670.                Factor 2                         Result Field
  9671.                        ΓöÇ                                 +
  9672.                7 84 2 5           Before MOVEL  5 6 78 4
  9673. a. Numeric    ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                       ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9674.       to               ΓöÇ                                 ΓöÇ
  9675.    Numeric     7 84 2 5           After MOVEL   7 8 42 5
  9676.               ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                       ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9677.  
  9678.  
  9679.                7 84 2 5           Before MOVEL  A K T 4 D
  9680. b. Numeric    ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                       ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9681.       to               ΓöÇ
  9682.    Character   7 84 2 5           After MOVEL   7 8 4 2 N
  9683.               ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                       ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9684.                                                          +
  9685.                P H 4 S N           Before MOVEL  5 6 7 8 4
  9686. c. Character  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                       ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9687.       to                                                 ΓöÇ
  9688.    Numeric     P H 4 S N           After MOVEL   7 8 4 2 5
  9689.               ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                       ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9690.  
  9691.                P H 4 S N           Before MOVEL  A K T 4 D
  9692. d. Character  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                       ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9693.       to
  9694.    Character   P H 4 S N           After MOVEL   P H 4 S N
  9695.               ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                       ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9696.  
  9697.                    Factor 2 Longer Than Result Field
  9698.  
  9699.                Factor 2                         Result Field
  9700.  
  9701.                                ΓöÇ                         +
  9702.                0 0 0 2 5 8 4 2 5   Before MOVEL  56 7 8 4
  9703. a. Numeric    ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ               ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9704.       to                       ΓöÇ
  9705.    Numeric     0 0 0 2 5 8 4 2 5   After MOVEL   00 0 2 5
  9706.               ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ               ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9707.                                ΓöÇ
  9708.                9 0 3 1 7 8 4 2 5   Before MOVEL  A K T 4 D
  9709. b. Numeric    ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ               ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9710.       to                       ΓöÇ
  9711.    Character   9 0 3 1 7 8 4 2 5   After MOVEL   9 0 3 1 7
  9712.               ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ               ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9713.                                                          +
  9714.                B R W C X H 4 S N   Before MOVEL  5 6 7 84
  9715. c. Character  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ               ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9716.       to                                                 ΓöÇ
  9717.    Numeric     B R W C X H 4 S N   After MOVEL   2 9 6 37
  9718.               ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ               ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9719.  
  9720.                B R W C X H 4 S N   Before MOVEL  A K T 4 D
  9721. d. Character  ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ               ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9722.       to
  9723.    Character   B R W C X H 4 S N   After MOVEL   B R W C X
  9724.               ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ               ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9725.  
  9726.                    Factor 2 Shorter Than Result Field
  9727.  
  9728.                Factor 2                         Result Field
  9729.                        ΓöÇ                                         +
  9730.    ΓöîΓöÇ          7 8 4 2 5           Before MOVEL  13 0 9 4 3 2 1 0
  9731.    ΓöéNumeric   ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                       ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9732.    Γöé   to              ΓöÇ                                         +
  9733.    ΓöéNumeric    7 8 4 2 5           After MOVEL   78 4 2 5 3 2 1 0
  9734. a.ΓöéΓöñ          ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                       ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9735.    Γöé                                                             +
  9736.    Γöé           C P T 5 N           Before MOVEL  1 3 0 9 4 3 2 1 0
  9737.    ΓöéCharacter ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                       ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9738.    ΓööΓöÇ  to                                                        +
  9739.     Numeric    C P T 5 N           After MOVEL   3 7 3 5 5 3 2 1 0
  9740.               ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                       ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9741.                        ΓöÇ
  9742.    ΓöîΓöÇ          7 8 4 2 5           Before MOVEL  B R W C X H 4 S A
  9743.    ΓöéNumeric   ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                       ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9744.    Γöé   to              ΓöÇ
  9745.    ΓöéCharacter  7 8 4 2 5           After MOVEL   7 8 4 2 N H 4 S A
  9746. b.ΓöéΓöñ          ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                       ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9747.    Γöé
  9748.    Γöé           C P T 5 N           Before MOVEL  B R W C X H 4 S A
  9749.    ΓöéCharacter ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                       ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9750.    ΓööΓöÇ  to
  9751.     Character  C P T 5 N           After MOVEL   C P T 5 N H 4 S A
  9752.               ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                       ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9753.       +                 ΓöÇ
  9754. Note: 4 = letter D, and 5 = letter N; arrow  is decimal point.
  9755.  
  9756.                    Factor 2 Shorter Than Result Field
  9757.                    With P in Operation Extender Field
  9758.  
  9759.                Factor 2                         Result Field
  9760.                        ΓöÇ                                         +
  9761.    ΓöîΓöÇ          7 8 4 2 5           Before MOVEL  13 0 9 4 3 2 1 0
  9762.    ΓöéNumeric   ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                       ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9763.    Γöé   to              ΓöÇ                                         +
  9764.    ΓöéNumeric    7 8 4 2 5           After MOVEL   78 4 2 5 0 0 0 0
  9765. a.ΓöéΓöñ          ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                       ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9766.    Γöé                                                             +
  9767.    Γöé           C P T 5 N           Before MOVEL  1 3 0 9 4 3 2 1 0
  9768.    ΓöéCharacter ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                       ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9769.    ΓööΓöÇ  to                                                        +
  9770.     Numeric    C P T 5 N           After MOVEL   3 7 3 5 5 0 0 0 0
  9771.               ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                       ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9772.                        ΓöÇ
  9773.    ΓöîΓöÇ          7 8 4 2 5           Before MOVEL  B R W C X H 4 S A
  9774.    ΓöéNumeric   ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                       ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9775.    Γöé   to              ΓöÇ
  9776.    ΓöéCharacter  7 8 4 2 5           After MOVEL   7 8 4 2 N
  9777. b.ΓöéΓöñ          ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                       ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9778.    Γöé
  9779.    Γöé           C P T 5 N           Before MOVEL  B R W C X H 4 S A
  9780.    ΓöéCharacter ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                       ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9781.    ΓööΓöÇ  to
  9782.     Character  C P T 5 N           After MOVEL   C P T 5 N
  9783.               ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ                       ΓööΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÿ
  9784.       +                 ΓöÇ
  9785. Note: 4 = letter D, and 5 = letter N; arrow  is decimal point.
  9786.  
  9787.  
  9788. ΓòÉΓòÉΓòÉ 1.10.20.52. MULT (Multiply) ΓòÉΓòÉΓòÉ
  9789.  
  9790. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9791. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  9792. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  9793. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9794. Γöé MULT    Γöé Multiplicand  Γöé Multiplier      Γöé Product  Γöé  + - Z  Γöé
  9795. Γöé (1/2)   Γöé               Γöé                 Γöé          Γöé         Γöé
  9796. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9797.  
  9798. If factor 1 is specified, factor 1 is multiplied by factor 2 and the product is 
  9799. placed in the result field. Be sure that the result field is large enough to 
  9800. hold it. Use the following rule to determine the maximum result field length: 
  9801. result field length equals the length of factor 1 plus the length of factor 2. 
  9802. If factor 1 is not specified, factor 2 is multiplied by the result field and 
  9803. the product is placed in the result field. Factor 1 and factor 2 must be 
  9804. numeric, and each can contain one of: an array, array element, field, 
  9805. figurative constant, literal, named constant, subfield, or table name.  The 
  9806. result field must be numeric, but cannot be a named constant. You can specify 
  9807. half adjust (position 53). 
  9808.  
  9809. For further information on the MULT operation, see Arithmetic Operations. 
  9810.  
  9811. See Figure "Summary of Arithmetic Operations" for examples of the MULT 
  9812. operation. 
  9813.  
  9814.  
  9815. ΓòÉΓòÉΓòÉ 1.10.20.53. MVR (Move Remainder) ΓòÉΓòÉΓòÉ
  9816.  
  9817. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9818. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  9819. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  9820. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9821. Γöé MVR     Γöé               Γöé                 Γöé RemainderΓöé  + - Z  Γöé
  9822. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9823.  
  9824. The MVR operation moves the remainder from the previous DIV operation to a 
  9825. separate field named in the result field. Factor 1 and factor 2 must be blank. 
  9826. The MVR operation must immediately follow the DIV operation.  If you use 
  9827. conditioning indicators, ensure that the MVR operation is processed immediately 
  9828. after the DIV operation. If the MVR operation is processed before the DIV 
  9829. operation, undesirable results occur. The result field must be numeric and can 
  9830. contain one of: an array, array element, subfield, or table name. 
  9831.  
  9832. Leave sufficient room in the result field if the DIV operation uses factors 
  9833. with decimal positions. The number of significant decimal positions is the 
  9834. greater of: 
  9835.  
  9836.  The number of decimal positions in factor 1 of the previous divide operation 
  9837.  The sum of the decimal positions in factor 2 and the result field of the 
  9838.   previous divide operation. 
  9839.  
  9840. The sign (+ or -) of the remainder is the same as the dividend (factor 1). 
  9841.  
  9842. You cannot specify half adjust (position 53) on a DIV operation that is 
  9843. immediately followed by an MVR operation. 
  9844.  
  9845. The maximum number of whole number positions in the remainder is equal to the 
  9846. whole number of positions in factor 2 of the previous divide operation. 
  9847.  
  9848. The MVR operation cannot be used if the previous divide operation has an array 
  9849. specified in the result field. 
  9850.  
  9851. For further information on the MVR operation, see Arithmetic Operations. 
  9852.  
  9853. See Figure "Summary of Arithmetic Operations" for an example of the MVR 
  9854. operation. 
  9855.  
  9856.  
  9857. ΓòÉΓòÉΓòÉ 1.10.20.54. NEXT (Next) ΓòÉΓòÉΓòÉ
  9858.  
  9859. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9860. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  9861. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  9862. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9863. Γöé NEXT    Γöé Program       Γöé File name       Γöé          Γöé  _ ER _ Γöé
  9864. Γöé         Γöé device        Γöé                 Γöé          Γöé         Γöé
  9865. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9866.  
  9867. The NEXT operation code forces the next input for a multiple device file to 
  9868. come from the program device specified in factor 1, providing the input 
  9869. operation is a cycle read or a READ-by-file-name. Any read operation, including 
  9870. CHAIN, EXFMT, READ, and READC, ends the effect of the previous NEXT operation. 
  9871. If NEXT is specified more than once between input operations, only the last 
  9872. operation is processed.  The NEXT operation code can be used only for a 
  9873. multiple device file. 
  9874.  
  9875. In factor 1, enter the name of a 10-character field that contains the program 
  9876. device name or a character literal or named constant that is the program device 
  9877. name.  In factor 2, enter the name of the multiple device WORKSTN file for 
  9878. which the operation is requested. 
  9879.  
  9880. You can specify an indicator in positions 56 and 57. It is set on if an 
  9881. exception/error occurs on the NEXT operation.  If the INFSR subroutine is 
  9882. specified and positions 56 and 57 do not contain an indicator, the subroutine 
  9883. automatically receives control when an exception/error occurs.  If the INFSR 
  9884. subroutine is not specified and positions 56 and 57 do not contain an 
  9885. indicator, the default error handler takes control. 
  9886.  
  9887.  
  9888. ΓòÉΓòÉΓòÉ 1.10.20.55. OCUR (Set/Get Occurrence of a Data Structure) ΓòÉΓòÉΓòÉ
  9889.  
  9890. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9891. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  9892. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  9893. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9894. Γöé OCUR    Γöé Occurrence    Γöé Data structure  Γöé Occur-   Γöé  _ ER _ Γöé
  9895. Γöé         Γöé value         Γöé                 Γöé rence    Γöé         Γöé
  9896. Γöé         Γöé               Γöé                 Γöé value    Γöé         Γöé
  9897. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9898.  
  9899. The OCUR operation code specifies the occurrence of the data structure that is 
  9900. to be used next within an RPG/400 program. If a data structure with multiple 
  9901. occurrences or a subfield of that data structure is specified in an operation, 
  9902. the first occurrence of the data structure is used until an OCUR operation is 
  9903. specified. After an OCUR operation is specified, the occurrence of the data 
  9904. structure that was established by the OCUR operation is used. 
  9905.  
  9906. Factor 1 is optional; if specified, it can contain a numeric, zero decimal 
  9907. position literal, field name, named constant, or a data structure name. Factor 
  9908. 1 is used during the OCUR operation to set the occurrence of the data structure 
  9909. specified in factor 2.  If factor 1 is blank, the value of the current 
  9910. occurrence of the data structure in factor 2 is placed in the result field 
  9911. during the OCUR operation. 
  9912.  
  9913. If factor 1 is a data structure name, it must be a multiple occurrence data 
  9914. structure.  The current occurrence of the data structure in factor 1 is used to 
  9915. set the occurrence of the data structure in factor 2. 
  9916.  
  9917. Factor 2 is required and must be the name of a multiple occurrence data 
  9918. structure. 
  9919.  
  9920. The result field is optional; if specified, it must be a numeric field name 
  9921. with no decimal positions. During the OCUR operation, the value of the current 
  9922. occurrence of the data structure specified in factor 2, after being set by any 
  9923. value or data structure that is optionally specified in factor 1, is placed in 
  9924. the result field. 
  9925.  
  9926. You can specify a resulting indicator in positions 56 and 57 to be set on if 
  9927. the occurrence specified is outside the valid range set for the data structure. 
  9928. If the occurrence is outside the valid range, the occurrence of the data 
  9929. structure in factor 2 remains the same as before the OCUR operation was 
  9930. processed. 
  9931.  
  9932. The OCUR operation establishes which occurrence of a multiple occurrence data 
  9933. structure is used next in a program.  Only one occurrence can be used at a 
  9934. time. 
  9935.  
  9936. Figure "Uses of the OCUR Operation" illustrates uses of the OCUR operation. 
  9937.  
  9938.  
  9939. ΓòÉΓòÉΓòÉ 1.10.20.55.1. OCUR Examples ΓòÉΓòÉΓòÉ
  9940.  
  9941.  
  9942. Uses of the OCUR Operation
  9943.  
  9944.                   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ        50th        ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9945.                   Γöé FLDA Γöé FLDB ΓöéΓöéΓöÇΓöÇΓöÇΓöÇOccurrenceΓöÇΓöÇΓöÇΓöÇΓöé FLDC Γöé FLDD Γöé
  9946.                   Γöé      Γöé      Γöé                    Γöé      Γöé      Γöé
  9947.                 ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉΓöÇΓöÿ      49th        ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉΓöÇΓöÿ
  9948.                 Γöé FLDA Γöé FLDB ΓöéΓöéΓöÇΓöÇΓöÇΓöÇOccurrenceΓöÇΓöÇΓöÇΓöÇΓöé FLDC Γöé FLDD Γöé
  9949.                 Γöé      Γöé      Γöé                    Γöé      Γöé      Γöé
  9950.               ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉΓöÇΓöÿ                  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉΓöÇΓöÿ
  9951.             ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ                    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9952.           ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ                    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9953.         ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ                    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9954.       ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ                    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9955.     ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ         3rd        ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9956.     Γöé FLDA Γöé FLDB ΓöéΓöéΓöÇΓöÇΓöÇΓöÇOccurrenceΓöÇΓöÇΓöÇΓöÇΓöé FLDC Γöé FLDD Γöé
  9957.     Γöé      Γöé      Γöé                    Γöé      Γöé      Γöé
  9958.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉΓöÇΓöÿ       2nd        ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉΓöÇΓöÿ
  9959.   Γöé FLDA Γöé FLDB ΓöéΓöéΓöÇΓöÇΓöÇΓöÇOccurrenceΓöÇΓöÇΓöÇΓöÇΓöé FLDC Γöé FLDD Γöé
  9960.   Γöé      Γöé      Γöé                    Γöé      Γöé      Γöé
  9961. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉΓöÇΓöÿ       1st        ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉΓöÇΓöÿ
  9962. Γöé FLDA Γöé FLDB ΓöéΓöéΓöÇΓöÇΓöÇΓöÇOccurrenceΓöÇΓöÇΓöÇΓöÇΓöé FLDC Γöé FLDD Γöé
  9963. Γöé      Γöé      Γöé                    Γöé      Γöé      Γöé
  9964. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ                    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9965.       DS1                                DS2
  9966.  
  9967. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  9968. I....................................PFromTo++DField+L1M1FrPlMnZr...
  9969. I*
  9970. I*  DS1 and DS2 are multiple occurrence data structures.
  9971. I*  Each data structure has 50 occurrences.
  9972. IDS1         DS                         50
  9973. I                                        1   5 FLDA
  9974. I                                        6   80FLDB
  9975. I*
  9976. IDS2         DS                         50
  9977. I                                        1   6 FLDC
  9978. I                                        7  11 FLDD
  9979.  
  9980. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  9981. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  9982. C*  DS1 is set to the third occurrence.  The subfields FLDA
  9983. C*  and FLDB of the third occurrence can now be used.  The MOVE
  9984. C*  and Z-ADD operations change the contents of FLDA and FLDB,
  9985. C*  respectively, in the third occurrence of DS1.
  9986. C           3         OCUR DS1
  9987. C                     MOVE 'ABCDE'   FLDA
  9988. C                     Z-ADD22        FLDB
  9989. C*
  9990. C*  DS1 is set to the fourth occurrence.  Using the values in
  9991. C*  FLDA and FLDB of the fourth occurrence of DS1, the MOVE
  9992. C*  operation places the contents of FLDA in the result field,
  9993. C*  FLDX, and the Z-ADD operation places the contents of FLDB
  9994. C*  in the result field, FLDY.
  9995. C           4         OCUR DS1
  9996. C                     MOVE FLDA      FLDX
  9997. C                     Z-ADDFLDB      FLDY
  9998. C*
  9999. C*  DS1 is set to the occurrence specified in field X.
  10000. C*  For example, if X = 10, DS1 is set to the tenth occurrence.
  10001. C           X         OCUR DS1
  10002. C*
  10003. C*  DS1 is set to the current occurrence of DS2.  For example, if
  10004. C*  the current occurrence of DS2 is the twelfth occurrence, DSI
  10005. C*  is set to the twelfth occurrence.
  10006. C           DS2       OCUR DS1
  10007. C*
  10008. C*  The value of the current occurrence of DS1 is placed in the
  10009. C*  result field, Z.  Field Z must be numeric with zero decimal
  10010. C*  positions.  For example, if the current occurrence of DS1
  10011. C*  is 15, field Z contains the value 15.
  10012. C                     OCUR DS1       Z
  10013.  
  10014. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  10015. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  10016. C*
  10017. C*  DS1 is set to the current occurrence of DS2.  The value of the
  10018. C*  current occurrence of DS1 is then moved to the result field,
  10019. C*  Z.  For example, if the current occurrence of DS2 is the fifth
  10020. C*  occurrence, DS1 is set to the fifth occurrence.  The result
  10021. C*  field, Z, contains the value 5.
  10022. C           DS2       OCUR DS1       Z
  10023. C*
  10024. C*  DS1 is set to the current occurrence of X.  For example, if
  10025. C*  X = 15, DS1 is set to the fifteenth occurrence.  If X equals
  10026. C*  0 or is greater than 50, an error occurs and indicator 20 is
  10027. C*  set on.  If indicator 20 is on, the LR indicator is set on.
  10028. C           X         OCUR DS1                    20
  10029. C*
  10030. C           *IN20     IFEQ *ON
  10031. C                     SETON                     LR
  10032. C                     END
  10033.  
  10034.  
  10035. ΓòÉΓòÉΓòÉ 1.10.20.56. OPEN (Open File for Processing) ΓòÉΓòÉΓòÉ
  10036.  
  10037. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10038. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  10039. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  10040. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10041. Γöé OPEN    Γöé               Γöé File name       Γöé          Γöé  _ ER _ Γöé
  10042. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10043.  
  10044. The explicit OPEN operation opens the file named in factor 2. The factor 2 
  10045. entry cannot be designated as a primary, secondary, or table file. You can 
  10046. specify a resulting indicator in positions 56 and 57 to be set on if the OPEN 
  10047. operation is not successful.  If no indicator is specified, but the INFSR 
  10048. subroutine is specified, the INFSR automatically receives control when an 
  10049. error/exception occurs.  If no indicator or INFSR subroutine is specified, the 
  10050. default error/exception handler receives control when an error/exception 
  10051. occurs. 
  10052.  
  10053. To open the file specified in factor 2 for the first time in a program with an 
  10054. explicit OPEN operation, specify UC (user control) in positions 71 and 72 of 
  10055. the file description specifications.  (See File Description Specifications for 
  10056. restrictions when using the UC entry.) 
  10057.  
  10058. If a file is opened and later closed by the CLOSE operation in the program, the 
  10059. programmer can reopen the file with the OPEN operation and the UC entry is not 
  10060. required in positions 71 and 72.  When UC is not specified, the file is opened 
  10061. at program initialization.  If an OPEN operation is specified for a file that 
  10062. is already open, an error occurs. 
  10063.  
  10064. Multiple OPEN operations in a program to the same file are valid as long as the 
  10065. file is closed when the OPEN operation is issued to it. 
  10066.  
  10067. When you open a file with the ID option specified (on the file description 
  10068. specifications continuation line), the ID field is set to blanks. See the 
  10069. description of the ID option, in File Description Specifications. 
  10070.  
  10071. Figure "OPEN Operation with CLOSE Operation" shows the OPEN operation used with 
  10072. the CLOSE operation. 
  10073.  
  10074.  
  10075. ΓòÉΓòÉΓòÉ 1.10.20.56.1. OPEN Example ΓòÉΓòÉΓòÉ
  10076.  
  10077.  
  10078. OPEN Operation with CLOSE Operation
  10079.  
  10080. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  10081. FFilenameIPEAF....RlenLK1AIOvKlocEDevice+......KExit++Entry+A....U..
  10082. FEXCPTN  O   E                    DISK                           UC
  10083. FFILEX   I   E                    DISK
  10084. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  10085. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  10086. C*
  10087. C*  The explicit OPEN operation opens the EXCPTN file for
  10088. C*  processing if indicator 97 is on and indicator 98 is off.
  10089. C*  Note that the EXCPTN file on the file description
  10090. C*  specifications has UC specified in positions 71 and 72.
  10091. C*
  10092. C   97N98             OPEN EXCPTN                 99  99=NO SUCCESS
  10093. C   97N98N99          WRITEERREC
  10094. C*
  10095. C*  FILEX is opened at program initialization.  The explicit
  10096. C*  CLOSE operation closes FILEX before control is passed to RTNX.
  10097. C*  RTNX or another program can open and use FILEX.  Upon return,
  10098. C*  the OPEN operation reopens the file.  Because FILEX is opened
  10099. C*  at program initialization, UC is not specified in positions 71
  10100. C*  and 72 of the file description specifications.
  10101. C*
  10102. C                     CLOSEFILEX
  10103. C                     CALL 'RTNX'
  10104. C                     OPEN FILEX
  10105.  
  10106.  
  10107. ΓòÉΓòÉΓòÉ 1.10.20.57. ORxx (Or) ΓòÉΓòÉΓòÉ
  10108.  
  10109. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10110. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  10111. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  10112. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10113. Γöé ORXX    Γöé Comparand     Γöé Comparand       Γöé          Γöé         Γöé
  10114. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10115.  
  10116. The ORxx operation is optional with the DOUxx, DOWxx, IFxx, WHxx, and ANDxx 
  10117. operations. ORxx is specified immediately following a DOUxx, DOWxx, IFxx, WHxx, 
  10118. ANDxx or ORxx statement. Use ORxx to specify a more complex condition for the 
  10119. DOUxx, DOWxx, IFxx, and WHxx operations. 
  10120.  
  10121. The control level entry (positions 7 and 8) can be blank or can contain an L1 
  10122. through L9 indicator, an LR indicator, or an L0 entry to group the statement 
  10123. within the appropriate section of the program. The control level entry must be 
  10124. the same as the entry for the associated DOUxx, DOWxx, IFxx, or WHxx operation. 
  10125. Conditioning indicator entries (positions 9 through 17) are not allowed. 
  10126.  
  10127. Factor 1 and factor 2 must contain a literal, a named constant, a figurative 
  10128. constant, a table name, an array element, a data structure name, or a field 
  10129. name. Factor 1 and factor 2 must be either both character data or both numeric 
  10130. data. The comparison of factor 1 and factor 2 follows the same rules as those 
  10131. given for the compare operations.  See Compare Operations. 
  10132.  
  10133. Figure "DOUxx Operations" shows an example of ORxx and ANDxx operations with a 
  10134. DOUxx operation. 
  10135.  
  10136.  
  10137. ΓòÉΓòÉΓòÉ 1.10.20.58. OTHER (Otherwise Select) ΓòÉΓòÉΓòÉ
  10138.  
  10139. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10140. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  10141. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  10142. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10143. Γöé OTHER   Γöé               Γöé                 Γöé          Γöé         Γöé
  10144. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10145.  
  10146. The OTHER operation begins the sequence of operations to be processed if no 
  10147. WHxx condition is satisfied in a SELEC group. The sequence ends with the ENDSL 
  10148. or END operation. 
  10149.  
  10150. Rules to remember when using the OTHER operation: 
  10151.  
  10152.  The OTHER operation is optional in a SELEC group. 
  10153.  Only one OTHER operation can be specified in a SELEC group. 
  10154.  No WHxx operation can be specified after an OTHER operation in the same SELEC 
  10155.   group. 
  10156.  The sequence of calculation operations in the OTHER group can be empty; the 
  10157.   effect is the same as not specifying an OTHER statement. 
  10158.  Within total calculations, the control level entry (positions 7 and 8) can be 
  10159.   blank or can contain an L1 through L9 indicator, an LR indicator, or an L0 
  10160.   entry to group the statement within the appropriate section of the program. 
  10161.   The control level entry is for documentation purposes only. Conditioning 
  10162.   indicator entries (positions 9 through 17) are not allowed. 
  10163.  
  10164. Figure "OTHER Operation" shows an example of the OTHER operation. 
  10165.  
  10166.  
  10167. ΓòÉΓòÉΓòÉ 1.10.20.58.1. OTHER Example ΓòÉΓòÉΓòÉ
  10168.  
  10169. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  10170. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  10171. C*
  10172. C* Example of a SELEC group with WHxx and OTHER.  If X equals 1,
  10173. C* do the operations in sequence 1; if X does not equal 1 and Y
  10174. C* equals 2, do the operations in sequence 2.  If neither
  10175. C* condition is true, do the operations in sequence 3.
  10176. C*
  10177. C                     SELEC
  10178. C           X         WHEQ 1
  10179. C                      :                              seq 1
  10180. C           Y         WHEQ 2
  10181. C                      :                              seq 2
  10182. C                     OTHER
  10183. C                      :                              seq 3
  10184. C                     ENDSL
  10185.  
  10186. OTHER Operation 
  10187.  
  10188.  
  10189. ΓòÉΓòÉΓòÉ 1.10.20.59. OUT (Write a Data Area) ΓòÉΓòÉΓòÉ
  10190.  
  10191. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10192. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  10193. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  10194. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10195. Γöé OUT     Γöé *LOCK         Γöé Data area name  Γöé          Γöé  _ ER _ Γöé
  10196. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10197.  
  10198. The OUT operation updates the data area specified in factor 2.  To specify a 
  10199. data area in factor 2 of an OUT operation, you must ensure two things: 
  10200.  
  10201.  The data area must also be specified in the result field of a *NAMVAR DEFN 
  10202.   statement. 
  10203.  The data area must have been locked previously by a *LOCK IN statement or it 
  10204.   must have been specified as a data area data structure by a U in position 18 
  10205.   of the input specifications. (The RPG/400 language implicitly retrieves and 
  10206.   locks data area data structures at program initialization.) 
  10207.  
  10208. Factor 1 can contain the reserved word *LOCK or can be blank. When factor 1 
  10209. contains *LOCK, the data area remains locked after it is updated. When factor 1 
  10210. is blank, the data area is unlocked after it is updated. 
  10211.  
  10212. Factor 1 must be blank when factor 2 contains the name of the local data area 
  10213. or the Program Initialization Parameters (PIP) data area. 
  10214.  
  10215. Factor 2 must be the name of the data area to be updated or must be the 
  10216. reserved word *NAMVAR. When *NAMVAR is specified, all data areas defined in the 
  10217. program are updated. If an error occurs when one or more data areas are updated 
  10218. (for example, if you specify an OUT operation to a data area that has not been 
  10219. locked by the program), an error occurs on the OUT operation and the RPG/400 
  10220. exception/error handling routine receives control. If you specify a program 
  10221. exception/error subroutine (*PSSR), the program status data structure contains 
  10222. information on the data area in error. If a message is issued to the requester, 
  10223. the message identifies the data area in error. 
  10224.  
  10225. You can specify a resulting indicator in positions 56 and 57 to be set on if an 
  10226. error occurs during the operation. Positions 54-55 and 58-59 must be blank. 
  10227.  
  10228. For further rules for the OUT operation, see Data-Area Operations. 
  10229.  
  10230. See Figure "IN and OUT Operations" for an example of the OUT operation. 
  10231.  
  10232.  
  10233. ΓòÉΓòÉΓòÉ 1.10.20.60. PARM (Identify Parameters) ΓòÉΓòÉΓòÉ
  10234.  
  10235. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10236. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  10237. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  10238. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10239. Γöé PARM    Γöé Target field  Γöé Source field    Γöé Param-   Γöé         Γöé
  10240. Γöé         Γöé               Γöé                 Γöé eter     Γöé         Γöé
  10241. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10242.  
  10243. The declarative PARM operation defines the parameters that compose a parameter 
  10244. list (PLIST).  PARM operations can appear anywhere in calculations as long as 
  10245. they immediately follow the PLIST or CALL operation they refer to. PARM 
  10246. statements must be in the order expected by the called program.  One PARM 
  10247. statement, or as many as 255 PARM statements, can follow a PLIST or CALL. 
  10248.  
  10249. The PARM operation can be specified anywhere within calculations, including 
  10250. total calculations.  The control level entry (positions 7 and 8) can be blank 
  10251. or can contain an L1 through L9 indicator, an LR indicator, or an L0 entry to 
  10252. group the statement in the appropriate section of the program.  Conditioning 
  10253. indicator entries (positions 9 through 17) are not allowed. 
  10254.  
  10255. Factor 1 and factor 2 entries are optional. If specified, the entries must be 
  10256. the same type (character or numeric) as specified in the result field. A 
  10257. literal or named constant cannot be specified in factor 1.  Factor 1 and factor 
  10258. 2 must be blank if the result field contains the name of a multiple-occurrence 
  10259. data structure. 
  10260.  
  10261. The result field must contain the name of a field, data structure, or array 
  10262. that is to be the parameter. Also, the result field of a non-*ENTRY PLIST can 
  10263. contain an array element. The result field can be numeric or character. The 
  10264. result field cannot contain *IN, *INxx, *IN,xx, a label, a literal, a data-area 
  10265. name, a data-area data structure name, a globally initialized data structure, a 
  10266. data structure with initialized subfields, a data structure with a compile time 
  10267. array as a subfield, or a table name. In addition, an array element, a 
  10268. data-structure subfield name, the name of a compile-time array and the name of 
  10269. a program status or file information data structure (INFDS) are not allowed in 
  10270. the result field of PARM specified for an *ENTRY PLIST. A field name can be 
  10271. specified only once in an *ENTRY PLIST. 
  10272.  
  10273. If an array is specified in the result field, the area defined for the array is 
  10274. passed to the called program.  When a data structure with multiple occurrences 
  10275. is passed to the called program, all occurrences of the data structure are 
  10276. passed as a single field. However, if a subfield of a multiple occurrence data 
  10277. structure is specified in the result field, only the current occurrence of the 
  10278. subfield is passed to the called program. 
  10279.  
  10280. Each parameter field has only one storage location; it is in the calling 
  10281. program. The address of the storage location of the result field is passed to 
  10282. the called program on a PARM operation. If the called program changes the value 
  10283. of a parameter, it changes the data at that storage location. When control 
  10284. returns to the calling program, the value of the parameter in the calling 
  10285. program (that is, the result field) has changed.  Even if the called program 
  10286. ends in error after it changes the value of a parameter, the changed value 
  10287. exists in the calling program. To preserve the information passed to the called 
  10288. program for later use, specify in factor 2 the name of the field that contains 
  10289. the information you want to pass to the called program. Factor 2 is copied into 
  10290. the result field, and the storage address of the result field is passed to the 
  10291. called program. 
  10292.  
  10293. Because the program accesses the parameter fields by address, not field name, 
  10294. the calling and called parameters do not have to use the same field names for 
  10295. fields that are passed.  The attributes of the corresponding parameter fields 
  10296. in the calling and called programs should be the same.  If they are not, 
  10297. undesirable results may occur. 
  10298.  
  10299. When a CALL operation runs, the following occurs: 
  10300.  
  10301.  1. In the calling program, the contents of the factor 2 field of a PARM 
  10302.     operation are copied into the result field (receiver field) of the same 
  10303.     PARM operation. 
  10304.  2. In the called program, after it receives control and after any normal 
  10305.     program initialization, the contents of the result field of a PARM 
  10306.     operation are copied into the factor 1 field (receiver field) of the same 
  10307.     PARM operation. 
  10308.  3. In the called program, when control is returned to the calling program, the 
  10309.     contents of the factor 2 field of a PARM operation are copied into the 
  10310.     result field (receiver field) of the same PARM operation. This move does 
  10311.     not occur if the called program ends abnormally. 
  10312.  4. Upon return to the calling program, the contents of the result field of a 
  10313.     PARM operation in the calling program are copied into the factor 1 field 
  10314.     (receiver field) of the same PARM operation. This move does not occur if 
  10315.     the called program ends abnormally or if an error occurs on the CALL 
  10316.     operation. 
  10317.  
  10318. Note:   If the receiver field is numeric, the value of the field to be placed 
  10319. in the receiver field is added to a field of zeros and the sum is placed in the 
  10320. receiver field. If the receiver field is character, the field to be placed in 
  10321. the receiver field is moved (left-adjusted) into the receiver field, and the 
  10322. receiver field is padded with blanks. For a discussion of how to call and pass 
  10323. parameters to a program through CL, see the Programming:  Control Language 
  10324. Programmer's Guide. 
  10325.  
  10326. Figure "PLIST/PARM Operations" illustrates the PARM operation. 
  10327.  
  10328.  
  10329. ΓòÉΓòÉΓòÉ 1.10.20.61. PLIST (Identify a Parameter List) ΓòÉΓòÉΓòÉ
  10330.  
  10331. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10332. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  10333. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  10334. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10335. Γöé PLIST   Γöé PLIST name    Γöé                 Γöé          Γöé         Γöé
  10336. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10337.  
  10338. The declarative PLIST operation defines a unique symbolic name for a parameter 
  10339. list to be specified in a CALL operation. 
  10340.  
  10341. You can specify a PLIST operation anywhere within calculations, including 
  10342. within total calculations and between subroutines.  The control level entry 
  10343. (positions 7 and 8) can be blank or can contain an L1 through L9 indicator, an 
  10344. LR indicator, or an L0 entry to group the statement in the appropriate section 
  10345. of the program. The PLIST operation must be immediately followed by at least 
  10346. one PARM operation. Conditioning indicator entries (positions 9 through 17) are 
  10347. not allowed. 
  10348.  
  10349. Factor 1 must contain the name of the parameter list. If the parameter list is 
  10350. the entry parameter list of a called program, factor 1 must contain *ENTRY. 
  10351. Only one *ENTRY parameter list can occur in a program.  A parameter list is 
  10352. ended when an operation other than PARM is encountered. 
  10353.  
  10354. Figure "PLIST/PARM Operations" illustrates the PLIST operation. 
  10355.  
  10356.  
  10357. ΓòÉΓòÉΓòÉ 1.10.20.61.1. PLIST Example ΓòÉΓòÉΓòÉ
  10358.  
  10359.  
  10360. PLIST/PARM Operations
  10361.  
  10362. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  10363. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  10364. C*
  10365. C*  In the calling program, the CALL operation calls PROG2 and
  10366. C*  allows PROG2 to access the data in the parameter list fields.
  10367. C                     CALL 'PROG2'   PLIST1
  10368. C*
  10369. C*  In the second PARM statement, when CALL is processed, the
  10370. C*  contents of factor 2, *IN27, are placed in the result field,
  10371. C*  BYTE.  When PROG2 returns control, the contents of the result
  10372. C*  field, BYTE, are placed in the factor 1 field, *IN30.  Note
  10373. C*  that factor 1 and factor 2 entries on a PARM are optional.
  10374. C*
  10375. C           PLIST1    PLIST
  10376. C                     PARM           AMT     52
  10377. C           *IN30     PARM *IN27     BYTE    1
  10378. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  10379. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  10380. C                     CALL 'PROG2'
  10381. C*  In this example, the PARM operations immediately follow a
  10382. C*  CALL operation instead of a PLIST operation.
  10383. C                     PARM           AMT     52
  10384. C           *IN30     PARM *IN27     BYTE    1
  10385. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  10386. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  10387. C*  In the called program, PROG2,  *ENTRY in factor 1 of the
  10388. C*  PLIST statement identifies it as the entry parameter list.
  10389. C*  When control transfers to PROG2, the contents of the result
  10390. C*  fields (FLDC and FLDG) of the parameter list are placed in
  10391. C*  the factor 1 fields (FLDA and FLDD).  When the called program
  10392. C*  returns, the contents of the factor 2 fields of the parameter
  10393. C*  list (FLDB and FLDE) are placed in the result fields (FLDC
  10394. C*  and FLDG).  All of the fields are defined elsewhere in the
  10395. C*  program.
  10396. C           *ENTRY    PLIST
  10397. C           FLDA      PARM FLDB      FLDC
  10398. C           FLDD      PARM FLDE      FLDG
  10399.  
  10400.  
  10401. ΓòÉΓòÉΓòÉ 1.10.20.62. POST (Post) ΓòÉΓòÉΓòÉ
  10402.  
  10403. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10404. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  10405. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  10406. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10407. Γöé POST    Γöé Program       Γöé File name       Γöé INFDS    Γöé  _ ER _ Γöé
  10408. Γöé         Γöé device        Γöé                 Γöé name     Γöé         Γöé
  10409. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10410.  
  10411. The POST operation puts information in an INFDS (file information data 
  10412. structure).  The information is either on the status of a specific program 
  10413. device or I/O feedback associated with a file. 
  10414.  
  10415. In factor 1, you can specify a program device name to get information about 
  10416. that specific program device. Use either a character field of length 10 or 
  10417. less, a character literal, or a character named constant. If you leave factor 1 
  10418. blank, you get I/O feedback information. 
  10419.  
  10420. In factor 2, specify the name of a file.  Information for this file is posted 
  10421. in the INFDS associated with this file.  If you specify a program device in 
  10422. factor 1, the file must be defined as a WORKSTN file. 
  10423.  
  10424. If you specify a file in factor 2, you can leave the result field blank. The 
  10425. INFDS associated with this file will be used. You can specify a file in factor 
  10426. 2 and its associated INFDS in the result field. If you leave factor 2 blank, 
  10427. you must specify an INFDS in the result field; information from the file 
  10428. associated with this INFDS will be posted. 
  10429.  
  10430. In positions 56 and 57, you can specify an indicator that is set on if there is 
  10431. an error.  If no indicator is specified, control passes to your INFSR 
  10432. subroutine (if you have specified one) or the default error/exception handler 
  10433. when an error/exception occurs. 
  10434.  
  10435. Even when a POST operation code is not processed, its existence in your program 
  10436. can affect the way the RPG/400 language operates. Usually, the INFDS is updated 
  10437. at each input and output operation or block of operations. However, if anywhere 
  10438. in your program, you have specified a POST operation with factor 1 blank, then 
  10439. RPG/400 updates the I/O Feedback Information area and the Device Dependent 
  10440. Feedback Information area in the INFDS of any file only when you process a POST 
  10441. operation for that file (except for the area *STATUS which is always updated). 
  10442. To ensure that the DUMP operation code provides up-to-date information in this 
  10443. case, issue a POST operation before the DUMP operation. 
  10444.  
  10445. If a program has no POST operation code, or if it has only POST operation codes 
  10446. with factor 1 specified, the INFDS is updated with each input/output operation 
  10447. or block of operations. If RPG is blocking records, the information in the 
  10448. INFDS will be valid for the last block of records processed. If you require 
  10449. more accurate information, do not use record blocking. If you do not require 
  10450. feedback information after every input/output operation, you may be able to 
  10451. improve performance by using the POST operation only when you require the 
  10452. feedback information. 
  10453.  
  10454. When a POST operation is processed, the associated file must be open.  If you 
  10455. specify a program device on the POST operation, it does not have to be acquired 
  10456. by the file. 
  10457.  
  10458.  
  10459. ΓòÉΓòÉΓòÉ 1.10.20.63. READ (Read a Record) ΓòÉΓòÉΓòÉ
  10460.  
  10461. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10462. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  10463. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  10464. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10465. Γöé READ    Γöé               Γöé File name,      Γöé Data     Γöé   _ ER  Γöé
  10466. Γöé (N)     Γöé               Γöé Record name     Γöé struc-   Γöé   EOF   Γöé
  10467. Γöé         Γöé               Γöé                 Γöé ture     Γöé         Γöé
  10468. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10469.  
  10470. The READ operation reads the record, currently pointed to, from a full 
  10471. procedural file (identified by an F in position 16 of the file description 
  10472. specifications). 
  10473.  
  10474. Factor 2 must contain the name of a file. A record format name in factor 2 is 
  10475. allowed only with an externally described file (E in position 19 of the file 
  10476. description specifications). It may be the case that a READ-by-format-name 
  10477. operation will receive a different format than the one you specified in factor 
  10478. 2.  If so, your READ operation ends in error. 
  10479.  
  10480. The result field can contain the name of a data structure into which the record 
  10481. is read only if the file named in factor 2 is a program described file 
  10482. (identified by an F in position 19 of the file description specifications). 
  10483. See File Operations for information on how data is transferred between the file 
  10484. and the data structure. 
  10485.  
  10486. If a READ operation is successful, the file is positioned at the next record 
  10487. that satisfies the read. If either indicator is set on, you must reposition the 
  10488. file (by a CHAIN (Random Retrieval from a File), SETLL (Set Lower Limit), or 
  10489. SETGT (Set Greater Than) operation). 
  10490.  
  10491. If the file from which you are reading is an update disk file, you can specify 
  10492. an N in position 53 to indicate that no lock should be placed on the record 
  10493. when it is read.  See the RPG/400* User's Guide for more information. 
  10494.  
  10495. You can specify an indicator in positions 56 and 57 to be set on if the READ 
  10496. operation is not completed successfully. If an error occurs when no indicator 
  10497. is specified, control passes to your INFSR subroutine (if specified) or the 
  10498. default error/exception handler. 
  10499.  
  10500. You must specify an indicator in positions 58 and 59 to signal whether end of 
  10501. file occurred on the READ operation.  The file must be repositioned after the 
  10502. indicator is set on to process any further successful sequential operation (for 
  10503. example, READ or READP) to the file.  This indicator is set on or off every 
  10504. time the READ operation is performed. 
  10505.  
  10506. Figure "READ Operation" illustrates the READ operation. 
  10507.  
  10508. When you specify a multiple device file in factor 2, the READ operation does 
  10509. one of: 
  10510.  
  10511.  Reads data from the device specified in the most recent NEXT operation (if 
  10512.   such a NEXT operation has been processed). 
  10513.  Accepts the first response from any device that has been acquired for the 
  10514.   file, and that was specified for "invite status" with the DDS keyword INVITE. 
  10515.   If there are no invited devices, the operation receives an end of file. The 
  10516.   input is processed according to the corresponding format.  If the device is a 
  10517.   workstation, the last format written to it is used. If the device is a 
  10518.   communications device, you can select the format. 
  10519.  
  10520.   Refer to the ICF Programmer's Guide for more information on format selection 
  10521.   processing for an ICF file. 
  10522.  
  10523.   The READ operation will stop waiting after a period of time in which no input 
  10524.   is provided, or when one of the following CL commands has been entered with 
  10525.   the controlled option specified: 
  10526.  
  10527.    - ENDJOB (End Job) 
  10528.    - ENDSBS (End Subsystem) 
  10529.    - PWRDWNSYS (Power Down System) 
  10530.    - ENDSYS (End System). 
  10531.  
  10532.   The error indicator specified in positions 56 and 57 is set on. See the 
  10533.   Communications:  Intersystem Communications Function Programmer's Guide for a 
  10534.   discussion of the WAITRCD parameter on the commands to create or modify a 
  10535.   file. This parameter controls the length of time the READ operation waits for 
  10536.   input. 
  10537.  
  10538. When you specify a format name in factor 2, and the format name is associated 
  10539. with a multiple device file, data is read from the device identified by the 
  10540. field specified in the ID entry on the file continuation specifications.  If 
  10541. there is no such entry, data is read from the device used in the last 
  10542. successful input operation. 
  10543.  
  10544.  
  10545. ΓòÉΓòÉΓòÉ 1.10.20.63.1. READ Example ΓòÉΓòÉΓòÉ
  10546.  
  10547. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  10548. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  10549. C*
  10550. C*  READ retrieves the next record from the file FILEA, which must
  10551. C*  be a full procedural file.  Indicator 61 is set on if end of
  10552. C*  file occurs on READ, or if end of file has occurred previously
  10553. C*  and the file has not been repositioned.  When indicator 61
  10554. C*  is set on, the program branches to the label (EOF) specified
  10555. C*  in the GOTO statement.
  10556. C                     READ FILEA                    61 END OF FILE
  10557. C   61                GOTO EOF
  10558. C*
  10559. C*  READ retrieves the next record of the type REC1 (factor 2)
  10560. C*  from an externally described file.  (REC1 is a record format
  10561. C*  name.)  Indicator 64 is set on if end of file occurs on READ, or
  10562. C*  or if it has occurred previously and the file has not been
  10563. C*  repositioned.  When indicator 64 is set on, the program
  10564. C*  branches to the label (EOF) specified in the GOTO statement.
  10565. C*  N in position 53 indicates that the record is not locked.
  10566. C*
  10567. C                     READ REC1                N    64 END OF FILE
  10568. C   64                GOTO EOF
  10569. C*
  10570. C           EOF       TAG
  10571.  
  10572. READ Operation 
  10573.  
  10574.  
  10575. ΓòÉΓòÉΓòÉ 1.10.20.64. READC (Read Next Changed Record) ΓòÉΓòÉΓòÉ
  10576.  
  10577. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10578. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  10579. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  10580. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10581. Γöé READC   Γöé               Γöé Record name     Γöé          Γöé   _ ER  Γöé
  10582. Γöé         Γöé               Γöé                 Γöé          Γöé   EOF   Γöé
  10583. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10584.  
  10585. The READC operation can be used only with an externally described WORKSTN file 
  10586. to obtain the next changed record in a subfile.  Factor 2 is required and must 
  10587. be the name of a record format defined as a subfile by the SFILE keyword on the 
  10588. file description specifications. (See Continuation Line Summary Chart for 
  10589. information on the SFILE keyword.) 
  10590.  
  10591. For a multiple device file, data is read from the subfile record associated 
  10592. with a program device; the program device is identified by the field specified 
  10593. in the ID entry (on the file specifications continuation line). If there is no 
  10594. such entry, data is read from the program device used for the last successful 
  10595. input operation. 
  10596.  
  10597. You can specify a resulting indicator in positions 56 and 57 to be set on if an 
  10598. error occurs while the operation is running.  A resulting indicator in 
  10599. positions 58 and 59 is required; it is set on when there are no more changed 
  10600. records in the subfile. 
  10601.  
  10602.  
  10603. ΓòÉΓòÉΓòÉ 1.10.20.65. READE (Read Equal Key) ΓòÉΓòÉΓòÉ
  10604.  
  10605. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10606. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  10607. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  10608. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10609. Γöé READE   Γöé Search argu-  Γöé File name,      Γöé Data     Γöé   _ ER  Γöé
  10610. Γöé (N)     Γöé ment          Γöé Record name     Γöé struc-   Γöé   EOF   Γöé
  10611. Γöé         Γöé               Γöé                 Γöé ture     Γöé         Γöé
  10612. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10613.  
  10614. The READE operation retrieves the next sequential record from a full procedural 
  10615. file (identified by an F in position 16 of the file description specifications) 
  10616. if the key of the record matches the search argument. If the key of the record 
  10617. does not match the search argument, the indicator that must be specified in 
  10618. positions 58 and 59 is set on, and the record is not returned to the program. 
  10619.  
  10620. Factor 1, the search argument, is optional and identifies the record to be 
  10621. retrieved. It can be a field name, a literal, a named constant, or a figurative 
  10622. constant. You can also specify a KLIST name in factor 1 for an externally 
  10623. described file. If factor 1 is left blank and the full key of the next record 
  10624. is equal to that of the current record, the next record in the file is 
  10625. retrieved. The full key is defined by the record format or file used in factor 
  10626. 2. 
  10627.  
  10628. Note:   If factor 1 equals the key of the current record or if factor 1 is not 
  10629. specified, the key comparison takes place at the Data Management level; 
  10630. otherwise, it takes place within the RPG/400 program. If the file being read is 
  10631. defined as update and the compare is by RPG, a temporary lock on the next 
  10632. record is requested and the search argument is compared to the key of that 
  10633. record. If the record is already locked, the program must wait until the record 
  10634. is available before obtaining the temporary lock and making the comparison. If 
  10635. the comparison is unequal, the record-not-found indicator is turned on, and the 
  10636. temporary record lock is removed. If no lock (N in position 53) is specified, a 
  10637. temporary lock is not requested. 
  10638.  
  10639. Factor 2 must contain the name of the file or record format to be retrieved. A 
  10640. record format name in factor 2 is allowed only with an externally described 
  10641. file (identified by an E in position 19 of the file description 
  10642. specifications). 
  10643.  
  10644. The result field can contain the name of a data structure into which the record 
  10645. is read only if the file named in factor 2 is a program described file 
  10646. (identified by an F in position 19 of the file description specifications). See 
  10647. File Operations for a description of the way data is transferred between the 
  10648. file and data structure. 
  10649.  
  10650. If the file you are reading is an update disk file, you can specify an N in 
  10651. position 53 to indicate that no lock should be placed on the record when it is 
  10652. read.  See the RPG/400* User's Guide for more information. 
  10653.  
  10654. You can specify a resulting indicator in positions 56 and 57 to be set on if 
  10655. the operation does is completed successfully. You must specify a resulting 
  10656. indicator in positions 58 and 59. The indicator is set on if a record is not 
  10657. found with a key equal to the search argument or if end of file occurs.  If a 
  10658. READE operation is not successful, you must reposition the file (for example, 
  10659. by a CHAIN (Random Retrieval from a File), SETGT (Set Greater Than), or SETLL 
  10660. (Set Lower Limit) operation). 
  10661.  
  10662. If factor 1 is specified and one or more key fields in the file being read from 
  10663. are defined with ALTSEQ, ABSVAL, DIGIT, or ZONE, the result of the read 
  10664. operation may differ from that expected. The reason is the content of the field 
  10665. on which the access path is built may not be the same as the content that the 
  10666. READE operation is using for its internal comparison. 
  10667.  
  10668. A READE (with factor 1 specified) that immediately follows an OPEN operation or 
  10669. an EOF condition retrieves the first record in the file if the key of the 
  10670. record matches the search argument. A READE (with no factor 1 specified) that 
  10671. immediately follows an OPEN operation or an EOF condition results in an error 
  10672. condition. The error indicator, if specified, in positions 56 and 57 is set on. 
  10673. No further I/O operations can be issued against the file until it is 
  10674. successfully closed and reopened. 
  10675.  
  10676. Note:   If the key used contains a numeric (packed or zoned) field, the search 
  10677. argument must exactly match the key field. For example, if the physical file 
  10678. uses a packed key of X'123C' for +123. and the search argument is 123, READE 
  10679. will use X'123F' and EOF will be returned. 
  10680.  
  10681. Figure "READE Operation" shows READE operations with a file name and record 
  10682. format name specified in factor 2. 
  10683.  
  10684.  
  10685. ΓòÉΓòÉΓòÉ 1.10.20.65.1. READE Examples ΓòÉΓòÉΓòÉ
  10686.  
  10687.  
  10688. READE Operation
  10689.  
  10690. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  10691. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  10692. C*
  10693. C*  With Factor 1 Specified...
  10694. C*
  10695. C*  The READE operation retrieves the next record from the file
  10696. C*  FILEA and compares its key to the search argument, KEYFLD.
  10697. C*  Indicator 55 is set on if KEYFLD is not equal to the key of
  10698. C*  the record read or if end of file is encountered.
  10699. C*
  10700. C           KEYFLD    READEFILEA                    55 NOT EQUAL
  10701. C*
  10702. C*  The READE operation retrieves the next record of the type REC1
  10703. C*  from an externally described file and compares the key of the
  10704. C*  record read to the search argument, KEYFLD.  (REC1 is a record
  10705. C*  format name.)  Indicator 56 is set on if KEYFLD is not equal to
  10706. C*  the key of the record read or if end of file is encountered.
  10707. C           KEYFLD    READEREC1                     56 NOT EQUAL
  10708. C*
  10709. C*  With No Factor 1 Specified...
  10710. C*
  10711. C*  The READE operation retrieves the next record in the access
  10712. C*  path from the file FILEA if the key value is equal to
  10713. C*  the key value of the record at the current cursor position.
  10714. C*  If the key values are not equal, indicator 55 is set on.
  10715. C                     READEFILEA                    55 NOT EQUAL
  10716. C*
  10717. C*  The READE operation retrieves the next record in the access
  10718. C*  path from the file FILEA if the key value equals the key value
  10719. C*  of the record at the current position.  REC1 is a record format
  10720. C*  name.  Indicator 56 is set on if the key values are unequal.
  10721. C*  N in position 53 indicates that the record is not locked.
  10722. C                     READEREC1                N    56 NOT EQUAL
  10723.  
  10724.  
  10725. ΓòÉΓòÉΓòÉ 1.10.20.66. READP (Read Prior Record) ΓòÉΓòÉΓòÉ
  10726.  
  10727. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10728. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  10729. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  10730. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10731. Γöé READP   Γöé               Γöé File name,      Γöé Data     Γöé   _ ER  Γöé
  10732. Γöé (N)     Γöé               Γöé Record name     Γöé struc-   Γöé   BOF   Γöé
  10733. Γöé         Γöé               Γöé                 Γöé ture     Γöé         Γöé
  10734. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10735.  
  10736. The READP operation reads the prior record from a full procedural file 
  10737. (identified by an F in position 16 of the file description specifications). 
  10738.  
  10739. Factor 2 must contain the name of a file or record format to be read. A record 
  10740. format name in factor 2 is allowed only with an externally described file.  If 
  10741. a record format name is specified in factor 2, the record retrieved is the 
  10742. first prior record of the specified type. Intervening records are bypassed. 
  10743.  
  10744. The result field can contain the name of a data structure into which the record 
  10745. is read only if the file named in factor 2 is a program described file 
  10746. (identified by an F in position 19 of the file description specifications). See 
  10747. File Operations for how data is transferred between the file and data 
  10748. structure. 
  10749.  
  10750. If a READP operation is successful, the file is positioned at the next record 
  10751. that satisfies the read.  If a READP operation is not successful, you must 
  10752. reposition the file (for example, by a CHAIN (Random Retrieval from a File) or 
  10753. SETLL (Set Lower Limit) operation). You can specify an indicator in positions 
  10754. 56 and 57 to be set on if the READP operation is not completed successfully. 
  10755.  
  10756. If the file from which you are reading is an update disk file, you can specify 
  10757. an N in position 53 to indicate that no lock should be placed on the record 
  10758. when it is read.  See the RPG/400* User's Guide for more information. 
  10759.  
  10760. You must specify an indicator in positions 58 and 59 to be set on when no prior 
  10761. records exist in the file (beginning of file condition). If the file is not 
  10762. repositioned after this indicator is set on, the indicator is set for every 
  10763. subsequent READP operation to the file. 
  10764.  
  10765. You must be reposition the file after the indicator is set on to process any 
  10766. further successful sequential operation (for example, READ (Read a Record)) to 
  10767. the file. 
  10768.  
  10769. Figure "READP Operation" shows READP operations with a file name and record 
  10770. format name specified in factor 2. 
  10771.  
  10772.  
  10773. ΓòÉΓòÉΓòÉ 1.10.20.66.1. READP Examples ΓòÉΓòÉΓòÉ
  10774.  
  10775.  
  10776. READP Operation
  10777.  
  10778. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  10779. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  10780. C*
  10781. C*  The READP operation reads the prior record from FILEA.
  10782. C*  Indicator 71 is set on if beginning of file is encountered.
  10783. C*  When indicator 71 is set on, the program branches to the
  10784. C*  label BOF specified in the GOTO operation.
  10785. C                     READPFILEA                    71 BOF
  10786. C   71                GOTO BOF                         BEG OF FILE
  10787. C*
  10788. C*  The READP operation reads the next prior record of the type
  10789. C*  REC1 from an externally described file.  (REC1 is a record
  10790. C*  format name.)  Indicator 72 is set on if beginning of file is
  10791. C*  encountered during processing of the READP operation.  When
  10792. C*  indicator 72 is set on, the program branches to the label BOF
  10793. C*  specified in the GOTO operation.
  10794. C                     READPREC1                     7272 = BOF
  10795. C   72                GOTO BOF
  10796. C*
  10797. C           BOF       TAG
  10798.  
  10799.  
  10800. ΓòÉΓòÉΓòÉ 1.10.20.67. REDPE (Read Prior Equal) ΓòÉΓòÉΓòÉ
  10801.  
  10802. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10803. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  10804. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  10805. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10806. Γöé REDPE   Γöé Search argu-  Γöé File name,      Γöé Data     Γöé   _ ER  Γöé
  10807. Γöé (N)     Γöé ment          Γöé Record name     Γöé struc-   Γöé   BOF   Γöé
  10808. Γöé         Γöé               Γöé                 Γöé ture     Γöé         Γöé
  10809. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10810.  
  10811. The REDPE operation retrieves the next prior sequential record from a full 
  10812. procedural file if the key of the record matches the search argument. If the 
  10813. key of the record does not match the search argument, the indicator in 
  10814. positions 58-59 is set on and the record is not returned to the program. 
  10815.  
  10816. Factor 1, the search argument, is optional and identifies the record to be 
  10817. retrieved. It can be a field name, a literal, a named constant, or a figurative 
  10818. constant. You can also specify a KLIST name in factor 1 for an externally 
  10819. defined file. If factor 1 is left blank and the full key of the next prior 
  10820. record is equal to that of the current record, the next prior record in the 
  10821. file is retrieved. The full key is defined by the record format or file used in 
  10822. factor 2. 
  10823.  
  10824. Factor 2 must contain the name of the file or record format to be retrieved. A 
  10825. record format name in factor 2 is allowed only with an externally described 
  10826. file (identified by an E in position 19 of the file description 
  10827. specifications). The Result Field can contain the name of a data structure into 
  10828. which the record is read only if the file named in factor 2 is a program 
  10829. described file (identified by an F in position 19 of the file description 
  10830. specifications). See File Operations for a description of the way data is 
  10831. transferred between the file and data structure. 
  10832.  
  10833. If the file from which you are reading is an update disk file, you can specify 
  10834. an N in position 53 to indicate that no lock should be placed on the record 
  10835. when it is read.  See the RPG/400* User's Guide for more information. 
  10836.  
  10837. You can specify a resulting indicator in positions 56 and 57 to be set on if 
  10838. the operation is not completed successfully. You must specify a resulting 
  10839. indicator positions 58 and 59. The indicator is set on if a record is not found 
  10840. with a key equal to the search argument, or if beginning of file is 
  10841. encountered. If a REDPE operation is not successful, you must reposition the 
  10842. file (for example, by a CHAIN (Random Retrieval from a File) or SETLL (Set 
  10843. Lower Limit) operation). 
  10844.  
  10845. Note:   If factor 1 equals the key of the current record or if factor 1 is not 
  10846. specified, the key comparison takes place at the Data Management level; 
  10847. otherwise, it takes place within the RPG/400 program. If the file being read is 
  10848. defined as update and the compare is by RPG, a temporary lock on the prior 
  10849. record is requested and the search argument is compared to the key of that 
  10850. record. If the record is already locked, the program must wait until the record 
  10851. is available before obtaining the temporary lock and making the comparison. If 
  10852. the comparison is unequal, the record-not-found indicator is turned on, and the 
  10853. temporary record lock is removed. If no lock (N in position 53) is specified, a 
  10854. temporary lock is not requested. 
  10855.  
  10856. If factor 1 is specified and one or more key fields in the file being read from 
  10857. are defined with ALTSEQ, ABSVAL, DIGIT, or ZONE, the result of the read 
  10858. operation may differ from that expected. The reason is that the content of the 
  10859. field on which the access path is built may not be the same as the content that 
  10860. the REDPE operation is using for its internal comparison. 
  10861.  
  10862. A REDPE (with factor 1 specified) that immediately follows an OPEN operation or 
  10863. a BOF condition returns BOF. A REDPE (with no factor 1 specified) that 
  10864. immediately follows an OPEN operation or a BOF condition results in an error 
  10865. condition. The error indicator, if specified, in positions 56 and 57 is set on. 
  10866. The file must be positioned (using CHAIN (Random Retrieval from a File), SETLL 
  10867. (Set Lower Limit), READ (Read a Record), READP (Read Prior Record), or READE 
  10868. (Read Equal Key) (with factor 1 specified) ) prior to issuing a REDPE operation 
  10869. with factor 1 blank.  A SETGT operation code should not be used to position the 
  10870. file prior to issuing a REDPE as this results in a record-not-found condition 
  10871. (because the record previous to the current record never has the same key as 
  10872. the current record after a SETGT is issued). 
  10873.  
  10874. If the key used contains a numeric (packed or zoned) field, the search argument 
  10875. must exactly match the key field. For example, if the physical file uses a 
  10876. packed key of X'123C' for +123. and the search argument is 123, REDPE will use 
  10877. X'123F' and BOF will be returned. 
  10878.  
  10879. Figure "REDPE Operation" shows an example of the REDPE operation. 
  10880.  
  10881.  
  10882. ΓòÉΓòÉΓòÉ 1.10.20.67.1. REDPE Example ΓòÉΓòÉΓòÉ
  10883.  
  10884. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  10885. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  10886. C*
  10887. C* With Factor 1 Specified...
  10888. C*
  10889. C* The previous record is read and the key compared to FIELDA.
  10890. C* Indicator 99 is set on if the record's key does not match
  10891. C* FIELDA.
  10892. C           FIELDA    REDPEFILEA                    99
  10893. C*
  10894. C* The previous record is read from FILEB and the key compared
  10895. C* to FIELDB.  The record is placed in data structure DS1.  If
  10896. C* the record key does not match FIELDB, indicator 99 is set on.
  10897. C           FIELDB    REDPEFILEB     DS1            99
  10898. C*
  10899. C* The previous record from record format RECA is read, and
  10900. C* the key compared to FIELDC.  Indicator 88 is set on if the
  10901. C* operation is not completed successfully, and 99 is set on if
  10902. C* the record key does not match FIELDC.
  10903. C           FIELDC    REDPERECA                   8899
  10904. C*
  10905. C* With No Factor 1 Specified...
  10906. C*
  10907. C* The previous record in the access path is retrieved if its
  10908. C* key value equals the key value of the current record.
  10909. C* Indicator 99 is set on if the key values are not equal.
  10910. C                     REDPEFILEA                    99
  10911. C*
  10912. C* The previous record is retrieved from FILEB if its key value
  10913. C* matches the key value of the record at the current position
  10914. C* in the file.  The record is placed in data structure DS1.
  10915. C* Indicator 99 is set on if the key values are not equal.
  10916. C                     REDPEFILEB     DS1            99
  10917. C*
  10918. C* The previous record from record format RECA is retrieved if
  10919. C* its key value matches the key value of the current record in
  10920. C* the access path.  Indicator 88 is set on if the operation is
  10921. C* not successful; 99 is set on if the key values are unequal.
  10922. C                     REDPERECA                   8899
  10923.  
  10924. REDPE Operation 
  10925.  
  10926.  
  10927. ΓòÉΓòÉΓòÉ 1.10.20.68. REL (Release) ΓòÉΓòÉΓòÉ
  10928.  
  10929. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10930. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  10931. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  10932. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10933. Γöé REL     Γöé Program       Γöé File name       Γöé          Γöé  _ ER _ Γöé
  10934. Γöé         Γöé device        Γöé                 Γöé          Γöé         Γöé
  10935. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10936.  
  10937. The REL operation releases the program device specified in factor 1 from the 
  10938. multiple device WORKSTN file specified in factor 2. 
  10939.  
  10940. In factor 1, specify the program device name.  Use either a character field of 
  10941. length 10 or less, a character literal, or a named constant.  In factor 2, 
  10942. specify the file name. 
  10943.  
  10944. You can specify an indicator in positions 56 and 57 that is set on when an 
  10945. error occurs. If you do not specify one and an error occurs, control passes to 
  10946. your INFSR subroutine (if specified) or the default error/exception handler. 
  10947.  
  10948. When there are no program devices acquired to a WORKSTN file, the next 
  10949. READ-by-file-name or cycle-read gets an end-of-file condition. You must decide 
  10950. what the program does next. 
  10951.  
  10952. To release a record lock, use the UNLCK operation. See the UNLCK operation for 
  10953. more information about unlocking data areas and releasing record locks for 
  10954. update disk files. 
  10955.  
  10956. The REL operation is valid only for multiple device WORKSTN files. 
  10957.  
  10958.  
  10959. ΓòÉΓòÉΓòÉ 1.10.20.69. RESET (Reset) ΓòÉΓòÉΓòÉ
  10960.  
  10961. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10962. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  10963. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  10964. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10965. Γöé RESET   Γöé *NOKEY        Γöé Structure or    Γöé          Γöé         Γöé
  10966. Γöé         Γöé               Γöé Variable        Γöé          Γöé         Γöé
  10967. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10968.  
  10969. The RESET operation sets elements in a structure (record format, data 
  10970. structure, array, or table), or a variable (field, subfield, or indicator) to 
  10971. its initial value. The initial value for a variable is the value the variable 
  10972. had at the end of the *INIT operation of the program. This value can be set 
  10973. using data structure initialization, or you can use the initialization 
  10974. subroutine to assign an initial value to the structure or variable. When RESET 
  10975. is specified for a structure or variable, a snapshot of the initial value of 
  10976. that variable or structure is taken at the end of the *INIT operation after 
  10977. *INZSR (initialization subroutine) is processed. This value is then used to 
  10978. reset the structure or variable. 
  10979.  
  10980. Factor 1 must be blank unless factor 2 contains a record format name. In this 
  10981. case, factor 1 can contain *NOKEY, which indicates that all fields except key 
  10982. fields are to be reset to their initial values. 
  10983.  
  10984. Factor 2 contains the structure or variable to be reset to its initial value. 
  10985. It can contain one of:  a record format, data structure name, array name, table 
  10986. name, field name, subfield, array element, or indicator name. If a record 
  10987. format name or a single occurrence data structure is specified, all fields are 
  10988. reset (in the order they are declared within the structure). In the case of a 
  10989. multiple-occurrence data structure, all fields in the current occurrence are 
  10990. reset.  If a table name is specified, the current table element is reset; in 
  10991. the case of an array name, the entire array is reset. If an array element 
  10992. (including indicators) is specified in factor 2 using an array index, only the 
  10993. element specified is reset. 
  10994.  
  10995. When the RESET operation is applied to a record format name, only those fields 
  10996. that are output in that record format are affected.  For WORKSTN (positions 
  10997. 40-46) file record formats, only those fields with a usage of output or both 
  10998. are affected. All field-conditioning indicators are affected by the operation. 
  10999. Fields in DISK, SEQ, or PRINTER file record formats are affected only if the 
  11000. record format is output in the program. Input-only fields are not affected by 
  11001. the RESET operation. By definition, they assume new values at the next input 
  11002. operation. 
  11003.  
  11004. The RESET operation is used in conjunction with data structure initialization 
  11005. and the initialization subroutine (*INZSR). You can use both data structure 
  11006. initialization and the *INZSR to set the initial value of a field or structure. 
  11007. The value is then used to reset the field or structure if it appears in factor 
  11008. 2 of a RESET operation. For example, you can use the *INZSR to set the values 
  11009. of several fields in a record format, and then later in the program use the 
  11010. RESET operation against the record format to reset the values of the fields. 
  11011. The snapshot of the field value for the RESET operation is taken at the end of 
  11012. the initialization step in the program, after the *INZSR is run. Any changes 
  11013. made to the values of variables in the *INZSR override any data structure 
  11014. initialization, and the value the variable has at the end of the initialization 
  11015. step is used to save the reset snapshot. 
  11016.  
  11017. This operation results in an increase in the amount of storage required by the 
  11018. program because the initial values of all structures and variables that are 
  11019. reset must be saved. However, the amount of storage declared is reduced where 
  11020. possible.  For example, if a data structure is reset and a subfield within that 
  11021. data structure is also reset, the save area for the subfield is based on the 
  11022. same storage as the data structure save area.  Note that, if a single 
  11023. occurrence of a multiple-occurrence data structure is reset, a save area for 
  11024. the entire data structure (all occurrences) is declared. A save area is created 
  11025. for a structure or variable only if it appears in factor 2 of a RESET 
  11026. operation.  If no RESET operations are coded in the program, then no additional 
  11027. storage is required. If a RESET occurs during the initialization routine of the 
  11028. program, an error message will be issued at run time. If a GOTO or CABxx is 
  11029. used to leave subroutine calculations during processing of the *INZSR, or if 
  11030. control passes to another part of the cycle as the result of error processing, 
  11031. the part of the initialization step which initializes the save areas will never 
  11032. be reached. In this case, an error message will be issued for all RESET 
  11033. operations in the program at run time. 
  11034.  
  11035. Figure "RESET Operation" shows an example of the RESET operation. 
  11036.  
  11037.  
  11038. ΓòÉΓòÉΓòÉ 1.10.20.69.1. RESET Example ΓòÉΓòÉΓòÉ
  11039.  
  11040. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  11041. FFilenameIPEAF....RlenLK1AIOvKlocEDevice+......KExit++Entry+A....U..
  11042. FEXTFILE O   E                    DISK
  11043. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  11044. I..............Namedconstant+++++++++C.........Fldnme.............
  11045. I*
  11046. I* The file EXTFILE contains one record format RECFMT containing
  11047. I* the character fields CHAR1 and CHAR2 and the numeric fields
  11048. I* NUM1 and NUM2.
  11049. IDS1        IDS
  11050. I I            'MONDAY'                  1   8 DAY1
  11051. I I            'THURSDAY'                9  16 DAY2
  11052. I                                       17  22 JDATE
  11053. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  11054. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  11055. C*
  11056. C* The following operation blank DAY1, DAY2, and JDATE.
  11057. C                     CLEARDS1
  11058. C* The following operation will set DAY1, DAY2, and JDATE to their
  11059. C* initial values of 'MONDAY', 'THURSDAY', and UDATE respectively.
  11060. C* The initial value of UDATE for JDATE is set in the *INZSR.
  11061. C                     RESETDS1
  11062. C* The following operation will set CHAR1 and CHAR2 to blanks and
  11063. C* NUM1 and NUM2 to zero.
  11064. C                     CLEARRECFMT
  11065. C* The following operation will set CHAR1, CHAR2, NUM1, and
  11066. C* NUM2 to their initial values of 'NAME', 'ADDRESS', 1, and 2
  11067. C* respectively. These initial values are set in the *INZSR.
  11068. C*
  11069. C                     RESETRECFMT
  11070. C*
  11071. C           *INZSR    BEGSR
  11072. C                     MOVELUDATE     JDATE
  11073. C                     MOVEL'NAME    'CHAR1
  11074. C                     MOVEL'ADDRESS 'CHAR2
  11075. C                     Z-ADD1         NUM1
  11076. C                     Z-ADD2         NUM2
  11077. C                     ENDSR
  11078.  
  11079. RESET Operation 
  11080.  
  11081.  
  11082. ΓòÉΓòÉΓòÉ 1.10.20.70. RETRN (Return to Caller) ΓòÉΓòÉΓòÉ
  11083.  
  11084. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11085. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  11086. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  11087. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11088. Γöé RETRN   Γöé               Γöé                 Γöé          Γöé         Γöé
  11089. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11090.  
  11091. The RETRN operation causes a return to the caller as follows: 
  11092.  
  11093.  1. The halt indicators are checked. If a halt indicator is on, the program 
  11094.     ends abnormally. (All open files are closed, an error return code is set to 
  11095.     indicate to the calling routine that the program has ended abnormally, and 
  11096.     control returns to the calling routine.) 
  11097.  2. If no halt indicators are on, the LR indicator is checked. If LR is on, the 
  11098.     program ends normally. (Locked data area structures, arrays, and tables are 
  11099.     written, and external indicators are reset.) 
  11100.  3. If no halt indicator is on and LR is not on, the program returns to the 
  11101.     calling routine. Data is preserved for the next time the program is run. 
  11102.     Files and data areas are not written out. 
  11103.  
  11104.  
  11105. ΓòÉΓòÉΓòÉ 1.10.20.71. ROLBK (Roll Back) ΓòÉΓòÉΓòÉ
  11106.  
  11107. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11108. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  11109. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  11110. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11111. Γöé ROLBK   Γöé               Γöé                 Γöé          Γöé  _ ER _ Γöé
  11112. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11113.  
  11114. The ROLBK operation: 
  11115.  
  11116.  Eliminates all the changes to your files that have been specified in output 
  11117.   operations since the previous COMIT or ROLBK operation (or since the 
  11118.   beginning of operations under commitment control if there has been no 
  11119.   previous COMIT or ROLBK operation). 
  11120.  Releases all the record locks for the files you have under commitment 
  11121.   control. 
  11122.  Repositions the file to its position at the time of the previous COMIT 
  11123.   operation (or at the time of the file OPEN, if there has been no previous 
  11124.   COMIT operation.) 
  11125.  
  11126. The file changes and the record-lock releases apply to all the files under 
  11127. commitment control in your routing step, whether the changes have been 
  11128. requested by the program issuing the ROLBK operation or by another program in 
  11129. the same routing step. The program issuing the ROLBK operation does not need to 
  11130. have any files under commitment control. For example, suppose program A calls 
  11131. program B and program C. Program B has files under commitment control, and 
  11132. program C does not. A ROLBK operation in program C still affects the files 
  11133. changed by program B. 
  11134.  
  11135. The optional indicator in positions 56 and 57 is set on if the operation is not 
  11136. successfully completed. 
  11137.  
  11138.  
  11139. ΓòÉΓòÉΓòÉ 1.10.20.72. SCAN (Scan Character String) ΓòÉΓòÉΓòÉ
  11140.  
  11141. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11142. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  11143. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  11144. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11145. Γöé SCAN    Γöé Comparator    Γöé Base            Γöé Left-    Γöé _ ER FD Γöé
  11146. Γöé         Γöé string:length Γöé string:start    Γöé most     Γöé         Γöé
  11147. Γöé         Γöé               Γöé                 Γöé position Γöé         Γöé
  11148. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11149.  
  11150. The SCAN operation scans a character string (base string) contained in factor 2 
  11151. for a substring (compare string) contained in factor 1. The scan begins at a 
  11152. specified location contained in factor 2 and continues for the length of the 
  11153. compare string which is specified in factor 1. 
  11154.  
  11155. Factor 1 must contain either the compare string or the compare string, followed 
  11156. by a colon, followed by the length. The compare string portion of factor 1 must 
  11157. be character, and can contain one of:  a field name, array element, named 
  11158. constant, data structure name, literal, or table name. The length portion must 
  11159. be numeric with no decimal positions and can contain one of: a named constant, 
  11160. array element, field name, literal, or table name.  If no length is specified, 
  11161. it is that of the compare string. 
  11162.  
  11163. Factor 2 must contain either the base string or the base string, followed by a 
  11164. colon, followed by the start location of the SCAN. The base string portion of 
  11165. factor 2 must be character, and can contain one of: a field name, array 
  11166. element, named constant, data structure name, literal, or table name.  The 
  11167. start location portion of factor 2 must be numeric with no decimal positions 
  11168. and can be a named constant, array element, field name, literal, or table name. 
  11169. If no start location is specified, a value of 1 is used. 
  11170.  
  11171. The result field contains the numeric value of the leftmost position of the 
  11172. compare string in the base string, if found.  It must be numeric with no 
  11173. decimal positions and can contain one of:  a field name, array element, array 
  11174. name, or table name.  If no result field is specified, a resulting indicator in 
  11175. positions 58 and 59 must be specified. The result field is set to 0 if the 
  11176. string is not found. If the result field contains an array, each occurrence of 
  11177. the compare string is placed in the array with the leftmost occurrence in 
  11178. element 1. The array elements following the element containing the rightmost 
  11179. occurrence are all zero. The result array should be as large as the character 
  11180. field length of the base string specified in factor 2. 
  11181.  
  11182. Note:   The strings are indexed from position 1. If the start position is 
  11183. greater than 1, the result field contains the position of the compare string 
  11184. relative to the beginning of the source string, not relative to the start 
  11185. position. Figurative constants cannot be used in the factor 1, factor 2, or 
  11186. result fields. No overlapping within data structures is allowed for factor 1 
  11187. and the result field or factor 2 and the result field. 
  11188.  
  11189. A resulting indicator in positions 58 and 59 can be specified to be set on if 
  11190. the string being scanned for is found.  A resulting indicator in positions 56 
  11191. and 57 can be specified to be set on if there is an error during the SCAN 
  11192. operation. An error occurs if the start position is greater than the length of 
  11193. factor 2 or if the value of factor 1 is too large. If no error indicator is 
  11194. specified and an error condition occurs, *PSSR, the error/exception handling 
  11195. subroutine runs (if it is specified in the program). If it is not specified, an 
  11196. error message is issued. 
  11197.  
  11198. The SCAN begins at the leftmost character of factor 2 (as specified by the 
  11199. start location) and continues character by character, from left to right, 
  11200. comparing the characters in factor 2 to those in factor 1.  If the result field 
  11201. is not an array, the SCAN operation will locate only the first occurrence of 
  11202. the compare string. To continue scanning beyond the first occurrence, use the 
  11203. result field from the previous SCAN operation to calculate the starting 
  11204. position of the next SCAN. If the result field is a numeric array, as many 
  11205. occurrences as there are elements in the array are noted.  If no occurrences 
  11206. are found, the result field is set to zero; if the result field is an array, 
  11207. all its elements are set to zero. 
  11208.  
  11209. Leading, trailing, or embedded blanks specified in the compare string are 
  11210. included in the SCAN operation. 
  11211.  
  11212. The SCAN operation is case-sensitive.  A compare string specified in lowercase 
  11213. will not be found in a base string specified in uppercase. 
  11214.  
  11215. Figure "SCAN Operation" shows examples of the SCAN operation. 
  11216.  
  11217.  
  11218. ΓòÉΓòÉΓòÉ 1.10.20.72.1. SCAN Examples ΓòÉΓòÉΓòÉ
  11219.  
  11220. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  11221. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  11222. C*
  11223. C* The SCAN operation finds the substring 'ABC' starting in
  11224. C* position 3 in factor 2;  3 is placed in the result field.
  11225. C* Indicator 90 is set on because the string is found.  Because
  11226. C* no starting position is specified, the default of 1 is used.
  11227. C           'ABC'     SCAN 'XCABCD'  RESULT         90
  11228. C*
  11229. C* This SCAN operation scans the string in factor 2 for an
  11230. C* occurrence of the string in factor 1 starting at position 3.
  11231. C* The operation places the values 5 and 6 in the first and
  11232. C* second elements of the array.  Indicator 90 is set on.
  11233. C                     MOVE 'ARRAYY'  FIELD1   6
  11234. C                     MOVE 'Y'       FIELD2   1
  11235. C           FIELD2    SCAN FIELD1:3  ARRAY          90
  11236. C*
  11237. C* This SCAN operation scans the string in factor 2, starting
  11238. C* at position 2, for an occurrence of the string in factor 1
  11239. C* for a length of 4.  Because 'TOOL' is not found in FIELD1,
  11240. C* INT is set to zero and indicator 90 is set off.
  11241. C                     MOVE 'TESTING' FIELD1   7
  11242. C                     Z-ADD2         X        10
  11243. C                     MOVEL'TOOL'    FIELD2   5
  11244. C           FIELD2:4  SCAN FIELD1:X  INT      20    90
  11245. C*
  11246.  
  11247. SCAN Operation 
  11248.  
  11249.  
  11250. ΓòÉΓòÉΓòÉ 1.10.20.73. SELEC (Begin a Select Group) ΓòÉΓòÉΓòÉ
  11251.  
  11252. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11253. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  11254. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  11255. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11256. Γöé SELEC   Γöé               Γöé                 Γöé          Γöé         Γöé
  11257. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11258.  
  11259. The select group conditionally processes one of several alternative sequences 
  11260. of operations.  It consists of: 
  11261.  
  11262.  A SELEC statement 
  11263.  Zero or more WHxx groups 
  11264.  An optional OTHER group 
  11265.  ENDSL or END statement. 
  11266.  
  11267. After the SELEC operation, control passes to the statement following the first 
  11268. WHxx condition that is satisfied. All statements are then executed until the 
  11269. next WHxx operation.  Control passes to the ENDSL statement (only one WHxx is 
  11270. executed). If no WHxx condition is satisfied and an OTHER operation is 
  11271. specified, control passes to the statement following the OTHER operation. If no 
  11272. WHxx condition is satisfied and no OTHER operation is specified, control 
  11273. transfers to the statement following the ENDSL operation of the select group. 
  11274.  
  11275. Conditioning indicators can be used on the SELEC operation. If they are not 
  11276. satisfied, control passes immediately to the statement following the ENDSL 
  11277. operation of the select group. 
  11278.  
  11279. The select group can be specified anywhere in calculations.  It can be nested 
  11280. within IF, DO, or other select groups. The IF and DO groups can be nested 
  11281. within select groups. 
  11282.  
  11283. If a SELEC operation is specified inside a select group, the WHxx and OTHER 
  11284. operations apply to the new select group until an ENDSL is specified. 
  11285.  
  11286. Figure "SELEC Operation" shows an example of the SELEC operation. 
  11287.  
  11288.  
  11289. ΓòÉΓòÉΓòÉ 1.10.20.73.1. SELEC Example ΓòÉΓòÉΓòÉ
  11290.  
  11291. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  11292. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  11293. C*
  11294. C* In the following example, if X equals 1, do the operations in
  11295. C* sequence 1 (note that no END operation is needed before the
  11296. C* next WHxx); if X does NOT equal 1, and if Y=2 and X<10, do the
  11297. C* operations in sequence 2.  If neither condition is true, do
  11298. C* the operations in sequence 3.
  11299. C*
  11300. C                     SELEC
  11301. C           X         WHEQ 1
  11302. C                     Z-ADDA         B
  11303. C                     MOVE C         D
  11304. C                      :                               seq 1
  11305. C           Y         WHEQ 2
  11306. C           X         ANDLT10
  11307. C                      :                               seq 2
  11308. C                     OTHER
  11309. C                      :                               seq 3
  11310. C                     ENDSL
  11311. C*
  11312. C* The following example shows a select group with conditioning
  11313. C* indicators.  After the CHAIN operation, if indicator 10 is on,
  11314. C* then control passes to the ADD operation.  If indicator 10 is
  11315. C* off, then the select group is processed.
  11316. C*
  11317. C           KEY       CHAINFILE                     10
  11318. C  N10                SELEC
  11319. C           X         WHEQ 1
  11320. C                      :                              seq 1
  11321. C           Y         WHEQ 2
  11322. C                      :                              seq 2
  11323. C                     ENDSL
  11324. C                     ADD  1         N
  11325.  
  11326. SELEC Operation 
  11327.  
  11328.  
  11329. ΓòÉΓòÉΓòÉ 1.10.20.74. SETGT (Set Greater Than) ΓòÉΓòÉΓòÉ
  11330.  
  11331. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11332. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  11333. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  11334. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11335. Γöé SETGT   Γöé Search argu-  Γöé File name       Γöé          Γöé NR ER _ Γöé
  11336. Γöé         Γöé ment          Γöé                 Γöé          Γöé         Γöé
  11337. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11338.  
  11339. The SETGT operation positions a file at the next record with a key or relative 
  11340. record number that is greater than the key or relative record number specified 
  11341. in factor 1. The file must be a full procedural file (identified by an F in 
  11342. position 16 of the file description specifications). 
  11343.  
  11344. Factor 1 is required.  If the file is accessed by key, factor 1 can be a field 
  11345. name, a named constant, a figurative constant, or a literal that is used as the 
  11346. search argument in positioning a file. You can also specify a KLIST (Define a 
  11347. Composite Key) name in factor 1 for an externally described file that is 
  11348. positioned by key. If the file is accessed by relative record number, factor 1 
  11349. must be an integer literal, named constant, or field. 
  11350.  
  11351. Factor 2 is required and must be either a file name or, in the OS/400 system, a 
  11352. record format name. A record format name in factor 2 is allowed only with an 
  11353. externally described file. 
  11354.  
  11355. You can specify a resulting indicator in positions 54 and 55 to be set on if no 
  11356. record is found with a key or relative record number that is greater than the 
  11357. search argument specified in factor 1. You can specify any valid resulting 
  11358. indicator in positions 56 and 57 to be set on if an error occurs during 
  11359. processing of the operation. 
  11360.  
  11361. If the SETGT operation is not successful (no-record-found condition), the file 
  11362. is positioned to the end of the file. 
  11363.  
  11364. Figurative constants can also be used to position the file.  When used with a 
  11365. file with a composite key, figurative constants are treated as though each 
  11366. field of the key contained the figurative constant value. In most cases, *LOVAL 
  11367. positions the file so that the first read retrieves the record with the lowest 
  11368. key. In most cases, *HIVAL positions the file so that a READ receives an 
  11369. end-of-file indication; a subsequent READP retrieves the last record in the 
  11370. file.  However, note the following cases for using *LOVAL and *HIVAL with 
  11371. numeric keys: 
  11372.  
  11373.  With an externally described file that has a key in descending order, *HIVAL 
  11374.   positions the file so that the first read operation retrieves the first 
  11375.   record in the file (the record with the highest key), and *LOVAL positions 
  11376.   the file so that a READP operation retrieves the last record in the file (the 
  11377.   record with the lowest key). 
  11378.  If a record is added or a key field is altered after a SETGT operation with 
  11379.   either *LOVAL or *HIVAL, the file may no longer be positioned to the record 
  11380.   with the lowest or highest key. 
  11381.  *LOVAL represents a key value X'99...9D' and *HIVAL represents a key value 
  11382.   X'99...9F'. When a program described file has a packed decimal key specified 
  11383.   in the file specifications but the actual file key field contains character 
  11384.   data, records may have keys that are less than *LOVAL or greater than *HIVAL. 
  11385.   When a key field contains unsigned binary data, *LOVAL may not be the lowest 
  11386.   key. 
  11387.  
  11388. Following the SETGT operation, a file is positioned so that it is immediately 
  11389. before the first record whose key or relative record number is greater than the 
  11390. search argument specified in factor 1.  You retrieve this record by reading the 
  11391. file.  Before you read the file, however, records may be deleted from the file 
  11392. by another job or through another file in your job. Thus, you may not get the 
  11393. record you expected. For information on preventing unexpected modification of 
  11394. your files, see the discussion of allocating objects in the Programming: 
  11395. Control Language Reference. 
  11396.  
  11397. Figure "SETGT Operation" illustrates the SETGT operation. 
  11398.  
  11399.  
  11400. ΓòÉΓòÉΓòÉ 1.10.20.74.1. SETGT Example ΓòÉΓòÉΓòÉ
  11401.  
  11402.  
  11403. SETGT Operation
  11404.  
  11405. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  11406. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  11407. C*  This example shows how to position the file so READ will read
  11408. C*  the next record. The search argument, KEY, specified for the
  11409. C*  SETGT operation has a value of 98; therefore, SETGT positions
  11410. C*  the file before the first record of file format FILEA that
  11411. C*  has a key field value greater than 98.  The file is positioned
  11412. C*  before the first record with a key value of 100.  The READ
  11413. C*  operation reads the record that has a value of 100 in its key
  11414. C*  field.
  11415. C           KEY       SETGTFILEA                      GREATER THAN
  11416. C                     READ FILEA                    64READ NEXT
  11417. C*
  11418. C*
  11419. C*  This example shows how to read the last record of a group of
  11420. C*  records with the same key value and format from a program
  11421. C*  described file.  The search argument, KEY, specified for the
  11422. C*  SETGT operation positions the file before the first record of
  11423. C*  file FILEB that has a key field value greater than 70.
  11424. C*  The file is positioned before the first record with a key
  11425. C*  value  of 80.  The READP operation reads the last record that
  11426. C*  has a value of 70 in its key field.
  11427. C           KEY       SETGTFILEB                      GREATER THAN
  11428. C                     READPFILEB                    64READ LAST
  11429.  
  11430.               Key Field                         Key Field
  11431.                Values                            Values
  11432.           ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ                  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11433.           Γöé       97      Γöé                  Γöé      50       Γöé
  11434.           Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ                  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11435.           Γöé       97      Γöé                  Γöé      60       Γöé
  11436.           Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ                  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11437.           Γöé       97      Γöé                  Γöé      70       Γöé
  11438.           Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ                  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11439.           Γöé       97      Γöé        (READP)ΓöÇΓöÇΓöé      70       Γöé
  11440.           Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñFILEA   (SETGT)ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñFILEB
  11441.           Γöé       98      Γöé                  Γöé      80       Γöé
  11442. (SETGT)ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ                  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11443. (READ)ΓöÇΓöÇΓöÇΓöé      100      Γöé                  Γöé      80       Γöé
  11444.           ΓöéΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ                  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11445.           Γöé      100      Γöé                  Γöé      80       Γöé
  11446.           Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ                  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11447.           Γöé      100      Γöé                  Γöé      90       Γöé
  11448.           Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ                  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11449.           Γöé      101      Γöé                  Γöé      90       Γöé
  11450.           Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ                  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11451.           Γöé      101      Γöé                  Γöé      91       Γöé
  11452.           ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ                  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11453.  
  11454. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  11455. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  11456. C*
  11457. C*  This example shows the use of *LOVAL.  The SETGT operation
  11458. C*  positions the file before the first record of a file in
  11459. C*  ascending order.  The READ operation reads the first record
  11460. C*  (key value 97).
  11461. C           *LOVAL    SETGTRECDA                      GREATER THAN
  11462. C                     READ RECDA                    64READ NEXT
  11463. C*
  11464. C*
  11465. C*  This example shows the use of *HIVAL.  The SETGT operation
  11466. C*  positions the file after the last record of a file in ascending
  11467. C*  order. The READP operation reads the last record (key value 91).
  11468. C           *HIVAL    SETGTRECDB                      GREATER THAN
  11469. C                     READPRECDB                    64READ LAST
  11470.  
  11471.                Key Field                       Key Field
  11472.                 Values                          Values
  11473. (SETGT)ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ               ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11474.  (READ)ΓöÇΓöÇΓöÇΓöÇ       97      Γöé               Γöé      50       Γöé
  11475.            ΓöéΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ               Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11476.            Γöé       97      Γöé               Γöé      60       Γöé
  11477.            Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ               Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11478.            Γöé       97      Γöé               Γöé      70       Γöé
  11479.            Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ               Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11480.            Γöé       97      Γöé               Γöé      70       Γöé
  11481.            Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñRECDA          Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñRECDB
  11482.            Γöé       98      Γöé Record        Γöé      80       Γöé Record
  11483.            Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ Format        Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ Format
  11484.            Γöé      100      Γöé               Γöé      80       Γöé
  11485.            Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ               Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11486.            Γöé      100      Γöé               Γöé      80       Γöé
  11487.            Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ               Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11488.            Γöé      100      Γöé               Γöé      90       Γöé
  11489.            Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ               Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11490.            Γöé      101      Γöé               Γöé      90       Γöé
  11491.            Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ               Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11492.            Γöé      101      Γöé    (READP)ΓöÇΓöÇΓöÇΓöÇ      91       Γöé
  11493.            ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    (SETGT)ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11494.  
  11495.  
  11496. ΓòÉΓòÉΓòÉ 1.10.20.75. SETLL (Set Lower Limit) ΓòÉΓòÉΓòÉ
  11497.  
  11498. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11499. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  11500. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  11501. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11502. Γöé SETLL   Γöé Search argu-  Γöé File name       Γöé          Γöé  NR ER  Γöé
  11503. Γöé         Γöé ment          Γöé                 Γöé          Γöé    EQ   Γöé
  11504. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11505.  
  11506. The SETLL operation positions a file at the next record that has a key or 
  11507. relative record number that is greater than or equal to the search argument 
  11508. (key or relative record number) specified in factor 1. The file must be a full 
  11509. procedural file (identified by an F in position 16 of the file description 
  11510. specifications). 
  11511.  
  11512. Factor 1 is required.  If the file is accessed by key, factor 1 can be a field 
  11513. name, a named constant, a figurative constant, or a literal that is used as the 
  11514. search argument in positioning the file. You can also specify a KLIST name in 
  11515. factor 1 for an externally described file that is positioned by key. If the 
  11516. file is accessed by relative record number, factor 1 must contain an integer 
  11517. literal, named constant, or numeric field with no decimal positions. 
  11518.  
  11519. Factor 2 is required and can contain either a file name or a record format 
  11520. name. A record format name in factor 2 is allowed only with an externally 
  11521. described file. 
  11522.  
  11523. The resulting indicators reflect the status of the operation.  If an indicator 
  11524. is specified in positions 54 and 55, it is set on when the search argument is 
  11525. greater than the highest key or relative record number in the file.  If an 
  11526. indicator is specified in positions 56 and 57, it is set on when an error 
  11527. occurs during running of the operation. If an indicator is specified in 
  11528. positions 58 and 59, it is set on when a record is present whose key or 
  11529. relative record number is equal to the search argument. 
  11530.  
  11531. If factor 2 contains a file name for which the lower limit is to be set, the 
  11532. file is positioned at the first record with a key or relative record number 
  11533. equal to or greater than the search argument specified in factor 1. 
  11534.  
  11535. If factor 2 contains a record format name for which the lower limit is to be 
  11536. set, the file is positioned at the first record of the specified type that has 
  11537. a key equal to or greater than the search argument specified in factor 1. 
  11538.  
  11539. Figurative constants can be used to position the file.  When used with a file 
  11540. with a composite key, figurative constants are treated as though each field of 
  11541. the key contained the figurative constant value. In most cases, *LOVAL 
  11542. positions the file so that the first read retrieves the record with the lowest 
  11543. key.  In most cases, *HIVAL positions the file so that a READP retrieves the 
  11544. last record in the file, or a READ receives an end-of-file indication. 
  11545. However, note the following cases for using *LOVAL and *HIVAL with numeric 
  11546. keys: 
  11547.  
  11548.  With an externally described file that has a key in descending order, *HIVAL 
  11549.   positions the file so that the first read operation retrieves the first 
  11550.   record in the file (the record with the highest key), and *LOVAL positions 
  11551.   the file so that a READP operation retrieves the last record in the file (the 
  11552.   record with the lowest key). 
  11553.  If a record is added or a key field altered after a SETLL operation with 
  11554.   either *LOVAL or *HIVAL, the file may no longer be positioned to the record 
  11555.   with the lowest or highest key. 
  11556.  *LOVAL represents a key value X'99...9D' and *HIVAL represents a key value 
  11557.   X'99...9F'. When a program described file has a packed decimal key specified 
  11558.   in the file specifications but the actual file key field contains character 
  11559.   data, records may have keys that are less than *LOVAL or greater than *HIVAL. 
  11560.   When a key field contains unsigned binary data, *LOVAL may not be the lowest 
  11561.   key. 
  11562.  
  11563. Figure "SETGT Operation" shows the use of figurative constants with the SETGT 
  11564. operation.  Figurative constants are used the same way with the SETLL 
  11565. operation. 
  11566.  
  11567. Remember the following when using the SETLL operation: 
  11568.  
  11569.  If the SETLL operation is not successful (no records found condition), the 
  11570.   file is positioned to the end of the file. 
  11571.  When end of file is reached on a file being processed by SETLL, another SETLL 
  11572.   can be issued to reposition the file. 
  11573.  After a SETLL operation successfully positions the file at a record, you 
  11574.   retrieve this record by reading the file.  Before you read the file, however, 
  11575.   records may be deleted from the file by another job or through another file 
  11576.   in your job.  Thus, you may not get the record you expected. Even if the 
  11577.   resulting indicator in positions 58 and 59 is set on to indicate you found a 
  11578.   matching record, you may not get that record. 
  11579.  SETLL does not cause the system to access a data record. If you are only 
  11580.   interested in verifying that a key actually exists, SETLL with an equal 
  11581.   indicator (positions 58-59) is a better performing solution than the CHAIN 
  11582.   operation in most cases.  Under special cases of a multiple format logical 
  11583.   file with sparse keys, CHAIN can be a faster solution than SETLL. 
  11584.  
  11585. Figure "SETLL Operation" illustrates the SETLL operation. 
  11586.  
  11587.  
  11588. ΓòÉΓòÉΓòÉ 1.10.20.75.1. SETLL Example ΓòÉΓòÉΓòÉ
  11589.  
  11590. In this example, the file ORDFIL contains order records. The key field is the 
  11591. order number (ORDER) field. There are multiple records for each order. ORDFIL 
  11592. looks like this in the calculation specifications: 
  11593.  
  11594.  
  11595. SETLL Operation
  11596.  
  11597. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  11598. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  11599. C*
  11600. C*  All the 101 records in ORDFIL are to be printed.  The value 101
  11601. C*  has previously been placed in ORDER.  The SETLL operation
  11602. C*  positions the file at the first 101 record.  Because there are
  11603. C*  101 records, indicator 55 is set on and the GOTO operation is
  11604. C*  not processed.
  11605. C           ORDER     SETLLORDFIL                   55 101 PRESNT
  11606. C  N55                GOTO NOTFND
  11607. C           LOOP      TAG
  11608. C*  The READE operation reads the first 101 record.  Because
  11609. C*  indicator 56 is not on, the lines conditioned by N56 are
  11610. C*  processed.
  11611. C           ORDER     READEORDFIL                   56 END OF GRP
  11612. C*  The EXCPT operation is processed, and the program branches to the
  11613. C*  label specified in the GOTO operation.
  11614. C  N56                EXCPTDETAIL                     PRINT A LINE
  11615. C  N56                GOTO LOOP
  11616. C*  The READE operation reads the second, third, and fourth 101
  11617. C*  records in the same manner as the first 101 record was read.
  11618. C*  After the fourth 101 record is read, the READE operation is
  11619. C*  attempted.  Because the 102 record is not of the same group,
  11620. C*  indicator 56 is set on and the two following operations are
  11621. C*  bypassed.
  11622. C           NOTFND    TAG
  11623.  
  11624.                                 ORDFIL
  11625.  
  11626.                         ORDER          Other Fields
  11627.                         ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11628.                         Γöé100    Γöé    1st record of 100Γöé
  11629.                         ΓöéΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11630.                         Γöé100    Γöé    2nd record of 100Γöé
  11631.                         ΓöéΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11632.                         Γöé100    Γöé    3rd record of 100Γöé
  11633.              (SETLL)ΓöÇΓöÇΓöÇΓöéΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11634.                         Γöé101    Γöé    1st record of 101Γöé
  11635.                         ΓöéΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11636.                         Γöé101    Γöé    2nd record of 101Γöé
  11637.                         ΓöéΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11638.                         Γöé101    Γöé    3rd record of 101Γöé
  11639.                         ΓöéΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11640.                         Γöé101    Γöé    4th record of 101Γöé
  11641.                         ΓöéΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11642.                         Γöé102    Γöé    1st record of 102Γöé
  11643.                         ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11644.  
  11645.  
  11646. ΓòÉΓòÉΓòÉ 1.10.20.76. SETOF (Set Off) ΓòÉΓòÉΓòÉ
  11647.  
  11648. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11649. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  11650. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  11651. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11652. Γöé SETOF   Γöé               Γöé                 Γöé          Γöé  OF OF  Γöé
  11653. Γöé         Γöé               Γöé                 Γöé          Γöé    OF   Γöé
  11654. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11655.  
  11656. The SETOF operation sets off any indicators specified in positions 54 through 
  11657. 59. You must specify at least one resulting indicator in positions 54 through 
  11658. 59. Entries of 1P and MR are not valid.  Setting off L1 through L9 indicators 
  11659. does not automatically set off any lower control-level indicators. 
  11660.  
  11661. Figure "SETON and SETOF Operations" illustrates the SETOF operation. 
  11662.  
  11663.  
  11664. ΓòÉΓòÉΓòÉ 1.10.20.77. SETON (Set On) ΓòÉΓòÉΓòÉ
  11665.  
  11666. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11667. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  11668. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  11669. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11670. Γöé SETON   Γöé               Γöé                 Γöé          Γöé  ON ON  Γöé
  11671. Γöé         Γöé               Γöé                 Γöé          Γöé    ON   Γöé
  11672. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11673.  
  11674. The SETON operation sets on any indicators specified in positions 54 through 
  11675. 59. You must specify at least one resulting indicator in positions 54 through 
  11676. 59. Entries of 1P, MR, KA through KN, and KP through KY are not valid. Setting 
  11677. on L1 through L9 indicators does not automatically set on any lower 
  11678. control-level indicators. 
  11679.  
  11680. Figure "SETON and SETOF Operations" illustrates the SETON operation. 
  11681.  
  11682.  
  11683. ΓòÉΓòÉΓòÉ 1.10.20.77.1. SETON and SETOF Operations Example ΓòÉΓòÉΓòÉ
  11684.  
  11685.  
  11686. SETON and SETOF Operations
  11687.  
  11688. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  11689. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  11690. C*
  11691. C*  The SETON and SETOF operations set from one to three indicators
  11692. C*  specified in positions 54 through 59 on and off.
  11693. C*  The SETON operation sets indicator 17 on.
  11694. C                     SETON                     17
  11695. C*  The SETON operation sets indicators 17 and 18 on.
  11696. C                     SETON                     1718
  11697. C*  The SETOF operation sets indicator 21 off.
  11698. C                     SETOF                     21
  11699.  
  11700.  
  11701. ΓòÉΓòÉΓòÉ 1.10.20.78. SHTDN (Shut Down) ΓòÉΓòÉΓòÉ
  11702.  
  11703. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11704. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  11705. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  11706. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11707. Γöé SHTDN   Γöé               Γöé                 Γöé          Γöé  ON _ _ Γöé
  11708. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11709.  
  11710. The SHTDN operation allows the programmer to determine whether the system 
  11711. operator has requested shutdown.  If the system operator has requested 
  11712. shutdown, the resulting indicator specified in positions 54 and 55 is set on. 
  11713. Positions 54 and 55 must contain one of the following indicators: 01 through 
  11714. 99, L1 through L9, U1 through U8, H1 through H9, LR, or RT. 
  11715.  
  11716. The system operator can request shutdown by specifying the *CNTRLD option on 
  11717. the following CL commands: ENDJOB (End Job), PWRDWNSYS (Power Down System), 
  11718. ENDSYS (End System), and ENDSBS (End Subsystem). 
  11719.  
  11720. Positions 56 through 59 must be blank. 
  11721.  
  11722. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  11723. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  11724. C*
  11725. C*  When the SHTDN operation is run, a test is made to determine
  11726. C*  whether the system operator has requested shutdown.  If so,
  11727. C*  indicator 27 is set on and the GOTO END operation is processed.
  11728. C                     SHTDN                     27
  11729. C   27                GOTO END
  11730.  
  11731. SHTDN Operation 
  11732.  
  11733.  
  11734. ΓòÉΓòÉΓòÉ 1.10.20.79. SORTA (Sort an Array) ΓòÉΓòÉΓòÉ
  11735.  
  11736. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11737. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  11738. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  11739. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11740. Γöé SORTA   Γöé               Γöé Array name      Γöé          Γöé         Γöé
  11741. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11742.  
  11743. Factor 2 contains the name of an array to be sorted.  The array is sorted into 
  11744. sequence (ascending or descending), depending on the sequence specified for the 
  11745. array in position 45 of the extension specifications.  If no sequence is 
  11746. specified, the array is sorted into ascending sequence.  The array *IN cannot 
  11747. be specified in factor 2 of a SORTA operation. A related array, such as a 
  11748. second array defined on the same extension specification, is not sorted. Only 
  11749. the array specified in factor 2 is sorted. 
  11750.  
  11751. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  11752. E....FromfileTofile++Name++N/rN/tbLenPDSArrnamLenPDSComments
  11753. E                    ARRY        8  1  A
  11754. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  11755. C*  The SORTA operation sorts ARRY into ascending sequence because A
  11756. C*  is specified in position 45 of the extension specifications.
  11757. C*  If the nonsorted ARRY contents were GT1BA2L0, the sorted ARRY
  11758. C*  contents would be ABGLT012.
  11759. C*
  11760. C                     SORTAARRY
  11761.  
  11762. SORTA Operation 
  11763.  
  11764.  
  11765. ΓòÉΓòÉΓòÉ 1.10.20.80. SQRT (Square Root) ΓòÉΓòÉΓòÉ
  11766.  
  11767. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11768. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  11769. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  11770. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11771. Γöé SQRT    Γöé               Γöé Value           Γöé Root     Γöé         Γöé
  11772. Γöé (1/2)   Γöé               Γöé                 Γöé          Γöé         Γöé
  11773. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11774.  
  11775. The SQRT operation derives the square root of the field named in factor 2.  The 
  11776. square root of factor 2 is placed in the result field. 
  11777.  
  11778. Factor 2 must be numeric, and can contain one of: an array, array element, 
  11779. field, figurative constant, literal, named constant, subfield, or table name. 
  11780.  
  11781. The result field must be numeric, and can contain one of: an array, array 
  11782. element, subfield, or table element. 
  11783.  
  11784. An entire array can be used in a SQRT operation if factor 2 and the result 
  11785. field contain array names. 
  11786.  
  11787. The number of decimal positions in the result field can be either less than or 
  11788. greater than the number of decimal positions in factor 2. However, the result 
  11789. field should not have fewer than half the number of decimal positions in factor 
  11790. 2. 
  11791.  
  11792. If the value of the factor 2 field is zero, the result field value is also 
  11793. zero.  If the value of the factor 2 field is negative, the RPG/400 
  11794. exception/error handling routine receives control. 
  11795.  
  11796. For further rules on the SQRT operation, see Arithmetic Operations. 
  11797.  
  11798. See Figure "Summary of Arithmetic Operations" for an example of the SQRT 
  11799. operation. 
  11800.  
  11801.  
  11802. ΓòÉΓòÉΓòÉ 1.10.20.81. SUB (Subtract) ΓòÉΓòÉΓòÉ
  11803.  
  11804. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11805. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  11806. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  11807. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11808. Γöé SUB(1/2)Γöé Minuend       Γöé Subtrahend      Γöé Differ-  Γöé  + - Z  Γöé
  11809. Γöé         Γöé               Γöé                 Γöé ence     Γöé         Γöé
  11810. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11811.  
  11812. If factor 1 is specified, factor 2 is subtracted from factor 1 and the 
  11813. difference is placed in the result field.  If factor 1 is not specified, the 
  11814. contents of factor 2 are subtracted from the contents of the result field. 
  11815.  
  11816. Factor 1 and factor 2 must be numeric, and each can contain one of:  an array, 
  11817. array element, field, figurative constant, literal, named constant, subfield, 
  11818. or table name. 
  11819.  
  11820. The result field must be numeric, and can contain one of: an array, array 
  11821. element, subfield, or table name. 
  11822.  
  11823. For rules for the SUB operation, see Arithmetic Operations. 
  11824.  
  11825. See Figure "Summary of Arithmetic Operations" for examples of the SUB 
  11826. operation. 
  11827.  
  11828.  
  11829. ΓòÉΓòÉΓòÉ 1.10.20.82. SUBST (Substring) ΓòÉΓòÉΓòÉ
  11830.  
  11831. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11832. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  11833. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  11834. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11835. Γöé SUBST   Γöé Length to     Γöé Base            Γöé Target   Γöé  _ ER _ Γöé
  11836. Γöé (P)     Γöé extract       Γöé string:start    Γöé string   Γöé         Γöé
  11837. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11838.  
  11839. The SUBST operation returns a substring from factor 2, starting at the location 
  11840. specified in factor 2 for the length specified in factor 1, and places this 
  11841. substring in the result field. If factor 1 is not specified, the length of the 
  11842. string from the start position is used. 
  11843.  
  11844. Factor 1 can contain the length value of the string to be extracted from the 
  11845. string specified in factor 2. It must be numeric with no decimal positions and 
  11846. can contain one of:  a field name, array element, table name, literal, or named 
  11847. constant. 
  11848.  
  11849. Factor 2 must contain either the base character string, or the base character 
  11850. string followed by ':', followed by the start location. The base string portion 
  11851. must be character, and can contain one of: a field name, array element, named 
  11852. constant, data structure name, table name, or literal. The start position must 
  11853. be numeric with zero decimal positions, and can contain one of the following: 
  11854. a field name, array element, table name, literal or named constant. If it is 
  11855. not specified, SUBST starts in position 1 of the base string. 
  11856.  
  11857. The start location and the length of the substring to be extracted must be 
  11858. positive integers. The start location must not be greater than the length of 
  11859. the base string, and the length must not be greater than the length of the base 
  11860. string from the start location. If either or both of these conditions is not 
  11861. satisfied, the operation will not be performed, and if you specified an error 
  11862. indicator in positions 56 and 57 it will be set on. If you did not specify an 
  11863. error indicator, the exception/error handling routine receives control. 
  11864.  
  11865. The result field must be character, and can contain one of the following:  a 
  11866. field name, array element, data structure, or table name. The substring is 
  11867. left-justified, and its length should be at least as large as the length 
  11868. specified in factor 1. If the substring is longer than the field specified in 
  11869. the result field, the substring will be truncated from the right. 
  11870.  
  11871. Note:   You cannot use figurative constants in the factor 1, factor 2, or 
  11872. result fields.  No overlapping is allowed for factor 1 and the result field or 
  11873. factor 2 and the result field. 
  11874.  
  11875. If factor 1 is shorter than the length of the result field, a P specified in 
  11876. the operation extender position (position 53) indicates that the result field 
  11877. should be padded on the right with blanks after the substring occurs. 
  11878.  
  11879. Figure "SUBST Operation" shows examples of the SUBST operation. 
  11880.  
  11881.  
  11882. ΓòÉΓòÉΓòÉ 1.10.20.82.1. SUBST Examples ΓòÉΓòÉΓòÉ
  11883.  
  11884. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  11885. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  11886. C*
  11887. C* The SUBST operation extracts the substring from factor 2 starting
  11888. C* at position 3 for a length of 2.  The value 'CD' is placed in the
  11889. C* result field RESULT.  Indicator 90 is not set on because no error
  11890. C* occurred.
  11891. C                     Z-ADD3         T       20
  11892. C                     MOVEL'ABCDEF'  STRING 10
  11893. C           2         SUBSTSTRING:T  RESULT       90
  11894. C*
  11895. C* In this SUBST operation, the length is greater than the length
  11896. C* of the string minus the start position plus 1.  As a result,
  11897. C* indicator 90 is set on and the result field is not changed.
  11898. C*
  11899. C                     MOVE 'ABCDEF'  STRING  6
  11900. C                     Z-ADD4         T       10
  11901. C           5         SUBSTSTRING:T  RESULT       90
  11902.  
  11903. C*
  11904. C* In this SUBST operation, 3 characters are substringed starting
  11905. C* at the fifth position of the base string.  Because P is not
  11906. C* specified in position 53, only the first 3 characters of RESULT
  11907. C* are changed.  RESULT contains '123XXXXX'.
  11908. C                     Z-ADD3         LENGTH  20
  11909. C                     Z-ADD5         T       20
  11910. C                     MOVE 'TEST123' STRING  8
  11911. C                     MOVE *ALL'X'   RESULT
  11912. C           LENGTH    SUBSTSTRING:T  RESULT  8    90
  11913. C*
  11914. C* This example is the same as the previous one except P is
  11915. C* specified in position 53, and the result is padded with blanks.
  11916. C* RESULT equals '123bbbbb'.
  11917. C                     Z-ADD3         LENGTH  20
  11918. C                     Z-ADD5         T       20
  11919. C                     MOVE 'TEST123' STRING  8
  11920. C                     MOVE *ALL'X'   RESULT
  11921. C           LENGTH    SUBSTSTRING:T  RESULT  8 P  90
  11922. C*
  11923. C* In the following example, CITY contains the string
  11924. C* 'Toronto, Ontario'.  The SCAN operation is used to locate the
  11925. C* separating blank, position 9 in this illustration.  SUBST
  11926. C* without factor 1 places the string starting at position 10 and
  11927. C* continuing for the length of the string in field TCNTRE.
  11928. C* TCNTRE contains 'Ontario'.
  11929. C           ' '       SCAN CITY      C
  11930. C                     ADD  1         C
  11931. C                     SUBSTCITY:C    TCNTRE
  11932. C*
  11933. C* Before the operations STRING='bbbJohnbbbbbb'.
  11934. C* RESULT is a 10 character field which contains 'ABCDEFGHIJ'.
  11935. C* The CHECK operation locates the first nonblank character
  11936. C* and sets on indicator 10 if such a character exists.  If *IN10
  11937. C* is on, the SUBST operation substrings STRING starting from the
  11938. C* 'J' to the end of STRING.  Padding is used to ensure that
  11939. C* nothing is left from the previous contents of the result
  11940. C* field.
  11941. C* After the operations RESULT='Johnbbbbbb'.
  11942. C*
  11943. C           ' '       CHECKSTRING    ST             10
  11944. C   10                SUBSTSTRING:ST RESULT    P
  11945.  
  11946.  
  11947.  
  11948.  
  11949. SUBST Operation 
  11950.  
  11951.  
  11952. ΓòÉΓòÉΓòÉ 1.10.20.83. TAG (Tag) ΓòÉΓòÉΓòÉ
  11953.  
  11954. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11955. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  11956. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  11957. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11958. Γöé TAG     Γöé Label         Γöé                 Γöé          Γöé         Γöé
  11959. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11960.  
  11961. The declarative TAG operation names the label that identifies the destination 
  11962. of a GOTO (Go To) or CABxx (Compare and Branch) operation. 
  11963.  
  11964. It can be specified anywhere within calculations, including within total 
  11965. calculations.  The control level entry (positions 7 and 8) can be blank or can 
  11966. contain an L1 through L9 indicator, the LR indicator, or the L0 entry to group 
  11967. the statement within the appropriate section of the program.  Conditioning 
  11968. indicator entries (positions 9 through 17) are not allowed. 
  11969.  
  11970. Factor 1 must contain the name of the destination of a GOTO or CABxx operation. 
  11971. This name must be a unique symbolic name, which is specified in factor 2 of a 
  11972. GOTO operation or in the result field of a CABxx operation. The name can be 
  11973. used as a common point for multiple GOTO or CABxx operations. 
  11974.  
  11975. Branching to the TAG from a different part of the RPG/400 logic cycle may 
  11976. result in an endless loop. For example, if a detail calculation line specifies 
  11977. a GOTO operation to a total calculation TAG operation, an endless loop may 
  11978. occur. 
  11979.  
  11980. See Figure "GOTO and TAG Operations" for examples of the TAG operation. 
  11981.  
  11982.  
  11983. ΓòÉΓòÉΓòÉ 1.10.20.84. TESTB (Test Bit) ΓòÉΓòÉΓòÉ
  11984.  
  11985. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11986. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  11987. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  11988. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11989. Γöé TESTB   Γöé               Γöé Bit numbers     Γöé Char-    Γöé  OF ON  Γöé
  11990. Γöé         Γöé               Γöé                 Γöé acter    Γöé    EQ   Γöé
  11991. Γöé         Γöé               Γöé                 Γöé field    Γöé         Γöé
  11992. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11993.  
  11994. The TESTB operation compares the bits identified in factor 2 with the 
  11995. corresponding bits in the field named as the result field.  The result field 
  11996. must be a one-position character field. Resulting indicators in positions 54 
  11997. through 59 reflect the status of the result field bits. Factor 2 is always a 
  11998. source of bits for the result field. 
  11999.  
  12000. Factor 2 can contain: 
  12001.  
  12002.  Bit numbers 0-7:  From 1 to 8 bits can be tested per operation.  The bits to 
  12003.   be tested are identified by the numbers 0 through 7. (0 is the leftmost bit.) 
  12004.   The bit numbers must be enclosed in apostrophes, and the entry must begin in 
  12005.   position 33.  For example, to test bits 0, 2, and 5, enter '025' in factor 2. 
  12006.  Field name:  You can specify the name of a one-position character field, 
  12007.   table name, or array element in factor 2. The bits that are on in the field, 
  12008.   table name, or array element are compared with the corresponding bits in the 
  12009.   result field; bits that are off are not affected.  The field specified in 
  12010.   factor 2 or in the result field can be an array element if each element of 
  12011.   the array is a one-position character field. 
  12012.  Hexadecimal literal or named constant: You can specify a 1-byte hexadecimal 
  12013.   literal or hexadecimal named constant. Bits that are on in factor 2 are 
  12014.   compared with the corresponding bits in the result field; bits that are off 
  12015.   are not considered. 
  12016.  
  12017. Figure "TESTB Operation" illustrates uses of the TESTB operation. 
  12018.  
  12019. Indicators assigned in positions 54 through 59 reflect the status of the result 
  12020. field bits. At least one indicator must be assigned, and as many as three can 
  12021. be assigned for one operation. For TESTB operations, the resulting indicators 
  12022. are set on as follows: 
  12023.  
  12024.  Positions 54 and 55:  An indicator in these positions is set on if the bit 
  12025.   numbers specified in factor 2 or each bit that is on in the factor 2 field is 
  12026.   off in the result field.  That is, all of the specified bits are equal to 
  12027.   off. 
  12028.  Positions 56 and 57:  An indicator in these positions is set on if the bit 
  12029.   numbers specified in factor 2 or the bits that are on in the factor 2 field 
  12030.   are of mixed status (some on, some off) in the result field. That is, some of 
  12031.   the specified bits are equal to on. 
  12032.  
  12033.   Note:   If only one bit is to be tested, these positions must be blank. If a 
  12034.   field name is specified in factor 2 and it has only one bit on, an indicator 
  12035.   in positions 56 and 57 is not set on. 
  12036.  Positions 58 and 59:  An indicator in these positions is set on if the bit 
  12037.   numbers specified in the factor 2 or each bit that is on in factor 2 field is 
  12038.   on in the result field.  That is, all of the specified bits are equal to on. 
  12039.  
  12040.   Note:   If the field in factor 2 has no bits on, then no indicators are set 
  12041.   on. 
  12042.  
  12043.  
  12044. ΓòÉΓòÉΓòÉ 1.10.20.84.1. TESTB Examples ΓòÉΓòÉΓòÉ
  12045.  
  12046. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  12047. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  12048. C*
  12049. C*  The field bit settings are FLDF = 00000001, and FLDG = 11110001.
  12050. C*
  12051. C*  Indicator 16 is set on because bit 3 is off (0) in FLDF.
  12052. C*  Indicator 17 is set off.
  12053. C                     TESTB'3'       FLDF       16  17
  12054. C*
  12055. C*  Indicator 16 is set on because both bits 3 and 6 are off (0) in
  12056. C*  FLDF.  Indicators 17 and 18 are set off.
  12057. C                     TESTB'36'      FLDF       161718
  12058. C*
  12059. C*  Indicator 17 is set on because bit 3 is off (0) and bit 7 is on
  12060. C*  (1) in FLDF.  Indicators 16 and 18 are set off.
  12061. C                     TESTB'37'      FLDF       161718
  12062. C*
  12063. C*  Indicator 17 is set on because bit 7 is on (1) in FLDF.
  12064. C*  Indicator 16 is set off.
  12065. C                     TESTB'7'       FLDF       16  17
  12066. C*
  12067. C*  Indicator 17 is set on because bits 0,1,2, and 3 are off (0) and
  12068. C*  bit 7 is on (1).  Indicators 16 and 18 are set off.
  12069. C                     TESTBFLDG      FLDF       161718
  12070. C*
  12071. C*  The hexadecimal literal X'88' (10001000) is used in factor 2.
  12072. C*  Indicator 17 is set on because bit 0 is on and bit 4 is off.
  12073. C*  Indicators 16 and 18 are set off.
  12074. C                     TESTBX'88'     FLDG       161718
  12075.  
  12076. TESTB Operation 
  12077.  
  12078.  
  12079. ΓòÉΓòÉΓòÉ 1.10.20.85. TESTN (Test Numeric) ΓòÉΓòÉΓòÉ
  12080.  
  12081. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12082. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  12083. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  12084. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12085. Γöé TESTN   Γöé               Γöé                 Γöé Char-    Γöé  NU BN  Γöé
  12086. Γöé         Γöé               Γöé                 Γöé acter    Γöé    BL   Γöé
  12087. Γöé         Γöé               Γöé                 Γöé field    Γöé         Γöé
  12088. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12089.  
  12090. The TESTN operation tests a character result field for the presence of zoned 
  12091. decimal digits and blanks.  The result field must be a character field. To be 
  12092. considered numeric, each character in the field, except the low-order 
  12093. character, must contain a hexadecimal F zone and a digit (0 through 9). The 
  12094. low-order character is numeric if it contains a hexadecimal C, hexadecimal D, 
  12095. or hexadecimal F zone, and a digit (0 through 9). Note that the alphabetic 
  12096. characters J through R, should they appear in the low-order position of a 
  12097. field, are treated as negative numbers by TESTN. As a result of the test, 
  12098. resulting indicators are set on as follows: 
  12099.  
  12100.  Positions 54 and 55:  Either the result field contains numeric characters, or 
  12101.   it contains a 1-character field that consists of a letter from A to R. 
  12102.  Positions 56 and 57:  The result field contains both numeric characters and 
  12103.   at least one leading blank. For example, the values b123 or bb123 set this 
  12104.   indicator on. However, the value b1b23 is not a valid numeric field because 
  12105.   of the embedded blanks, so this value does not set this indicator on. 
  12106.  
  12107.   Note:   An indicator cannot be specified in positions 56 and 57 when a field 
  12108.   of length one is tested because the character field must contain at least one 
  12109.   numeric character and one leading blank. 
  12110.  Positions 58 and 59:  The result field contains all blanks. 
  12111.  
  12112. The same indicator can be used for more than one condition.  If any of the 
  12113. conditions exist, the indicator is set on. 
  12114.  
  12115. To prevent undesirable results or an abnormal end of a program, the TESTN 
  12116. operation validates data in fields before arithmetic or editing operations are 
  12117. processed on the fields.  Following validation, the field must be moved to a 
  12118. numeric field to process the arithmetic and editing operations. 
  12119.  
  12120. Figure "TESTN Operation" illustrates uses of the TESTN operation. 
  12121.  
  12122.  
  12123. ΓòÉΓòÉΓòÉ 1.10.20.85.1. TESTN Examples ΓòÉΓòÉΓòÉ
  12124.  
  12125. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  12126. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  12127. C*
  12128. C*  The field values are FLDA = 123, FLDB = 1X4, FLDC = 004,
  12129. C*  FLDD = bbb, FLDE = b1b3, and FLDF = b12.
  12130. C*
  12131. C*  Indicator 21 is set on because FLDA contains all numeric
  12132. C*  characters.
  12133. C                     TESTN          FLDA       21
  12134. C*  Indicator 22 is set on because FLDA contains all numeric
  12135. C*  characters.  Indicators 23 and 24 remain off.
  12136. C                     TESTN          FLDA       222324
  12137. C*  All indicators are off because FLDB does not contain valid
  12138. C*  numeric data.
  12139. C                     TESTN          FLDB       252627
  12140. C*  Indicator 28 is set on because FLDC contains valid numeric data.
  12141. C*  Indicators 29 and 30 remain off.
  12142. C                     TESTN          FLDC       282930
  12143. C*  Indicator 33 is set on because FLDD contains all blanks.
  12144. C*  Indicators 31 and 32 remain off.
  12145. C                     TESTN          FLDD       313233
  12146. C*  Indicators 34, 35, and 36 remain off.  Indicator 35 remains off
  12147. C*  off because FLDE contains a blank after a digit.
  12148. C                     TESTN          FLDE       343536
  12149. C*  Indicator 38 is set on because FLDF contains leading blanks and
  12150. C*  low order digits.  Indicators 37 and 39 remain off.
  12151. C                     TESTN          FLDF       373839
  12152.  
  12153. TESTN Operation 
  12154.  
  12155.  
  12156. ΓòÉΓòÉΓòÉ 1.10.20.86. TESTZ (Test Zone) ΓòÉΓòÉΓòÉ
  12157.  
  12158. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12159. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  12160. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  12161. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12162. Γöé TESTZ   Γöé               Γöé                 Γöé Char-    Γöé         Γöé
  12163. Γöé         Γöé               Γöé                 Γöé acter    Γöé         Γöé
  12164. Γöé         Γöé               Γöé                 Γöé field    Γöé         Γöé
  12165. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12166.  
  12167. The TESTZ operation tests the zone of the leftmost character in the result 
  12168. field.  The result field must be a character field.  Resulting indicators are 
  12169. set on according to the results of the test. You must specify at least one 
  12170. resulting indicator positions 54 through 59. The characters &, A through I, and 
  12171. any character with the same zone as the character A set on the indicator in 
  12172. positions 54 and 55. The characters - (minus), J through R, and any character 
  12173. with the same zone as the character J set on the indicator in positions 56 and 
  12174. 57. Characters with any other zone set on the indicator in positions 58 and 59. 
  12175.  
  12176.  
  12177. ΓòÉΓòÉΓòÉ 1.10.20.87. TIME (Time of Day) ΓòÉΓòÉΓòÉ
  12178.  
  12179. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12180. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  12181. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  12182. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12183. Γöé TIME    Γöé               Γöé                 Γöé Numeric  Γöé         Γöé
  12184. Γöé         Γöé               Γöé                 Γöé field    Γöé         Γöé
  12185. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12186.  
  12187. The TIME operation accesses the system time of day and, if specified, the 
  12188. system date at any time during program processing. The system time is based on 
  12189. the 24-hour clock. 
  12190.  
  12191. The result field must specify the name of a 6-, 12- or 14-digit numeric field 
  12192. (no decimal positions) into which the time of day or the time of day and the 
  12193. system date are written. 
  12194.  
  12195. To access the time of day only, specify the result field as a 6-digit numeric 
  12196. field. To access both the time of day and the system date, specify the result 
  12197. field as a 12- (2-digit year portion) or 14-digit  (4-digit year portion) 
  12198. numeric field. The time of day is always placed in the first six positions of 
  12199. the result field in the following format: 
  12200.  
  12201. hhmmss (hh=hours, mm=minutes, and ss=seconds) 
  12202.  
  12203. If the system date is included, it is placed in positions 7 through 12  or 7 
  12204. through 14 of the result field. The date format depends on the date format job 
  12205. attribute QDATFMT and can be mmddyy, ddmmyy, yymmdd, or Julian.  The Julian 
  12206. format for 2-digit year portion contains the year in positions 7 and 8, the day 
  12207. (1 through 366, right-adjusted, with zeros in the unused high-order positions) 
  12208. in positions 9 through 11, and 0 in position 12. For 4-digit year portion, it 
  12209. contains the year in positions 7 through 10, the day (1 through 366, 
  12210. right-adjusted, with zeros in the unused high-order positions) in positions 11 
  12211. through 13, and 0 in position 14. 
  12212.  
  12213. The special fields UDATE and *DATE contain the job date. These values are not 
  12214. updated when midnight is passed, or when the job date is changed during the 
  12215. running of the program. 
  12216.  
  12217.  
  12218. TIME Operation
  12219.  
  12220. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  12221. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  12222. C*
  12223. C*  When the TIME operation is processed (with a 6-digit numeric
  12224. C*  field), the current time (in the form hhmmss) is placed in the
  12225. C*  result field CLOCK.  The TIME operation is based on the 24-hour
  12226. C*  clock, for example, 132710.  (In the 12-hour time system, 132710
  12227. C*  is 1:27:10 p.m.)  CLOCK can then be specified in the output
  12228. C*  specifications.
  12229. C                     TIME           CLOCK   60       TIME OF DAY
  12230. C*  When the TIME operation is processed (with a 12-digit numeric
  12231. C*  field), the current time and day is placed in the result field
  12232. C*  TIMSTP.  The first 6 digits are the time, and the last 6 digits
  12233. C*  are the date; for example, 093315121579 is 9:33:15 a.m. on
  12234. C*  December 15, 1979.  TIMSTP can then be specified in the output
  12235. C*  specifications.
  12236. C                     TIME           TIMSTP 120       TIME STAMP
  12237. C                     MOVELTIMSTP    TIME    60
  12238. C                     MOVE TIMSTP    SYSDAT  60
  12239. C*  This example duplicates the 12-digit example above but uses a
  12240. C*  14-digit field.  The first 6 digits are the time, and the last
  12241. C*  8 digits are the date;   for example, 13120001101992
  12242. C*  is 1:12:00 p.m. on January 10, 1992.
  12243. C*  TIMSTP can then be specified in the output specifications.
  12244. C                     TIME           TIMSTP 140       TIME STAMP
  12245. C                     MOVELTIMSTP    TIME    60
  12246. C                     MOVE TIMSTP    SYSDAT  80
  12247.  
  12248.  
  12249. ΓòÉΓòÉΓòÉ 1.10.20.88. UNLCK (Unlock a Data Area or Release a Record) ΓòÉΓòÉΓòÉ
  12250.  
  12251. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12252. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  12253. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  12254. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12255. Γöé UNLCK   Γöé               Γöé Data area or    Γöé          Γöé  _ ER _ Γöé
  12256. Γöé         Γöé               Γöé file name       Γöé          Γöé         Γöé
  12257. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12258.  
  12259. The UNLCK operation is used to unlock data areas and release record locks in a 
  12260. program. The data area must already be specified in the result field of an 
  12261. *NAMVAR DEFN statement. If the UNLCK operation is specified to an already 
  12262. unlocked data area, an error does not occur. 
  12263.  
  12264. In addition, the UNLCK operation allows the most recently locked record to be 
  12265. unlocked for an update disk file. 
  12266.  
  12267. Factor 2 must contain the name of the data area to be unlocked, the name of an 
  12268. update disk file, or the reserved word *NAMVAR. When *NAMVAR is specified in 
  12269. factor 2, all data areas in the program that are locked are unlocked. Factor 2 
  12270. must not refer to the local data area or the Program Initialization Parameters 
  12271. (PIP) data area. 
  12272.  
  12273. The file specified in factor 2 must be an UPDATE disk file. 
  12274.  
  12275. You can specify a resulting indicator in positions 56 and 57 to be set on if an 
  12276. error occurs on the operation. Positions 54, 55, 58, and 59 must be blank. 
  12277.  
  12278.  
  12279. UNLCK Operation
  12280.  
  12281. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  12282. FFilenameIPEAF....RlenLK1AIOvKlocEDevice+......KExit++Entry+A....U
  12283. F*
  12284. FUPDATA  UF  E                    DISK
  12285. F*
  12286. C*  Assume that the file UPDATA contains record format VENDOR.
  12287. C*  A record is read from UPDATA.  Since the file is an update
  12288. C*  file, the record is locked.  If *IN50 is on, the record is
  12289. C*  updated; otherwise the record is unlocked using the UNLCK
  12290. C*  operation.  Note that factor 2 of the UNLCK operation is the
  12291. C*  file name, UPDATA, not the record name, VENDOR.
  12292. C*
  12293. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  12294. C*
  12295. C                     READ VENDOR                   12
  12296.                         :
  12297. C*          *IN50     IFEQ *ON
  12298. C*                    UPDATVENDOR                     Update record
  12299. C                     ELSE
  12300. C                     UNLCKUPDATA                 99  Release record
  12301. C                     ENDIF
  12302. C*
  12303.  
  12304.  
  12305. ΓòÉΓòÉΓòÉ 1.10.20.89. UPDAT (Modify Existing Record) ΓòÉΓòÉΓòÉ
  12306.  
  12307. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12308. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  12309. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  12310. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12311. Γöé UPDAT   Γöé               Γöé File name       Γöé Data     Γöé  _ ER _ Γöé
  12312. Γöé         Γöé               Γöé                 Γöé struc-   Γöé         Γöé
  12313. Γöé         Γöé               Γöé                 Γöé ture     Γöé         Γöé
  12314. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12315.  
  12316. The UPDAT operation modifies the last record retrieved for processing from an 
  12317. update disk file or subfile. No other operation should be performed on the file 
  12318. between the input operation that retrieved the record and the UPDAT operation. 
  12319.  
  12320. Factor 2 must contain the name of a file or record format to be updated. A 
  12321. record format name in factor 2 is required with an externally described file. 
  12322. The record format name must be the name of the last record read from the file; 
  12323. otherwise, an error occurs. A file name in factor 2 is required with a program 
  12324. described file. 
  12325.  
  12326. The result field must contain a data structure name if factor 2 contains a file 
  12327. name. The updated record is written directly from the data structure to the 
  12328. file. The result field must be blank if factor 2 contains a record format name. 
  12329.  
  12330. You can specify a resulting indicator in positions 56 and 57 to be set on if 
  12331. the UPDAT operation is not completed successfully. 
  12332.  
  12333. Remember the following when using the UPDAT operation: 
  12334.  
  12335.  When a record format name is specified in factor 2, the current values in the 
  12336.   program for the fields in the record definition are used to modify the 
  12337.   record. 
  12338.  If some but not all fields in a record are to be updated, use the output 
  12339.   specifications and not the UPDAT operation. 
  12340.  Before UPDAT is issued to a file or record, a valid input operation with lock 
  12341.   (READ, READC, READE, READP, REDPE, CHAIN, or primary/secondary file) must be 
  12342.   issued to the same file or record. If the read operation returns with an 
  12343.   error condition or if it was read without locking, the record is not locked 
  12344.   and UPDAT cannot be issued. The record must be read again with the default of 
  12345.   blank in position 53 to specify a lock request. 
  12346.  Consecutive UPDAT operations to the same file or record are not valid. 
  12347.   Intervening successful read operations must be issued. 
  12348.  Beware of using the UPDAT operation on primary or secondary files during 
  12349.   total calculations.  At this stage in the RPG/400 cycle, the fields from the 
  12350.   current record (the record that is about to be processed) have not yet been 
  12351.   moved to the processing area. Therefore, the UPDAT operation updates the 
  12352.   current record with the fields from the preceding record.  Also, when the 
  12353.   fields from the current record are moved to the processing area, they are the 
  12354.   fields that were updated from the preceding record. 
  12355.  For multiple device files, specify a subfile record format in factor 2. The 
  12356.   operation is processed for the program device identified in the field 
  12357.   specified in the ID entry of the file specifications continuation line. (If 
  12358.   there is no such entry, the device for the last successful input operation is 
  12359.   used.)  This device must be the same one you specified for the input 
  12360.   operation that must precede the UPDAT operation.  You must not process input 
  12361.   or output operations to other devices in between the input and UPDAT 
  12362.   operations.  If you do, your UPDAT operation will fail. 
  12363.  For a display file which has multiple subfile record formats, you must not 
  12364.   process read-for-update operations to one subfile record in between the input 
  12365.   and UPDAT operations to another subfile in the same display file. If you do, 
  12366.   the  UPDAT operation will fail. 
  12367.  
  12368.  
  12369. ΓòÉΓòÉΓòÉ 1.10.20.90. WHxx (When True Then Select) ΓòÉΓòÉΓòÉ
  12370.  
  12371. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12372. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  12373. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  12374. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12375. Γöé WHXX    Γöé Comparand     Γöé Comparand       Γöé          Γöé         Γöé
  12376. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12377.  
  12378. The WHxx operations of a select group determine where control passes after the 
  12379. SELEC (Begin a Select Group) operation is processed. 
  12380.  
  12381. The WHxx conditional operation is true if factor 1 and factor 2 have the 
  12382. relationship specified by xx If the condition is true, the operations following 
  12383. the WHxx are processed until the next WHxx, OTHER, ENDSL, or END operation. 
  12384.  
  12385. When performing the WHxx operation remember: 
  12386.  
  12387.  After the operation group is processed, control passes to the statement 
  12388.   following the ENDSL operation. 
  12389.  
  12390.  You can code complex WHxx conditions using ANDxx and ORxx. Calculations are 
  12391.   processed when the condition specified by the combined WHxx, ANDxx, and ORxx 
  12392.   operations is true. 
  12393.  
  12394.  The WHxx group can be empty. 
  12395.  
  12396.  Within total calculations, the control level entry (positions 7 and 8) can be 
  12397.   blank or can contain an L1 through L9 indicator, an LR indicator, or an L0 
  12398.   entry to group the statement within the appropriate section of the program. 
  12399.   The control level entry is for documentation purposes only. Conditioning 
  12400.   indicator entries (positions 9 through 17) are not allowed. 
  12401.  
  12402. Refer to Compare Operations for valid values for xx. 
  12403.  
  12404. Figure "WHxx Operation" shows an example of the WHxx operation. 
  12405.  
  12406.  
  12407. ΓòÉΓòÉΓòÉ 1.10.20.90.1. WHxx Example ΓòÉΓòÉΓòÉ
  12408.  
  12409.  
  12410. WHxx Operation
  12411.  
  12412. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  12413. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  12414. C*
  12415. C* The following example shows nested SELEC groups.  The employee
  12416. C* type can be one of 'C' for casual, 'T' for retired, 'R' for
  12417. C* regular, and 'S' for student.  Depending on the employee type
  12418. C* (EMPTYP), the number of days off per year (DAYS) will vary.
  12419. C*
  12420. C                     SELEC
  12421. C           EMPTYP    WHEQ 'C'
  12422. C           EMPTYP    OREQ 'T'
  12423. C                     Z-ADD0         DAYS
  12424. C           EMPTYP    WHEQ 'R'
  12425. C*
  12426. C* When the employee type is 'R', the days off depend also on the
  12427. C* number of years of employment.  The base number of days is 14.
  12428. C* For less than 2 years, no extra days are added.  Between 2 and
  12429. C* 5 years, 5 extra days are added.  Between 6 and 10 years, 10
  12430. C* extra days are added, and over 10 years, 20 extra days are added.
  12431. C*
  12432. C                     Z-ADD14        DAYS
  12433. C*
  12434. C* Nested select group.
  12435. C                     SELEC
  12436. C           YEARS     WHLT 2
  12437. C           YEARS     WHLE 5
  12438. C                     ADD  5         DAYS
  12439. C           YEARS     WHLE 10
  12440. C                     ADD  10        DAYS
  12441. C                     OTHER
  12442. C                     ADD  20        DAYS
  12443. C                     ENDSL
  12444. C* End of nested select group.
  12445. C*
  12446. C           EMPTYP    WHEQ 'S'
  12447. C                     Z-ADD5         DAYS
  12448. C                     ENDSL
  12449.  
  12450. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  12451. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  12452. C* Example of a SELEC group with complex WHxx expressions.  Assume
  12453. C* that a record and an action code have been entered by a user.
  12454. C* Select one of the following:
  12455. C*   * When F3 has been pressed, do subroutine QUIT.
  12456. C*   * When action code A (add) was entered and the record does not
  12457. C*     exist (*IN50=1), write the record.
  12458. C*   * When action code A is entered, the record exists, and the
  12459. C*     active record code for the record is D (deleted); update
  12460. C*     the record with active rec code=A.  When action code D is
  12461. C*     entered, the record exists, and the ACREC code is A; mark
  12462. C*     the record as deleted.
  12463. C*   * When action code is C (change), the record exists, and the
  12464. C*     ACREC code is A; update the record.
  12465. C*   * Otherwise, do error processing.
  12466. C*
  12467. C           RSCDE     CHAINFILE                 50
  12468. C                     SELEC
  12469. C           *INKC     WHEQ *ON
  12470. C                     EXSR QUIT
  12471. C           ACODE     WHEQ 'A'
  12472. C           *IN50     ANDEQ*ON
  12473. C                     WRITEREC
  12474. C           ACODE     WHEQ 'A'
  12475. C           *IN50     ANDEQ*OFF
  12476. C           ACREC     ANDEQ'D'
  12477. C           ACODE     OREQ 'D'
  12478. C           *IN50     ANDEQ*OFF
  12479. C           ACREC     ANDEQ'A'
  12480. C                     MOVE ACODE     ACREC
  12481. C                     UPDATREC
  12482. C           ACODE     WHEQ 'C'
  12483. C           *IN50     ANDEQ*OFF
  12484. C           ACREC     ANDEQ'A'
  12485. C                     UPDATREC
  12486. C                     OTHER
  12487. C                     EXSR ERROR
  12488. C                     ENDSL
  12489.  
  12490.  
  12491. ΓòÉΓòÉΓòÉ 1.10.20.91. WRITE (Create New Records) ΓòÉΓòÉΓòÉ
  12492.  
  12493. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12494. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  12495. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  12496. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12497. Γöé WRITE   Γöé               Γöé File name       Γöé Data     Γöé  _ ER _ Γöé
  12498. Γöé         Γöé               Γöé                 Γöé struc-   Γöé         Γöé
  12499. Γöé         Γöé               Γöé                 Γöé ture     Γöé         Γöé
  12500. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12501.  
  12502. The WRITE operation writes a new record to a file. 
  12503.  
  12504. Factor 2 must contain the name of a file. A record format name is required in 
  12505. factor 2 with an externally described file. A file name in factor 2 is required 
  12506. with a program described file, and the result field must contain the name of a 
  12507. data structure.  The record is written directly from the data structure to the 
  12508. file. The result field must be blank if factor 2 contains a record format name. 
  12509.  
  12510. The result field must be a data structure name. 
  12511.  
  12512. Positions 56 and 57 can contain an indicator to be set on if the WRITE 
  12513. operation is not completed successfully. The indicator in positions 56 and 57 
  12514. will be set on if overflow is reached to an externally described print file and 
  12515. no overflow indicator has been specified on the File description specification. 
  12516. On a WRITE to a subfile (SFILE) record name, you can specify an indicator in 
  12517. positions 58 and 59; it is set on when the subfile is filled. 
  12518.  
  12519. When using the WRITE operation remember: 
  12520.  
  12521.  When factor 2 contains a record format name, the current values in the 
  12522.   program for all the fields in the record definition are used to construct the 
  12523.   record. 
  12524.  When records that use relative record numbers are written to a file, you must 
  12525.   update the RECNO (relative record number) field so it contains the relative 
  12526.   record number of the record to be written. 
  12527.  When you use the WRITE operation to add records to a DISK file, you must 
  12528.   specify an A in position 66 of the file description specifications.  (See 
  12529.   Position 66 (File Addition).) 
  12530.  Device dependent functions are not available. For example, if a WRITE is 
  12531.   issued to a PRINTER device, there is no spacing or skipping (normally 
  12532.   specified in columns 17 through 22 of the output specifications). If the file 
  12533.   is externally described, these functions are part of the external 
  12534.   description. 
  12535.  For a multiple device file, data is written to the program device named in 
  12536.   the field specified in the ID entry on the file specifications continuation 
  12537.   line.  If there is no such entry, data is written to the program device for 
  12538.   which the last successful input operation was processed. 
  12539.  
  12540. See Figure "WRITE Operation" for an example of the WRITE operation. 
  12541.  
  12542.  
  12543. ΓòÉΓòÉΓòÉ 1.10.20.91.1. WRITE Example ΓòÉΓòÉΓòÉ
  12544.  
  12545.  
  12546. WRITE Operation
  12547.  
  12548. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  12549. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  12550. C*
  12551. C*  The WRITE operation writes the fields in the data structure
  12552. C*  DS1 to the file, FILE1.
  12553. C*
  12554. C                     WRITEFILE1     DS1                ADD RECORD
  12555.  
  12556.  
  12557. ΓòÉΓòÉΓòÉ 1.10.20.92. XFOOT (Summing the Elements of an Array) ΓòÉΓòÉΓòÉ
  12558.  
  12559. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12560. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  12561. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  12562. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12563. Γöé XFOOT   Γöé               Γöé Array name      Γöé Sum      Γöé  + - Z  Γöé
  12564. Γöé (1/2)   Γöé               Γöé                 Γöé          Γöé         Γöé
  12565. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12566.  
  12567. XFOOT adds the elements of an array together and places the sum into the field 
  12568. specified as the result field. Factor 2 contains the name of the array. 
  12569.  
  12570. If half-adjust (position 53) is specified, the rounding occurs after all 
  12571. elements are summed and before the results are moved into the result field. If 
  12572. the result field is an element of the array specified in factor 2, the value of 
  12573. the element before the XFOOT operation is used to calculate the total of the 
  12574. array. 
  12575.  
  12576. For further rules for the XFOOT operation, see Arithmetic Operations. 
  12577.  
  12578. See Figure "Summary of Arithmetic Operations" for an example of the XFOOT 
  12579. operation. 
  12580.  
  12581.  
  12582. ΓòÉΓòÉΓòÉ 1.10.20.93. XLATE (Translate) ΓòÉΓòÉΓòÉ
  12583.  
  12584. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12585. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  12586. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  12587. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12588. Γöé XLATE   Γöé From:To       Γöé String:start    Γöé Target   Γöé  _ ER _ Γöé
  12589. Γöé (P)     Γöé               Γöé                 Γöé String   Γöé         Γöé
  12590. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12591.  
  12592. Characters in the source string (factor 2) are translated according to the From 
  12593. and To strings (both in factor 1) and put into a receiver field (result field). 
  12594. Source characters with a match in the From string are translated to 
  12595. corresponding characters in the To string. XLATE starts translating the source 
  12596. at the location specified in factor 2 and continues character by character, 
  12597. from left to right. If a character of the source string exists in the From 
  12598. string, the corresponding character in the To string is placed in the result 
  12599. field. Any characters in the source field before the starting position are 
  12600. placed unchanged in the result field. 
  12601.  
  12602. Factor 1 must contain the From string, followed by a colon, followed by the To 
  12603. string.  The From and To strings can contain one of the following: a field 
  12604. name, array element, named constant, data structure name, literal, or table 
  12605. name. 
  12606.  
  12607. Factor 2 must contain either the source string or the source string followed by 
  12608. a colon and the start location. The source string portion of factor 2 must be 
  12609. character, and can contain one of the following: a field name, array element, 
  12610. named constant, data structure name, data structure subfield, literal, or table 
  12611. name. The start location portion of factor 2 must be numeric with no decimal 
  12612. positions and can be a named constant, array element, field name, literal, or 
  12613. table name. If no start location is specified, a value of 1 is used. 
  12614.  
  12615. The result field can be a character field, character array element, data 
  12616. structure or a character table. The length of the result field should be as 
  12617. large as the source string specified in factor 2. If the result field is larger 
  12618. than the source string, the result will be left adjusted.  If the result field 
  12619. is shorter than the source string, the result field will contain the leftmost 
  12620. part of the translated source. 
  12621.  
  12622. If a character in the From string is duplicated, the first occurrence 
  12623. (leftmost) is used. 
  12624.  
  12625. Note:   Figurative constants cannot be used in factor 1, factor 2, or result 
  12626. fields. No overlapping in a data structure is allowed for factor 1 and the 
  12627. result field, or factor 2 and the result field. 
  12628.  
  12629. Any valid indicator can be specified in columns 7 to 17. 
  12630.  
  12631. If factor 2 is shorter than the result field, a P specified in the operation 
  12632. extender position (position 53) indicates that the result field should be 
  12633. padded on the right with blanks after the translation. 
  12634.  
  12635. Columns 54 and 55 must be blank. An indicator in positions 56-57 turns on if an 
  12636. error occurs on the operation. Columns 58-59 must be blank. 
  12637.  
  12638. Both factor 2 and the result field must be character or both must be DBCS. See 
  12639. XLATE Examples. 
  12640.  
  12641.  
  12642. ΓòÉΓòÉΓòÉ 1.10.20.93.1. XLATE Examples ΓòÉΓòÉΓòÉ
  12643.  
  12644. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  12645. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  12646. C*
  12647. C* The following translates the blank in NUMBER to '-'.  The result
  12648. C* in RESULT will be '999-9999'.
  12649. C*
  12650. C                     MOVE '999 9999'NUMBER  8
  12651. C           ' ':'-'   XLATENUMBER    RESULT  8
  12652.  
  12653. XLATE Operation 
  12654.  
  12655. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  12656. I..............Namedconstant+++++++++C.........Fldnme.............
  12657. I*
  12658. I* In the following example, all values in STRING are translated to
  12659. I* uppercase.  As a result, RESULT='RPG DEP'.
  12660. I*
  12661. I             'ABCDEFGHIJKLMNOPQRS-  C        UP
  12662. I             'TUVWXYZ'
  12663. I             'abcdefghijklmnopqrs-  C        LO
  12664. I             'tuvwxyz'
  12665. C*
  12666. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  12667. C                     MOVE 'RpG Dep' STRING  7
  12668. C           LO:UP     XLATESTRING    RESULT       90
  12669. C*
  12670. C* In the following example all values in the string are translated
  12671. C* to lowercase.  As a result, RESULT='rpg dep'.
  12672. C*
  12673. C                     MOVE 'RpG Dep' STRING  7
  12674. C           UP:LO     XLATESTRING    RESULT       90
  12675.  
  12676. XLATE Operation With Named Constants 
  12677.  
  12678.  
  12679. AlternateCodePageExampleofXLATE
  12680.  
  12681. I..............Namedconstant+++++++++C.........Fldnme.............
  12682. I*  US  English alphabet.
  12683. I              'aaaaae-              C         US
  12684. I              'c-
  12685. I              'eee-
  12686. I              'iiii-
  12687. I              'n'
  12688. I*  Extended alphabet.
  12689. I              '╨░╨ô╨òa╨ö╨í-              C         XA
  12690. I              '╨ù-
  12691. I              '╨Æ╨ÿ╨Ü-
  12692. I              '╨▒╨£╨¢╨¥-
  12693. I              '╨┤'
  12694. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  12695. C*
  12696. C* The following examples change characters only supported in
  12697. C* certain languages to characters more widely supported.
  12698. C* The field FRANC contains names of employees in the European offices
  12699. C* of an international corporation.  The program translates those
  12700. C* characters that are not printable with a US English printer.
  12701. C* Assuming the FRANC field contains the names 'Fran╨ùois',
  12702. C* 'H╨Ælene', and 'Ni╨┤a', they will be translated to
  12703. C* 'Francois', 'Helene', and 'Nina'.
  12704. C*
  12705. C           XA:US     XLATEFRANC     INTER1 20
  12706.  
  12707.  
  12708. ΓòÉΓòÉΓòÉ 1.10.20.94. Z-ADD (Zero and Add) ΓòÉΓòÉΓòÉ
  12709.  
  12710. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12711. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  12712. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  12713. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12714. Γöé Z-ADD   Γöé               Γöé Addend          Γöé Sum      Γöé  + - Z  Γöé
  12715. Γöé (1/2)   Γöé               Γöé                 Γöé          Γöé         Γöé
  12716. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12717.  
  12718. Factor 2 is added to a field of zeros. The sum is placed in the result field. 
  12719. Factor 1 is not used. Factor 2 must be numeric and can contain one of: an 
  12720. array, array element, field, figurative constant, literal, named constant, 
  12721. subfield, or table name. 
  12722.  
  12723. The result field must be numeric, and can contain one of: an array, array 
  12724. element, subfield, or table name. 
  12725.  
  12726. Half-adjust (position 53) can be specified. 
  12727.  
  12728. For the rules for the Z-ADD operation, see Arithmetic Operations. 
  12729.  
  12730. See Figure "Summary of Arithmetic Operations" for an example of the Z-ADD 
  12731. operation. 
  12732.  
  12733.  
  12734. ΓòÉΓòÉΓòÉ 1.10.20.95. Z-SUB (Zero and Subtract) ΓòÉΓòÉΓòÉ
  12735.  
  12736. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12737. Γöé   CODE  Γöé    FACTOR 1   Γöé     FACTOR 2    Γöé  RESULT  Γöé INDICA- Γöé
  12738. Γöé         Γöé               Γöé                 Γöé   FIELD  Γöé   TORS  Γöé
  12739. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12740. Γöé Z-SUB   Γöé               Γöé Subtrahend      Γöé Differ-  Γöé  + - Z  Γöé
  12741. Γöé (1/2)   Γöé               Γöé                 Γöé ence     Γöé         Γöé
  12742. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12743.  
  12744. Factor 2 is subtracted from a field of zeros.  The difference, which is the 
  12745. negative of factor 2, is placed in the result field. You can use the operation 
  12746. to change the sign of a field. Factor 1 is not used. Factor 2 must be numeric 
  12747. and can contain one of the following:  an array, array element, field, 
  12748. figurative constant, literal, named constant, subfield, or table name. 
  12749.  
  12750. The result field must be numeric, and can contain one of the following:  an 
  12751. array, array element, subfield, or table name. 
  12752.  
  12753. Half-adjust (position 53) can be specified. 
  12754.  
  12755. For the rules for the Z-SUB operation, see Arithmetic Operations. 
  12756.  
  12757. See Figure "Summary of Arithmetic Operations" for an example of the Z-SUB 
  12758. operation. 
  12759.  
  12760.  
  12761. ΓòÉΓòÉΓòÉ 1.11. RPG/400 Words with Special Functions ΓòÉΓòÉΓòÉ
  12762.  
  12763. The following RPG/400 reserved words have special functions within a program: 
  12764.  
  12765.  UDATE, *DATE, UMONTH, *MONTH, UYEAR, *YEAR, UDAY, and *DAY allow you to 
  12766.   access the system date, or a portion of it, to be used in the program. 
  12767.  
  12768.  PAGE, PAGE1-PAGE7 can be used for numbering the pages of a report, for record 
  12769.   sequence numbering, or to sequentially number output fields. 
  12770.  
  12771.  Figurative constants (*BLANK/*BLANKS, *ZERO/*ZEROS, *HIVAL, *LOVAL, *ON/*OFF, 
  12772.   *ALLX'x1..', and *ALL'X..') are implied literals that allow specifications 
  12773.   without referring to length. 
  12774.  
  12775.  *IN and *INxx allow indicators to be referred to as data. 
  12776.  
  12777.  The following reserved words define symbolic locations within the file 
  12778.   information data structure (INFDS) and the program status data structure. 
  12779.  
  12780.    *FILE 
  12781.    *OPCODE 
  12782.    *PARMS 
  12783.    *PROGRAM 
  12784.    *RECORD 
  12785.    *ROUTINE 
  12786.    *STATUS 
  12787.  
  12788.  The following reserved words provide symbolic labels for the ENDSR operation 
  12789.   for the file and program exception/error subroutines or for the INFDS. 
  12790.  
  12791.    *CANCL    Cancel the program 
  12792.    *DETC     Detail calculations 
  12793.    *DETL     Detail lines 
  12794.    *GETIN    Get input record 
  12795.    *INIT     Program initialization 
  12796.    *OFL      Overflow lines 
  12797.    *TERM     Program ending 
  12798.    *TOTC     Total calculations 
  12799.    *TOTL     Total lines 
  12800.  
  12801.  Special words used with operation codes. 
  12802.  
  12803.    *DEFN 
  12804.    *ENTRY 
  12805.    *INZSR 
  12806.    *LDA 
  12807.    *LIKE 
  12808.    *LOCK 
  12809.    *NAMVAR 
  12810.    *OFF 
  12811.    *ON 
  12812.    *PDA 
  12813.    *PSSR 
  12814.  
  12815.  Special words used with translation. 
  12816.  
  12817.    *FILE 
  12818.    *EQUATE 
  12819.  
  12820.  *PLACE allows repetitive placement of fields in an output record. (See *PLACE 
  12821.   for more information.) 
  12822.  
  12823.  *ALL allows all fields that are defined for an externally described file to 
  12824.   be written on output.  (See Rules for Figurative Constants for more 
  12825.   information on *ALL) 
  12826.  
  12827.  
  12828. ΓòÉΓòÉΓòÉ 1.11.1. User Date Special Words ΓòÉΓòÉΓòÉ
  12829.  
  12830. The user date special words (UDATE, *DATE, UMONTH, *MONTH, UDAY, *DAY, UYEAR, 
  12831. *YEAR) allow the programmer to supply a date for the program at run time.  The 
  12832. user date special words access the job date that is specified in the job 
  12833. description. The user dates can be written out at output time, and are written 
  12834. in the format specified by the control specification. 
  12835.  
  12836. See Rules for User Date for more information. 
  12837.  
  12838.  
  12839. ΓòÉΓòÉΓòÉ 1.11.1.1. Rules for User Date ΓòÉΓòÉΓòÉ
  12840.  
  12841. Remember the following rules when using the user date: 
  12842.  
  12843.  UDATE, when specified in positions 32 through 37 of the output 
  12844.   specifications, prints a 6-character numeric date field. *DATE, when 
  12845.   similarly specified, prints an 8-character (4-digit year portion) numeric 
  12846.   date field. Both special words can produce three different date formats: 
  12847.  
  12848.    Month/day/year 
  12849.    Year/month/day 
  12850.    Day/month/year 
  12851.  
  12852. Use positions 19 and 20 of the control specification to specify the date format 
  12853. and the editing to be done. If positions 19 and 20 are blank, the date format 
  12854. is determined by the contents of position 21. 
  12855.  
  12856.  For an interactive program, the user date special words are set when the job 
  12857.   starts running. For a batch program, they are set when the job is sent to the 
  12858.   job queue. In neither case are they updated when the program runs over 
  12859.   midnight or when the job date changes. Use the TIME operation code to obtain 
  12860.   the time and date while the program is running. 
  12861.  
  12862.  UMONTH, *MONTH, UDAY, *DAY, and UYEAR when specified in positions 32 through 
  12863.   37 of the output specifications, print a 2-position numeric date field. *YEAR 
  12864.   can be used to print a 4-position numeric date field. Use UMONTH or *MONTH to 
  12865.   print the month only, UDAY or *DAY to print the day only, and UYEAR or *YEAR 
  12866.   to print the year only. 
  12867.  
  12868.  UDATE and *DATE can be edited when they are written if the Y edit code is 
  12869.   specified in position 38 of the output specifications. The control 
  12870.   specification entry in position 20 determines the separator character to be 
  12871.   inserted; for example, 12/31/88, 31.12.88., 12/31/1988. 
  12872.  
  12873.  UMONTH, *MONTH, UDAY, *DAY, UYEAR and *YEAR cannot be edited by the Y edit 
  12874.   code in position 38 of the output specifications. 
  12875.  
  12876.  The user date special words can be used in factor 1 or factor 2 of the 
  12877.   calculation specifications for operation codes that use numeric fields. 
  12878.  
  12879.   Note:   The operation codes CLEAR and RESET, the array index for factor 2 of 
  12880.   LOKUP, and factor 1 of PARM are exceptions to this rule. The user date 
  12881.   special words cannot be used with them. 
  12882.  
  12883.  The user date special words cannot appear as the result field in a 
  12884.   calculation or as an input field. 
  12885.  
  12886.  Blank-after (position 39 of the output specifications) cannot be used with 
  12887.   user date special words. 
  12888.  
  12889.  *YEAR is a 4-digit numeric field containing the year portion of the job date. 
  12890.  
  12891.  *MONTH and *DAY function precisely as UMONTH and UDAY, respectively. 
  12892.  
  12893.  
  12894. ΓòÉΓòÉΓòÉ 1.11.2. PAGE, PAGE1-PAGE7 ΓòÉΓòÉΓòÉ
  12895.  
  12896. PAGE is used to number the pages of a report, to serially number the output 
  12897. records in a file, or to sequentially number output fields. It does not cause a 
  12898. page eject. PAGE1 through PAGE7 are used to serially number several output 
  12899. files. 
  12900.  
  12901. The eight possible PAGE entries (PAGE, PAGE1, PAGE2, PAGE3, PAGE4, PAGE5, 
  12902. PAGE6, and PAGE7) may be needed for numbering different types of output pages 
  12903. or for numbering pages for different printer files. 
  12904.  
  12905. PAGE and PAGE1 through PAGE7 can be specified in positions 32 through 37 of the 
  12906. output specifications or in the input or calculation specifications. 
  12907.  
  12908. See Rules for PAGE, PAGE1-PAGE7 for more information. 
  12909.  
  12910.  
  12911. ΓòÉΓòÉΓòÉ 1.11.2.1. Rules for PAGE, PAGE1-PAGE7 ΓòÉΓòÉΓòÉ
  12912.  
  12913. Remember the following rules when using the PAGE fields: 
  12914.  
  12915.  When a PAGE field is specified in the output specifications, without being 
  12916.   defined elsewhere, it is assumed to be a four-digit, numeric field with zero 
  12917.   decimal positions. 
  12918.  
  12919.  Page numbering, unless otherwise specified, starts with 0001; and 1 is 
  12920.   automatically added for each new page. 
  12921.  
  12922.  To start at a page number other than 1, enter that page number in a field of 
  12923.   an input record and name that field PAGE in positions 53 through 58, or use a 
  12924.   calculation operation such as Z-ADD. The number entered in the PAGE field 
  12925.   should be one less than the starting page number. For example, if numbering 
  12926.   starts with 24, enter a 23 in the PAGE field.  The PAGE field can be of any 
  12927.   length but must have zero decimal positions (see Figure "Page Record 
  12928.   Description"). Any entry in the PAGE field should be right-adjusted, such as 
  12929.   0023. 
  12930.  
  12931.  Page numbering can be restarted at any point in a job.  The following methods 
  12932.   can be used to reset the PAGE field: 
  12933.  
  12934.    - Specify blank-after (position 39 of the output specifications). 
  12935.    - Specify the PAGE field as the result field of an operation in the 
  12936.      calculation specifications. 
  12937.    - Specify output indicators in the output specifications (see Figure 
  12938.      "Resetting the PAGE Fields to Zero"). Output indicators cannot be used to 
  12939.      control the printing of a PAGE field, because a PAGE field is always 
  12940.      written. 
  12941.    - Specify the PAGE field as an input field as shown in Figure "Page Record 
  12942.      Description". 
  12943.  
  12944.  Leading zeros are automatically suppressed (Z edit code is assumed) when a 
  12945.   PAGE field is printed unless an edit code, edit word, or data format (P/B/L/R 
  12946.   in position 44) has been specified.  Editing and the data format override the 
  12947.   suppression of leading zeros. 
  12948.  
  12949.  PAGE can be specified in input or calculation specifications, and can be of 
  12950.   any length. When the PAGE field is defined in input and calculation 
  12951.   specifications, it is treated as a field name in the output specifications 
  12952.   and zero suppression is not automatic. 
  12953.  
  12954.  
  12955. ΓòÉΓòÉΓòÉ 1.11.2.1.1. Page Record Description ΓòÉΓòÉΓòÉ
  12956.  
  12957.  
  12958. Page Record Description
  12959.  
  12960. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  12961. IFilenameSqNORiPos1NCCPos2NCCPos3NCC.PFromTo++DField+L1M1FrPlMnZr...
  12962. IINPUT   PG  50   1 CP
  12963. I                                        2   50PAGE
  12964.  
  12965.  
  12966. ΓòÉΓòÉΓòÉ 1.11.2.1.2. Resetting the PAGE Fields to Zero ΓòÉΓòÉΓòÉ
  12967.  
  12968.  
  12969. Resetting the PAGE Fields to Zero
  12970.  
  12971. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  12972. OName++++DFBASbSaN01N02N03Field+YBEnd+PConstant/editword+++++++++...
  12973. O*  When indicator 15 is on, the PAGE field is set to zero and 1 is
  12974. O*  added before the field is printed.  When indicator 15 is off, 1
  12975. O*  is added to the contents of the PAGE field before it is printed.
  12976. OPRINT   H   01   L1
  12977. O                 15      PAGE  1   75
  12978.  
  12979.  
  12980. ΓòÉΓòÉΓòÉ 1.11.3. Figurative Constants ΓòÉΓòÉΓòÉ
  12981.  
  12982. The figurative constants *BLANK/*BLANKS, *ZERO/*ZEROS, *HIVAL, *LOVAL, 
  12983. *ALL'x..', *ALLX'x1..' and *ON/*OFF are implied literals that can be specified 
  12984. without a length, because the implied length and decimal positions of a 
  12985. figurative constant are the same as those of the associated field. (For 
  12986. exceptions, see the following section, Rules for Figurative Constants.) 
  12987.  
  12988. Figurative constants can be specified in positions 18 through 27 (factor 1) and 
  12989. in positions 33 through 42 (factor 2) of the calculation specifications.  The 
  12990. following shows the reserved words and implied values for figurative constants: 
  12991.  
  12992. Reserved Words     Implied Values 
  12993. *BLANK/*BLANKS     All blanks.  Valid only for character fields. 
  12994. *ZERO/*ZEROS       Character/numeric fields:  All zeros. 
  12995. *HIVAL             Character fields:  The highest collating character for the 
  12996.                    system (hexadecimal FFs). 
  12997.                    Numeric fields:  All nines with a positive sign. 
  12998. *LOVAL             Character fields:  The lowest collating character for the 
  12999.                    system (hexadecimal zeros). 
  13000.                    Numeric fields:  All nines with a negative sign. 
  13001. *ALL'x..'          Character/numeric fields: Character string x . . is 
  13002.                    cyclically repeated to a length equal to the associated 
  13003.                    field.  If the field is a numeric field, all characters 
  13004.                    within the string must be numeric (0 through 9). No sign or 
  13005.                    decimal point can be specified when *ALL'x..' is used as a 
  13006.                    numeric constant. 
  13007. *ALLX'x1..'        Character fields:  The hexadecimal literal  X'x1..' is 
  13008.                    cyclically repeated to a length equal to the associated 
  13009.                    field. 
  13010. *ON/*OFF           *ON is all ones.  *OFF is all zeros.  Both are only valid 
  13011.                    for character fields. 
  13012.  
  13013.  
  13014. ΓòÉΓòÉΓòÉ 1.11.3.1. Rules for Figurative Constants ΓòÉΓòÉΓòÉ
  13015.  
  13016. Remember the following rules when using figurative constants: 
  13017.  
  13018.  Figurative constants are considered elementary items. Except for MOVEA, 
  13019.   figurative constants act like a field if used in conjunction with an array. 
  13020.   For example:  MOVE *ALL'XYZ' ARR. 
  13021.  
  13022.   If ARR has 4-byte character elements, then each element will contain 'XYZX'. 
  13023.  
  13024.  MOVEA is considered to be a special case.  The constant is generated with a 
  13025.   length equal to the portion of the array specified.  For example: 
  13026.  
  13027.    - MOVEA *BLANK ARR,X 
  13028.  
  13029.      Beginning with element X, the remainder of ARR will contain blanks. 
  13030.  
  13031.    - MOVEA *ALL'XYZ' ARR,X 
  13032.  
  13033.      ARR has 4-byte character elements.  Element boundaries are ignored, as is 
  13034.      always the case with character MOVEA operations. Beginning with element X, 
  13035.      the remainder of the array will contain 'XYZXYZXYZ...'. 
  13036.  
  13037. Note that the results of MOVEA are different from those of the MOVE example 
  13038. above. 
  13039.  
  13040.  After figurative constants are set/reset to their appropriate length, their 
  13041.   normal collating sequence can be altered if an alternate collating sequence 
  13042.   is specified. 
  13043.  The move operations MOVE and MOVEL produce the same result when moving the 
  13044.   figurative constants *ALL'x..' and *ALLX'x1..'. The character string is 
  13045.   cyclically repeated character by character (starting on the left) until the 
  13046.   length of the associated field is the same as the length of the character 
  13047.   string. 
  13048.  Figurative constants are valid in compare operations such as  COMP, CAB, DOU, 
  13049.   DOW, and IF; when the associated field in the compare operations is the field 
  13050.   with which the figurative constant is to be compared. 
  13051.  Figurative constants are not allowed in factor 1 of a DEBUG or DSPLY 
  13052.   operation or in factor 2 of MHLZO, MLHZO, MHHZO, MLLZO, BITON, BITOF, TESTB, 
  13053.   or SQRT operations. 
  13054.  The figurative constants, *BLANK/*BLANKS, are moved as zeros to a numeric 
  13055.   field in a MOVE operation. 
  13056.  *BLANK/*BLANKS do not cause any storage allocation if used in factor 2. 
  13057.   Otherwise, storage equivalent to the implied length of blanks is used.  The 
  13058.   performance of *BLANK/*BLANKS is equal to using spaces when the implied 
  13059.   length of blanks is less than or equal to 140. 
  13060.  
  13061.  
  13062. ΓòÉΓòÉΓòÉ 1.11.3.2. Specifying an Array in Calculations ΓòÉΓòÉΓòÉ
  13063.  
  13064. An entire array or individual elements in an array can be specified in 
  13065. calculation specifications.  You can process individual elements like fields. 
  13066. Remember, if an array element is to be used as a result field, the array name 
  13067. with the comma and index cannot exceed 6 characters. 
  13068.  
  13069. To specify an entire array, use only the array name, which can be used as 
  13070. factor 1, factor 2, or the result field. The following operations can be used 
  13071. with an array name: ADD, Z-ADD, SUB, Z-SUB, MULT, DIV, SQRT, MOVE, MOVEL, 
  13072. MOVEA, MLLZO, MLHZO, MHLZO, MHHZO, DEBUG, XFOOT, LOKUP, SORTA, PARM, DEFN, 
  13073. CLEAR, RESET, CHECK, CHEKR, and SCAN. 
  13074.  
  13075. Several other operations can be used with an array element only but not with 
  13076. the array name alone. These operations include but are not limited to: BITON, 
  13077. BITOF, COMP, CABxx, TESTZ, TESTN, TESTB, MVR, DOUxx, DOWxx, IFxx, SUBST, and 
  13078. CAT. 
  13079.  
  13080. When specified with an array name without an index, certain operations are 
  13081. repeated for each element in the array.  These are ADD, Z-ADD, SUB, Z-SUB, 
  13082. MULT, DIV, SQRT, MOVE, MOVEL, MLLZO, MLHZO, MHLZO and MHHZO. The following 
  13083. rules apply to these operations when an array name without an index is 
  13084. specified: 
  13085.  
  13086.  When factors 1 and 2 and the result field are arrays with the same number of 
  13087.   elements, the operation uses the first element from every array, then the 
  13088.   second element from every array until all elements in the arrays are 
  13089.   processed.  If the arrays do not have the same number of entries, the 
  13090.   operation ends when the last element of the array with the fewest elements 
  13091.   has been processed. When factor 1 is not specified for the ADD, SUB, MULT, 
  13092.   and DIV operations, factor 1 is assumed to be the same as the result field. 
  13093.  When one of the factors is a field, a literal, or a figurative constant and 
  13094.   the other factor and the result field are arrays, the operation is done once 
  13095.   for every element in the shorter array. The same field, literal, or 
  13096.   figurative constant is used in all of the operations. 
  13097.  The result field must always be an array. 
  13098.  If an operation code uses factor 2 only (for example, Z-ADD, Z-SUB, SQRT, 
  13099.   ADD, SUB, MULT, or DIV do not have factor 1 specified) and the result field 
  13100.   is an array, the operation is done once for every element in the array.  The 
  13101.   same field or constant is used in all of the operations. 
  13102.  Resulting indicators (positions 54 through 59) cannot be used because of the 
  13103.   number of operations being processed. 
  13104.  
  13105.  
  13106. ΓòÉΓòÉΓòÉ 1.11.4. Where You Can Use DBCS Data in RPG/400 Programs ΓòÉΓòÉΓòÉ
  13107.  
  13108. In an RPG/400 program, you can use DBCS data: 
  13109.  
  13110.  In any comment statement (a statement with an asterisk in position 7) 
  13111.  In the comment field of the extension specification (positions 58-74) 
  13112.  In the comment field of the calculation specification (positions 60-74) 
  13113.  In literals and constants (including named constants) 
  13114.  As data in any character field, subfield, array, or table. 
  13115.  
  13116. You may mix DBCS data with alphanumeric data. The RPG/400 language treats DBCS 
  13117. data in the same way as Single Byte Character Set (SBCS) data. 
  13118.  
  13119. The RPG/400 language uses the value 10 in the *OUT field in the file 
  13120. information data structure (INFDS) to indicate that the national language 
  13121. output capability of the device makes it possible for you to use DBCS data with 
  13122. it. 
  13123.  
  13124.  
  13125. ΓòÉΓòÉΓòÉ 1.11.4.1. Transparent Literals and Constants ΓòÉΓòÉΓòÉ
  13126.  
  13127. A constant or literal is transparent if the constant or literal: 
  13128.  
  13129.  Begins with an apostrophe followed by a shift-out character. 
  13130.  Ends with a shift-in character followed by an apostrophe. 
  13131.  Contains no embedded shift control characters. 
  13132.  Contains only DBCS data. 
  13133.  If you are specifying a transparent constant using hexadecimal literals, you 
  13134.   must specify the shift-out and shift-in characters in hexadecimal. 
  13135.  
  13136. The following is an example of a DBCS named constant. The constant is continued 
  13137. by placing a hyphen instead of an apostrophe at the end of each continued line. 
  13138. When concatenated, the internal SO/SI characters will be dropped and only the 
  13139. starting SO and ending SI will remain. For more information on named constants 
  13140. see Named Constant Specifications. 
  13141.  
  13142. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  13143. I..............Namedconstant+++++++++C.........Fldnme.............
  13144. I              'oK1K2K3i-            C         DOUBLE
  13145. I              'oK4K5i'
  13146.  
  13147. Using DBCS data in a constant or literal that is not transparent may produce 
  13148. unwanted results. The DBCS data may include a character representing an 
  13149. apostrophe. This character ends your constant or literal where you did not 
  13150. expect it to end. With a transparent constant or literal, the RPG/400 language 
  13151. ensures this result does not occur. 
  13152.  
  13153. If you specify 1 in position 57 of the control specification, transparent 
  13154. literals and constants are scanned. Your literal or constant is checked to be 
  13155. transparent, when an apostrophe followed by a shift-out character is found. If 
  13156. it is not, a warning message is issued on the compiler listing. The literal or 
  13157. constant is then treated as a literal or constant that is not transparent. 
  13158.  
  13159. Note:   If you specify the shift-out and shift-in characters in a hexadecimal 
  13160. literal, it will not be considered a transparent literal, and will not be 
  13161. checked if you specify a 1 in column 57 of the control specification. 
  13162.  
  13163. All RPG/400 restrictions on the length of constants or literals apply to 
  13164. transparent constants and literals, including the apostrophes and control 
  13165. characters. 
  13166.  
  13167. You may use transparent constants and literals in any of the places you use 
  13168. constants or literals: 
  13169.  
  13170.  In factor 1 and factor 2 of the calculation specifications. However, it may 
  13171.   not be meaningful to use DBCS data in all of these places. For example, a 
  13172.   move zone operation with a transparent literal in factor 2 will move only the 
  13173.   zone of the shift control character. See the description of each operation 
  13174.   code in Operation Codes to decide if it is appropriate to use a transparent 
  13175.   literal. 
  13176.  As a constant in the constant or edit word field (positions 45-70) of the 
  13177.   output specifications. 
  13178.  
  13179.  
  13180. ΓòÉΓòÉΓòÉ 1.11.4.2. Additional Considerations for Using DBCS Data in RPG/400 Programs ΓòÉΓòÉΓòÉ
  13181.  
  13182. Fields with DBCS data from externally defined files are defined by the RPG/400 
  13183. language as character fields. These fields are treated in the same manner as 
  13184. other character fields. However, on the cross-reference listing, the DBCS 
  13185. fields are indicated by IGC in the key field section, or by G in the field 
  13186. section. 
  13187.  
  13188.  
  13189. ΓòÉΓòÉΓòÉ 1.11.4.3. Example of Coding DBCS Data in an RPG/400 Program ΓòÉΓòÉΓòÉ
  13190.  
  13191. Here are some RPG/400 specifications that include DBCS data. 
  13192.  
  13193. In this figure, 'Kn' represents a DBCS character, 'o' represents shift-out 
  13194. character, and 'i' represents a shift-in character. 
  13195.  
  13196. This is an EBCDIC example. 
  13197.  
  13198. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  13199. H........1..CDYI....S..............1.F..............................
  13200. H                                                  1
  13201.  
  13202. You may check transparent literals and constants by specifying a 1 in column 57 
  13203. of the control specification. 
  13204.  
  13205. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  13206. E*
  13207. E*oK1K2K3K4iABoK1K2K3K4iCDEFGHoK1K2K3K4K5K6K7K8K9i
  13208.  
  13209. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  13210. E....FromfileTofile++Name++N/rN/tbLenPDSArrnamLenPDSComments
  13211. E                    ARR         4  5 0             oK1K2i ARRoK1i
  13212. E*
  13213.  
  13214. DBCS data may be mixed with alphanumeric data in comments. 
  13215.  
  13216. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  13217. CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
  13218. C           'oK1K2K3i'COMP FLDA                 161718
  13219. C                     MOVE 'oK1K2K3i'FLDB
  13220. C           LABELA    TAG                             'oK1K2K3K4i'
  13221. C*
  13222.  
  13223. Transparent constants and literals are DBCS data enclosed in apostrophes. 
  13224.  
  13225. *...1....+....2....+....3....+....4....+....5....+....6....+....7...
  13226. OName++++DFBASbSaN01N02N03Field+YBEnd+PConstant/editword+++++++++...
  13227. O                                    7 'oK1K2i'
  13228. O                                   48 'oK1K2K3K4K5K6K7i'
  13229. O                         FLDC      57 '$  0. oK1K2K3i'
  13230.  
  13231. You may use DBCS constants in your output specifications. 
  13232.  
  13233. Error status code 450 will be returned if shift-out and shift-in characters are 
  13234. not properly used. 
  13235.  
  13236. Here are some sample entries from a compile listing. FLDK1 is a DBCS field in 
  13237. an externally described file. 
  13238.  
  13239.  
  13240. Sample Key Field Information
  13241.  
  13242.                            PHYSICAL      LOGICAL
  13243.             FILE/RCD       FIELD         FIELD      ATTRIBUTES
  13244.  
  13245.  
  13246.                            FLDK1                    IGC      6
  13247.                            AFLD                     CHAR     3
  13248.  
  13249.  
  13250. Sample Cross-Reference Listing
  13251.  
  13252.             FIELD       ATTR       REFERENCE (M=MODIFIED D=DEFINED)
  13253.  
  13254.  
  13255.             FLDK1       G(6)        1000010D
  13256.             AFLD        A(2)        1000004D
  13257.  
  13258.  
  13259. ΓòÉΓòÉΓòÉ 1.12. RPG/400 Restrictions ΓòÉΓòÉΓòÉ
  13260.  
  13261. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  13262. Γöé FUNCTION                       Γöé RESTRICTION                   Γöé
  13263. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13264. Γöé AN/OR lines (positions 7 and 8 Γöé Maximum of 7 per operation.   Γöé
  13265. Γöé of calculation specifications) Γöé                               Γöé
  13266. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13267. Γöé Arrays and tables              Γöé Maximum of 200 per program.   Γöé
  13268. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13269. Γöé Array/table input record       Γöé Maximum length is 80.         Γöé
  13270. Γöé length for compile time        Γöé                               Γöé
  13271. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13272. Γöé Character field length         Γöé Maximum length is 256.        Γöé
  13273. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13274. Γöé Control fields (position 59    Γöé Maximum length is 256.        Γöé
  13275. Γöé and 60 of input specifica-     Γöé                               Γöé
  13276. Γöé tions) length                  Γöé                               Γöé
  13277. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13278. Γöé Data structure length          Γöé Maximum of 9999.              Γöé
  13279. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13280. Γöé Data structure occurrences     Γöé Maximum of 9999 per data      Γöé
  13281. Γöé (number of)                    Γöé structure.                    Γöé
  13282. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13283. Γöé Edit Word                      Γöé Maximum length of 24 for      Γöé
  13284. Γöé                                Γöé literals or 115 for named     Γöé
  13285. Γöé                                Γöé constants.                    Γöé
  13286. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13287. Γöé Elements in an array/table     Γöé Maximum of 9999 per           Γöé
  13288. Γöé (positions 36 through 39 of    Γöé array/table.                  Γöé
  13289. Γöé extension specifications)      Γöé                               Γöé
  13290. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13291. Γöé File                           Γöé Maximum of 50 per program.    Γöé
  13292. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13293. Γöé Levels of nesting in struc-    Γöé Maximum of 100.               Γöé
  13294. Γöé tured groups                   Γöé                               Γöé
  13295. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13296. Γöé Look-ahead                     Γöé Can be specified only once    Γöé
  13297. Γöé                                Γöé for a file.  Can be specified Γöé
  13298. Γöé                                Γöé only for primary and sec-     Γöé
  13299. Γöé                                Γöé ondary files.                 Γöé
  13300. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13301. Γöé Named Constant                 Γöé Maximum length of 256 for     Γöé
  13302. Γöé                                Γöé character named constant, 512 Γöé
  13303. Γöé                                Γöé for hexadecimal named con-    Γöé
  13304. Γöé                                Γöé stant, constant, 128 for DBCS Γöé
  13305. Γöé                                Γöé named constant, and 30 digits Γöé
  13306. Γöé                                Γöé with 9 decimal positions for  Γöé
  13307. Γöé                                Γöé numeric named constant.       Γöé
  13308. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13309. Γöé Overflow indicator             Γöé Only 1 unique overflow indi-  Γöé
  13310. Γöé                                Γöé cator can be specified per    Γöé
  13311. Γöé                                Γöé printer file.                 Γöé
  13312. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13313. Γöé Parameters                     Γöé Maximum of 255                Γöé
  13314. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13315. Γöé Primary file (P in position 16 Γöé Maximum of 1 per program.     Γöé
  13316. Γöé of file description specifica- Γöé                               Γöé
  13317. Γöé tions)                         Γöé                               Γöé
  13318. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13319. Γöé Printer file (PRINTER in posi- Γöé Maximum of 8 per program.     Γöé
  13320. Γöé tions 40 through 46 of file    Γöé                               Γöé
  13321. Γöé description specifications)    Γöé                               Γöé
  13322. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13323. Γöé Printing lines per page        Γöé Minimum of 2; maximum of 112. Γöé
  13324. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13325. Γöé Program status data structure  Γöé Only 1 allowed per program.   Γöé
  13326. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13327. Γöé Record address file (R in      Γöé Only 1 allowed per program.   Γöé
  13328. Γöé position 16 of file            Γöé                               Γöé
  13329. Γöé description specifications)    Γöé                               Γöé
  13330. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13331. Γöé Record length for program      Γöé Maximum length is 9999.  (1)  Γöé
  13332. Γöé described file (positions 24   Γöé                               Γöé
  13333. Γöé through 27 of file description Γöé                               Γöé
  13334. Γöé specifications)                Γöé                               Γöé
  13335. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13336. Γöé Structured groups (see levels  Γöé                               Γöé
  13337. Γöé of nesting)                    Γöé                               Γöé
  13338. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13339. Γöé Subroutines                    Γöé Maximum of 254 per program.   Γöé
  13340. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13341. Γöé Tables (see arrays)            Γöé                               Γöé
  13342. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13343. Γöé (1)Any device record size restraints override this value.      Γöé
  13344. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  13345.  
  13346.  
  13347. ΓòÉΓòÉΓòÉ 1.13. The Structured Query Language ΓòÉΓòÉΓòÉ
  13348.  
  13349. The AS/400 system allows you to insert SQL/400 statements into RPG/400 
  13350. programs. You enter SQL/400 statements on a calculation specification. The 
  13351. syntax is shown in Figure "Syntax for Entering SQL/400 Statements into an 
  13352. RPG/400 Program". You must observe the following rules: 
  13353.  
  13354.  The starting delimiter /EXEC SQL must be entered into columns 7-15, with the 
  13355.   slash in column 7. 
  13356.  
  13357.  SQL/400 statements can be started on the same line as the starting delimiter. 
  13358.  
  13359.  SQL/400 statements can be continued on any number of subsequent continuation 
  13360.   lines. The continuation line delimiter is the + in column 7. 
  13361.  
  13362.  SQL/400 statements cannot go past column 74. 
  13363.  
  13364.  The ending delimiter /END-EXEC must be entered in columns 7-15, with the 
  13365.   slash in column 7, on a separate line. This signals the end of the SQL/400 
  13366.   statements. It must be entered by itself, with no SQL/400 statements 
  13367.   following it. 
  13368.  
  13369.   You must enter a separate command to process the SQL/400 statements. 
  13370.  
  13371.   Refer to the SQL/400* Programmer's Guide and the SQL/400* Reference for the 
  13372.   descriptions of how to code SQL/400 statements. 
  13373.  
  13374.   For information on restrictions governing SQL statements in RPG/400 programs, 
  13375.   see Restrictions. 
  13376.  
  13377.  
  13378. ΓòÉΓòÉΓòÉ 1.13.1. SQL/400 Syntax ΓòÉΓòÉΓòÉ
  13379.  
  13380.  
  13381. Syntax for Entering SQL/400 Statements into an RPG/400 Program
  13382.  
  13383. C     :
  13384. C     :
  13385. C     :
  13386. C/EXEC SQL    (the starting delimiter)
  13387. C+
  13388. C+       (continuation lines containing SQL statements)
  13389. C+
  13390. .
  13391. .
  13392. .
  13393. C/END-EXEC    (the ending delimiter)
  13394. C     :
  13395. C     :
  13396. C     :
  13397.  
  13398.  
  13399. ΓòÉΓòÉΓòÉ 1.13.2. Restrictions ΓòÉΓòÉΓòÉ
  13400.  
  13401. In the RPG/400 programming language, the only restriction is that SQL/400 
  13402. statements cannot be specified in the referred source member of a /COPY 
  13403. statement. 
  13404.  
  13405.  
  13406. ΓòÉΓòÉΓòÉ 1.14. Simple Edit Codes ΓòÉΓòÉΓòÉ
  13407.  
  13408. You can use simple edit codes to edit numeric fields without adding any 
  13409. punctuation. The simple edit codes and their functions are: 
  13410.  
  13411.  The X edit code ensures a hexadecimal F sign for positive fields. However, 
  13412.   because the system does this, you normally do not have to specify this code. 
  13413.   Leading zeros are not suppressed. The X edit code does not modify negative 
  13414.   numbers. 
  13415.  The Y edit code is normally used to edit a three- to seven-digit date field. 
  13416.   The Y edit code suppresses only the leftmost zero; however, if the field is 
  13417.   seven positions long, the two leftmost positions are zero-suppressed. 
  13418.   Positions 20 (date edit) and  21 (decimal notation) of the control 
  13419.   specification can be used to alter edit formats. 
  13420.  The Z edit code removes the sign (plus or minus) from and suppresses the 
  13421.   leading zeros of a numeric field. The decimal point is not placed in the 
  13422.   field and is not printed. 
  13423.  
  13424.  
  13425. ΓòÉΓòÉΓòÉ 1.14.1. Combination Edit Codes ΓòÉΓòÉΓòÉ
  13426.  
  13427. The combination edit codes (1 through 4, A through D, J through Q) punctuate a 
  13428. numeric field. 
  13429.  
  13430. All of the edit codes suppress leading zeros to the left of the decimal 
  13431. notation except when J is specified in position 21 (decimal notation) of the 
  13432. control specification The decimal position of the source field determines 
  13433. whether and where a decimal point is printed. If decimal positions are 
  13434. specified for the source field and the zero balance is to be suppressed, the 
  13435. decimal notation prints only if the field is not zero. If a zero balance is not 
  13436. to be printed, a zero field prints as blanks. 
  13437.  
  13438. When a zero balance is to be printed and the field is equal to zero, either of 
  13439. the following is printed: 
  13440.  
  13441.  A decimal notation followed by n zeros, where n is the number of decimal 
  13442.   places in the field 
  13443.  A zero in the units position of a field if no decimal places are specified. 
  13444.  
  13445. You can use a floating currency symbol or asterisk protection with any of the 
  13446. 12 combination edit codes. To specify a floating currency symbol, code the 
  13447. currency symbol in positions 45 through 47 of the output specifications, along 
  13448. with an edit code in position 38 for the field to be edited.  The floating 
  13449. currency symbol appears to the left of the first significant digit. The 
  13450. floating currency symbol does not print on a zero balance when an edit code is 
  13451. used that suppresses the zero balance. (A dollar sign ($) is used as the 
  13452. currency symbol unless a currency symbol is specified in position 18 of the 
  13453. control specification.) 
  13454.  
  13455. An asterisk constant coded in positions 45 through 47 of the output 
  13456. specifications ('*'), along with an edit code for the field to be edited causes 
  13457. an asterisk to be printed for each zero suppressed.  A complete field of 
  13458. asterisks is printed on a zero balance source field. 
  13459.  
  13460. Asterisk fill and the floating currency symbol cannot be used with the simple 
  13461. (X, Y, Z) or with the user-defined (5 through 9) edit codes. 
  13462.  
  13463. A currency symbol can appear before the asterisk fill (fixed currency symbol). 
  13464. This requires the following coding: 
  13465.  
  13466.  1. Place an edit code in position 38. 
  13467.  2. Place a currency symbol constant one space before the beginning of the 
  13468.     edited field. 
  13469.  3. Place '*' in positions 45 through 47 of the line containing the edit code. 
  13470.  
  13471. When an edit code is used to print an entire array, two blanks precede each 
  13472. element of the array (except the first element). 
  13473.  
  13474. One of the decimal notation formats for output is a J entry in position 21 of 
  13475. the control specification. If you specify J, the use of commas and periods is 
  13476. reversed; that is, a period is used as the grouping separator character and a 
  13477. comma is used as the decimal notation. The zero-suppression character is in the 
  13478. second position (rather than the first) to the left of the decimal notation. 
  13479. This writes all zero balances and balances with zero values to the left of the 
  13480. comma with one leading zero (0,00 or 0,04).  The J entry also overrides any 
  13481. edit codes that might suppress the leading zero. Remember that the decimal 
  13482. positions of the source field determine whether and where a decimal notation is 
  13483. printed. 
  13484.  
  13485. Another decimal notation format is an I in position 21 of the control 
  13486. specification. If you specify I, a period is used as the grouping separator 
  13487. character and a comma is used as the decimal notation. 
  13488.  
  13489.  
  13490. ΓòÉΓòÉΓòÉ 1.14.2. Parts of an Edit Word ΓòÉΓòÉΓòÉ
  13491.  
  13492. An edit word (coded into positions 45 to 70 of the output specifications) 
  13493. consists of three parts:  the body, the status, and the expansion. The 
  13494. following shows the three parts of an edit word: 
  13495.  
  13496.             E D I T   W O R D
  13497. Γöé   Γöé   Γöé   Γöé   Γöé   Γöé   Γöé   Γöé   Γöé   Γöé   Γöé
  13498. Γöé b Γöé b Γöé b Γöé , Γöé b Γöé b Γöé 0 Γöé . Γöé b Γöé b Γöé
  13499. ΓööΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÿ
  13500.  Γöé                                     Γöé
  13501.  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  13502.                   Γöé
  13503.                 Body
  13504.  
  13505.    Γöé   Γöé   Γöé   Γöé   Γöé   Γöé   Γöé   Γöé   Γöé
  13506.    Γöé & Γöé C Γöé R Γöé & Γöé & Γöé T Γöé O Γöé T Γöé
  13507.    ΓööΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÿ
  13508.     Γöé         Γöé Γöé                 Γöé
  13509.     ΓööΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÿ ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  13510.          Γöé               Γöé
  13511.        Status        Expansion
  13512.  
  13513. The body is the space for the digits transferred from the source data field to 
  13514. the output record. The body begins at the leftmost position of the edit word. 
  13515. The number of blanks (plus one zero or an asterisk) in the edit word body must 
  13516. be equal to or greater than the number of digits of the source data field to be 
  13517. edited.  The body ends with the rightmost character that can be replaced by a 
  13518. digit. 
  13519.  
  13520. The status defines a space to allow for a negative indicator, either the two 
  13521. letters CR or a minus sign (-). The negative indicator specified is output only 
  13522. if the source data is negative.  All characters in the edit word between the 
  13523. last replaceable character (blank, zero suppression character) and the negative 
  13524. indicator are also output with the negative indicator only if the source data 
  13525. is negative; if the source data is positive, these status positions are 
  13526. replaced by blanks.  Edit words without the CR or - indicators have no status 
  13527. positions. 
  13528.  
  13529. The status must be entered after the last blank in the edit word. If more than 
  13530. one CR follows the last blank, only the first CR is treated as a status; the 
  13531. remaining CRs are treated as constants.  For the minus sign to be considered as 
  13532. a status, it must be the last character in the edit word. 
  13533.  
  13534. The expansion is a series of ampersands and constant characters entered after 
  13535. the status. Ampersands are replaced by blank spaces in the output; constants 
  13536. are output as is.  If status is not specified, the expansion follows the body. 
  13537.  
  13538.  
  13539. ΓòÉΓòÉΓòÉ 1.15. Array Data ΓòÉΓòÉΓòÉ
  13540.  
  13541. The first entry for each input record must begin in position 1. The entire 
  13542. record need not be filled with entries. The unused entries are filled with 
  13543. zeroes or blanks for numeric and character arrays respectively. 
  13544.  
  13545.  
  13546. ΓòÉΓòÉΓòÉ <hidden> Full Line ΓòÉΓòÉΓòÉ
  13547.  
  13548. You can use this line to enter any of the following: 
  13549.  
  13550. Control 
  13551. File description 
  13552. Extension 
  13553. Line counter 
  13554. Input 
  13555. Calculation 
  13556. Output 
  13557. Compiler Directive 
  13558. SQL Statement 
  13559. Array Data 
  13560. Comment (* in position 7). 
  13561.  
  13562.  
  13563. ΓòÉΓòÉΓòÉ <hidden> Creating RPGHSPEC.RPG ΓòÉΓòÉΓòÉ
  13564.  
  13565. You can use any editor to create RPGHSPEC.RPG provided the file is 80 
  13566. characters long, a properly coded control specification, and in the CODE base 
  13567. directory. If you wish to use the CODE/400 editor, you can follow this 
  13568. procedure: 
  13569.  
  13570.  1. Start CODE. 
  13571.  2. Click on File Pull-down and create a new file. 
  13572.  3. Select LOCAL from the Servers list.                  e 
  13573.  4. Select the RPG_400 Language profile. 
  13574.  5. Enter the desired H specification fields. You can use the H specification 
  13575.     prompt. 
  13576.  6. Save the file as RPGHSPEC.RPG if the CODE base directory. 
  13577.  7. Exit the edit session. 
  13578.  
  13579. Rename the file or move it to another directory if you wish to use the default 
  13580. blank H specification. 
  13581.  
  13582.  
  13583. ΓòÉΓòÉΓòÉ 1.16. RPG/400 Reserved Fields ΓòÉΓòÉΓòÉ
  13584.  
  13585.  Control Specification Reserved Fields 
  13586.  File Description Specification Reserved Fields 
  13587.  File Description Specification Externally Described Files Reserved Fields 
  13588.  File Description Specification Continuation Line Reserved Fields 
  13589.  File Description Specification Continuation (SFILE/RENAME) 
  13590.  Extension Specification Reserved Fields 
  13591.  Line Counter Specification Reserved Fields 
  13592.  Input Specification Record Reserved Fields 
  13593.  Input Specification Record AND/OR Reserved Fields 
  13594.  Input Specification Externally Described Record Reserved Fields 
  13595.  Input Specification Data Structure Reserved Fields 
  13596.  Input Specification Data Structure Subfield Reserved Fields 
  13597.  Input Specification Data Structure Subfield *KEYWORD Reserved Fields 
  13598.  Input Specification Initialization Reserved Fields 
  13599.  Input Specification Named Constant Reserved Fields 
  13600.  Output Specification Record Reserved Fields 
  13601.  Output Specification Record AND/OR Reserved Fields 
  13602.  Output Specification File Reserved Fields 
  13603.  Output Specification Externally Described Record Reserved Fields 
  13604.  Output Specification Externally Described File Reserved Fields 
  13605.  
  13606.  
  13607. ΓòÉΓòÉΓòÉ 1.16.1. Control Specification Reserved Fields ΓòÉΓòÉΓòÉ
  13608.  
  13609. Positions 7-14, 16-17, 22-25, 27-40, 42, 44-56, and 58-74 must be blank. 
  13610.  
  13611.  
  13612. ΓòÉΓòÉΓòÉ 1.16.2. File Description Specification Reserved Fields ΓòÉΓòÉΓòÉ
  13613.  
  13614. Positions 20-23, 47-52, 67-70 and 73-74 must be blank. 
  13615.  
  13616.  
  13617. ΓòÉΓòÉΓòÉ 1.16.3. File Description Specification Externally Described Files Reserved Fields ΓòÉΓòÉΓòÉ
  13618.  
  13619. Positions 20-27, 29-30, 32-39, 47-52, 67-70, and 73-74 must be blank. 
  13620.  
  13621.  
  13622. ΓòÉΓòÉΓòÉ 1.16.4. File Description Specification Continuation Line Reserved Fields ΓòÉΓòÉΓòÉ
  13623.  
  13624. Positions 7-18, 29-46, and 68-74 must be blank. 
  13625.  
  13626.  
  13627. ΓòÉΓòÉΓòÉ 1.16.5. File Description Specification Continuation (SFILE/RENAME) ΓòÉΓòÉΓòÉ
  13628.  
  13629. Positions 7-18, 29-46, and 66-74 must be blank. 
  13630.  
  13631.  
  13632. ΓòÉΓòÉΓòÉ 1.16.6. Extension Specification Reserved Fields ΓòÉΓòÉΓòÉ
  13633.  
  13634. Positions 7-10 must be blank. 
  13635.  
  13636.  
  13637. ΓòÉΓòÉΓòÉ 1.16.7. Line Counter Specification Reserved Fields ΓòÉΓòÉΓòÉ
  13638.  
  13639. Positions 25-74 must be blank. 
  13640.  
  13641.  
  13642. ΓòÉΓòÉΓòÉ 1.16.8. Input Specification Record Reserved Fields ΓòÉΓòÉΓòÉ
  13643.  
  13644. Positions 42-74 must be blank. 
  13645.  
  13646.  
  13647. ΓòÉΓòÉΓòÉ 1.16.9. Input Specification Record AND/OR Reserved Fields ΓòÉΓòÉΓòÉ
  13648.  
  13649. Positions 7-13, 17-18, and 42-74 must be blank. 
  13650.  
  13651.  
  13652. ΓòÉΓòÉΓòÉ 1.16.10. Input Specification Externally Described Record Reserved Fields ΓòÉΓòÉΓòÉ
  13653.  
  13654. Positions 15-18, 21-41, and 42-74 must be blank. 
  13655.  
  13656.  
  13657. ΓòÉΓòÉΓòÉ 1.16.11. Input Specification File Reserved Fields ΓòÉΓòÉΓòÉ
  13658.  
  13659. Positions 7-42, and 71-74 must be blank. 
  13660.  
  13661.  
  13662. ΓòÉΓòÉΓòÉ 1.16.12. Input Specification Externally Described File Reserved Fields ΓòÉΓòÉΓòÉ
  13663.  
  13664. Positions 7-20, 31-52, 63-64, and 71-74 must be blank. 
  13665.  
  13666.  
  13667. ΓòÉΓòÉΓòÉ 1.16.13. Input Specification Data Structure Reserved Fields ΓòÉΓòÉΓòÉ
  13668.  
  13669. Positions 13-16, 31-43, and 52-74 must be blank. 
  13670.  
  13671.  
  13672. ΓòÉΓòÉΓòÉ 1.16.14. Input Specification Data Structure Subfield Reserved Fields ΓòÉΓòÉΓòÉ
  13673.  
  13674. Positions 7, 9-20, 31-42, and 59-74 must be blank. 
  13675.  
  13676.  
  13677. ΓòÉΓòÉΓòÉ 1.16.15. Input Specification Data Structure Subfield *KEYWORD Reserved Fields ΓòÉΓòÉΓòÉ
  13678.  
  13679. Positions 7-43, 52, and 59-74 must be blank. 
  13680.  
  13681.  
  13682. ΓòÉΓòÉΓòÉ 1.16.16. Input Specification Initialization Reserved Fields ΓòÉΓòÉΓòÉ
  13683.  
  13684. Positions 7, 9-20, and 59-74 must be blank. 
  13685.  
  13686.  
  13687. ΓòÉΓòÉΓòÉ 1.16.17. Input Specification Named Constant Reserved Fields ΓòÉΓòÉΓòÉ
  13688.  
  13689. Positions 7-20, 44-52, and 59-74 must be blank. 
  13690.  
  13691.  
  13692. ΓòÉΓòÉΓòÉ 1.16.18. Output Specification Record Reserved Fields ΓòÉΓòÉΓòÉ
  13693.  
  13694. Positions 38-74 must be blank. 
  13695.  
  13696.  
  13697. ΓòÉΓòÉΓòÉ 1.16.19. Output Specification Record AND/OR Reserved Fields ΓòÉΓòÉΓòÉ
  13698.  
  13699. Positions 7-13 and 32-74 must be blank. 
  13700.  
  13701.  
  13702. ΓòÉΓòÉΓòÉ 1.16.20. Output Specification File Reserved Fields ΓòÉΓòÉΓòÉ
  13703.  
  13704. Positions 7-22, and 71-74 must be blank. 
  13705.  
  13706.  
  13707. ΓòÉΓòÉΓòÉ 1.16.21. Output Specification Externally Described Record Reserved Fields ΓòÉΓòÉΓòÉ
  13708.  
  13709. Positions 19-22, and 38-74 must be blank. 
  13710.  
  13711.  
  13712. ΓòÉΓòÉΓòÉ 1.16.22. Output Specification Externally Described File Reserved Fields ΓòÉΓòÉΓòÉ
  13713.  
  13714. Positions 7-22, 38, and 40-74 must be blank.