home *** CD-ROM | disk | FTP | other *** search
/ ftp.uv.es / 2014.11.ftp.uv.es.tar / ftp.uv.es / pub / mvs / TSOREXX.DISTRIB.CNTL.V1R1 < prev   
Text File  |  1993-08-17  |  261KB  |  3,219 lines

  1. //JOBNAME JOB ACCOUNT,'NAME'                                                    
  2. //*------------------------------------------------------------------*/         
  3. //*                                                                  */         
  4. //* Copyright (c) The Charles Stark Draper Laboratory, Inc., 1993    */         
  5. //*                                                                  */         
  6. //* This software is provided on an "AS IS" basis. All warranties,   */         
  7. //* including the implied warranties of merchantability and fitness, */         
  8. //* are expressly denied.                                            */         
  9. //*                                                                  */         
  10. //* Provided this copyright notice is included, this software may    */         
  11. //* be freely distributed and not offered for sale.                  */         
  12. //*                                                                  */         
  13. //* Changes or modifications may be made and used only by the maker  */         
  14. //* of same, and not further distributed. Such modifications should  */         
  15. //* be mailed to the author for consideration for addition to the    */         
  16. //* software and incorporation in subsequent releases.               */         
  17. //*                                                                  */         
  18. //*------------------------------------------------------------------*/         
  19. //*                                                                             
  20. //* TSO/REXX Utilities                                                          
  21. //*                                                                             
  22. //* Author: Steve Bacher <seb@draper.com>                                       
  23. //*                                                                             
  24. //* Date: 7 May 1993                                                            
  25. //*                                                                             
  26. //*-------------------------------------------------------------------          
  27. //*                                                                             
  28. //* This job creates the distribution libraries (PDS's).                        
  29. //*                                                                             
  30. //* Run this JCL to create the PDS's, after customizing to suit.                
  31. //* (Obviously, put in a good JOB statement first.)                             
  32. //* To customize the JCL, change the defaults on the //MDLOAD PROC              
  33. //* statement to your liking, particularly the PREFIX default.                  
  34. //* You might also want to change the final qualifiers of the PDS's             
  35. //* created - to do this, find the // EXEC MDLOAD statements and                
  36. //* change the value of the TO parameter.                                       
  37. //*                                                                             
  38. //* See the $$README file (of the CNTL PDS, first in this stream)               
  39. //* for the rest of the installation instructions.                              
  40. //*                                                                             
  41. //MDLOAD PROC CLS='*',BS='6160',U='3380',V='',                                  
  42. //      TRK1='30',TRK2='10',DIR='35',RLSE='RLSE',                               
  43. //      PREFIX='SYS8.TSOREXX.INSTALL.'                                          
  44. //*                                                                             
  45. //IEBUPDTE EXEC PGM=IEBUPDTE,PARM=NEW                                           
  46. //SYSPRINT DD SYSOUT=&CLS                                                       
  47. //SYSUT2 DD DISP=(NEW,CATLG,DELETE),DSN=&PREFIX.&TO,                            
  48. //  DCB=(RECFM=FB,LRECL=80,BLKSIZE=&BS),                                        
  49. //  SPACE=(TRK,(&TRK1,&TRK2,&DIR),&RLSE),UNIT=&U,VOL=SER=&V                     
  50. //*                                                                             
  51. //  PEND                                                                        
  52. //*                                                                             
  53. //CNTL     EXEC MDLOAD,TRK1='5',TO='CNTL'                                       
  54. //SYSIN    DD   DATA,DLM='?!'                                                   
  55. ./ ADD NAME=$$README                                                            
  56.                                                                                 
  57. TSO/REXX Utilities:  XPROC and XWRITENR                                         
  58.                                                                                 
  59. XPROC provides the capability of the CLIST PROC statement for TSO REXX          
  60. execs.  Similarly, XWRITENR provides the capability of the CLIST WRITENR        
  61. statement for TSO REXX execs.                                                   
  62.                                                                                 
  63. To install these utilities:                                                     
  64.                                                                                 
  65. (1) Pick a load library.  Probably you will need these to be in one of          
  66.     your MVS system link list libraries, but you might want to put it           
  67.     in a user library first.  The JCL (see next step) references this           
  68.     library and assumes it already exists, so make sure that it exists          
  69.     and that you can update it before you proceed.                              
  70.                                                                                 
  71. (2) Assemble and link all of the utilities.  The JCL is in the                  
  72.     corresponding member of the CNTL dataset (called either                     
  73.     SYS8.TSOREXX.INSTALL.CNTL or blah.CNTL, where blah is what you              
  74.     changed the MDLOAD prefix to).                                              
  75.                                                                                 
  76.     Before submitting the JCL, customize it so that it will run on your         
  77.     system.  In particular, change the names of the referenced data sets        
  78.     from SYS8.TSOREXX.INSTALL.ASM and SYS8.TSOREXX.LOAD to whatever you         
  79.     are using.  The .ASM was created when you built this distribution.          
  80.     The .LOAD was decided upon by you in step (1).                              
  81.     It was NOT allocated by building the distribution.                          
  82.                                                                                 
  83. (3) Install the TSO HELP files.  The HELP is in the corresponding member        
  84.     of the HELP dataset (called either SYS8.TSOREXX.INSTALL.HELP or             
  85.     blah.HELP, where blah is what you changed the MDLOAD prefix to).            
  86.                                                                                 
  87. (4) Get the load modules into a system load library, refresh LLA if             
  88.     applicable to your system, and enjoy.                                       
  89.                                                                                 
  90. (5) Send all gripes, compliments and suggestions to seb@draper.com.             
  91.                                                                                 
  92. ./ ADD NAME=XPROC                                                               
  93. //ASSEMBLE  EXEC PGM=IEV90,PARM='LIST,NODECK,OBJECT'                            
  94. //SYSPRINT  DD SYSOUT=A                                                         
  95. //SYSPUNCH  DD DUMMY                                                            
  96. //SYSLIB    DD DISP=SHR,DSN=SYS1.MACLIB                                         
  97. //SYSLIN    DD DISP=(,PASS),UNIT=SYSALLDA,SPACE=(1680,(10,50))                  
  98. //SYSUT1    DD UNIT=VIO,SPACE=(TRK,(100,100))                                   
  99. //SYSIN     DD DISP=SHR,DSN=SYS8.TSOREXX.INSTALL.ASM(XPROC)                     
  100. //*                                                                             
  101. //LINKEDIT  EXEC PGM=IEWL,PARM='LIST,LET,RENT,REUS,MAP',COND=(0,NE)             
  102. //SYSPRINT  DD SYSOUT=A                                                         
  103. //SYSLMOD   DD DISP=SHR,DSN=SYS8.TSOREXX.LOAD(XPROC)                            
  104. //SYSLIN    DD DISP=(OLD,DELETE),DSN=*.ASSEMBLE.SYSLIN                          
  105. //SYSUT1    DD UNIT=VIO,SPACE=(TRK,(100,100))                                   
  106. ./ ADD NAME=XWRITENR                                                            
  107. //ASSEMBLE  EXEC PGM=IEV90,PARM='LIST,NODECK,OBJECT'                            
  108. //SYSPRINT  DD SYSOUT=A                                                         
  109. //SYSPUNCH  DD DUMMY                                                            
  110. //SYSLIB    DD DISP=SHR,DSN=SYS1.MACLIB                                         
  111. //SYSLIN    DD DISP=(,PASS),UNIT=SYSALLDA,SPACE=(1680,(10,50))                  
  112. //SYSUT1    DD UNIT=VIO,SPACE=(TRK,(100,100))                                   
  113. //SYSIN     DD DISP=SHR,DSN=SYS8.TSOREXX.INSTALL.ASM(XWRITENR)                  
  114. //*                                                                             
  115. //LINKEDIT  EXEC PGM=IEWL,PARM='LIST,LET,RENT,REUS,MAP',COND=(0,NE)             
  116. //SYSPRINT  DD SYSOUT=A                                                         
  117. //SYSLMOD   DD DISP=SHR,DSN=SYS8.TSOREXX.LOAD(XWRITENR)                         
  118. //SYSLIN    DD DISP=(OLD,DELETE),DSN=*.ASSEMBLE.SYSLIN                          
  119. //SYSUT1    DD UNIT=VIO,SPACE=(TRK,(100,100))                                   
  120. ./ ENDUP                                                                        
  121. ?!                                                                              
  122. //*                                                                             
  123. //ASM      EXEC MDLOAD,TRK1='5',TO='ASM'                                        
  124. //SYSIN    DD   DATA,DLM='?!'                                                   
  125. ./ ADD NAME=XPROC                                                               
  126.          TITLE 'XPROC copyright notice'                                 00010000
  127. *********************************************************************** 00020000
  128. *                                                                     * 00030000
  129. *   Copyright (c) 1989 The Charles Stark Draper Laboratory, Inc.      * 00040000
  130. *                                                                     * 00050000
  131. *   This program is provided on an "as is" basis.  It may be freely   * 00060000
  132. *   distributed as long as it is not offered for commercial sale,     * 00070000
  133. *   and as long as this copyright notice is included.                 * 00080000
  134. *                                                                     * 00090000
  135. *********************************************************************** 00100000
  136.          TITLE 'XPROC macros'                                           00110000
  137.          MACRO                                                          00120000
  138. &SYM     ERROR &MSG,&FLUSH=YES                                          00130000
  139. &SYM     L     R1,=A(&MSG)         Get address of error message         00140000
  140.          LA    R0,L'&MSG           Get length of error message          00150000
  141.          BAL   R14,PUTLINE         Display error message                00160000
  142.          AIF   ('&FLUSH' EQ 'NO').MEND                                  00170000
  143.          B     FLUSHIT             Fail                                 00180000
  144. .MEND    MEND                                                           00190000
  145.          TITLE 'XPROC - CLIST-style command line parser for REXX'       00200000
  146. *********************************************************************** 00210000
  147. *                                                                     * 00220000
  148. * XPROC    - CLIST-style command line parser for REXX                 * 00230000
  149. *                                                                     * 00240000
  150. * Author:  S. Bacher 06/89                                            * 00250000
  151. *                                                                     * 00260000
  152. * Syntax:  XPROC {inputvar} number {positional-parameter-variables}*  * 00270000
  153. *                                  {keyword-and-maybe-value-specs}*   * 00280000
  154. *                                                                     * 00290000
  155. *        where: "inputvar" is a valid CLIST/REXX variable name        * 00300000
  156. *               and the part of the command that follows "inputvar"   * 00310000
  157. *               looks exactly like the syntax of the CLIST "PROC"     * 00320000
  158. *               statement.                                            * 00330000
  159. *                                                                     * 00340000
  160. * Example: /* REXX */                                                 * 00350000
  161. *          PARSE ARG OPERANDS                                         * 00360000
  162. *          "XPROC OPERANDS 2 FILE DSN VOL() SHR COUNT(1) KEY('A B')"  * 00370000
  163. *                                                                     * 00380000
  164. *          Note that everything, including "inputvar", must be quoted * 00390000
  165. *          under REXX to prevent substitution.                        * 00400000
  166. *                                                                     * 00410000
  167. * Function:  To parse the value of a string (accessed as "inputvar")  * 00420000
  168. *            according to the PROC-style specifications and place     * 00430000
  169. *            the results in REXX variables.  If "inputvar" is         * 00440000
  170. *            omitted, the argument to the REXX exec is parsed.        * 00450000
  171. *                                                                     * 00460000
  172. * Return codes:                                                       * 00470000
  173. *                                                                     * 00480000
  174. * 0 - normal operation                                                * 00490000
  175. * 12 - error(s) occurred, prompting not possible                      * 00500000
  176. *                                                                     * 00510000
  177. * Note:  This can be used in CLISTs as well.  One use might be to     * 00520000
  178. *        parse a non-command-buffer line, e.g. edit macro text.       * 00530000
  179. *                                                               #TSO147 00540000
  180. * Change activity:                                              #TSO147 00550000
  181. *                                                               #TSO147 00560000
  182. * 10/24/89 - SEB1525 - Bug fix when bigger keyword area needed. #TSO147 00570000
  183. * 01/30/91 - SEB1525 - Extended to permit the specification of        * 00580000
  184. *                      options via the syntax keyword/option.         * 00590000
  185. *                      First option so supported is lowercase.        * 00600000
  186. * 04/13/92 - SEB1525 - Bug fix when prototype has quoted data.  #TSO159 00610000
  187. * 12/15/92 - SEB1525 - Pass REXX env block from ECT to IRXEXCOM #TSO162 00620000
  188. *                      to solve problem with IPCS/ISPF          #TSO162 00630000
  189. *                                                                     * 00640000
  190. *********************************************************************** 00650000
  191.          SPACE 1                                                        00660000
  192. R0       EQU   0                                                        00670000
  193. R1       EQU   1                                                        00680000
  194. R2       EQU   2    Miscellaneous uses                                  00690000
  195. R3       EQU   3    Used by SCAN and PUTLINE; other temporary uses      00700000
  196. R4       EQU   4    Positional parameter info                           00710000
  197. R5       EQU   5    Positional parameter info                           00720000
  198. R6       EQU   6    Keyword count                                       00730000
  199. R7       EQU   7    Address of IKJPARS PDL answer area                  00740000
  200. R8       EQU   8    Used to loop through parameters                     00750000
  201. R9       EQU   9    Dynamic base register                               00760000
  202. R10      EQU   10   Static base register                                00770000
  203. R11      EQU   11   Static base register                                00780000
  204. R12      EQU   12   Static base register                                00790000
  205. R13      EQU   13   Save area pointer                                   00800000
  206. R14      EQU   14                                                       00810000
  207. R15      EQU   15                                                       00820000
  208.          SPACE 1                                                        00830000
  209. XPROC    CSECT                                                          00840000
  210. XPROC    AMODE 31                                                       00850000
  211. XPROC    RMODE ANY                                                      00860000
  212.          SAVE  (14,12),,XPROC_&SYSDATE._&SYSTIME                        00870000
  213.          LR    R12,R15                                                  00880000
  214.          USING XPROC,R12                                                00890000
  215.          LA    R11,4095(,R12)                                           00900000
  216.          USING XPROC+4095,R11                                           00910000
  217.          LA    R10,4095(,R11)                                           00920000
  218.          USING XPROC+4095+4095,R10                                      00930000
  219. *                                                                       00940000
  220. * Allocate storage to hold work area plus copies of positional and      00950000
  221. * keyword parameters.  Since the maximum length required to hold        00960000
  222. * all the parameters is obviously the length of the command buffer,     00970000
  223. * use that as the amount to add.                                        00980000
  224. *                                                                       00990000
  225.          LR    R2,R1               Save input parameter address         01000000
  226.          LA    R4,SIZDATD            Get length of basic workarea       01010000
  227.          L     R3,CPPLCBUF-CPPL(,R2) Point to command buffer            01020000
  228.          AH    R4,0(,R3)             Add length of command buffer       01030000
  229.          LR    R0,R4                                                    01040000
  230.          GETMAIN R,LV=(0)                                               01050000
  231.          ST    R13,4(,R1)                                               01060000
  232.          ST    R1,8(,R13)                                               01070000
  233.          LR    R13,R1                                                   01080000
  234.          LR    R9,R13                                                   01090000
  235.          USING DATD,R9                                                  01100000
  236.          ST    R4,DATDLEN          Save length of getmained area        01110000
  237.          LA    R0,WORDCOPY         Point to variable area               01120000
  238.          ST    R0,WORDPTR          Save address of it                   01130000
  239.          MVC   CPPL(16),0(R2)      Set up our copy of CPPL              01140000
  240.          MVC   IOPLUPT,CPPLUPT     Pointer TO UPT                       01150000
  241.          MVC   IOPLECT,CPPLECT     Pointer TO ECT                       01160000
  242.          LA    R0,ECB                                                   01170000
  243.          ST    R0,IOPLECB          Pointer to user's ECB                01180000
  244.          MVC   PTLIST(LENPUTL),MPTLIST Set up PUTLINE list form         01190000
  245.          LA    R0,1                Define 1 message segment             01200000
  246.          LA    R1,MSGHDR                                                01210000
  247.          STM   R0,R1,OLD           Make PUTLINE output line descriptor  01220000
  248. *                                  Initialize other data areas          01230000
  249.          STM   R11,R12,MYBASES     Base registers used in PARSE exits   01240000
  250.          MVI   FLAGS,X'00'         Clear flags                          01250000
  251.          XR    R0,R0               Make a zero                          01260000
  252.          ST    R0,APOSD                                                 01270000
  253.          ST    R0,LPOSD                                                 01280000
  254.          ST    R0,AKEYD                                                 01290000
  255.          ST    R0,LKEYD                                                 01300000
  256.          ST    R0,AKEYE                                                 01310000
  257.          ST    R0,POSCOUNT                                              01320000
  258.          ST    R0,KEYCOUNT                                              01330000
  259.          ST    R0,PWADDR                                                01340000
  260.          ST    R0,PWLEN                                                 01350000
  261.          ST    R0,VBUFADDR                                              01360000
  262.          ST    R0,VBUFLEN                                               01370000
  263.          ST    R0,ARGADDR                                               01380000
  264.          ST    R0,ARGLEN                                                01390000
  265. *                                                                       01400000
  266.          EJECT                                                          01410000
  267. *                                                                       01420000
  268. *********************************************************************** 01430000
  269. *                                                                       01440000
  270. * First, set things up so that SCAN can start scanning.  On entry to    01450000
  271. * the command, CPPLCBUF points to the command buffer.  Halfword 1 is    01460000
  272. * the length of the buffer plus 4, and halfword 2 is the offset of the  01470000
  273. * first operand (if any) past the command name in the buffer (set by    01480000
  274. * TSO's call to IKJSCAN).                                               01490000
  275. *                                                                       01500000
  276. *********************************************************************** 01510000
  277. *                                                                       01520000
  278.          L     R2,CPPLCBUF                                              01530000
  279.          LR    R1,R2                                                    01540000
  280.          AH    R1,0(,R2)                                                01550000
  281.          ST    R1,SCANEPTR         Save end of command buffer           01560000
  282.          LA    R1,4(,R2)                                                01570000
  283.          AH    R1,2(,R2)                                                01580000
  284.          ST    R1,SCANPTR          Initialize scan pointer              01590000
  285.          XR    R0,R0                                                    01600000
  286.          ST    R0,PARCOUNT         Initialize parenthesis count         01610000
  287. *                                                                       01620000
  288. *********************************************************************** 01630000
  289. *                                                                     * 01640000
  290. * Scan command buffer for first operand - must be input variable name * 01650000
  291. *                                                                     * 01660000
  292. *********************************************************************** 01670000
  293. *                                                                       01680000
  294.          BAL   R14,SCAN            Return R15 -> arg                    01690000
  295.          B     NOOPERANDS          No value                             01700000
  296.          B     ARG1OK              Unquoted name                        01710000
  297.          B     ERROR_NO_WANT_QS    Quoted string found                  01720000
  298.          B     ERROR_NO_WANT_LP    "(" found                            01730000
  299.          B     ERROR_NO_WANT_RP    ")" found                            01740000
  300.          B     ERROR_NO_WANT_SL    "/" found                            01750000
  301.          SPACE 1                                                        01760000
  302. ARG1OK   DS    0H                                                       01770000
  303.          SPACE 1                                                        01780000
  304. *                                                                       01790000
  305. *********************************************************************** 01800000
  306. *                                                                     * 01810000
  307. * Validate first argument as a variable name so that it can be used   * 01820000
  308. * to retrieve CLIST/REXX variable value.                              * 01830000
  309. *                                                                     * 01840000
  310. * We may not really have to do that here - just verify that it's not  * 01850000
  311. * a positional count.  If it is a positional count, set the address   * 01860000
  312. * and length of the input variable to zero (extension to XPROC will   * 01870000
  313. * get value to parse from REXX argument string in that case).         * 01880000
  314. *                                                                     * 01890000
  315. *********************************************************************** 01900000
  316. *                                                                       01910000
  317.          LR    R3,R1               Save address                         01920000
  318.          LR    R4,R2               Save length                          01930000
  319.          CH    R2,=H'256'          If it's too long for EX instruction  01940000
  320.          BH    ERROR_FIRST_ARG     then first arg is invalid            01950000
  321.          BCTR  R2,0                Reduce for execute                   01960000
  322.          EX    R2,TRTPOSCT         Scan for numerics                    01970000
  323.          BNZ   NOTPOSCOUNT         If any non-numerics, not a count     01980000
  324.          XR    R0,R0               Else make a zero                     01990000
  325.          ST    R0,PVARADDR         Clear address of the variable        02000000
  326.          ST    R0,PVARLEN          Clear length of the variable         02010000
  327.          B     ISACOUNT            Process this as the pos parm count   02020000
  328.          SPACE 1                                                        02030000
  329. NOTPOSCOUNT DS 0H                  Not a count - assume a variable name 02040000
  330.          LR    R14,R3              Get address of variable name         02050000
  331.          LA    R1,PVAR             Point to place to build var name     02060000
  332.          ST    R1,PVARADDR         Save address of the variable         02070000
  333.          ST    R4,PVARLEN          Save length of the variable          02080000
  334.          BCTR  R4,0                Reduce for execute                   02090000
  335.          EX    R4,MVCWORD          Move word to PVAR                    02100000
  336.          EX    R4,UPWORD           Translate to uppercase               02110000
  337.          SPACE 1                                                        02120000
  338. *                                                                       02130000
  339. *********************************************************************** 02140000
  340. *                                                                     * 02150000
  341. * Scan command buffer for next operand - must be count of positionals * 02160000
  342. *                                                                     * 02170000
  343. *********************************************************************** 02180000
  344. *                                                                       02190000
  345.          BAL   R14,SCAN                                                 02200000
  346.          B     NOPOSCOUNT          No value                             02210000
  347.          B     ARG2OK              Unquoted name                        02220000
  348.          B     ERROR_NO_WANT_QS    Quoted string found                  02230000
  349.          B     ERROR_NO_WANT_LP    "(" found                            02240000
  350.          B     ERROR_NO_WANT_RP    ")" found                            02250000
  351.          B     ERROR_NO_WANT_SL    "/" found                            02260000
  352.          SPACE 1                                                        02270000
  353. ARG2OK   DS    0H                  We have what should be a count...    02280000
  354.          LR    R3,R1               Get address of argument              02290000
  355.          LR    R4,R2               Get length of argument               02300000
  356. ISACOUNT DS    0H                  Here for first non-alpha arg...      02310000
  357. *                                                                       02320000
  358. *********************************************************************** 02330000
  359. *                                                                     * 02340000
  360. * Validate this argument as a number so that it can be used to count  * 02350000
  361. * the number of positional parameters.                                * 02360000
  362. *                                                                     * 02370000
  363. *********************************************************************** 02380000
  364. *                                                                       02390000
  365.          BCTR  R4,0                Reduce for execute                   02400000
  366.          CH    R4,=H'7'            If positional count more than 8 digs 02410000
  367.          BH    BADPOSCOUNT         then invalid value                   02420000
  368.          EX    R4,TRTPOSCT         Scan for numerics                    02430000
  369.          BNZ   BADPOSCOUNT         If any non-numerics, invalid value   02440000
  370.          EX    R4,PACKIT           Convert to numeric                   02450000
  371.          CVB   R0,DOUBLE           Get binary value                     02460000
  372.          ST    R0,POSCOUNT         Store positional parameter count     02470000
  373.          SPACE 1                                                        02480000
  374. *                                                                       02490000
  375. *********************************************************************** 02500000
  376. *                                                                     * 02510000
  377. * We are about to start collecting all parameter names, both          * 02520000
  378. * positional and keyword.  While we do this, we determine how much    * 02530000
  379. * space will be needed for IKJPARS control blocks.                    * 02540000
  380. *                                                                     * 02550000
  381. * Compute storage needed for the PCL (built by us):                   * 02560000
  382. *                                                                     * 02570000
  383. *   For initial overhead:            7                                * 02580000
  384. *   For each positional parameter:   56 + (2 * length(min(name,234))) * 02590000
  385. *   For each keyword with a value:   66 + (2 * length(min(name,237))) * 02600000
  386. *                                       + length(name)                * 02610000
  387. *   For each keyword without value:  11 + length(name)                * 02620000
  388. *                                                                     * 02630000
  389. * Compute storage reserved for the PDL (built by IKJPARS):            * 02640000
  390. *                                                                     * 02650000
  391. *   For initial overhead:            8                                * 02660000
  392. *   For each positional parameter:   8                                * 02670000
  393. *   For each keyword:                2                                * 02680000
  394. *   For each value subfield:         8                                * 02690000
  395. *                                                                     * 02700000
  396. *********************************************************************** 02710000
  397. *                                                                       02720000
  398.          LA    R0,7                Set PCL amount to initial value      02730000
  399.          ST    R0,PCLLEN                                                02740000
  400.          XR    R0,R0               Set quoted-value-strings length      02750000
  401.          ST    R0,QVALLEN                                               02760000
  402.          LA    R0,8                Set PDL initial total length         02770000
  403.          ST    R0,PDLLEN                                                02780000
  404. *                                                                       02790000
  405. *********************************************************************** 02800000
  406. *                                                                     * 02810000
  407. * Get storage to hold information for as many positional parameters   * 02820000
  408. * as we have defined.                                                 * 02830000
  409. *                                                                     * 02840000
  410. *********************************************************************** 02850000
  411. *                                                                       02860000
  412.          ICM   R5,15,POSCOUNT      Get count of positional parameters   02870000
  413.          BZ    NOPOZZES            If zero, no positional parameters    02880000
  414.          MH    R5,=Y(POSDDATL)     Get total length to acquire          02890000
  415.          GETMAIN RC,LV=(R5),LOC=ANY Get storage                         02900000
  416.          LTR   R15,R15             If GETMAIN failed,                   02910000
  417.          BNZ   BADPOSCOUNT         then positional count too big        02920000
  418.          ST    R1,APOSD            Save address of this area            02930000
  419.          ST    R5,LPOSD            Save length of this area             02940000
  420.          LR    R4,R1               Address first entry in area          02950000
  421.          USING POSDDATA,R4                                              02960000
  422. *                                                                       02970000
  423. *********************************************************************** 02980000
  424. *                                                                     * 02990000
  425. * Loop (positional-parameter-count) times, collecting variable names. * 03000000
  426. *                                                                     * 03010000
  427. *********************************************************************** 03020000
  428. *                                                                       03030000
  429.          NI    FLAGS,255-FLAGPOSD  Not currently processing anything    03040000
  430.          NI    FLAGS,255-FLAGKEYD                                       03050000
  431.          XR    R0,R0               Zero out error fields                03060000
  432.          ST    R0,LASTADDR                                              03070000
  433.          ST    R0,LASTLEN                                               03080000
  434.          ST    R0,LASTAREA                                              03090000
  435.          L     R8,POSCOUNT         Get count of positional parameters   03100000
  436. PPLOOP   DS    0H                  R5 contains count of parms to get    03110000
  437.          BAL   R14,SCAN            Get a positional parame              03120000
  438.          B     PPMISSING           No value                             03130000
  439.          B     PPADD               Unquoted name                        03140000
  440.          B     ERROR_NO_WANT_QS    Quoted string found                  03150000
  441.          B     PPLP                "(" found                            03160000
  442.          B     ERROR_NO_WANT_RP    ")" found                            03170000
  443.          B     PPSLASH             "/" found                            03180000
  444.          SPACE 1                                                        03190000
  445. PPLP     DS    0H                  "(" found when a positional expected 03200000
  446.          C     R8,POSCOUNT         If no pos. parms found yet           03210000
  447.          BE    ERROR_NO_WANT_LP    then this is truly an error; else    03220000
  448. *                                  (future extension, but error now)    03230000
  449.          L     R3,LASTADDR         Get address of last processed P.P.   03240000
  450.          L     R2,LASTLEN          Get length of last processed P.P.    03250000
  451.          B     ERROR_PP_WITH_LP    say value spec not allowed           03260000
  452.          SPACE 1                                                        03270000
  453. PPSLASH  DS    0H                  "/" found when a positional expected 03280000
  454.          BAL   R14,DOOPTS          Process options                      03290000
  455.          B     PPLOOP                                                   03300000
  456.          SPACE 1                                                        03310000
  457. PPADD    DS    0H                  Add a positional parameter           03320000
  458. *                                                                       03330000
  459. * Check parameter for validity, and (if it's OK) make uppercase copy    03340000
  460. * of it in our area.                                                    03350000
  461. *                                                                       03360000
  462.          CH    R2,=H'255'          If too long                          03370000
  463.          BH    ERROR_PARM_TOO_LONG then error                           03380000
  464.          LR    R14,R1              Address                              03390000
  465.          LR    R15,R2              Length                               03400000
  466.          BCTR  R15,0               Reduce length for execute            03410000
  467.          EX    R15,VERIFYP         Check syntax of parameter            03420000
  468.          BNZ   ERROR_PARM_INVALID  If bad, error                        03430000
  469.          CLI   0(R14),C'0'         Must not begin with numeric          03440000
  470.          BNL   ERROR_PARM_INVALID  If bad, error                        03450000
  471.          L     R1,WORDPTR          Get next available word slot         03460000
  472.          EX    R15,MVCWORD         Move word to slot                    03470000
  473.          EX    R15,UPWORD          Translate to uppercase               03480000
  474.          LA    R0,1(R15,R1)        Update slot pointer                  03490000
  475.          ST    R0,WORDPTR          for next time                        03500000
  476. *                                                                       03510000
  477. * Check for duplicates. R1 -> new word, R15 = length-1                  03520000
  478. *                                                                       03530000
  479.          L     R2,APOSD            Get address of first positional      03540000
  480.          LA    R0,1(,R15)          Get true length                      03550000
  481. CDPPLOOP DS    0H                  Loop to check for duplicates         03560000
  482.          CR    R2,R4               until we hit current PP slot         03570000
  483.          BNL   CDPPLEND                                                 03580000
  484.          C     R0,POSDLEN-POSDDATA(,R2)                                 03590000
  485.          BNE   CDPPNEXT            If lengths don't match, continue     03600000
  486.          L     R14,POSDADDR-POSDDATA(,R2) Point to old parameter        03610000
  487.          EX    R15,COMPWORD        If values are equal,                 03620000
  488.          BE    ERROR_PARM_DUPLICATE then error                          03630000
  489. CDPPNEXT LA    R2,POSDDATL(,R2)    Else continue                        03640000
  490.          B     CDPPLOOP                                                 03650000
  491. CDPPLEND DS    0H                  End loop to check for duplicates     03660000
  492.          LA    R2,1(,R15)          Get length                           03670000
  493.          ST    R1,POSDADDR         Save address of this pos. parm.      03680000
  494.          ST    R2,POSDLEN          Save length of this pos. parm.       03690000
  495.          XR    R0,R0               Clear other fields                   03700000
  496.          ST    R0,POSDPCEA                                              03710000
  497.          MVI   POSDFLGS,0                                               03720000
  498.          ST    R4,LASTAREA         Save for option/error processing     03730000
  499.          ST    R1,LASTADDR         Save for option/error processing     03740000
  500.          ST    R2,LASTLEN          Save for option/error processing     03750000
  501.          OI    FLAGS,FLAGPOSD      Say currently processing positional  03760000
  502.          NI    FLAGS,255-FLAGKEYD                                       03770000
  503. *                                                                       03780000
  504. * PCE length for positional param: 56 + (2 * length(min(name,234)))     03790000
  505. * PDE length for positional param: 8                                    03800000
  506. *                                                                       03810000
  507.          LR    R15,R2              Get length of positional parm name   03820000
  508.          CH    R15,=H'234'         If longer than 255-21                03830000
  509.          BNH   *+8                 then                                 03840000
  510.          LA    R15,255-21           set length to 255-21                03850000
  511.          ST    R15,POSDMAXL        Store this length                    03860000
  512.          SLA   R15,1               2 * length(min(name,234))            03870000
  513.          LA    R15,56(,R15)        56 + (2 * length(min(name,234)))     03880000
  514.          ST    R15,POSDPCEL        Set length of PCE for this parameter 03890000
  515.          A     R15,PCLLEN          Accumulate PCL length                03900000
  516.          ST    R15,PCLLEN                                               03910000
  517.          LA    R1,8                Length of PDE for positional = 8     03920000
  518.          A     R1,PDLLEN           Accumulate PDL length                03930000
  519.          ST    R1,PDLLEN                                                03940000
  520.          LA    R4,POSDDATL(,R4)    Bump pointer                         03950000
  521.          BCT   R8,PPLOOP           Loop until count exhausted           03960000
  522.          SPACE 1                                                        03970000
  523. NOPOZZES DS    0H                  Here if no positional parameters     03980000
  524.          SPACE 1                                                        03990000
  525. *                                                                       04000000
  526. *********************************************************************** 04010000
  527. *                                                                     * 04020000
  528. * Get storage to hold information for keyword and value parameters.   * 04030000
  529. * We don't know how much we'll need yet, so we'll get a chunk of it   * 04040000
  530. * and hope for the best.                                              * 04050000
  531. *                                                                     * 04060000
  532. *********************************************************************** 04070000
  533. *                                                                       04080000
  534.          L     R5,KEYDINCR         Get estimated initial length         04090000
  535.          GETMAIN RC,LV=(R5),LOC=ANY Get storage                         04100000
  536.          LTR   R15,R15                                                  04110000
  537.          BNZ   GETMAIN_FAILURE                                          04120000
  538.          ST    R1,AKEYD            Save address of this area            04130000
  539.          ST    R5,LKEYD            Save length of this area             04140000
  540.          XR    R4,R4               Start things off                     04150000
  541.          USING KEYDDATA,R4                                              04160000
  542.          LA    R0,0(R1,R5)         Point to end of area                 04170000
  543.          ST    R0,AKEYE            Save address of end                  04180000
  544. *                                                                       04190000
  545. *********************************************************************** 04200000
  546. *                                                                     * 04210000
  547. * Loop collecting keywords and keyword/value pairs.                   * 04220000
  548. *                                                                     * 04230000
  549. *********************************************************************** 04240000
  550. *                                                                       04250000
  551.          XR    R6,R6               Clear keyword count                  04260000
  552. KVLOOP   DS    0H                                                       04270000
  553.          BAL   R14,SCAN            Get a keyword parameter              04280000
  554.          B     KVEND               No more                              04290000
  555.          B     KVADD               Unquoted name                        04300000
  556.          B     ERROR_NO_WANT_QS    Quoted string found                  04310000
  557.          B     KVLP                "(" found                            04320000
  558.          B     ERROR_NO_WANT_RP    ")" found                            04330000
  559.          B     KVSLASH             "/" found                            04340000
  560.          SPACE 1                                                        04350000
  561. KVLP     DS    0H                  "(" found when a keyword expected    04360000
  562.          LTR   R6,R6               If we've seen keyword parms already  04370000
  563.          BNZ   ERROR_NO_WANT_LP    then this is truly an error          04380000
  564.          ICM   R0,15,POSCOUNT      Else if no positional parameters     04390000
  565.          BZ    ERROR_NO_WANT_LP    then this is truly an error.  Else,  04400000
  566. *                                  (future extension, but error now)    04410000
  567.          L     R3,LASTADDR         Get address of last processed P.P.   04420000
  568.          L     R2,LASTLEN          Get length of last processed P.P.    04430000
  569.          B     ERROR_PP_WITH_LP    say value spec w/p.p. not allowed    04440000
  570.          SPACE 1                                                        04450000
  571. KVSLASH  DS    0H                  "/" found when a keyword expected    04460000
  572.          BAL   R14,DOOPTS          Process options                      04470000
  573.          B     KVLOOP                                                   04480000
  574.          SPACE 1                                                        04490000
  575. KVADD    DS    0H                  Add a keyword parameter              04500000
  576.          OI    FLAGS,FLAGKEYD      Say we're currently processing       04510000
  577.          NI    FLAGS,255-FLAGPOSD  keyword/value parameters             04520000
  578.          LTR   R4,R4               If we haven't got any keywords yet   04530000
  579.          BNZ   KVNZ                then                                 04540000
  580.          L     R4,AKEYD             point to first entry in area        04550000
  581.          B     KVA                  and do our stuff.                   04560000
  582. KVNZ     DS    0H                  Else...                              04570000
  583.          LA    R4,KEYDDATL(,R4)    Bump pointer                         04580000
  584.          C     R4,AKEYE            If this takes us past end of buffer  04590000
  585.          BL    KVA                 then...                      #TSO147 04600000
  586.          STM   R1,R2,SCANRES       Store result of scan                 04610000
  587.          L     R5,LKEYD             get length of current area          04620000
  588.          A     R5,KEYDINCR          increment it                        04630000
  589.          GETMAIN RC,LV=(R5),LOC=ANY get storage                         04640000
  590.          LTR   R15,R15                                                  04650000
  591.          BNZ   GETMAIN_FAILURE                                          04660000
  592.          LR    R2,R1               Address of new key area              04670000
  593.          LR    R0,R2               Address of new key area              04680000
  594.          L     R14,AKEYD           Address of old key area              04690000
  595.          L     R1,LKEYD            Length of old key area               04700000
  596.          LR    R15,R1              Length of old key area               04710000
  597.          MVCL  R0,R14              Move old key data to new key data    04720000
  598.          LR    R4,R0               Point to slot in new key area        04730000
  599.          L     R1,AKEYD            Address of old key area              04740000
  600.          L     R0,LKEYD            Length of old key area               04750000
  601.          FREEMAIN RC,LV=(0),A=(1)  Free the old key area                04760000
  602.          ST    R2,AKEYD            Save address of new area             04770000
  603.          ST    R5,LKEYD            Save length of new area              04780000
  604.          LA    R0,0(R2,R5)         Point to end of area                 04790000
  605.          ST    R0,AKEYE            Save address of end                  04800000
  606.          LM    R1,R2,SCANRES       Load results of scan                 04810000
  607. KVA      DS    0H                                                       04820000
  608. *                                                                       04830000
  609. * Check parameter for validity, and (if it's OK) make uppercase copy    04840000
  610. * of it in our area.                                                    04850000
  611. *                                                                       04860000
  612.          CH    R2,=H'255'          If too long                          04870000
  613.          BH    ERROR_PARM_TOO_LONG then error                           04880000
  614.          LR    R14,R1              Address                              04890000
  615.          LR    R15,R2              Length                               04900000
  616.          BCTR  R15,0               Reduce length for execute            04910000
  617.          EX    R15,VERIFYP         Check syntax of parameter            04920000
  618.          BNZ   ERROR_PARM_INVALID  If bad, error                        04930000
  619.          CLI   0(R14),C'0'         Must not begin with numeric          04940000
  620.          BNL   ERROR_PARM_INVALID  If bad, error                        04950000
  621.          L     R1,WORDPTR          Get next available word slot         04960000
  622.          EX    R15,MVCWORD         Move word to slot                    04970000
  623.          EX    R15,UPWORD          Translate to uppercase               04980000
  624.          LA    R0,1(R15,R1)        Update slot pointer                  04990000
  625.          ST    R0,WORDPTR          for next time                        05000000
  626. *                                                                       05010000
  627. * Check for duplicates. R1 -> new word, R15 = length-1                  05020000
  628. *                                                                       05030000
  629.          ICM   R8,15,POSCOUNT      Get count of positionals             05040000
  630.          BZ    KVPPLEND            If none, don't check 'em, obviously  05050000
  631.          L     R2,APOSD            Get address of first positional      05060000
  632.          LA    R0,1(,R15)          Get true length                      05070000
  633. KVPPLOOP DS    0H                  Loop to check for duplicates         05080000
  634.          C     R0,POSDLEN-POSDDATA(,R2)                                 05090000
  635.          BNE   KVPPNEXT            If lengths don't match, continue     05100000
  636.          L     R14,POSDADDR-POSDDATA(,R2) Point to old parameter        05110000
  637.          EX    R15,COMPWORD        If values are equal,                 05120000
  638.          BE    ERROR_PARM_DUPLICATE then error                          05130000
  639. KVPPNEXT LA    R2,POSDDATL(,R2)    Else continue                        05140000
  640.          BCT   R8,KVPPLOOP         until no more positionals            05150000
  641. KVPPLEND DS    0H                  End loop to check for duplicates     05160000
  642. *                                  Now check against keywords so far    05170000
  643.          LTR   R8,R6               Get count of keywords                05180000
  644.          BZ    KVKWLEND            If none so far, don't check 'em      05190000
  645.          L     R2,AKEYD            Get address of first keyword         05200000
  646.          LA    R0,1(,R15)          Get true length                      05210000
  647. KVKWLOOP DS    0H                  Loop to check for duplicates         05220000
  648.          C     R0,KEYWORDL-KEYDDATA(,R2)                                05230000
  649.          BNE   KVKWNEXT            If lengths don't match, continue     05240000
  650.          L     R14,KEYWORDA-KEYDDATA(,R2) Point to old parameter        05250000
  651.          EX    R15,COMPWORD        If values are equal,                 05260000
  652.          BE    ERROR_PARM_DUPLICATE then error                          05270000
  653. KVKWNEXT LA    R2,KEYDDATL(,R2)    Else continue                        05280000
  654.          BCT   R8,KVKWLOOP         until no more keywords               05290000
  655. KVKWLEND DS    0H                  End loop to check for duplicates     05300000
  656.          LA    R6,1(,R6)           Increment keyword count              05310000
  657.          LA    R2,1(,R15)          Get length                           05320000
  658.          ST    R1,KEYWORDA         Save address of this pos. parm.      05330000
  659.          ST    R2,KEYWORDL         Save length of this pos. parm.       05340000
  660.          ST    R4,LASTAREA         Save for option/error processing     05350000
  661.          ST    R1,LASTADDR         Save for option/error processing     05360000
  662.          ST    R2,LASTLEN          Save for option/error processing     05370000
  663.          XR    R0,R0               Clear other keyword/value fields     05380000
  664.          ST    R0,KEYDVALA                                              05390000
  665.          ST    R0,KEYDVALL                                              05400000
  666.          ST    R0,KEYDPCEA                                              05410000
  667.          ST    R0,KEYDPCEL                                              05420000
  668.          ST    R0,KEYDMAXL                                              05430000
  669.          ST    R0,KEYSUBOF                                              05440000
  670.          MVI   KEYFLAGS,0                                               05450000
  671. KVOLOOP  DS    0H                                                       05460000
  672. *                                                                       05470000
  673. * Now get the next thing, which might be a parenthesized default value  05480000
  674. * or a slashed keyword processing option                                05490000
  675. *                                                                       05500000
  676.          BAL   R14,SCAN            Get a keyword parameter              05510000
  677.          B     KVFINEND            No more                              05520000
  678.          B     KVFINADD            Unquoted name, it's another keyword  05530000
  679.          B     ERROR_NO_WANT_QS    Quoted string found                  05540000
  680.          B     KVVALUE             "(" found                            05550000
  681.          B     ERROR_NO_WANT_RP    ")" found                            05560000
  682.          B     KVOPTION            "/" found                            05570000
  683.          SPACE 1                                                        05580000
  684. KVOPTION DS    0H                  We (probably) have a /option...      05590000
  685.          BAL   R14,DOOPTS          Process options                      05600000
  686.          B     KVOLOOP                                                  05610000
  687.          SPACE 1                                                        05620000
  688. KVVALUE  DS    0H                  We (probably) have a value...        05630000
  689.          SPACE 1                                                        05640000
  690. *                                                                       05650000
  691. * Scan for the value (can be any kind of string).                       05660000
  692. *                                                                       05670000
  693.          BAL   R14,SCAN            Get a value string                   05680000
  694.          B     KVNULL              End of buffer, value is null         05690000
  695.          B     KVWORD              Unquoted name, it's a value          05700000
  696.          B     KVSTRING            Quoted string found, it's a value    05710000
  697.          B     KVERROR             "(" found, should never happen       05720000
  698.          B     KVNULL              ")" found, value is null             05730000
  699.          B     KVERROR             "/" found, should never happen       05740000
  700.          SPACE 1                                                        05750000
  701. KVWORD   DS    0H                  Unquoted word is the value           05760000
  702.          ST    R1,KEYDVALA         Store address of default value       05770000
  703.          ST    R2,KEYDVALL         Store length of default value        05780000
  704.          OI    KEYFLAGS,KEYFDVAL   Indicate a default value present     05790000
  705.          B     KVGETRP             Go get right paren                   05800000
  706.          SPACE 1                                                        05810000
  707. KVSTRING DS    0H                  Quoted string is the value           05820000
  708.          ST    R1,KEYDVALA         Store address of default value       05830000
  709.          ST    R2,KEYDVALL         Store length of default value        05840000
  710.          OI    KEYFLAGS,KEYFDVAL   Indicate a default value present     05850000
  711.          OI    KEYFLAGS,KEYFQUOT   Indicate it's a quoted string        05860000
  712.          B     KVGETRP             Go get right paren                   05870000
  713.          SPACE 1                                                        05880000
  714. KVGETRP  DS    0H                  Time to terminate the value...       05890000
  715. *                                                                       05900000
  716. * Scan for the right parenthesis that ends the value spec               05910000
  717. *                                                                       05920000
  718.          BAL   R14,SCAN            Get a value string                   05930000
  719.          B     KVFINEND            End of buffer                        05940000
  720.          B     KVEXTRA             Unquoted name, shouldn't be there    05950000
  721.          B     KVEXTRA             Quoted string, shouldn't be there    05960000
  722.          B     KVERROR             "(" found, should never happen       05970000
  723.          B     KVFINLOP            ")" found, OK, continue looping      05980000
  724.          B     KVERROR             "/" found, should never happen       05990000
  725.          SPACE 1                                                        06000000
  726. KVEXTRA  DS    0H                                                       06010000
  727. *                                  (future extension, but for now)      06020000
  728.          LR    R3,R1               Get address of extraneous data       06030000
  729. ******** LR    R2,R2               Get length of extraneous data        06040000
  730.          LA    R1,MSG_EXTRANEOUS   Ignore extraneous info               06050000
  731.          LA    R0,L'MSG_EXTRANEOUS                                      06060000
  732.          BAL   R14,PUTLINE                                              06070000
  733.          B     KVGETRP             Keep looking for that right paren    06080000
  734.          SPACE 1                                                        06090000
  735. KVNULL   DS    0H                                                       06100000
  736.          OI    KEYFLAGS,KEYFDVAL   Indicate a default value present     06110000
  737.          LA    R14,KVLOOP          (but it's null)                      06120000
  738.          B     KVACCUM             Accumulate length, then get next KW  06130000
  739.          SPACE 1                                                        06140000
  740. KVFINLOP DS    0H                  End keyword(value), another follows  06150000
  741.          LA    R14,KVLOOP          Proceed to KVLOOP after doing...     06160000
  742.          B     KVACCUM             accumulation for this keyword        06170000
  743.          SPACE 1                                                        06180000
  744. KVFINADD DS    0H                  End this keyword, another follows    06190000
  745.          LA    R14,KVADD           Proceed to KVADD after doing...      06200000
  746.          B     KVACCUM             accumulation for this keyword        06210000
  747.          SPACE 1                                                        06220000
  748. KVFINEND DS    0H                  End this keyword, no more follow     06230000
  749.          LA    R14,KVEND           Proceed to KVEND after doing...      06240000
  750. ******** B     KVACCUM             accumulation for this keyword        06250000
  751.          SPACE 1                                                        06260000
  752. KVACCUM  DS    0H                                                       06270000
  753. *                                                                       06280000
  754. *   Calculate PCE and PDE lengths for keyword parameter                 06290000
  755. *   For each keyword with a value:                                      06300000
  756. *     66 + (2 * length(min(name,237))) + length(name)                   06310000
  757. *   For each keyword without value:                                     06320000
  758. *     11 + length(name)                                                 06330000
  759. *                                                                       06340000
  760. * We're going to use the same storage to build unquoted values of       06350000
  761. * keywords, so add that length in too.                                  06360000
  762. *                                                                       06370000
  763.          STM   R1,R2,SCANRES       Save results of scan                 06380000
  764.          L     R15,KEYWORDL        Get length of keyword name           06390000
  765.          TM    KEYFLAGS,KEYFDVAL   If a value specified                 06400000
  766.          BNO   PCKWNVAL            then...                              06410000
  767.          CH    R15,=H'237'         min(name,237)                        06420000
  768.          BNH   *+8                                                      06430000
  769.          LA    R15,237                                                  06440000
  770.          ST    R15,KEYDMAXL        Save this length                     06450000
  771.          SLA   R15,1               2 * length(min(name,237))            06460000
  772.          LA    R15,66(,R15)        66 + (2 * length(min(name,237)))     06470000
  773.          A     R15,KEYWORDL        66 + ... + length(name)              06480000
  774.          LA    R1,8                Accumulate PDL length for subfield   06490000
  775.          A     R1,PDLLEN                                                06500000
  776.          ST    R1,PDLLEN                                                06510000
  777.          TM    KEYFLAGS,KEYFQUOT   If value is quoted string            06520000
  778.          BNO   PCKWNEXT            then...                              06530000
  779.          L     R1,KEYDVALL          accumulate value length             06540000
  780.          A     R1,QVALLEN                                               06550000
  781.          ST    R1,QVALLEN          (actual'll be less, but never more)  06560000
  782.          B     PCKWNEXT                                                 06570000
  783. PCKWNVAL DS    0H                  No value specified...                06580000
  784.          LA    R15,11(,R15)        just 11 + length(name)               06590000
  785. PCKWNEXT DS    0H                                                       06600000
  786.          ST    R15,KEYDPCEL        Save PCE length                      06610000
  787.          A     R15,PCLLEN          Accumulate PCL length for keyword    06620000
  788.          ST    R15,PCLLEN                                               06630000
  789.          LA    R1,2                Accumulate PDL length for keyword    06640000
  790.          A     R1,PDLLEN                                                06650000
  791.          ST    R1,PDLLEN                                                06660000
  792.          LM    R1,R2,SCANRES       Load results of scan                 06670000
  793.          BR    R14                 Go to KVADD or KVEND or KVLOOP       06680000
  794.          SPACE 1                                                        06690000
  795. KVEND    DS    0H                  No more parameters of any kind       06700000
  796.          SPACE 1                                                        06710000
  797.          ST    R6,KEYCOUNT         Save number of keywords              06720000
  798.          SPACE 1                                                        06730000
  799.          EJECT                                                          06740000
  800. *********************************************************************** 06750000
  801. *                                                                     * 06760000
  802. * Prepare to build control blocks for IKJPARS for the parameters,     * 06770000
  803. * like so:                                                            * 06780000
  804. *                                                                     * 06790000
  805. *          IKJPARM                                                    * 06800000
  806. *                                                                     * 06810000
  807. *   For each positional parameter "pp":                               * 06820000
  808. *                                                                     * 06830000
  809. *          IKJIDENT 'POSITIONAL PARAMETER pp',                        * 06840000
  810. *                ASIS,   /* only if the /ASIS option is specified */  * 06850000
  811. *                CHAR,   /* only if /QUOTABLE option is specified */  * 06860000
  812. *                FIRST=ANY,OTHER=ANY,                                 * 06870000
  813. *                PROMPT='POSITIONAL PARAMETER pp'                     * 06880000
  814. *                                                                     * 06890000
  815. *   For each keyword parameter "kv" with a value "val";               * 06900000
  816. *                                                                     * 06910000
  817. *          IKJKEYWD                                                   * 06920000
  818. *          IKJNAME 'kv',SUBFLD=kvsubfld                               * 06930000
  819. *                                                                     * 06940000
  820. *   For each keyword parameter "kw" without a value:                  * 06950000
  821. *                                                                     * 06960000
  822. *          IKJKEYWD                                                   * 06970000
  823. *          IKJNAME 'kv'                                               * 06980000
  824. *                                                                     * 06990000
  825. *   For each keyword parameter "kv" with a value "val", as above:     * 07000000
  826. *                                                                     * 07010000
  827. * kvsubfld IKJSUBF                                                    * 07020000
  828. *          IKJIDENT 'VALUE FOR KEYWORD kv',                           * 07030000
  829. *                ASIS,   /* only if the /ASIS option is specified */  * 07040000
  830. *                CHAR,                                                * 07050000
  831. *                PROMPT='VALUE FOR KEYWORD kv'                        * 07060000
  832. *                                                                     * 07070000
  833. *          IKJENDP                                                    * 07080000
  834. *                                                                     * 07090000
  835. * Note that the default value from the specifications is not part of  * 07100000
  836. * the IKJPARS parameters.  Rather, the absence of the keyword is      * 07110000
  837. * detected after the call to PARSE and, at that point, the default    * 07120000
  838. * value is used if the terminal user did not provide one.             * 07130000
  839. *                                                                     * 07140000
  840. * Compute storage needed for the PCL (built by us):                   * 07150000
  841. *                                                                     * 07160000
  842. *   For initial overhead:            7                                * 07170000
  843. *   For each positional parameter:   56 + (2 * length(name))          * 07180000
  844. *   For each keyword with a value:   66 + (3 * length(name))          * 07190000
  845. *   For each keyword without value:  11 + length(name)                * 07200000
  846. *                                                                     * 07210000
  847. * Compute storage reserved for the PDL (built by IKJPARS):            * 07220000
  848. *                                                                     * 07230000
  849. *   For initial overhead:            8                                * 07240000
  850. *   For each positional parameter:   8                                * 07250000
  851. *   For each keyword:                2                                * 07260000
  852. *   For each value subfield:         8                                * 07270000
  853. *                                                                     * 07280000
  854. * We're going to use the same storage to build unquoted values of     * 07290000
  855. * keywords, so add that length in too.  Also, we want to include      * 07300000
  856. * storage for the final call to IKJCT441 to update all parameters.    * 07310000
  857. * How much storage is needed to build the parameter list:  9 words    * 07320000
  858. * for each parameter, plus 4 extra words = 13*4.                      * 07330000
  859. *                                                                     * 07340000
  860. *********************************************************************** 07350000
  861.          EJECT                                                          07360000
  862. *                                                                       07370000
  863. * Get storage for the PCL plus dequoted value strings plus IKJCT441 PL  07380000
  864. *                                                                       07390000
  865.          L     R1,PDLLEN                                                07400000
  866.          LA    R1,7(,R1)           Round PDL length                     07410000
  867.          N     R1,=X'FFFFFFF8'      up to doubleword boundary           07420000
  868.          ST    R1,PDLLEN           Store length of PDL                  07430000
  869.          LA    R1,8                                                     07440000
  870.          A     R1,QVALLEN          Quoted-string-length + fudge factor  07450000
  871.          ST    R1,QVALLEN          Store length of quoted-value area    07460000
  872.          A     R1,PCLLEN           Get length of PCL plus quoted area   07470000
  873.          L     R0,POSCOUNT         Get count of positional parameters   07480000
  874.          A     R0,KEYCOUNT         Add count of positional parameters   07490000
  875.          MH    R0,=Y(13*4)         Compute # of plists required         07500000
  876.          ST    R0,VUPLEN           Store length of IKJCTT41 parm list   07510000
  877.          AR    R0,R1               Add to total length                  07520000
  878.          ST    R0,PWLEN            Store length of this area            07530000
  879.          GETMAIN RC,LV=(0),LOC=ANY Get it                               07540000
  880.          LTR   R15,R15             If didn't get it, error              07550000
  881.          BNZ   GETMAIN_FAILURE                                          07560000
  882.          ST    R1,PWADDR           Save address thereof                 07570000
  883.          LR    R4,R1               Initialize PCL entry pointer         07580000
  884.          LA    R5,8                Initialize PDL offset value          07590000
  885.          XR    R0,R0               Clear other PCE-related junk         07600000
  886.          ST    R0,FIRSTKEY                                              07610000
  887.          ST    R0,SUBTOSET                                              07620000
  888. *                                                                       07630000
  889. * Build the IKJPARM part of the PCL.                                    07640000
  890. *                                                                       07650000
  891. * PCE contents:  +0 (2)  Length of entire PCL                           07660000
  892. *                +2 (2)  Length of PDL returned by PARSE                07670000
  893. *                +4 (2)  Offset in PDL to first IKJKEYWD PCE            07680000
  894. *                        (or to end-of-field indicator, i.e.            07690000
  895. *                        the x'0000' in an IKJSUBF or IKJENDP)          07700000
  896. *                                                                       07710000
  897. *        ...   ..,0(,R4)           Leave this unset for now...          07720000
  898.          L     R0,PDLLEN                                                07730000
  899.          STH   R0,2(,R4)           IKJPARM +2 (2) Length of PDL         07740000
  900. *        ...   ..,4(,R4)           Leave this unset for now...          07750000
  901.          LA    R4,6(,R4)           Bump past this PCE                   07760000
  902. *                                                                       07770000
  903. * For each positional parameter, build an IKJIDENT PCE.                 07780000
  904. *                                                                       07790000
  905. * PCE contents:  +0 (1)  Flags:  B'1001 0100' (IKJIDENT, PROMPT)        07800000
  906. *                +1 (1)  Flags:  B'0x00 0000' (x = 1 if ASIS, else 0)   07810000
  907. *                +2 (2)  Length of this PCE: 56 + 2*length(name)        07820000
  908. *                +4 (2)  Offset in PDL to PDE for this parameter        07830000
  909. *                +6 (1)  Flags:  B'0000 x000' (x = 1 if CHAR, else 0)   07840000
  910. *                +7 (1)  X'00' (FIRST=ANY)                              07850000
  911. *                +8 (1)  X'00' (OTHER=ANY)                              07860000
  912. *                +9 (2)  Length of 'POSITIONAL PARAMETER pp' + 4        07870000
  913. *                                  (25 + length(name))                  07880000
  914. *                +B (2)  X'0012'                                        07890000
  915. *                +D (*)  'POSITIONAL PARAMETER pp' (21 + length(name))  07900000
  916. *                +* (1)  Length of 'POSITIONAL PARAMETER pp' - 1        07910000
  917. *                                  (20 + length(name))                  07920000
  918. *                +* (*)  'POSITIONAL PARAMETER pp' (21 + length(name))  07930000
  919. *                                                                       07940000
  920.          ICM   R8,15,POSCOUNT      Get count of positionals             07950000
  921.          BZ    PBPPLEND            If none, skip                        07960000
  922.          L     R2,APOSD            Get address of first positional      07970000
  923. PBPPLOOP DS    0H                  Loop to build PCE's                  07980000
  924.          ST    R4,POSDPCEA-POSDDATA(,R2) Set address of PCE for this    07990000
  925.          MVI   0(R4),B'10010100'   +0 (1) Flags                         08000000
  926.          TM    POSDFLGS-POSDDATA(R2),POSDASIS If /ASIS option given     08010000
  927.          BZ    PBPPNASI                       then                      08020000
  928.          MVI   1(R4),B'01000000'   +1 (1) Flags                         08030000
  929.          B     PBPPAEND                       else                      08040000
  930. PBPPNASI MVI   1(R4),B'00000000'   +1 (1) Flags                         08050000
  931. PBPPAEND DS    0H                                                       08060000
  932.          L     R14,POSDPCEL-POSDDATA(,R2) Get length of PCE             08070000
  933.          STH   R14,2(,R4)          +2 (2) Length of this PCE            08080000
  934.          STH   R5,4(,R4)           +4 (2) Offset in PDL to PDE for this 08090000
  935.          TM    POSDFLGS-POSDDATA(R2),POSDCHAR If /QUOTABLE option given 08100000
  936.          BZ    PBPPNCHA                       then                      08110000
  937.          MVI   6(R4),B'00001000'   +6 (1) Flags                         08120000
  938.          B     PBPPCEND                       else                      08130000
  939. PBPPNCHA MVI   6(R4),B'00000000'   +6 (1) Flags                         08140000
  940. PBPPCEND DS    0H                                                       08150000
  941.          MVI   7(R4),X'00'         +7 (1) X'00' (FIRST=ANY)             08160000
  942.          MVI   8(R4),X'00'         +8 (1) X'00' (OTHER=ANY)             08170000
  943.          L     R15,POSDMAXL-POSDDATA(,R2) Get length of name for prompt 08180000
  944.          LA    R0,25(,R15)         21 + length(name) + 4                08190000
  945.          STH   R0,9(,R4)           +9 (2) Length of '...' + 4           08200000
  946.          MVC   11(2,R4),=X'0012'   +B (2) X'0012'                       08210000
  947.          MVC   13(21,R4),=C'POSITIONAL PARAMETER '                      08220000
  948.          LA    R4,13+21(,R4)       Point to where to move param name    08230000
  949.          BCTR  R15,0               Reduce length for execute            08240000
  950.          L     R1,POSDADDR-POSDDATA(,R2) Get address of parameter name  08250000
  951.          EX    R15,MVCTOPCE        Move parameter name to PCL           08260000
  952.          LA    R4,1(R15,R4)        Bump PCE pointer                     08270000
  953.          LA    R0,21(,R15)         21 + length(name) - 1                08280000
  954.          STC   R0,0(,R4)           Length of prompt data                08290000
  955.          MVC   1(21,R4),=C'POSITIONAL PARAMETER '                       08300000
  956.          LA    R4,1+21(,R4)        Point to where to move param name    08310000
  957.          EX    R15,MVCTOPCE        Move parameter name to PCL           08320000
  958.          LA    R4,1(R15,R4)        Bump PCE pointer                     08330000
  959.          LA    R5,8(,R5)           Increment PDE offset                 08340000
  960.          LA    R2,POSDDATL(,R2)    Continue                             08350000
  961.          BCT   R8,PBPPLOOP          until no more positionals           08360000
  962. PBPPLEND DS    0H                  End loop                             08370000
  963. *                                                                       08380000
  964. * For each keyword parameter, build an IKJKEYWD PCE.                    08390000
  965. *                                                                       08400000
  966. * PCE contents:  +0 (1)  Flags:  B'0100 0000' (IKJKEYWD)                08410000
  967. *                +1 (1)  Flags:  B'0000 0000'                           08420000
  968. *                +2 (2)  Length of this PCE: 6                          08430000
  969. *                +4 (2)  Offset in PDL to PDE for this parameter        08440000
  970. *                                                                       08450000
  971. * If the keyword has a value, build an IKJNAME PCE as follows:          08460000
  972. *                                                                       08470000
  973. * PCE contents:  +0 (1)  Flags:  B'0110 0100' (IKJNAME, has subfield)   08480000
  974. *                +1 (1)  Flags:  B'0000 0000'                           08490000
  975. *                +2 (2)  Length of this PCE: 7 + length(name)           08500000
  976. *                +4 (1)  Length of keyword name minus 1                 08510000
  977. *                +5 (*)  the keyword name                               08520000
  978. *                +* (2)  offset (plus 1) in PCL to subfield PCE         08530000
  979. *                                                                       08540000
  980. * A subfield will be built as well.  But not now.                       08550000
  981. *                                                                       08560000
  982. * If the keyword doesn't have a value, build an IKJNAME PCE as follows: 08570000
  983. *                                                                       08580000
  984. * PCE contents:  +0 (1)  Flags:  B'0110 0000' (IKJNAME, no subfield)    08590000
  985. *                +1 (1)  Flags:  B'0000 0000'                           08600000
  986. *                +2 (2)  Length of this PCE: 5 + length(name)           08610000
  987. *                +4 (1)  Length of keyword name minus 1                 08620000
  988. *                +5 (*)  the keyword name                               08630000
  989. *                                                                       08640000
  990.          ICM   R8,15,KEYCOUNT      Get count of keywords                08650000
  991.          BZ    PBKWLEND            If none, skip                        08660000
  992.          L     R2,AKEYD            Get address of first keyword         08670000
  993. PBKWLOOP DS    0H                  Loop to build PCE's                  08680000
  994. *                                                                       08690000
  995. * Build IKJKEYWD PCE                                                    08700000
  996. *                                                                       08710000
  997.          ICM   R0,15,FIRSTKEY      If this is first keyword             08720000
  998.          BNZ   *+8                 then                                 08730000
  999.          ST    R4,FIRSTKEY         set address of first keyword PCE     08740000
  1000.          ST    R4,KEYDPCEA-KEYDDATA(,R2) Set address of PCE for this    08750000
  1001.          MVI   0(R4),B'01000000'   +0 (1) Flags (IKJKEYWD)              08760000
  1002.          MVI   1(R4),B'00000000'   +1 (1) Flags                         08770000
  1003.          LA    R0,6                                                     08780000
  1004.          STH   R0,2(,R4)           +2 (2) Length of this PCE            08790000
  1005.          STH   R5,4(,R4)           +4 (2) Offset in PDL to PDE for this 08800000
  1006.          LA    R4,6(,R4)           Bump PCE pointer                     08810000
  1007. *                                                                       08820000
  1008. * Build IKJNAME PCE, format of which depends if with value or not.      08830000
  1009. *                                                                       08840000
  1010.          TM    KEYFLAGS-KEYDDATA(R2),KEYFDVAL If a value specified      08850000
  1011.          BNO   PBKWNVAL            then...                              08860000
  1012.          MVI   0(R4),B'01100100'   +0 (1) Flags (IKJNAME, has subfield) 08870000
  1013.          MVI   1(R4),B'00000000'   +1 (1) Flags                         08880000
  1014.          L     R15,KEYWORDL-KEYDDATA(,R2) Get length of parameter name  08890000
  1015.          LA    R0,7(,R15)                7 + length(name)               08900000
  1016.          STH   R0,2(,R4)           +2 (2) Length of this PCE            08910000
  1017.          BCTR  R15,0               Length minus 1 for store & execute   08920000
  1018.          STC   R15,4(,R4)          +4 (1) Length of keyword name - 1    08930000
  1019.          LA    R4,5(,R4)           Point to where to move keyword name  08940000
  1020.          L     R1,KEYWORDA-KEYDDATA(,R2) Get address of keyword name    08950000
  1021.          EX    R15,MVCTOPCE        Move keyword name to PCE             08960000
  1022.          LA    R4,1(R15,R4)        Bump past name                       08970000
  1023.          ST    R4,KEYSUBOF-KEYDDATA(,R2) Save where to set subfield off 08980000
  1024. *        ...   ...0(,R4)           Leave subfield offset out for now    08990000
  1025.          LA    R4,2(,R4)           Bump to end of PCE                   09000000
  1026.          B     PBKWNEXT                                                 09010000
  1027. PBKWNVAL DS    0H                  No value specified...                09020000
  1028.          TM    KEYFLAGS-KEYDDATA(R2),KEYFASIS If /ASIS was specified    09030000
  1029.          BO    ERROR_ASIS_NEEDS_VAL           then error                09040000
  1030.          MVI   0(R4),B'01100000'   +0 (1) Flags (IKJNAME, no subfield)  09050000
  1031.          MVI   1(R4),B'00000000'   +1 (1) Flags                         09060000
  1032.          L     R15,KEYWORDL-KEYDDATA(,R2) Get length of parameter name  09070000
  1033.          LA    R0,5(,R15)                5 + length(name)               09080000
  1034.          STH   R0,2(,R4)           +2 (2) Length of this PCE            09090000
  1035.          BCTR  R15,0               Length minus 1 for store & execute   09100000
  1036.          STC   R15,4(,R4)          +4 (1) Length of keyword name - 1    09110000
  1037.          LA    R4,5(,R4)           Point to where to move keyword name  09120000
  1038.          L     R1,KEYWORDA-KEYDDATA(,R2) Get address of keyword name    09130000
  1039.          EX    R15,MVCTOPCE        Move keyword name to PCE             09140000
  1040.          LA    R4,1(R15,R4)        Bump past name                       09150000
  1041. ******** LA    R4,0(,R4)           Bump to end of PCE                   09160000
  1042. PBKWNEXT DS    0H                                                       09170000
  1043.          LA    R5,2(,R5)           Increment PDE offset                 09180000
  1044.          LA    R2,KEYDDATL(,R2)    Continue                             09190000
  1045.          BCT   R8,PBKWLOOP          until no more keywords              09200000
  1046. PBKWLEND DS    0H                  End loop                             09210000
  1047. *                                                                       09220000
  1048. * For each keyword parameter with a value, build subfield PCE's.        09230000
  1049. *                                                                       09240000
  1050. * Build an IKJSUBF PCE.                                                 09250000
  1051. *                                                                       09260000
  1052. * PCE contents:  +0 (1)  Flags:  B'0000 0000' (end-of-field indicator)  09270000
  1053. *                +1 (2)  Offset in PCL to next end-of-field indicator   09280000
  1054. *                        (either the next IKJSUBF or the IKJENDP).      09290000
  1055. *                        If the subfield had keywords, this would have  09300000
  1056. *                        to point to the next IKJKEYWD PCE therein.     09310000
  1057. *                                                                       09320000
  1058. * Build an IKJIDENT PCE for the keyword value.                          09330000
  1059. *                                                                       09340000
  1060. * PCE contents:  +0 (1)  Flags:  B'1001 0100' (IKJIDENT, PROMPT)        09350000
  1061. *                +1 (1)  Flags:  B'0x00 0000' (x = 1 if ASIS, else 0)   09360000
  1062. *                +2 (2)  Length of this PCE: 50 + 2*length(name)        09370000
  1063. *                +4 (2)  Offset in PDL to PDE for this parameter        09380000
  1064. *                +6 (1)  Flags:  B'0000 1000' (CHAR)                    09390000
  1065. *                +7 (1)  X'01' (FIRST= is not applicable)               09400000
  1066. *                +8 (1)  X'01' (OTHER= is not applicable)               09410000
  1067. *                +9 (2)  Length of 'VALUE FOR KEYWORD pp' + 4           09420000
  1068. *                                  (22 + length(name))                  09430000
  1069. *                +B (2)  X'0012'                                        09440000
  1070. *                +D (*)  'VALUE FOR KEYWORD pp' (18 + length(name))     09450000
  1071. *                +* (1)  Length of 'VALUE FOR KEYWORD pp' - 1           09460000
  1072. *                                  (17 + length(name))                  09470000
  1073. *                +* (*)  'VALUE FOR KEYWORD pp' (18 + length(name))     09480000
  1074. *                                                                       09490000
  1075.          ICM   R8,15,KEYCOUNT      Get count of keywords                09500000
  1076.          BZ    PSKWLEND            If none, skip                        09510000
  1077.          L     R2,AKEYD            Get address of first keyword         09520000
  1078. PSKWLOOP DS    0H                  Loop to build subfield PCE's         09530000
  1079.          ICM   R14,15,KEYSUBOF-KEYDDATA(R2) Get where to put sub offset 09540000
  1080.          BZ    PSNOSUB             If none, skip                        09550000
  1081.          LA    R0,1(,R4)           Get address of PCE we're building    09560000
  1082.          S     R0,PWADDR           Convert to offset plus 1             09570000
  1083.          STH   R0,0(,R14)          Set keyword PCE's subfield offset    09580000
  1084. *                                                                       09590000
  1085. * Build IKJSUBF PCE                                                     09600000
  1086. *                                                                       09610000
  1087.          ICM   R1,15,SUBTOSET      If there's a previous IKJSUBF PCE    09620000
  1088.          BZ    PSNSUBST            to set, then                         09630000
  1089.          LR    R0,R4                get address of this IKJSUBF PCE     09640000
  1090.          S     R0,PWADDR            convert to offset                   09650000
  1091.          STH   R0,1(,R1)            set offset to next subfield         09660000
  1092. PSNSUBST DS    0H                                                       09670000
  1093.          ST    R4,SUBTOSET         Set address of subfield to set       09680000
  1094.          MVI   0(R4),B'00000000'   +0 (1) Flags (end-of-field indicator 09690000
  1095. *        ...   ...,1(,R4)          +1 (1) Offset of next SUBF or ENDP   09700000
  1096.          LA    R4,3(,R4)           Bump PCE pointer                     09710000
  1097.          MVI   0(R4),B'10010100'   +0 (1) Flags (IKJIDENT, PROMPT)      09720000
  1098.          TM    KEYFLAGS-KEYDDATA(R2),KEYFASIS If /ASIS option given     09730000
  1099.          BZ    PSNASIS                        then                      09740000
  1100.          MVI   1(R4),B'01000000'   +1 (1) Flags                         09750000
  1101.          B     PSNAEND                        else                      09760000
  1102. PSNASIS  MVI   1(R4),B'00000000'   +1 (1) Flags                         09770000
  1103. PSNAEND  DS    0H                                                       09780000
  1104.          L     R15,KEYDMAXL-KEYDDATA(,R2) Get length of name for prompt 09790000
  1105.          LR    R14,R15                                                  09800000
  1106.          SLA   R14,1               2 * length(name)                     09810000
  1107.          LA    R14,50(,R14)        50 + (2 * length(name))              09820000
  1108.          STH   R14,2(,R4)          +2 (2) Length of this PCE            09830000
  1109.          STH   R5,4(,R4)           +4 (2) Offset in PDL to PDE for this 09840000
  1110.          MVI   6(R4),B'00001000'   +6 (1) Flags (CHAR)                  09850000
  1111.          MVI   7(R4),X'01'         +7 (1) X'01' (FIRST=n/a)             09860000
  1112.          MVI   8(R4),X'01'         +8 (1) X'01' (OTHER=n/a)             09870000
  1113.          LA    R0,22(,R15)         18 + length(name) + 4                09880000
  1114.          STH   R0,9(,R4)           +9 (2) Length of '...' + 4           09890000
  1115.          MVC   11(2,R4),=X'0012'   +B (2) X'0012'                       09900000
  1116.          MVC   13(18,R4),=C'VALUE FOR KEYWORD '                         09910000
  1117.          LA    R4,13+18(,R4)       Point to where to move keyword name  09920000
  1118.          BCTR  R15,0               Length minus 1 for store & execute   09930000
  1119.          L     R1,KEYWORDA-KEYDDATA(,R2) Get address of keyword name    09940000
  1120.          EX    R15,MVCTOPCE        Move keyword name to PCL             09950000
  1121.          LA    R4,1(R15,R4)        Bump PCE pointer                     09960000
  1122.          LA    R0,18(,R15)         18 + length(name) - 1                09970000
  1123.          STC   R0,0(,R4)           Length of prompt data                09980000
  1124.          MVC   1(18,R4),=C'VALUE FOR KEYWORD '                          09990000
  1125.          LA    R4,1+18(,R4)        Point to where to move keyword name  10000000
  1126.          EX    R15,MVCTOPCE        Move keyword name to PCL             10010000
  1127.          LA    R4,1(R15,R4)        Bump PCE pointer                     10020000
  1128.          LA    R5,8(,R5)           Increment PDE offset                 10030000
  1129. PSNOSUB  DS    0H                                                       10040000
  1130.          LA    R2,KEYDDATL(,R2)    Continue                             10050000
  1131.          BCT   R8,PSKWLOOP          until no more keywords              10060000
  1132. PSKWLEND DS    0H                  End loop                             10070000
  1133.          SPACE 1                                                        10080000
  1134. *                                                                       10090000
  1135. * Build the IKJENDP part of the PCL.                                    10100000
  1136. *                                                                       10110000
  1137. * PCE contents:  +0 (1)  Flags:  B'0000 0000' (end-of-field indicator)  10120000
  1138. *                                                                       10130000
  1139.          MVI   0(R4),B'00000000'   +0 (1) Flags                         10140000
  1140.          ICM   R1,15,SUBTOSET      If there's a previous IKJSUBF PCE    10150000
  1141.          BZ    PENSUBST            to set, then                         10160000
  1142.          LR    R0,R4                get address of this IKJENDP PCE     10170000
  1143.          S     R0,PWADDR            convert to offset                   10180000
  1144.          STH   R0,1(,R1)            set offset to next subfield         10190000
  1145. PENSUBST DS    0H                                                       10200000
  1146.          ICM   R1,15,FIRSTKEY      If no keyword PCE built              10210000
  1147.          BNZ   PEGOTKEY            then                                 10220000
  1148.          ST    R4,FIRSTKEY          make this the one                   10230000
  1149. PEGOTKEY DS    0H                                                       10240000
  1150.          L     R15,PWADDR          Get address of start of PCE          10250000
  1151.          L     R0,FIRSTKEY         Load offset of first key/or/etc.PCE  10260000
  1152.          SR    R0,R15              Convert to offset                    10270000
  1153.          STH   R0,4(,R15)          Set offset in IKJPARM PCE            10280000
  1154.          LA    R4,1(,R4)           Bump past this PCE                   10290000
  1155.          LR    R0,R4                                                    10300000
  1156.          S     R0,PWADDR           Convert to offset                    10310000
  1157.          ST    R0,PCLLEN           Set actual PCL length                10320000
  1158.          L     R1,PWADDR           Get address of IKJPARM PCE           10330000
  1159.          STH   R0,0(,R1)           IKJPARM +0 (2) Length of PCL         10340000
  1160.          ST    R4,QOFF             Save address of where to build       10350000
  1161. *                                   unquoted strings                    10360000
  1162. *                                                                       10370000
  1163. * Note that unquoted strings won't be built until/unless we assign      10380000
  1164. * default values from them after a successful parse of the arguments.   10390000
  1165. *                                                                       10400000
  1166.          EJECT                                                          10410000
  1167. *                                                                       10420000
  1168. * Next steps:  If initial variable specified, use IKJCT441 to get its   10430000
  1169. *              value.  Otherwise use REXX call to get at arguments.     10440000
  1170. *              Make a command buffer out of this and call IKJPARS.      10450000
  1171. *              If parsing successful, go thru each positional and       10460000
  1172. *              keyword parameter, getting its value, and assign all     10470000
  1173. *              the values using IKJCT441.                               10480000
  1174. *                                                                       10490000
  1175.          ICM   R0,15,PVARADDR      Get address of first-arg variable    10500000
  1176.          BZ    NOVAR               If none, try REXX arg call           10510000
  1177.          ST    R0,CVNAMEA          Set address of variable name         10520000
  1178.          L     R0,PVARLEN          Get length of first-arg variable     10530000
  1179.          ST    R0,CVNAMEL          Set length of variable name          10540000
  1180.          LA    R0,TSVERETR         Return variable value                10550000
  1181. *                                  (create variable if doesn't exist)   10560000
  1182.          ST    R0,CVENTRY          Set entry code                       10570000
  1183.          XR    R0,R0                                                    10580000
  1184.          ST    R0,CVVALUEA         Address of variable value            10590000
  1185.          ST    R0,CVVALUEL         Length of variable value             10600000
  1186.          ST    R0,CVTOKEN          Token                                10610000
  1187.          LA    R14,CVENTRY         Store into IKJCT441 parameter list   10620000
  1188.          LA    R15,CVNAMEA                                              10630000
  1189.          LA    R0,CVNAMEL                                               10640000
  1190.          LA    R1,CVVALUEA                                              10650000
  1191.          LA    R2,CVVALUEL                                              10660000
  1192.          LA    R3,CVTOKEN                                               10670000
  1193.          STM   R14,R3,CVPARMS                                           10680000
  1194.          OI    CVPARM6,X'80'       Set VL bit                           10690000
  1195.          LA    R1,CVPARMS          Point to parameter list              10700000
  1196.          L     R15,X'10'               Get address of CVT               10710000
  1197.          L     R15,CVTTVT-CVT(,R15)    Get address of TSO vector table  10720000
  1198.          L     R15,TSVTVACC-TSVT(,R15) Get address of IKJCT441          10730000
  1199.          BALR  R14,R15             Call variable access routine         10740000
  1200.          CH    R15,=H'4'           Get return code                      10750000
  1201.          BNH   GETVAROK            If not 0 or 4, error                 10760000
  1202.          BAL   R14,ERROR_GETTING_VAR                                    10770000
  1203.          B     FLUSHIT                                                  10780000
  1204.          SPACE 1                                                        10790000
  1205. NOVAR    DS    0H                  No variable, try REXX arg call       10800000
  1206.          SPACE 1                                                        10810000
  1207. *                                                                       10820000
  1208. *********************************************************************** 10830000
  1209. *                                                                     * 10840000
  1210. * Invoke the IRXEXCOM routine to fetch the ARG information.           * 10850000
  1211. *                                                                     * 10860000
  1212. * Reference: TSO/E Version 2 REXX Reference, pp. 240-246              * 10870000
  1213. *                                                                     * 10880000
  1214. *********************************************************************** 10890000
  1215. *                                                                       10900000
  1216. * Build the SHVBLOCK                                                    10910000
  1217. *                                                                       10920000
  1218. * To store the argument value, we try using ARGWA, a 512-byte area      10930000
  1219. * that is already part of our workarea, to avoid unnecessary GETMAINs.  10940000
  1220. *                                                                       10950000
  1221. * If that doesn't turn out to be big enough, we'll have to GETMAIN,     10960000
  1222. * but it's best to avoid that.                                          10970000
  1223. *                                                                       10980000
  1224.          XC    SHVBLOCK(SHVBLEN),SHVBLOCK                               10990000
  1225.          MVI   SHVCODE,SHVPRIV     Fetch private information            11000000
  1226.          LA    R1,L'ARGWA                                               11010000
  1227.          ST    R1,SHVBUFL          Length of 'fetch' value buffer       11020000
  1228.          LA    R1,ARGWA                                                 11030000
  1229.          ST    R1,SHVVALA          Address of value buffer              11040000
  1230.          LA    R1,=C'ARG'          Name of thing to be fetched          11050000
  1231.          ST    R1,SHVNAMA          Address of variable name             11060000
  1232.          LA    R1,3                Length('ARG')                        11070000
  1233.          ST    R1,SHVNAML          Length of variable name              11080000
  1234.          LA    R14,=CL8'IRXEXCOM'  IRXEXCOM parm 1                      11090000
  1235.          XR    R15,R15             IRXEXCOM parm 2                      11100000
  1236.          LR    R0,R15              Parm 3 must be same as Parm 2        11110000
  1237.          LA    R1,SHVBLOCK         IRXEXCOM parm 4                      11120000
  1238.          STM   R14,R1,IRPARMS                                           11130000
  1239.          OI    IRPARM4,X'80'                                            11140000
  1240. RETRYIRX DS    0H                                                       11150000
  1241. *        XR    R0,R0               Don't specify an environment #TSO162 11160000
  1242.          L     R1,CPPLECT          Get passed ECT address       #TSO162 11170000
  1243.          L     R0,ECTENVBK-ECT(,R1) Get addr of REXX envir. blk #TSO162 11180000
  1244.          LA    R1,IRPARMS          Point to parameter list              11190000
  1245.          L     R15,X'10'               Get address of CVT               11200000
  1246.          L     R15,CVTTVT-CVT(,R15)    Get address of TSO vector table  11210000
  1247.          L     R15,TSVTEXCO-TSVT(,R15) Get address of IRXEXCOM          11220000
  1248.          BALR  R14,R15             Call REXX arg access routine         11230000
  1249.          LTR   R15,R15             If rc zero                           11240000
  1250.          BZ    OKIRX               then OK                              11250000
  1251.          CH    R15,=Y(SHVTRUNC)    If value was truncated               11260000
  1252.          BE    OOPSIRX             then need more room to hold value    11270000
  1253.          B     ERROR_IRXEXCOM      Else error                           11280000
  1254. OOPSIRX  DS    0H                  Not enough room to hold value        11290000
  1255.          ICM   R1,15,ARGADDR       Get address of arg buffer            11300000
  1256.          BZ    NOARGYET            If nonzero, then...                  11310000
  1257.          L     R0,ARGLEN           Get length                           11320000
  1258.          FREEMAIN RC,LV=(0),A=(1)                                       11330000
  1259. NOARGYET DS    0H                                                       11340000
  1260.          LA    R0,1024             Increment arg len so far             11350000
  1261.          A     R0,ARGLEN                                                11360000
  1262.          ST    R0,ARGLEN                                                11370000
  1263.          ST    R0,SHVBUFL          Reset length of fetch buffer         11380000
  1264.          GETMAIN RC,LV=(0),LOC=ANY                                      11390000
  1265.          LTR   R15,R15                                                  11400000
  1266.          BNZ   GETMAIN_FAILURE                                          11410000
  1267.          ST    R1,ARGADDR                                               11420000
  1268.          ST    R1,SHVVALA          Reset address of value buffer        11430000
  1269.          B     RETRYIRX            Try again                            11440000
  1270. OKIRX    DS    0H                  Everything OK                        11450000
  1271.          MVC   CVVALUEL,SHVVALL    Set length of arg value              11460000
  1272.          MVC   CVVALUEA,SHVVALA    Set address of arg value             11470000
  1273.          SPACE 1                                                        11480000
  1274. GETVAROK DS    0H                                                       11490000
  1275.          EJECT                                                          11500000
  1276. *                                                                       11510000
  1277. *********************************************************************** 11520000
  1278. *                                                                     * 11530000
  1279. * Build a fake command buffer containing the value of the variable,   * 11540000
  1280. * for use by IKJPARS.  Format:                                        * 11550000
  1281. * ___________________________________________________________________ * 11560000
  1282. * |            |       |                                            | * 11570000
  1283. * | valuelen+4 | zero  |  value text                                | * 11580000
  1284. * |____________|_______|____________________________________________| * 11590000
  1285. *                                                                     * 11600000
  1286. *********************************************************************** 11610000
  1287. *                                                                       11620000
  1288.          LA    R2,4                Get 4 + ...                          11630000
  1289.          A     R2,CVVALUEL             length of variable value         11640000
  1290.          ST    R2,VBUFLEN          Save length                          11650000
  1291.          GETMAIN RC,LV=(R2),LOC=ANY Get a fake command buffer           11660000
  1292.          LTR   R15,R15                                                  11670000
  1293.          BNZ   GETMAIN_FAILURE                                          11680000
  1294.          ST    R1,VBUFADDR         Save address of fake command buffer  11690000
  1295.          SLL   R2,16               Make buffer prefix                   11700000
  1296.          ST    R2,0(,R1)           Store into fake command buffer       11710000
  1297.          LA    R2,4(,R1)           Address of fake command buffer text  11720000
  1298.          L     R14,CVVALUEA        Address of variable value            11730000
  1299.          L     R15,CVVALUEL        Length of variable value             11740000
  1300.          LR    R3,R15              Length of fake command buffer text   11750000
  1301.          MVCL  R2,R14              Move variable value to fake buffer   11760000
  1302. *                                                                       11770000
  1303. *********************************************************************** 11780000
  1304. *                                                                     * 11790000
  1305. * Set up to call IKJPARS.                                             * 11800000
  1306. *                                                                     * 11810000
  1307. *********************************************************************** 11820000
  1308. *                                                                       11830000
  1309.          XC    ANSWER,ANSWER       Clear PDL address field              11840000
  1310.          MVC   PPLUPT,CPPLUPT      Address of UPT                       11850000
  1311.          MVC   PPLECT,CPPLECT      Address of ECT                       11860000
  1312.          LA    R14,ECB             Address of ECB                       11870000
  1313.          L     R15,PWADDR          Address of the PCL we built          11880000
  1314.          LA    R0,ANSWER           Address of PARSE answer area         11890000
  1315.          L     R1,VBUFADDR         Address of our fake command buffer   11900000
  1316.          STM   R14,R1,PPLECB       Set rest of PPL                      11910000
  1317.          ST    R9,PPLUWA           User work area = "DATD"              11920000
  1318.          ST    R9,PPLVEWA          (we don't use verify exit, but...)   11930000
  1319.          SPACE 1                                                        11940000
  1320.          CALLTSSR EP=IKJPARS,MF=(E,PPL)                                 11950000
  1321.          LTR   R15,R15                                                  11960000
  1322.          BNZ   ERROR_PARSE_FAILURE                                      11970000
  1323.          EJECT                                                          11980000
  1324. *                                                                       11990000
  1325. *********************************************************************** 12000000
  1326. *                                                                     * 12010000
  1327. * Now that PARSE has successfully gotten values for all parameters,   * 12020000
  1328. * go through them and retrieve their values, which will be used to    * 12030000
  1329. * set variables via IKJCT441.                                         * 12040000
  1330. *                                                                     * 12050000
  1331. *********************************************************************** 12060000
  1332. *                                                                       12070000
  1333.          L     R7,ANSWER           Get address of PDL                   12080000
  1334.          L     R5,PWADDR           Get address of PCL-et-al work area   12090000
  1335.          A     R5,PCLLEN           Bump past PCL part                   12100000
  1336.          A     R5,QVALLEN          Bump past unquoted-string part       12110000
  1337.          LA    R5,3(,R5)           Round up to                          12120000
  1338.          N     R5,=X'FFFFFFFC'      fullword boundary                   12130000
  1339.          ST    R5,VUPADDR          Save address of this plist           12140000
  1340. *                                                                       12150000
  1341. * Format of each block of IKJCT441 parameter list:                      12160000
  1342. *                                                                       12170000
  1343. *  +00 -> Entry code (TSVEUPDT)                                         12180000
  1344. *  +04 -> Address of variable name                                      12190000
  1345. *  +08 -> Length of variable name                                       12200000
  1346. *  +0C -> Address of variable value                                     12210000
  1347. *  +10 -> Length of variable value                                      12220000
  1348. *  +14 -> Token (zero, not used)                                        12230000
  1349. *  +18 -> ECT (X'FFFFFFFF', not used)                                   12240000
  1350. *  +1C -> Return code from IKJCT441                                     12250000
  1351. *  +20 -> Address of next block of this parameter list or X'80000000'   12260000
  1352. *  +24 ... not part of plist, but space to hold the address of value    12270000
  1353. *  +28 ... not part of plist, but space to hold the length of value     12280000
  1354. *  +2C ... not part of plist, but space to hold the return code         12290000
  1355. *  +30 ... not part of plist, but space to hold the address of link     12300000
  1356. *                                                                       12310000
  1357.          XR    R0,R0                                                    12320000
  1358.          ST    R0,CVTOKEN                                               12330000
  1359.          MVC   CVECT,=X'FFFFFFFF'                                       12340000
  1360.          LA    R15,TSVEUPDT        Entry code = update variable         12350000
  1361.          ST    R15,CVENTRY         Set entry code                       12360000
  1362.          L     R4,POSCOUNT         Get # of positionals                 12370000
  1363.          A     R4,KEYCOUNT           + # of keywords                    12380000
  1364.          BZ    NOUPDATE            If no parameters, no updating.       12390000
  1365.          L     R15,VUPADDR         Get address of the plist             12400000
  1366. BPLOOP   DS    0H                                                       12410000
  1367.          LR    R5,R15              Point to this element of parm list   12420000
  1368.          LA    R15,CVENTRY                                              12430000
  1369.          ST    R15,X'00'(,R5)      Parameter 1: entry code              12440000
  1370. *                                  Set later...                         12450000
  1371. *        ST       ,X'04'(,R5)      Parameter 2: address of var name     12460000
  1372. *                                  Set later...                         12470000
  1373. *        ST       ,X'08'(,R5)      Parameter 3: length of var name      12480000
  1374.          LA    R15,X'24'(,R5)      Value address slot                   12490000
  1375.          ST    R15,X'0C'(,R5)      Parameter 4: address of var value    12500000
  1376.          LA    R15,X'28'(,R5)      Value length slot                    12510000
  1377.          ST    R15,X'10'(,R5)      Parameter 5: length of var value     12520000
  1378.          LA    R15,CVTOKEN         Dummy token                          12530000
  1379.          ST    R15,X'14'(,R5)      Parameter 6: token (not used)        12540000
  1380.          LA    R15,CVECT           Dummy ECT                            12550000
  1381.          ST    R15,X'18'(,R5)      Parameter 7: ECT (not used)          12560000
  1382.          LA    R15,X'2C'(,R5)      Return code slot                     12570000
  1383.          ST    R15,X'1C'(,R5)      Parameter 8: IKJCT441 return code    12580000
  1384.          LA    R15,X'30'(,R5)      Link slot                            12590000
  1385.          ST    R15,X'20'(,R5)      Parameter 9: next element in list    12600000
  1386.          LA    R15,X'34'(,R5)                                           12610000
  1387.          ST    R15,X'30'(,R5)      Address of next plist block          12620000
  1388.          OI    X'20'(R5),X'80'     Set VL bit                           12630000
  1389.          BCT   R4,BPLOOP           Continue                             12640000
  1390.          L     R0,=X'00000000'     At end,                              12650000
  1391.          ST    R0,X'30'(,R5)       clear last link pointer in list      12660000
  1392.          L     R5,VUPADDR          Point to first plist block again     12670000
  1393.          EJECT                                                          12680000
  1394. *                                                                       12690000
  1395. *********************************************************************** 12700000
  1396. *                                                                     * 12710000
  1397. * Now go through positional parameters, setting things up.            * 12720000
  1398. *                                                                     * 12730000
  1399. * Format of PDE for a positional parameter (IKJIDENT):                * 12740000
  1400. *                                                                     * 12750000
  1401. * +0 (4) Pointer to the positional operand                            * 12760000
  1402. * +4 (2) Length thereof                                               * 12770000
  1403. * +6 (1) Flags                                                        * 12780000
  1404. * +7 (1) Reserved                                                     * 12790000
  1405. *                                                                     * 12800000
  1406. * Meaning of flags:  0... ....  The operand is not present.           * 12810000
  1407. *                    1... ....  The operand is present.               * 12820000
  1408. *                    .xxx xxxx  Reserved bits.                        * 12830000
  1409. *                                                                     * 12840000
  1410. *********************************************************************** 12850000
  1411. *                                                                       12860000
  1412.          ICM   R8,15,POSCOUNT      Get count of positionals             12870000
  1413.          BZ    BPPPLEND            If none, skip                        12880000
  1414.          L     R2,APOSD            Get address of first positional      12890000
  1415. BPPPLOOP DS    0H                  Loop to fill in IKJCT441 plist       12900000
  1416.          LA    R15,POSDADDR-POSDDATA(,R2) Get address of param name     12910000
  1417.          ST    R15,X'04'(,R5)      Parameter 2: address of var name     12920000
  1418.          LA    R15,POSDLEN-POSDDATA(,R2) Get length of param name       12930000
  1419.          ST    R15,X'08'(,R5)      Parameter 3: length of var name      12940000
  1420.          L     R15,POSDPCEA-POSDDATA(,R2) Get address of PCE            12950000
  1421.          LH    R1,4(,R15)          Get offset of PDE for this PCE       12960000
  1422.          AR    R1,R7               Convert to address of PDE            12970000
  1423. *                                                                       12980000
  1424. * Note: Of course it's impossible for the operand not to be present     12990000
  1425. *       under the current implementation.  But a future extension       13000000
  1426. *       might make this possible.                                       13010000
  1427. *                                                                       13020000
  1428.          TM    6(R1),X'80'         If operand is not present,           13030000
  1429.          BO    BPPPPRES            then...                              13040000
  1430.          XR    R14,R14              say it's set to a null value        13050000
  1431.          XR    R15,R15              say it's set to a null value        13060000
  1432.          B     BPPPSET             else...                              13070000
  1433. BPPPPRES DS    0H                  (operand is present)                 13080000
  1434.          L     R14,0(,R1)           get address of value                13090000
  1435.          LH    R15,4(,R1)           get length of value                 13100000
  1436. BPPPSET  DS    0H                  else (operand is present)            13110000
  1437.          ST    R14,X'24'(,R5)      Set address of variable value        13120000
  1438.          ST    R15,X'28'(,R5)      Set length of variable value         13130000
  1439.          L     R5,X'20'(,R5)       Go to                                13140000
  1440.          L     R5,0(,R5)                 next element of param list     13150000
  1441.          LA    R2,POSDDATL(,R2)    Continue                             13160000
  1442.          BCT   R8,BPPPLOOP          until no more positionals           13170000
  1443. BPPPLEND DS    0H                  End loop                             13180000
  1444.          EJECT                                                          13190000
  1445. *                                                                       13200000
  1446. *********************************************************************** 13210000
  1447. *                                                                     * 13220000
  1448. * Now go through keyword parameters, setting things up.               * 13230000
  1449. *                                                                     * 13240000
  1450. * Format of PDE for a keyword parameter (IKJKEYWD):                   * 13250000
  1451. *                                                                     * 13260000
  1452. * +0 (2) Number (0 if not specified, 1 if specified)                  * 13270000
  1453. *                                                                     * 13280000
  1454. *********************************************************************** 13290000
  1455. *                                                                     * 13300000
  1456. * Format of PDE for a keyword value parameter (IKJIDENT):             * 13310000
  1457. *                                                                     * 13320000
  1458. * +0 (4) Pointer to the positional operand                            * 13330000
  1459. * +4 (2) Length thereof                                               * 13340000
  1460. * +6 (1) Flags                                                        * 13350000
  1461. * +7 (1) Reserved                                                     * 13360000
  1462. *                                                                     * 13370000
  1463. * Meaning of flags:  0... ....  The operand is not present.           * 13380000
  1464. *                    1... ....  The operand is present.               * 13390000
  1465. *                    .xxx xxxx  Reserved bits.                        * 13400000
  1466. *                                                                     * 13410000
  1467. *********************************************************************** 13420000
  1468. *                                                                       13430000
  1469.          ICM   R8,15,KEYCOUNT      Get count of keywords                13440000
  1470.          BZ    BPKWLEND            If none, skip                        13450000
  1471.          L     R2,AKEYD            Get address of first keyword         13460000
  1472. BPKWLOOP DS    0H                  Loop to fill in IKJCT441 plist       13470000
  1473.          ST    R2,SAVER2           Save register to protect from TRT's  13480000
  1474.          LA    R15,KEYWORDA-KEYDDATA(,R2) Get address of keyword name   13490000
  1475.          ST    R15,X'04'(,R5)      Parameter 2: address of var name     13500000
  1476.          LA    R15,KEYWORDL-KEYDDATA(,R2) Get length of keyword name    13510000
  1477.          ST    R15,X'08'(,R5)      Parameter 3: length of var name      13520000
  1478.          TM    KEYFLAGS-KEYDDATA(R2),KEYFDVAL If keyword(value),        13530000
  1479.          BO    BPKWDVAL            then process value subfield          13540000
  1480. *                                                                       13550000
  1481. * Keyword without value is set to keyword name if specified, else null  13560000
  1482. *                                                                       13570000
  1483.          L     R15,KEYDPCEA-KEYDDATA(,R2) Get address of PCE            13580000
  1484.          LH    R1,4(,R15)          Get offset of PDE for this PCE       13590000
  1485.          AR    R1,R7               Convert to address of PDE            13600000
  1486.          CLC   0(2,R1),=X'0000'    If keyword is not specified,         13610000
  1487.          BNE   BPKWWPRS            then...                              13620000
  1488.          XR    R15,R15              say it's set to a null value        13630000
  1489.          ST    R15,X'24'(,R5)       set address of variable value       13640000
  1490.          ST    R15,X'28'(,R5)       set length of variable value        13650000
  1491.          B     BPKWNEXT            else...                              13660000
  1492. BPKWWPRS DS    0H                  (operand is present)                 13670000
  1493.          L     R14,X'04'(,R5)       get address of variable name        13680000
  1494.          L     R15,X'08'(,R5)       get length of variable name         13690000
  1495.          ST    R14,X'0C'(,R5)      Parameter 4: address of var value    13700000
  1496.          ST    R15,X'10'(,R5)      Parameter 5: length of var value     13710000
  1497.          B     BPKWNEXT                                                 13720000
  1498.          SPACE 1                                                        13730000
  1499. BPKWDVAL DS    0H                  Else keyword with a value specified  13740000
  1500. *                                                                       13750000
  1501. * Keyword with value:  If keyword is present, set from value subfield   13760000
  1502. * (which must be present according to the PARS rules).  Otherwise,      13770000
  1503. * set value from default from XPROC statement, unquoting if needed.     13780000
  1504. *                                                                       13790000
  1505.          L     R15,KEYDPCEA-KEYDDATA(,R2) Get address of PCE            13800000
  1506.          LH    R1,4(,R15)          Get offset of PDE for this PCE       13810000
  1507.          AR    R1,R7               Convert to address of PDE            13820000
  1508.          CLC   0(2,R1),=X'0000'    If keyword is not specified,         13830000
  1509.          BNE   BPKWVPRS            then...                              13840000
  1510.          L     R14,KEYDVALA-KEYDDATA(,R2) get address of default value  13850000
  1511.          L     R15,KEYDVALL-KEYDDATA(,R2) get length of default value   13860000
  1512.          TM    KEYFLAGS-KEYDDATA(R2),KEYFQUOT If value is quoted,       13870000
  1513.          BNO   BPKWVSET            then...                              13880000
  1514. *                                   unquote it                          13890000
  1515.          LA    R1,1(,R14)          Get address of quoted string + 1     13900000
  1516.          LR    R3,R15              Get length of quoted string          13910000
  1517.          SH    R3,=H'2'            minus 2 to get length between quotes 13920000
  1518.          BZ    BPKWNULL            If '', set variable to null value    13930000
  1519.          LR    R15,R1                                                   13940000
  1520.          LR    R14,R1              Save address of string input         13950000
  1521.          ST    R14,SCANPTR                                              13960000
  1522.          AR    R14,R3              Save address of end of it            13970000
  1523.          ST    R14,SCANEPTR                                             13980000
  1524.          L     R14,QOFF            Get where to build unquoted string   13990000
  1525.          LA    R0,256              Make a constant value of 256         14000000
  1526. BPGOTQL  CR    R3,R0               If length greater than 256           14010000
  1527.          BNH   BPGOTQX             then...                              14020000
  1528.          TRT   0(256,R15),STBLQUOT  scan for "'"                        14030000
  1529.          BNZ   BPGOTQT              If we found it, go. Else            14040000
  1530.          MVC   0(256,R14),0(R15)    copy unquoted data to area          14050000
  1531.          AR    R14,R0               Increment output pointer by 256     14060000
  1532.          AR    R15,R0               Increment input pointer by 256      14070000
  1533.          SR    R3,R0                Decrement length by 256             14080000
  1534.          BP    BPGOTQL              Either continue scanning            14090000
  1535.          B     BPGOTQE              or, if length zero, finished        14100000
  1536. BPGOTQX  DS    0H                  Else...                              14110000
  1537.          BCTR  R3,0                 Reduce length for execute           14120000
  1538.          EX    R3,BPGQTRT           Scan for "'"                        14130000
  1539.          BNZ   BPGOTQT              If found something, go              14140000
  1540.          B     BPGOTQE              else end of string                  14150000
  1541. BPGOTQT  DS    0H                  Reached "'"                          14160000
  1542.          CLI   1(R1),C''''         Another "'" has to follow            14170000
  1543.          BNE   0(0)                (else abend)                         14180000
  1544.          LR    R3,R1               Get length we just scanned           14190000
  1545.          SR    R3,R15                                                   14200000
  1546.          EX    R3,BPGQMVC          Move data so far (R15 -> it)         14210000
  1547. BPGQNMV  DS    0H                  (including quote, so no BCTR)        14220000
  1548.          LA    R14,1(R14,R3)       Bump past it and following quote     14230000
  1549.          LA    R15,2(,R1)          Bump to location past "''"           14240000
  1550.          L     R3,SCANEPTR                                              14250000
  1551.          SR    R3,R15              R3 := length remaining to scan       14260000
  1552.          BP    BPGOTQL             If something left, continue scan     14270000
  1553. BPGOTQE  DS    0H                  End of quoted string                 14280000
  1554.          L     R3,SCANEPTR                                              14290000
  1555.          SR    R3,R15              Get length remaining to move         14300000
  1556.          BZ    BPGENMV             If zero, skip move                   14310000
  1557.          EX    R3,BPGQMVC          Move data so far (R15 -> it)         14320000
  1558. BPGENMV  DS    0H                  (including quote, so no BCTR)        14330000
  1559.          LA    R14,0(R14,R3)       Bump past it                         14340000
  1560.          LR    R15,R14                                                  14350000
  1561.          S     R15,QOFF            Get length of unquoted string        14360000
  1562.          L     R1,QOFF             Get address of unquoted string       14370000
  1563.          ST    R14,QOFF            Update where to build next string    14380000
  1564.          LR    R14,R1                                                   14390000
  1565.          B     BPKWDSET            Set address and length of string     14400000
  1566. BPKWVSET DS    0H                  else (operand is present)            14410000
  1567.          ST    R14,X'24'(,R5)      Set address of variable value        14420000
  1568.          ST    R15,X'28'(,R5)      Set length of variable value         14430000
  1569.          B     BPKWNEXT                                                 14440000
  1570. BPKWVPRS DS    0H                  (operand is present)                 14450000
  1571.          L     R15,KEYSUBOF-KEYDDATA(,R2) Get where subfield offset is  14460000
  1572.          LH    R15,0(,R15)         Get offset+1 of IKJSUBF PCE          14470000
  1573.          LA    R15,2(,R15)         Bump to associated IKJIDENT PCE      14480000
  1574.          A     R15,PWADDR          Convert to address of subfield       14490000
  1575.          LH    R1,4(,R15)          Get offset of PDE for this PCE       14500000
  1576.          AR    R1,R7               Convert to address of PDE            14510000
  1577. *                                                                       14520000
  1578. * Note: Of course it's impossible for the operand not to be present     14530000
  1579. *       under the current implementation.  But a future extension       14540000
  1580. *       might make this possible.                                       14550000
  1581. *                                                                       14560000
  1582.          TM    6(R1),X'80'         If operand is not present,           14570000
  1583.          BO    BPKWDPRS            then...                              14580000
  1584. BPKWNULL DS    0H                                                       14590000
  1585.          XR    R14,R14              say it's set to a null value        14600000
  1586.          XR    R15,R15              say it's set to a null value        14610000
  1587.          B     BPKWDSET            else...                              14620000
  1588. BPKWDPRS DS    0H                  (operand is present)                 14630000
  1589.          L     R14,0(,R1)           get address of value                14640000
  1590.          LH    R15,4(,R1)           get length of value                 14650000
  1591. BPKWDSET DS    0H                  else (operand is present)            14660000
  1592.          ST    R14,X'24'(,R5)      Set address of variable value        14670000
  1593.          ST    R15,X'28'(,R5)      Set length of variable value         14680000
  1594. BPKWNEXT DS    0H                  Continue                             14690000
  1595.          L     R5,X'20'(,R5)       Go to                                14700000
  1596.          L     R5,0(,R5)                 next element of param list     14710000
  1597.          L     R2,SAVER2           Restore register clobbered by TRT    14720000
  1598.          LA    R2,KEYDDATL(,R2)    Continue                             14730000
  1599.          BCT   R8,BPKWLOOP          until no more positionals           14740000
  1600. BPKWLEND DS    0H                  End loop                             14750000
  1601. *                                                                       14760000
  1602. * Now call IKJCT441 to do all the variable updates.                     14770000
  1603. *                                                                       14780000
  1604.          L     R1,VUPADDR          Point to parameter list              14790000
  1605.          L     R15,X'10'               Get address of CVT               14800000
  1606.          L     R15,CVTTVT-CVT(,R15)    Get address of TSO vector table  14810000
  1607.          L     R15,TSVTVACC-TSVT(,R15) Get address of IKJCT441          14820000
  1608.          BALR  R14,R15             Call variable access routine         14830000
  1609.          L     R5,VUPADDR                                               14840000
  1610. RCLOOP   DS    0H                                                       14850000
  1611.          LA    R5,0(,R5)           Clear VL bit if any                  14860000
  1612.          LTR   R5,R5                                                    14870000
  1613.          BZ    RCEND                                                    14880000
  1614.          L     R15,X'2C'(,R5)      Get return code set by IKJCT441      14890000
  1615.          CH    R15,=H'4'           If return code                       14900000
  1616.          BNH   RCNEXT              If not 0 or 4, error                 14910000
  1617.          BAL   R14,ERROR_PUTTING_VAR                                    14920000
  1618.          OI    FLAGS,FLAGPUTE                                           14930000
  1619. RCNEXT   L     R5,X'20'(,R5)       Go to                                14940000
  1620.          L     R5,0(,R5)                 next element of param list     14950000
  1621.          B     RCLOOP                                                   14960000
  1622. RCEND    DS    0H                                                       14970000
  1623.          TM    FLAGS,FLAGPUTE      If a variable update error,          14980000
  1624.          BO    FLUSHIT             then flush                           14990000
  1625.          SPACE 1                                                        15000000
  1626. NOUPDATE DS    0H                  Here if no call to IKJCT441 needed   15010000
  1627.          SPACE 1                                                        15020000
  1628.          B     RETURN0             Everything fine, return code(0)      15030000
  1629.          EJECT                                                          15040000
  1630. *                                                                       15050000
  1631. TRTPOSCT TRT   0(*-*,R3),NUMTBL    Executed: scan word for numerics     15060000
  1632. PACKIT   PACK  DOUBLE(8),0(*-*,R3) Executed: convert word to decimal    15070000
  1633. VERIFYP  TRT   0(*-*,R14),VERTBL   Executed: verify syntax of parameter 15080000
  1634. MVCWORD  MVC   0(*-*,R1),0(R14)    Executed: move parameter to wordarea 15090000
  1635. UPWORD   TR    0(*-*,R1),UPTBL     Executed: translate to uppercase     15100000
  1636. COMPWORD CLC   0(*-*,R1),0(R14)    Executed: compare parameters         15110000
  1637. MVCTOPCE MVC   0(*-*,R4),0(R1)     Executed: move parameter name to PCE 15120000
  1638. BPGQTRT  TRT   0(*-*,R15),STBLQUOT Executed: scan for "'" mark          15130000
  1639. BPGQMVC  MVC   0(*-*,R14),0(R15)   Executed: copy unquoted data to area 15140000
  1640. *                                                                       15150000
  1641.          EJECT                                                          15160000
  1642. *                                                                       15170000
  1643. *********************************************************************** 15180000
  1644. *                                                                     * 15190000
  1645. * Various error conditions.                                           * 15200000
  1646. *                                                                     * 15210000
  1647. *********************************************************************** 15220000
  1648. *                                                                       15230000
  1649. ERROR_GETTING_VAR DS 0H                                                 15240000
  1650.          ST    R14,E44114          Save return register                 15250000
  1651.          ST    R15,RC441           Save IKJCT441 return code            15260000
  1652.          L     R2,CVNAMEL          Length of variable name              15270000
  1653.          L     R3,CVNAMEA          Address of variable name             15280000
  1654.          ERROR MSG_GETTING_VAR,FLUSH=NO                                 15290000
  1655.          B     ERROR441                                                 15300000
  1656.          SPACE 1                                                        15310000
  1657. ERROR_PUTTING_VAR DS 0H                                                 15320000
  1658.          ST    R14,E44114          Save return register                 15330000
  1659.          ST    R15,RC441           Save IKJCT441 return code            15340000
  1660.          L     R2,X'08'(,R5)       -> Length of variable name           15350000
  1661.          L     R2,0(,R2)           Length of variable name              15360000
  1662.          L     R3,X'04'(,R5)       -> Address of variable name          15370000
  1663.          L     R3,0(,R3)           Address of variable name             15380000
  1664.          ERROR MSG_PUTTING_VAR,FLUSH=NO                                 15390000
  1665. ******** B     ERROR441                                                 15400000
  1666.          SPACE 1                                                        15410000
  1667. ERROR441 DS    0H                                                       15420000
  1668.          XR    R2,R2               No additional information for...     15430000
  1669.          XR    R3,R3                                                    15440000
  1670.          L     R4,RC441            Load IKJCT441 return code            15450000
  1671.          CH    R4,=H'81'           Check IKJCT441 return code           15460000
  1672.          BH    ERROR441_MISC       > 81                                 15470000
  1673.          BE    ERROR441_RC81       = 81                                 15480000
  1674.          B     *(R4)               Else branch based on return code     15490000
  1675.          B     ERROR441_MISC       04: Variable cannot be rescanned     15500000
  1676. *                                  (not treated as an error here)       15510000
  1677.          B     ERROR441_RC08       08: Variable is a CLIST BIF          15520000
  1678.          B     ERROR441_RC12       12: Variable is a CLIST label        15530000
  1679.          B     ERROR441_RC16       16: Variable is unmodifiable         15540000
  1680.          B     ERROR441_MISC       20: n/a                              15550000
  1681.          B     ERROR441_RC24       24: Variable is a CLIST subprocedure 15560000
  1682.          B     ERROR441_MISC       28: n/a                              15570000
  1683.          B     ERROR441_RC32       32: GETMAIN/FREEMAIN failure         15580000
  1684.          B     ERROR441_RC36       36: Variable length is invalid       15590000
  1685.          B     ERROR441_RC40       40: Not in CLIST or REXX environment 15600000
  1686.          B     ERROR441_MISC       44: invalid entry code               15610000
  1687.          B     ERROR441_MISC       48: n/a                              15620000
  1688.          B     ERROR441_MISC       52: n/a                              15630000
  1689.          B     ERROR441_MISC       56: n/a                              15640000
  1690.          B     ERROR441_MISC       60: n/a                              15650000
  1691.          B     ERROR441_MISC       64: n/a                              15660000
  1692.          B     ERROR441_MISC       68: n/a                              15670000
  1693.          B     ERROR441_MISC       72: n/a                              15680000
  1694.          B     ERROR441_RC76       76: Variable is undefined &SYSX...   15690000
  1695.          B     ERROR441_RC80       80: Variable name invalid for REXX   15700000
  1696. ERROR441_RC08 ERROR MSG_IKJCT441_RC08,FLUSH=NO                          15710000
  1697.          L     R14,E44114                                               15720000
  1698.          BR    R14                                                      15730000
  1699. ERROR441_RC12 ERROR MSG_IKJCT441_RC12,FLUSH=NO                          15740000
  1700.          L     R14,E44114                                               15750000
  1701.          BR    R14                                                      15760000
  1702. ERROR441_RC16 ERROR MSG_IKJCT441_RC16,FLUSH=NO                          15770000
  1703.          L     R14,E44114                                               15780000
  1704.          BR    R14                                                      15790000
  1705. ERROR441_RC24 ERROR MSG_IKJCT441_RC24,FLUSH=NO                          15800000
  1706.          L     R14,E44114                                               15810000
  1707.          BR    R14                                                      15820000
  1708. ERROR441_RC32 ERROR MSG_IKJCT441_RC32,FLUSH=NO                          15830000
  1709.          L     R14,E44114                                               15840000
  1710.          BR    R14                                                      15850000
  1711. ERROR441_RC36 ERROR MSG_IKJCT441_RC36,FLUSH=NO                          15860000
  1712.          L     R14,E44114                                               15870000
  1713.          BR    R14                                                      15880000
  1714. ERROR441_RC40 ERROR MSG_IKJCT441_RC40,FLUSH=NO                          15890000
  1715.          L     R14,E44114                                               15900000
  1716.          BR    R14                                                      15910000
  1717. ERROR441_RC76 ERROR MSG_IKJCT441_RC76,FLUSH=NO                          15920000
  1718.          L     R14,E44114                                               15930000
  1719.          BR    R14                                                      15940000
  1720. ERROR441_RC80 ERROR MSG_IKJCT441_RC80,FLUSH=NO                          15950000
  1721.          L     R14,E44114                                               15960000
  1722.          BR    R14                                                      15970000
  1723. ERROR441_RC81 ERROR MSG_IKJCT441_RC81,FLUSH=NO                          15980000
  1724.          L     R14,E44114                                               15990000
  1725.          BR    R14                                                      16000000
  1726. ERROR441_MISC DS 0H                                                     16010000
  1727.          CVD   R4,DOUBLE                                                16020000
  1728.          UNPK  DOUBLE(2),DOUBLE(8)                                      16030000
  1729.          OI    DOUBLE+1,X'F0'                                           16040000
  1730.          LA    R2,2                Length of error code                 16050000
  1731.          LA    R3,DOUBLE           Address of error code                16060000
  1732.          ERROR MSG_IKJCT441_RC,FLUSH=NO                                 16070000
  1733.          L     R14,E44114                                               16080000
  1734.          BR    R14                                                      16090000
  1735.          SPACE 1                                                        16100000
  1736. NOOPERANDS DS  0H                  No input variable                    16110000
  1737.          XR    R2,R2               No accompanying data                 16120000
  1738.          XR    R3,R3               " " "                                16130000
  1739.          ERROR MSG_NO_OPERANDS                                          16140000
  1740.          SPACE 1                                                        16150000
  1741. NOPOSCOUNT DS  0H                  No count of positional parameters    16160000
  1742.          XR    R2,R2               No accompanying data                 16170000
  1743.          XR    R3,R3               " " "                                16180000
  1744.          ERROR MSG_NO_POS_COUNT                                         16190000
  1745.          SPACE 1                                                        16200000
  1746. BADPOSCOUNT DS 0H                  Bad count of positional parameters   16210000
  1747.          LA    R2,1(,R4)           Get length of bad data               16220000
  1748.          ERROR MSG_BAD_POS_COUNT                                        16230000
  1749.          SPACE 1                                                        16240000
  1750. ERROR_NO_WANT_LP DS 0H             Left parenthesis found, not wanted   16250000
  1751.          XR    R2,R2               No accompanying data                 16260000
  1752.          XR    R3,R3               " " "                                16270000
  1753.          ERROR MSG_NO_WANT_LP                                           16280000
  1754.          SPACE 1                                                        16290000
  1755. ERROR_NO_WANT_RP DS 0H             Right parenthesis found, not wanted  16300000
  1756.          XR    R2,R2               No accompanying data                 16310000
  1757.          XR    R3,R3               " " "                                16320000
  1758.          ERROR MSG_NO_WANT_RP                                           16330000
  1759.          SPACE 1                                                        16340000
  1760. ERROR_NO_WANT_QS DS 0H             Quoted string found, not wanted      16350000
  1761.          XR    R2,R2               No accompanying data                 16360000
  1762.          XR    R3,R3               " " "                                16370000
  1763.          ERROR MSG_NO_WANT_QS                                           16380000
  1764.          SPACE 1                                                        16390000
  1765. ERROR_NO_WANT_SL DS 0H             Slash found, not wanted              16400000
  1766.          XR    R2,R2               No accompanying data                 16410000
  1767.          XR    R3,R3               " " "                                16420000
  1768.          ERROR MSG_NO_WANT_SL                                           16430000
  1769.          SPACE 1                                                        16440000
  1770. PPMISSING DS   0H                  Positional parm not found, expected  16450000
  1771.          XR    R2,R2               No accompanying data                 16460000
  1772.          XR    R3,R3               " " "                                16470000
  1773.          ERROR MSG_TOO_FEW_PPARMS                                       16480000
  1774.          SPACE 1                                                        16490000
  1775. ERROR_PARM_TOO_LONG DS 0H                                               16500000
  1776.          LA    R2,252              Display only up to maximum length    16510000
  1777.          LR    R3,R1               Address of offending parameter       16520000
  1778.          ERROR MSG_PARM_TOO_LONG                                        16530000
  1779.          SPACE 1                                                        16540000
  1780. ERROR_PARM_INVALID DS 0H                                                16550000
  1781.          LA    R2,1(,R15)          Length of offending parameter        16560000
  1782.          LR    R3,R14              Address of offending parameter       16570000
  1783.          ERROR MSG_PARM_INVALID                                         16580000
  1784.          SPACE 1                                                        16590000
  1785. ERROR_PARM_DUPLICATE DS 0H                                              16600000
  1786.          LA    R2,1(,R15)          Length of offending parameter        16610000
  1787.          LR    R3,R14              Address of offending parameter       16620000
  1788.          ERROR MSG_PARM_DUPLICATE                                       16630000
  1789.          SPACE 1                                                        16640000
  1790. ERROR_OPT_TOO_LONG DS 0H                                                16650000
  1791.          LA    R2,L'OPTION         Display only up to maximum length    16660000
  1792.          LR    R3,R1               Address of offending parameter       16670000
  1793.          ERROR MSG_OPT_TOO_LONG                                         16680000
  1794.          SPACE 1                                                        16690000
  1795. ERROR_OPT_INVALID DS 0H                                                 16700000
  1796.          LA    R2,1(,R15)          Length of offending parameter        16710000
  1797.          LR    R3,R14              Address of offending parameter       16720000
  1798.          ERROR MSG_OPT_INVALID                                          16730000
  1799.          SPACE 1                                                        16740000
  1800. ERROR_OPT_POS_ONLY DS 0H                                                16750000
  1801.          LA    R2,1(,R15)          Length of offending parameter        16760000
  1802.          LR    R3,R14              Address of offending parameter       16770000
  1803.          ERROR MSG_OPT_POS_ONLY                                         16780000
  1804.          SPACE 1                                                        16790000
  1805. ERROR_ASIS_NEEDS_VAL DS 0H                                              16800000
  1806.          L     R3,KEYWORDA-KEYDDATA(,R2)                                16810000
  1807.          L     R2,KEYWORDL-KEYDDATA(,R2)                                16820000
  1808.          ERROR MSG_ASIS_NEEDS_VAL                                       16830000
  1809.          SPACE 1                                                        16840000
  1810. ERROR_PP_WITH_LP DS 0H             Positional parm with left paren      16850000
  1811.          ERROR MSG_PP_WITH_LP                                           16860000
  1812.          SPACE 1                                                        16870000
  1813. ERROR_FIRST_ARG DS 0H              Bad first argument                   16880000
  1814.          LR    R2,R4               Length of offending parameter        16890000
  1815.          ERROR MSG_VAR_TOO_LONG                                         16900000
  1816.          SPACE 1                                                        16910000
  1817. ERROR_IRXEXCOM DS 0H               IRXEXCOM failed                      16920000
  1818.          C     R15,=F'-2'          Insufficient storage?                16930000
  1819.          BE    GETMAIN_FAILURE                                          16940000
  1820.          C     R15,=F'-1'          No valid REXX environment?           16950000
  1821.          BE    ERROR_REXX_REQUIRED                                      16960000
  1822.          CVD   R15,DOUBLE                                               16970000
  1823.          UNPK  DOUBLE(3),DOUBLE(8)                                      16980000
  1824.          OI    DOUBLE+2,X'F0'                                           16990000
  1825.          LA    R2,3                Length of error code                 17000000
  1826.          LA    R3,DOUBLE           Address of error code                17010000
  1827.          ERROR MSG_IRXEXCOM_FAIL                                        17020000
  1828.          SPACE 1                                                        17030000
  1829. ERROR_REXX_REQUIRED DS 0H                                               17040000
  1830.          XR    R2,R2                                                    17050000
  1831.          XR    R3,R3                                                    17060000
  1832.          ERROR MSG_REXX_REQUIRED                                        17070000
  1833. ERROR_PARSE_FAILURE DS 0H          IKJPARS failed                       17080000
  1834.          CH    R15,=H'4'                                                17090000
  1835.          BE    FLUSHIT                                                  17100000
  1836.          CH    R15,=H'20'                                               17110000
  1837.          BE    FLUSHIT                                                  17120000
  1838.          CH    R15,=H'32'                                               17130000
  1839.          BE    FLUSHIT                                                  17140000
  1840.          CVD   R15,DOUBLE                                               17150000
  1841.          UNPK  DOUBLE(2),DOUBLE(8)                                      17160000
  1842.          OI    DOUBLE+1,X'F0'                                           17170000
  1843.          LA    R2,2                Length of error code                 17180000
  1844.          LA    R3,DOUBLE           Address of error code                17190000
  1845.          ERROR MSG_PARSE_FAILURE                                        17200000
  1846.          SPACE 1                                                        17210000
  1847. GETMAIN_FAILURE DS 0H              Insufficient storage                 17220000
  1848.          XR    R2,R2               No accompanying data                 17230000
  1849.          XR    R3,R3               " " "                                17240000
  1850.          ERROR MSG_GETMAIN_FAIL                                         17250000
  1851.          SPACE 1                                                        17260000
  1852. KVERROR  DS    0H                  This should never happen             17270000
  1853.          XR    R2,R2               No accompanying data                 17280000
  1854.          XR    R3,R3               " " "                                17290000
  1855.          ERROR MSG_KV_ERROR                                             17300000
  1856.          SPACE 1                                                        17310000
  1857. FLUSHIT  DS    0H                  Return in failure                    17320000
  1858.          SPACE 1                                                        17330000
  1859.          TCLEARQ INPUT             Flush terminal input                 17340000
  1860.          MVC   FLUSH(LENFLUSH),MFLUSH Set up STACK list form            17350000
  1861.          XC    ECB,ECB             Clear ECB and flush the input stack  17360000
  1862.          STACK PARM=FLUSH,MF=(E,IOPL)                                   17370000
  1863.          LTR   R15,R15             If STACK failed,                     17380000
  1864.          BZ    RETURN12            then...                              17390000
  1865.          CVD   R15,DOUBLE                                               17400000
  1866.          UNPK  DOUBLE(2),DOUBLE(8)                                      17410000
  1867.          OI    DOUBLE+1,X'F0'                                           17420000
  1868.          LA    R2,2                Length of error code                 17430000
  1869.          LA    R3,DOUBLE           Address of error code                17440000
  1870.          ERROR MSG_STACK_ERROR,FLUSH=NO                                 17450000
  1871. RETURN12 DS    0H                                                       17460000
  1872.          LA    R2,12               Set return code to 12                17470000
  1873.          B     RETURN                                                   17480000
  1874.          SPACE 1                                                        17490000
  1875. RETURN0  DS    0H                  Return with code 0                   17500000
  1876.          XR    R2,R2               Set return code to zero              17510000
  1877. ******** B     RETURN                                                   17520000
  1878.          SPACE 1                                                        17530000
  1879. RETURN   DS    0H                  R2 contains return code              17540000
  1880.          SPACE 1                                                        17550000
  1881.          ICM   R1,15,PWADDR        If there was a parse work area       17560000
  1882.          BZ    NOFREEPW            then free it                         17570000
  1883.          L     R0,PWLEN                                                 17580000
  1884.          FREEMAIN RC,LV=(0),A=(1)                                       17590000
  1885. NOFREEPW DS    0H                                                       17600000
  1886.          SPACE 1                                                        17610000
  1887.          ICM   R1,15,VBUFADDR      If there was a fake command buffer   17620000
  1888.          BZ    NOFREEVBUF          then free it                         17630000
  1889.          L     R0,VBUFLEN                                               17640000
  1890.          FREEMAIN RC,LV=(0),A=(1)                                       17650000
  1891. NOFREEVBUF DS  0H                                                       17660000
  1892.          SPACE 1                                                        17670000
  1893.          ICM   R1,15,ARGADDR       If there was an arg buffer           17680000
  1894.          BZ    NOFREEARG           then free it                         17690000
  1895.          L     R0,ARGLEN           Get length                           17700000
  1896.          FREEMAIN RC,LV=(0),A=(1)                                       17710000
  1897. NOFREEARG DS   0H                                                       17720000
  1898.          SPACE 1                                                        17730000
  1899.          ICM   R1,15,AKEYD         If there was a keyword/value area    17740000
  1900.          BZ    NOFREEKEYD          then free it                         17750000
  1901.          L     R0,LKEYD                                                 17760000
  1902.          FREEMAIN RC,LV=(0),A=(1)                                       17770000
  1903. NOFREEKEYD DS  0H                                                       17780000
  1904.          SPACE 1                                                        17790000
  1905.          ICM   R1,15,APOSD         If there was a pos parm area,        17800000
  1906.          BZ    NOFREEPOSD          then free it                         17810000
  1907.          L     R0,LPOSD                                                 17820000
  1908.          FREEMAIN RC,LV=(0),A=(1)                                       17830000
  1909. NOFREEPOSD DS  0H                                                       17840000
  1910.          SPACE 1                                                        17850000
  1911.          IKJRLSA ANSWER            Free IKJPARS storage if any          17860000
  1912.          SPACE 1                                                        17870000
  1913.          L     R0,DATDLEN          Get length of work area              17880000
  1914.          LR    R1,R13              Get address of work area             17890000
  1915.          L     R13,4(,R13)         Unchain save area                    17900000
  1916.          ST    R2,16(,R13)         Store return code in save area       17910000
  1917.          FREEMAIN R,LV=(0),A=(1)                                        17920000
  1918.          LM    R14,R12,12(R13)                                          17930000
  1919.          BR    R14                                                      17940000
  1920.          EJECT                                                          17950000
  1921. *********************************************************************** 17960000
  1922. * Subroutines                                                         * 17970000
  1923. *********************************************************************** 17980000
  1924.          EJECT                                                          17990000
  1925. DOOPTS   DS    0H                  Process options following "/"        18000000
  1926.          SPACE 1                                                        18010000
  1927.          ST    R14,DOOPT14         Save return address                  18020000
  1928.          TM    FLAGS,FLAGPOSD+FLAGKEYD Must be processing either a      18030000
  1929.          BZ    ERROR_NO_WANT_SL    positional or a keyword              18040000
  1930. *                                                                       18050000
  1931. * Process the option following the slash.                               18060000
  1932. *                                                                       18070000
  1933.          BAL   R14,SCAN            Scan for option name                 18080000
  1934.          B     DOOPTRET            None, skip                           18090000
  1935.          B     OPTNAME             Unquoted name, process               18100000
  1936.          B     ERROR_NO_WANT_QS    Quoted string found                  18110000
  1937.          B     ERROR_NO_WANT_LP    "(" found                            18120000
  1938.          B     ERROR_NO_WANT_RP    ")" found                            18130000
  1939.          B     ERROR_NO_WANT_SL    "/" found                            18140000
  1940.          SPACE 1                                                        18150000
  1941. OPTNAME  DS    0H                  Option name found                    18160000
  1942. *                                                                       18170000
  1943. * Validate option name and process it.                                  18180000
  1944. *                                                                       18190000
  1945.          CH    R2,=Y(L'OPTION)     If too long                          18200000
  1946.          BH    ERROR_OPT_TOO_LONG  then error                           18210000
  1947.          MVI   OPTION,C' '         Clear option field to blanks         18220000
  1948.          MVC   OPTION+1(L'OPTION-1),OPTION                              18230000
  1949.          LR    R14,R1              Address                              18240000
  1950.          LR    R15,R2              Length                               18250000
  1951.          BCTR  R15,0               Reduce length for execute            18260000
  1952.          LA    R1,OPTION           Point to place to move option name   18270000
  1953.          EX    R15,MVCWORD         Move option name to option area      18280000
  1954.          EX    R15,UPWORD          Translate to uppercase               18290000
  1955. *                                                                       18300000
  1956. * Time to process the options                                           18310000
  1957. *                                                                       18320000
  1958.          TM    FLAGS,FLAGPOSD      If currently processing positional   18330000
  1959.          BO    DOOPTP              then check positional options        18340000
  1960.          B     DOOPTK              else check keyword options           18350000
  1961.          SPACE 1                                                        18360000
  1962. DOOPTP   DS    0H                                                       18370000
  1963.          L     R1,LASTAREA         Point to current PP area             18380000
  1964. ******** CLC   =C'OPTIONAL ',OPTION                                     18390000
  1965. ******** BE    DOOPTP_OPTIONAL                                          18400000
  1966.          CLC   =C'ASIS ',OPTION                                         18410000
  1967.          BE    DOOPTP_ASIS                                              18420000
  1968.          CLC   =C'QUOTABLE ',OPTION                                     18430000
  1969.          BE    DOOPTP_CHAR                                              18440000
  1970.          B     ERROR_OPT_INVALID   All other options are bad, error     18450000
  1971.          SPACE 1                                                        18460000
  1972. DOOPTP_OPTIONAL DS 0H                                                   18470000
  1973.          OI    POSDFLGS-POSDDATA(R1),POSDOPT                            18480000
  1974.          B     DOOPTRET                                                 18490000
  1975.          SPACE 1                                                        18500000
  1976. DOOPTP_ASIS     DS 0H                                                   18510000
  1977.          OI    POSDFLGS-POSDDATA(R1),POSDASIS                           18520000
  1978.          B     DOOPTRET                                                 18530000
  1979.          SPACE 1                                                        18540000
  1980. DOOPTP_CHAR     DS 0H                                                   18550000
  1981.          OI    POSDFLGS-POSDDATA(R1),POSDCHAR                           18560000
  1982.          B     DOOPTRET                                                 18570000
  1983.          SPACE 1                                                        18580000
  1984. DOOPTK   DS    0H                                                       18590000
  1985.          L     R1,LASTAREA         Point to current KV area             18600000
  1986.          CLC   =C'ASIS ',OPTION                                         18610000
  1987.          BE    DOOPTK_ASIS                                              18620000
  1988.          CLC   =C'QUOTABLE ',OPTION                                     18630000
  1989.          BE    ERROR_OPT_POS_ONLY                                       18640000
  1990.          B     ERROR_OPT_INVALID   All other options are bad, error     18650000
  1991.          SPACE 1                                                        18660000
  1992. DOOPTK_ASIS    DS 0H                                                    18670000
  1993.          OI    KEYFLAGS-KEYDDATA(R1),KEYFASIS                           18680000
  1994.          B     DOOPTRET                                                 18690000
  1995.          SPACE 1                                                        18700000
  1996. DOOPTRET DS    0H                                                       18710000
  1997.          L     R14,DOOPT14                                              18720000
  1998.          BR    R14                                                      18730000
  1999.          EJECT                                                          18740000
  2000. SCAN     DS    0H                                                       18750000
  2001. *                                                                       18760000
  2002. *********************************************************************** 18770000
  2003. *                                                                     * 18780000
  2004. * This routine scans the command buffer for operands.  It returns the * 18790000
  2005. * address of the next operand in R1 and its length in R2 (when there  * 18800000
  2006. * are no more operands, R1 and R2 are zeroed).  The operand may be a  * 18810000
  2007. * name, a number, a parenthesis, or a quoted string. If it's a quoted * 18820000
  2008. * string, it will be returned as is, quotes and all.                  * 18830000
  2009. *                                                                     * 18840000
  2010. * Return is as follows:                                               * 18850000
  2011. *                                                                     * 18860000
  2012. * To return address + 0  ... no value found                           * 18870000
  2013. * To return address + 4  ... unquoted string found                    * 18880000
  2014. * To return address + 8  ... quoted string found                      * 18890000
  2015. * To return address + 12 ... left parenthesis found                   * 18900000
  2016. * To return address + 16 ... right parenthesis found                  * 18910000
  2017. *                                                                     * 18920000
  2018. * SCANPTR -> area to scan; SCANEPTR -> end thereof                    * 18930000
  2019. *                                                                     * 18940000
  2020. *********************************************************************** 18950000
  2021. *                                                                       18960000
  2022.          L     R1,SCANPTR          Point to data to scan                18970000
  2023.          XR    R2,R2               Clear TRT register                   18980000
  2024.          L     R3,SCANEPTR         Point to end of data to scan         18990000
  2025.          SR    R3,R1               Get length of data to scan           19000000
  2026.          LA    R0,256              Set up constant 256                  19010000
  2027.          LTR   R3,R3               If length is zero                    19020000
  2028.          BZ    SCANEND             then finished, return no value       19030000
  2029. SCANLOOP DS    0H                  Do TRT for remaining length          19040000
  2030.          CR    R3,R0               If length greater than 256           19050000
  2031.          BNH   SCANLEFF            then...                              19060000
  2032.          TRT   0(256,R1),STBL0      scan for important characters       19070000
  2033.          BNZ   SCANGOT1             If we found something, process it   19080000
  2034.          AR    R1,R0                Else increment text pointer by 256  19090000
  2035.          SR    R3,R0                Decrement length by 256             19100000
  2036.          BP    SCANLOOP             Either continue scanning            19110000
  2037.          B     SCANEND              or exit (no value), length now zero 19120000
  2038. SCANLEFF DS    0H                  Else...                              19130000
  2039.          BCTR  R3,0                 Reduce length for execute           19140000
  2040.          EX    R3,SCANTRT           Scan for important characters       19150000
  2041.          BNZ   SCANGOT1             If we found something, process it   19160000
  2042. ******** B     SCANEND              If none found, exit in failure      19170000
  2043. SCANEND  DS    0H                  Reached end of data                  19180000
  2044.          XR    R1,R1               Clear scanning registers             19190000
  2045.          XR    R2,R2                                                    19200000
  2046.          BR    R14                 Return with no value                 19210000
  2047. SCANGOT1 DS    0H                  R1 -> something we found             19220000
  2048.          L     R3,SCANEPTR                                              19230000
  2049.          SR    R3,R1               R3 := length remaining to scan       19240000
  2050.          B     *(R2)               R2 tells what kind it is             19250000
  2051.          B     GOTWORD             4:  Found nonblank                   19260000
  2052.          B     GOTLP               8:  Found (                          19270000
  2053.          B     GOTRP               12: Found )                          19280000
  2054.          B     GOTSLASH            16: Found /                          19290000
  2055.          B     GOTQUOTE            20: Found '                          19300000
  2056.          SPACE 1                                                        19310000
  2057. GOTWORD  DS    0H                  Found a nonblank (word)              19320000
  2058. *                                  R1 -> it, R3 = length to scan        19330000
  2059. *                                                                       19340000
  2060. * Scan for end-of-word                                                  19350000
  2061. *                                                                       19360000
  2062.          LR    R15,R1              Save address of the word             19370000
  2063. GOTWORDL CR    R3,R0               If length greater than 256           19380000
  2064.          BNH   GOTWORDX            then...                              19390000
  2065.          TRT   0(256,R1),STBLWORD   scan for important characters       19400000
  2066.          BNZ   GOTWORDT             If we found it, go. Else            19410000
  2067.          AR    R1,R0                Increment text pointer by 256       19420000
  2068.          SR    R3,R0                Decrement length by 256             19430000
  2069.          BP    GOTWORDL             Either continue scanning            19440000
  2070.          B     GOTWORDE             or go if length zero                19450000
  2071. GOTWORDX DS    0H                  Else...                              19460000
  2072.          BCTR  R3,0                 Reduce length for execute           19470000
  2073.          EX    R3,GOTWTRT           Scan for important characters       19480000
  2074.          BNZ   GOTWORDT             If found something, go              19490000
  2075.          L     R1,SCANEPTR          Else end of text = end of word      19500000
  2076.          B     GOTWORDE                                                 19510000
  2077. GOTWORDT L     R3,SCANEPTR         R3 := length remaining to scan       19520000
  2078.          SR    R3,R1               R1 -> character                      19530000
  2079.          B     *(R2)               Branch depending on R2               19540000
  2080.          B     GOTWORDE            4:  Found whitespace, end of word    19550000
  2081.          B     GOTWLP              8:  Found (                          19560000
  2082.          B     GOTWRP              12: Found )                          19570000
  2083.          B     GOTWS               16: Found /                          19580000
  2084.          SPACE 1                                                        19590000
  2085. GOTWORDE DS    0H                  Found whitespace or end of word      19600000
  2086.          LR    R2,R1               Set length of word found             19610000
  2087.          SR    R2,R15                                                   19620000
  2088.          ST    R1,SCANPTR          Set scan pointer for next scan       19630000
  2089.          LR    R1,R15              Set pointer to found item            19640000
  2090.          B     4(,R14)             Return to caller with unquoted word  19650000
  2091. GOTWLP   DS    0H                  Found "(" in word                    19660000
  2092.          ICM   R2,15,PARCOUNT      Get parenthesis count                19670000
  2093.          BZ    GOTWORDE            If was zero, not nested, end of word 19680000
  2094.          LA    R2,1(,R2)           Increment it                         19690000
  2095.          ST    R2,PARCOUNT                                              19700000
  2096.          B     GOTWNEXT            Else process as constituent char     19710000
  2097. GOTWRP   DS    0H                  Found a right parenthesis ")"        19720000
  2098.          ICM   R2,15,PARCOUNT      Get parenthesis count                19730000
  2099.          BZ    GOTWORDE            If was zero, not nested, end of word 19740000
  2100.          BCTR  R2,0                Decrement count                      19750000
  2101.          ST    R2,PARCOUNT                                              19760000
  2102.          LTR   R2,R2                                                    19770000
  2103.          BZ    GOTWORDE            If now zero, not nested, end of word 19780000
  2104.          B     GOTWNEXT            Else process as constituent char     19790000
  2105. GOTWS    DS    0H                  Found a slash "/"                    19800000
  2106.          ICM   R2,15,PARCOUNT      Get parenthesis count                19810000
  2107.          BNZ   GOTWNEXT            If inside (), treat as constituent   19820000
  2108.          B     GOTWORDE            Else treat as end of word            19830000
  2109.          SPACE 1                                                        19840000
  2110. GOTWNEXT LA    R1,1(,R1)           Bump text pointer                    19850000
  2111.          BCT   R3,GOTWORDL         Decrement count, scan if nonzero     19860000
  2112.          B     GOTWORDE            end of word                          19870000
  2113.          SPACE 1                                                        19880000
  2114. GOTLP    DS    0H                  Found a left parenthesis "("         19890000
  2115. *                                  R1 -> it, R3 = length to scan        19900000
  2116.          ICM   R2,15,PARCOUNT      Get parenthesis count                19910000
  2117.          BNZ   GOTWORD             If count was nonzero, start of word  19920000
  2118.          LA    R2,1(,R2)           Increment it                         19930000
  2119.          ST    R2,PARCOUNT                                              19940000
  2120.          LA    R2,1                Else set length to 1                 19950000
  2121.          LA    R15,1(,R1)          Set pointer past it                  19960000
  2122.          ST    R15,SCANPTR         Update scan pointer                  19970000
  2123.          B     12(,R14)            Return single left parenthesis       19980000
  2124.          SPACE 1                                                        19990000
  2125. GOTRP    DS    0H                  Found a right parenthesis ")"        20000000
  2126. *                                  R1 -> it, R3 = length to scan        20010000
  2127.          ICM   R2,15,PARCOUNT      Get parenthesis count                20020000
  2128.          BZ    SCANRETP            If was zero, not nested, return ")"  20030000
  2129.          BCTR  R2,0                Decrement count                      20040000
  2130.          ST    R2,PARCOUNT                                              20050000
  2131.          LTR   R2,R2                                                    20060000
  2132.          BNZ   GOTWORD             If now nonzero, part of word         20070000
  2133. SCANRETP DS    0H                  Return the parenthesis               20080000
  2134.          LA    R2,1                Set length to 1                      20090000
  2135.          LA    R15,1(,R1)          Set pointer past it                  20100000
  2136.          ST    R15,SCANPTR         Update scan pointer                  20110000
  2137.          B     16(,R14)            Return single right parenthesis      20120000
  2138.          SPACE 1                                                        20130000
  2139. GOTQUOTE DS    0H                  Found a single quote "'"             20140000
  2140. *                                  R1 -> it, R3 = length to scan        20150000
  2141.          LR    R15,R1              Save address of the quoted string    20160000
  2142.          LA    R1,1(,R1)           Bump past initial quote              20170000
  2143.          BCT   R3,GOTQL            Decrement length to scan             20180000
  2144.          B     ERRQUOTE            If nothing left, error               20190000
  2145. GOTQL    CR    R3,R0               If length greater than 256           20200000
  2146.          BNH   GOTQX               then...                              20210000
  2147.          TRT   0(256,R1),STBLQUOT   scan for "'"                        20220000
  2148.          BNZ   GOTQT                If we found it, go. Else            20230000
  2149.          AR    R1,R0                Increment text pointer by 256       20240000
  2150.          SR    R3,R0                Decrement length by 256             20250000
  2151.          BP    GOTQL                Either continue scanning            20260000
  2152.          B     ERRQUOTE             or, if length zero, error           20270000
  2153. GOTQX    DS    0H                  Else...                              20280000
  2154.          BCTR  R3,0                 Reduce length for execute           20290000
  2155.          EX    R3,GOTQTRT           Scan for "'"                        20300000
  2156.          BNZ   GOTQT                If found something, go              20310000
  2157.          B     ERRQUOTE             Else error                          20320000
  2158. GOTQT    DS    0H                  Reached "'"                          20330000
  2159.          L     R3,SCANEPTR                                              20340000
  2160.          SR    R3,R1               R3 := length remaining to scan       20350000
  2161.          BNP   GOTQE               If zero, it's the ending quote       20360000
  2162.          CLI   1(R1),C''''         If not "''"                          20370000
  2163.          BNE   GOTQE               then it's the ending quote           20380000
  2164.          LA    R1,2(,R1)           Else bump past "''"                  20390000
  2165.          SH    R3,=H'2'            Decrement scan length                20400000
  2166.          BP    GOTQL               If something left, continue scan     20410000
  2167.          B     ERRQUOTE            Else error                           20420000
  2168. GOTQE    DS    0H                  End of quoted string                 20430000
  2169.          LA    R1,1(,R1)           Bump past final quote mark           20440000
  2170.          LR    R2,R1               Set length of string including "'"s  20450000
  2171.          SR    R2,R15                                                   20460000
  2172.          ST    R1,SCANPTR          Set scan pointer for next scan       20470000
  2173.          LR    R1,R15              Set pointer to found item            20480000
  2174.          B     8(,R14)             Return quoted string to caller       20490000
  2175.          SPACE 1                                                        20500000
  2176. GOTSLASH DS    0H                  Found a slash "/"                    20510000
  2177. *                                  R1 -> it, R3 = length to scan        20520000
  2178.          CH    R3,=H'2'            If not enough room for "/*"          20530000
  2179.          BL    GOTSL               then treat as real slash             20540000
  2180.          CLI   1(R1),C'*'          If not "/*"                          20550000
  2181.          BNE   GOTSL               then treat as real slash             20560000
  2182.          LA    R1,2(,R1)           Else start of comment: bump text ptr 20570000
  2183.          SH    R3,=H'2'            Decrement length to scan             20580000
  2184.          BNP   SCANEND             If nothing left, end of text         20590000
  2185. GOTCOMML CR    R3,R0               If length greater than 256           20600000
  2186.          BNH   GOTCOMMX            then...                              20610000
  2187.          TRT   0(256,R1),STBLCOMM   scan for "*"                        20620000
  2188.          BNZ   GOTCOMME             If we found it, go. Else            20630000
  2189.          AR    R1,R0                Increment text pointer by 256       20640000
  2190.          SR    R3,R0                Decrement length by 256             20650000
  2191.          BP    GOTCOMML             Either continue scanning            20660000
  2192.          B     SCANEND              or, if length zero, end of text     20670000
  2193. GOTCOMMX DS    0H                  Else...                              20680000
  2194.          BCTR  R3,0                 Reduce length for execute           20690000
  2195.          EX    R3,GOTCTRT           Scan for "*"                        20700000
  2196.          BNZ   GOTCOMME             If found something, go              20710000
  2197.          B     SCANEND              Else end of text                    20720000
  2198. GOTCOMME DS    0H                   Reached an "*"                      20730000
  2199.          L     R3,SCANEPTR                                              20740000
  2200.          SR    R3,R1               R3 := length remaining to scan       20750000
  2201.          CH    R3,=H'2'            If not enough room for "*/"          20760000
  2202.          BL    GOTCOMMC            then continue scanning for it        20770000
  2203.          CLI   1(R1),C'/'          If not "*/"                          20780000
  2204.          BNE   GOTCOMMC            then continue scanning for it        20790000
  2205.          LA    R1,2(,R1)           Else bump past "*/"                  20800000
  2206.          SH    R3,=H'2'            Decrement scan length                20810000
  2207.          BP    SCANLOOP            If something left, continue scan     20820000
  2208.          B     SCANEND             Else end of text                     20830000
  2209. GOTCOMMC DS    0H                  "*" but no "/"                       20840000
  2210.          LA    R1,1(,R1)           Bump past "*"                        20850000
  2211.          BCT   R3,GOTCOMML         Decrement length, continue if nzero  20860000
  2212.          B     SCANEND             Else end of text                     20870000
  2213. GOTSL    DS    0H                  Found a slash "/" without a "*"      20880000
  2214.          ICM   R2,15,PARCOUNT      Get parenthesis count                20890000
  2215.          BNZ   GOTWORD             If inside (), treat as constituent   20900000
  2216. RETSLASH DS    0H                  Else treat as single slash "/"       20910000
  2217.          LA    R2,1                Set length to 1                      20920000
  2218.          LA    R15,1(,R1)          Set pointer past it                  20930000
  2219.          ST    R15,SCANPTR         Update scan pointer                  20940000
  2220.          B     20(,R14)            Return single slash                  20950000
  2221.          SPACE 1                                                        20960000
  2222. ERRQUOTE DS    0H                  Mismatched quotes                    20970000
  2223.          XR    R2,R2               No accompanying data                 20980000
  2224.          XR    R3,R3               " " "                                20990000
  2225.          ERROR MSG_QUOTE_ERROR                                          21000000
  2226.          SPACE 1                                                        21010000
  2227. SCANTRT  TRT   0(*-*,R1),STBL0      (Executed instruction)              21020000
  2228. GOTWTRT  TRT   0(*-*,R1),STBLWORD   (Executed instruction)              21030000
  2229. GOTCTRT  TRT   0(*-*,R1),STBLCOMM   (Executed instruction)              21040000
  2230. GOTQTRT  TRT   0(*-*,R1),STBLQUOT   (Executed instruction)              21050000
  2231.          SPACE 1                                                        21060000
  2232. STBL0    DC    256YL1(4)           Table to scan for good stuff         21070000
  2233.          ORG   STBL0+C' '          Blank                                21080000
  2234.          DC    YL1(0)              is whitespace                        21090000
  2235.          ORG   STBL0+C','          Comma                                21100000
  2236.          DC    YL1(0)              is whitespace                        21110000
  2237.          ORG   STBL0+X'05'         Tab                                  21120000
  2238.          DC    YL1(0)              is whitespace                        21130000
  2239.          ORG   STBL0+C'('          Left parenthesis                     21140000
  2240.          DC    YL1(8)              is special                           21150000
  2241.          ORG   STBL0+C')'          Right parenthesis                    21160000
  2242.          DC    YL1(12)             is special                           21170000
  2243.          ORG   STBL0+C'/'          Slash                                21180000
  2244.          DC    YL1(16)             might be part of /*                  21190000
  2245.          ORG   STBL0+C''''         Quote                                21200000
  2246.          DC    YL1(20)             is special                           21210000
  2247.          ORG   ,                                                        21220000
  2248.          SPACE 1                                                        21230000
  2249. STBLWORD DC    256YL1(0)           Table to scan for end of word        21240000
  2250.          ORG   STBLWORD+C' '       Blank                                21250000
  2251.          DC    YL1(4)              is whitespace                        21260000
  2252.          ORG   STBLWORD+C','       Comma                                21270000
  2253.          DC    YL1(4)              is whitespace                        21280000
  2254.          ORG   STBLWORD+X'05'      Tab                                  21290000
  2255.          DC    YL1(4)              is whitespace                        21300000
  2256.          ORG   STBLWORD+C'('       Left parenthesis                     21310000
  2257.          DC    YL1(8)              is special                           21320000
  2258.          ORG   STBLWORD+C')'       Right parenthesis                    21330000
  2259.          DC    YL1(12)             is special                           21340000
  2260.          ORG   STBLWORD+C'/'       Slash                                21350000
  2261.          DC    YL1(16)             might be part of /*                  21360000
  2262.          ORG   ,                                                        21370000
  2263.          SPACE 1                                                        21380000
  2264. STBLCOMM DC    256YL1(0)           Table to scan for "*/"               21390000
  2265.          ORG   STBLCOMM+C'*'                                            21400000
  2266.          DC    1YL1(1)                                                  21410000
  2267.          ORG   ,                                                        21420000
  2268.          SPACE 1                                                        21430000
  2269. STBLQUOT DC    256YL1(0)           Table to scan for "'"                21440000
  2270.          ORG   STBLQUOT+C''''                                           21450000
  2271.          DC    1YL1(1)                                                  21460000
  2272.          ORG   ,                                                        21470000
  2273. VERTBL   DC    256YL1(1)           Table to verify parameter syntax     21480000
  2274.          ORG   VERTBL+C'_'         Underscore is valid (?)              21490000
  2275.          DC    YL1(0)               valid?                              21500000
  2276.          ORG   VERTBL+C'@'         National character is valid (?)      21510000
  2277.          DC    YL1(0)                                                   21520000
  2278.          ORG   VERTBL+C'#'         National character is valid (?)      21530000
  2279.          DC    YL1(0)                                                   21540000
  2280.          ORG   VERTBL+C'$'         National character is valid (?)      21550000
  2281.          DC    YL1(0)                                                   21560000
  2282.          ORG   VERTBL+C'a'         Lower case alphabetics are valid     21570000
  2283.          DC    9YL1(0)                                                  21580000
  2284.          ORG   VERTBL+C'j'                                              21590000
  2285.          DC    9YL1(0)                                                  21600000
  2286.          ORG   VERTBL+C's'                                              21610000
  2287.          DC    8YL1(0)                                                  21620000
  2288.          ORG   VERTBL+C'A'         Upper case alphabetics are valid     21630000
  2289.          DC    9YL1(0)                                                  21640000
  2290.          ORG   VERTBL+C'J'                                              21650000
  2291.          DC    9YL1(0)                                                  21660000
  2292.          ORG   VERTBL+C'S'                                              21670000
  2293.          DC    8YL1(0)                                                  21680000
  2294.          ORG   VERTBL+C'0'         Numerics are valid (except 1st pos)  21690000
  2295.          DC    10YL1(0)                                                 21700000
  2296.          ORG   ,                                                        21710000
  2297. UPTBL    DC    256YL1(*-UPTBL)     Table to translate to uppercase      21720000
  2298.          ORG   UPTBL+C'a'                                               21730000
  2299.          DC    C'ABCDEFGHI'                                             21740000
  2300.          ORG   UPTBL+C'j'                                               21750000
  2301.          DC    C'JKLMNOPQR'                                             21760000
  2302.          ORG   UPTBL+C's'                                               21770000
  2303.          DC    C'STUVWXYZ'                                              21780000
  2304.          ORG   ,                                                        21790000
  2305.          EJECT                                                          21800000
  2306. PUTLINE  DS    0H                                                       21810000
  2307. *                                                                       21820000
  2308. *********************************************************************** 21830000
  2309. *                                                                     * 21840000
  2310. * This routine displays messages to the TSO user using the TSO        * 21850000
  2311. * PUTLINE service routine.  At entry R1 contains the address of the   * 21860000
  2312. * message to be displayed, and R0 contains the length of the message. * 21870000
  2313. * R3 points to additional data to be displayed, and R2 is its length. * 21880000
  2314. * If R1 is zero, the message has already been built in the workarea   * 21890000
  2315. * MSGWA.  The message is assumed to begin with a message ID unless    * 21900000
  2316. * the first character is blank, in which case the initial blank is    * 21910000
  2317. * stripped off by PUTLINE anyhow.                                     * 21920000
  2318. *                                                                     * 21930000
  2319. *********************************************************************** 21940000
  2320. *                                                                       21950000
  2321.          ST    R14,PUTL14          Save return register                 21960000
  2322.          LTR   R15,R0              Load length value                    21970000
  2323.          BNP   PUTLRET             If zero, don't do anything           21980000
  2324.          BCTR  R15,0               Else reduce length for execute       21990000
  2325.          LTR   R1,R1               If R1 is zero,                       22000000
  2326.          BZ    PUTIT               then message already set up.         22010000
  2327.          EX    R15,MVCPUT          Else move message to work area       22020000
  2328.          LTR   R2,R2               If additional data,                  22030000
  2329.          BZ    PUTIT               then                                 22040000
  2330.          LA    R1,MSGWA+1(R15)      Point to end of message             22050000
  2331.          CH    R2,=H'256'           (Use max length of 256)             22060000
  2332.          BNH   *+8                                                      22070000
  2333.          LA    R2,256                                                   22080000
  2334.          BCTR  R2,0                 Reduce data length for execute      22090000
  2335.          EX    R2,MVCPUT2           Move additional data to work area   22100000
  2336.          LA    R15,1(R15,R2)        Add length of data to msg length    22110000
  2337. PUTIT    DS    0H                                                       22120000
  2338.          LA    R15,5(,R15)         Restore length + 4 for header        22130000
  2339.          SLL   R15,16              Shift length into left half of hdr   22140000
  2340.          STCM  R15,15,MSGHDR       Put zeroes into right half of hdr    22150000
  2341. PUTLINE_RETRY DS 0H                                                     22160000
  2342.          XC    ECB,ECB             Clear ECB                            22170000
  2343.          PUTLINE PARM=PTLIST,                                          X22180000
  2344.                MF=(E,IOPL),                                            X22190000
  2345.                OUTPUT=(OLD,TERM,SINGLE,INFOR)                           22200000
  2346.          LTR   R15,R15             If PUTLINE OK                        22210000
  2347.          BZ    PUTLRET             then return                          22220000
  2348.          CH    R15,=H'8'           Else if attention interrupt          22230000
  2349.          BE    PUTLRET             then OK                              22240000
  2350.          CH    R15,=H'12'          Else if pending 2nd level message    22250000
  2351.          BE    PUTL12              then OK                              22260000
  2352. PUTERROR DS    0H                  Else PUTLINE error                   22270000
  2353.          CVD   R15,DOUBLE                                               22280000
  2354.          UNPK  DOUBLE(2),DOUBLE(8)                                      22290000
  2355.          OI    DOUBLE+1,X'F0'                                           22300000
  2356.          MVC   MSGWA+1(L'MSG_PUTLINE_FAILURE1),MSG_PUTLINE_FAILURE1     22310000
  2357.          MVC   MSGWA+1+L'MSG_PUTLINE_FAILURE1(2),DOUBLE                 22320000
  2358.          MVC   MSGWA+1+L'MSG_PUTLINE_FAILURE1+2(L'MSG_PUTLINE_FAILURE2)X22330000
  2359.                ,MSG_PUTLINE_FAILURE2                                    22340000
  2360.          TPUT  MSGWA+1,L'MSG_PUTLINE_FAILURE1+2+L'MSG_PUTLINE_FAILURE2  22350000
  2361.          LA    R1,MSGWA                                                 22360000
  2362.          LH    R0,MSGHDR                                                22370000
  2363.          SH    R0,=H'4'                                                 22380000
  2364.          TPUT  (1),(0),R           Try to display original message      22390000
  2365. PUTLRET  L     R14,PUTL14          Restore return register              22400000
  2366.          BR    R14                 Return                               22410000
  2367. *                                                                       22420000
  2368. PUTL12   DS    0H                  Try putting out pending 2nd level ms 22430000
  2369.          XC    ECB,ECB             Clear ecb                            22440000
  2370.          PUTLINE PARM=PTLIST,MF=(E,IOPL),OUTPUT=(0,TERM,SINGLE,INFOR)   22450000
  2371.          B     PUTLINE_RETRY                                            22460000
  2372. *                                                                       22470000
  2373. MVCPUT   MVC   MSGWA(*-*),0(R1)    Executed                             22480000
  2374. MVCPUT2  MVC   0(*-*,R1),0(R3)     Executed                             22490000
  2375.          EJECT                                                          22500000
  2376. MFLUSH   STACK MF=L,DELETE=ALL                                          22510000
  2377. LENFLUSH EQU   *-MFLUSH                                                 22520000
  2378. *                                                                       22530000
  2379. MPTLIST  PUTLINE MF=L,OUTPUT=(0,TERM,SINGLE,INFOR)                      22540000
  2380. LENPUTL  EQU   *-MPTLIST                                                22550000
  2381. *                                                                       22560000
  2382.          EJECT                                                          22570000
  2383.          LTORG                                                          22580000
  2384.          EJECT                                                          22590000
  2385. *********************************************************************** 22600000
  2386. * Messages                                                            * 22610000
  2387. *********************************************************************** 22620000
  2388.          SPACE 1                                                        22630000
  2389. MSG_NO_OPERANDS    DC C'XPROC001 No operands specified.'                22640000
  2390. MSG_REXX_REQUIRED  DC C'XPROC002 Not in REXX: input variable required.' 22650000
  2391. MSG_NO_POS_COUNT   DC C'XPROC003 Missing positional parameter count.'   22660000
  2392. MSG_BAD_POS_COUNT  DC C'XPROC004 Invalid positional parameter count: '  22670000
  2393. MSG_QUOTE_ERROR    DC C'XPROC005 Missing end quote.'                    22680000
  2394. MSG_NO_WANT_LP     DC C'XPROC006 "(" found where not expected.'         22690000
  2395. MSG_NO_WANT_RP     DC C'XPROC007 ")" found where not expected.'         22700000
  2396. MSG_NO_WANT_QS     DC C'XPROC008 Quoted string in invalid position.'    22710000
  2397. MSG_TOO_FEW_PPARMS DC C'XPROC009 Fewer positional parms than expected.' 22720000
  2398. MSG_PP_WITH_LP     DC C'XPROC010 Value not allowed on positional: '     22730000
  2399. MSG_PARM_TOO_LONG  DC C'XPROC011 Parameter name too long (> 255): '     22740000
  2400. MSG_PARM_INVALID   DC C'XPROC012 Invalid syntax in parameter name: '    22750000
  2401. MSG_PARM_DUPLICATE DC C'XPROC013 Duplicate parameter name: '            22760000
  2402. MSG_EXTRANEOUS     DC C'XPROC014 Extraneous data ignored in value: '    22770000
  2403. MSG_VAR_TOO_LONG   DC C'XPROC015 Variable name too long (> 256): '      22780000
  2404. MSG_GETTING_VAR    DC C'XPROC016 Error accessing value of variable: '   22790000
  2405. MSG_PUTTING_VAR    DC C'XPROC017 Error storing value of variable: '     22800000
  2406. MSG_IKJCT441_RC    DC C'XPROC018 IKJCT441 return code is: '             22810000
  2407. MSG_PARSE_FAILURE  DC C'XPROC019 PARSE service routine failure, code: ' 22820000
  2408. MSG_GETMAIN_FAIL   DC C'XPROC020 Not enough main storage to execute.'   22830000
  2409. MSG_IRXEXCOM_FAIL  DC C'XPROC021 IRXEXCOM failure, error code: '        22840000
  2410. MSG_STACK_ERROR    DC C'XPROC022 STACK service routine failure, code: ' 22850000
  2411. MSG_NO_WANT_SL     DC C'XPROC023 "/" found where not expected.'         22860000
  2412. MSG_OPT_TOO_LONG   DC C'XPROC024 Option name too long: '                22870000
  2413. MSG_OPT_INVALID    DC C'XPROC025 Invalid option name: '                 22880000
  2414. MSG_ASIS_NEEDS_VAL DC C'XPROC026 ASIS invalid with valueless keyword: ' 22890000
  2415. MSG_OPT_POS_ONLY   DC C'XPROC027 Option valid only for positional: '    22900000
  2416. *                                                                       22910000
  2417. MSG_KV_ERROR       DC C'XPROC999 Internal error in keyword value scan.' 22920000
  2418. *                                                                       22930000
  2419. MSG_PUTLINE_FAILURE1 DC C'*** XPROC: PUTLINE error code '               22940000
  2420. MSG_PUTLINE_FAILURE2 DC C' trying to issue the following message:'      22950000
  2421. *                                                                       22960000
  2422. ISMSG    DC    C'*** XPROC ignoring slash after this parameter: ' dummy 22970000
  2423.          SPACE 1                                                        22980000
  2424.          EJECT                                                          22990000
  2425. *********************************************************************** 23000000
  2426. * Constants                                                           * 23010000
  2427. *********************************************************************** 23020000
  2428.          SPACE 1                                                        23030000
  2429. KEYDINCR DC    A(100*KEYDDATL)     Initial & increment key area length  23040000
  2430.          SPACE 1                                                        23050000
  2431. NUMTBL   DC    256YL1(1)           Table to validate numerics           23060000
  2432.          ORG   NUMTBL+C'0'                                              23070000
  2433.          DC    10YL1(0)                                                 23080000
  2434.          ORG   ,                                                        23090000
  2435.          EJECT                                                          23100000
  2436. MSG_IKJCT441_RC08 DC C'XPROC508 Variable is a CLIST built-in function.' 23110000
  2437. MSG_IKJCT441_RC12 DC C'XPROC512 Variable is a CLIST label.'             23120000
  2438. MSG_IKJCT441_RC16 DC C'XPROC516 CLIST variable cannot be updated.'      23130000
  2439. MSG_IKJCT441_RC24 DC C'XPROC524 Variable is a CLIST subprocedure.'      23140000
  2440. MSG_IKJCT441_RC32 DC C'XPROC532 GETMAIN or FREEMAIN storage failure.'   23150000
  2441. MSG_IKJCT441_RC36 DC C'XPROC536 Variable name or value too long.'       23160000
  2442. MSG_IKJCT441_RC40 DC C'XPROC540 No valid CLIST or REXX environment.'    23170000
  2443. MSG_IKJCT441_RC76 DC C'XPROC576 Undefined &&SYSX CLIST variable.'       23180000
  2444. MSG_IKJCT441_RC80 DC C'XPROC580 Variable name invalid for REXX.'        23190000
  2445. MSG_IKJCT441_RC81 DC C'XPROC581 Internal REXX routine failure.'         23200000
  2446.          EJECT                                                          23210000
  2447. *********************************************************************** 23220000
  2448. * Work area                                                           * 23230000
  2449. *********************************************************************** 23240000
  2450.          SPACE 1                                                        23250000
  2451. DATD     DSECT ,                   Dynamically acquired work area       23260000
  2452.          SPACE 1                                                        23270000
  2453. SAVEAREA DS    18F                 OS save area                         23280000
  2454. SAVE2    DS    18F                 Save area for PARSE exit routines    23290000
  2455. DOUBLE   DS    D                   Conversion work area                 23300000
  2456. DATDLEN  DS    F                   Length of this work area             23310000
  2457. PUTL14   DS    F                   Return register save                 23320000
  2458. E44114   DS    F                   Return register save                 23330000
  2459. DOOPT14  DS    F                   Return register save                 23340000
  2460. SAVER2   DS    A                   Save for TRT register                23350000
  2461. MYBASES  DS    2A                  Base regs for IKJPARS exit routines  23360000
  2462. SCANRES  DS    2A                  Used to save output from SCAN        23370000
  2463. WORDPTR  DS    A                   Address of next slot for word copy   23380000
  2464. PWADDR   DS    A                   Address of IKJPARS PCL area          23390000
  2465. PWLEN    DS    F                   Length of IKJPARS PCL area           23400000
  2466. PCLLEN   DS    F                   Actual length of the IKJPARS PCL     23410000
  2467. QOFF     DS    A                   Address of quoted-value-string area  23420000
  2468. QVALLEN  DS    F                   Length of quoted-value-string area   23430000
  2469. VUPADDR  DS    F                   Address of IKJCT441 update parm list 23440000
  2470. VUPLEN   DS    F                   Length of IKJCT441 update parm list  23450000
  2471. PDLLEN   DS    F                   Length of the IKJPARS PDL            23460000
  2472. VBUFADDR DS    A                   Address of fake command buffer       23470000
  2473. VBUFLEN  DS    A                   Length of fake command buffer        23480000
  2474. ARGADDR  DS    A                   Address of ARG buffer                23490000
  2475. ARGLEN   DS    F                   Length of ARG buffer                 23500000
  2476. SCANPTR  DS    A                   Scanning pointer                     23510000
  2477. SCANEPTR DS    A                   Scanning end pointer                 23520000
  2478. PARCOUNT DS    F                   Parenthesis count                    23530000
  2479. PVARADDR DS    A                   Address of input variable name       23540000
  2480. PVARLEN  DS    F                   Length of input variable name        23550000
  2481. POSCOUNT DS    F                   Positional parameter count           23560000
  2482. KEYCOUNT DS    F                   Keyword count                        23570000
  2483. LASTAREA DS    A                   Address of last pos or key area      23580000
  2484. LASTADDR DS    A                   Address of last processed thing      23590000
  2485. LASTLEN  DS    F                   Length of last processed thing       23600000
  2486. APOSD    DS    A                   Address of positional parm area      23610000
  2487. LPOSD    DS    A                   Length of positional parm area       23620000
  2488. AKEYD    DS    A                   Address of keyword/value area        23630000
  2489. LKEYD    DS    A                   Length of keyword/value area         23640000
  2490. AKEYE    DS    A                   Address of end of keyword/value area 23650000
  2491. FIRSTKEY DS    A                   Address of first IKJKEYWD PCE        23660000
  2492. SUBTOSET DS    A                   Address of previous IKJSUBF PCE      23670000
  2493. FLAGS    DS    X                   Flags                                23680000
  2494. FLAGPUTE EQU   B'10000000'         1 = error putting variable values    23690000
  2495. FLAGPOSD EQU   B'01000000'         1 = currently processing positionals 23700000
  2496. FLAGKEYD EQU   B'00100000'         1 = currently processing keywords    23710000
  2497. *        EQU   B'00010000'          Reserved                            23720000
  2498. *        EQU   B'00001000'          Reserved                            23730000
  2499. *        EQU   B'00000100'          Reserved                            23740000
  2500. *        EQU   B'00000010'          Reserved                            23750000
  2501. *        EQU   B'00000001'          Reserved                            23760000
  2502. *                                                                       23770000
  2503. ECB      DS    F                   ECB for TSO routines                 23780000
  2504. *                                                                       23790000
  2505. OLD      DS    0F                  PUTLINE output line descriptor       23800000
  2506. OLDF1    DS    F'1'                Number of message segments           23810000
  2507. OLDMSG   DS    A(*-*)              Address of the first message segment 23820000
  2508. *                                                                       23830000
  2509. MSGHDR   DS    F                   PUTLINE message header               23840000
  2510. MSGWA    DS    CL512               PUTLINE message work area            23850000
  2511. ARGWA    DS    CL512               ARG message work area                23860000
  2512. *                                                                       23870000
  2513. FLUSH    STACK MF=L,DELETE=ALL                                          23880000
  2514. *                                                                       23890000
  2515. PTLIST   PUTLINE MF=L,OUTPUT=(0,TERM,SINGLE,INFOR)                      23900000
  2516. *                                                                       23910000
  2517. CPPL     DS    0A                                                       23920000
  2518. *********************************************************************** 23930000
  2519. *    THE COMMAND PROCESSOR PARAMETER LIST (CPPL) IS A LIST OF         * 23940000
  2520. *    ADDRESSES PASSED FROM THE TMP TO THE CP VIA REGISTER 1           * 23950000
  2521. *********************************************************************** 23960000
  2522. *                                                                       23970000
  2523. CPPLCBUF DS    A        PTR TO COMMAND BUFFER                           23980000
  2524. CPPLUPT  DS    A        PTR TO UPT                                      23990000
  2525. CPPLPSCB DS    A        PTR TO PSCB                                     24000000
  2526. CPPLECT  DS    A        PTR TO ECT                                      24010000
  2527. *                                                                       24020000
  2528. IOPL     DS    0A                                                       24030000
  2529. *********************************************************************** 24040000
  2530. *    THE I/O SERVICE ROUTINE PARAMETER LIST (IOPL) IS A LIST OF       * 24050000
  2531. *    FULLWORD ADDRESSES PASSED BY THE INVOKER OF ANY I/O SERVICE      * 24060000
  2532. *    ROUTINE TO THE APPROPRIATE SERVICE ROUTINE VIA REGISTER ONE.     * 24070000
  2533. *********************************************************************** 24080000
  2534. *                                                                       24090000
  2535. IOPLUPT  DS    A        PTR TO UPT                                      24100000
  2536. IOPLECT  DS    A        PTR TO ECT                                      24110000
  2537. IOPLECB  DS    A        PTR TO USER'S ECB                               24120000
  2538. IOPLIOPB DS    A        PTR TO THE I/O SERVICE RTN PARM BLOCK           24130000
  2539. *                                                                       24140000
  2540. PPL      DS    0A                                                       24150000
  2541. *********************************************************************** 24160000
  2542. *    THE PARSE PARAMETER LIST (PPL) IS A LIST OF ADDRESSES PASSED     * 24170000
  2543. *    FROM THE INVOKER TO PARSE VIA REGISTER 1                         * 24180000
  2544. *********************************************************************** 24190000
  2545.          SPACE                                                          24200000
  2546. PPLUPT   DS    A        PTR TO UPT                                      24210000
  2547. PPLECT   DS    A        PTR TO ECT                                      24220000
  2548. PPLECB   DS    A        PTR TO CP'S ECB                                 24230000
  2549. PPLPCL   DS    A        PTR TO PCL                                      24240000
  2550. PPLANS   DS    A        PTR TO ANS PLACE                                24250000
  2551. PPLCBUF  DS    A        PTR TO CMD BUFFER                               24260000
  2552. PPLUWA   DS    A        PTR TO USER WORK AREA (FOR VALIDITY CK RTNS)    24270000
  2553. PPLVEWA  DS    A        PTR TO USER WORK AREA FOR VERIFY EXITS          24280000
  2554. *                                                                       24290000
  2555. ANSWER   DS    F                   ANSWER AREA FOR PARSE                24300000
  2556.          SPACE 1                                                        24310000
  2557. CVPARMS  DS    0F                  Variable access facility parm list   24320000
  2558. CVPARM1  DS    A                   Parameter 1: entry code              24330000
  2559. CVPARM2  DS    A                   Parameter 2: address of var name     24340000
  2560. CVPARM3  DS    A                   Parameter 3: length of var name      24350000
  2561. CVPARM4  DS    A                   Parameter 4: address of var value    24360000
  2562. CVPARM5  DS    A                   Parameter 5: length of var value     24370000
  2563. CVPARM6  DS    A                   Parameter 6: token (not used)        24380000
  2564. *                                                                       24390000
  2565. CVENTRY  DS    A                   Entry code                           24400000
  2566. CVNAMEA  DS    A                   Address of variable name             24410000
  2567. CVNAMEL  DS    A                   Length of variable name              24420000
  2568. CVVALUEA DS    A                   Address of variable value            24430000
  2569. CVVALUEL DS    A                   Length of variable value             24440000
  2570. CVTOKEN  DS    A                   Token (not used)                     24450000
  2571. CVECT    DS    A                   ECT (not used)                       24460000
  2572. *                                                                       24470000
  2573. RC441    DS    F                   Return code from IKJCT441            24480000
  2574.          SPACE 1                                                        24490000
  2575.          SPACE 1                                                        24500000
  2576. IRPARMS  DS    0F                  IRXEXCOM parameter list              24510000
  2577. IRPARM1  DS    A                   Parameter 1: CL8'IRXEXCOM'           24520000
  2578. IRPARM2  DS    A                   Parameter 2: same as parameter 3     24530000
  2579. IRPARM3  DS    A                   Parameter 3: same as parameter 2     24540000
  2580. IRPARM4  DS    A                   Parameter 4: SHVBLOCK                24550000
  2581. *                                                                       24560000
  2582. *********************************************************************** 24570000
  2583. *                                                                     * 24580000
  2584. * Copied from 'SYS1.MACLIB(IRXSHVB)'.                                 * 24590000
  2585. *                                                                     * 24600000
  2586. *********************************************************************** 24610000
  2587. *                                                                       24620000
  2588. SHVBLOCK DS    0D                     SHARED VARIABLE REQUEST BLOCK     24630000
  2589. SHVNEXT  DS  A                        Chain pointer to next SHVBLOCK    24640000
  2590. SHVUSER  DS  F                        Used during "FETCH NEXT"          24650000
  2591. *                                      Contains length of buffer        24660000
  2592. *                                      pointed to by SHVNAMA            24670000
  2593. SHVCODES DS  0F                                                         24680000
  2594. SHVCODE  DS  CL1                      Function code - indicates type    24690000
  2595. *                                      of variable access request       24700000
  2596. SHVRET   DS  XL1                      Return codes                      24710000
  2597.          DS  H'0'                     Reserved (should be 0)            24720000
  2598. SHVBUFL  DS  F                        Length of fetch value buffer      24730000
  2599. SHVNAMA  DS  A                        Address of variable name          24740000
  2600. SHVNAML  DS  F                        Length of variable name           24750000
  2601. SHVVALA  DS  A                        Address of value buffer           24760000
  2602. SHVVALL  DS  F                        Length of value buffer            24770000
  2603. *                                      (Set on fetch)                   24780000
  2604. SHVBLEN  EQU *-SHVBLOCK               Length of SHVBLOCK                24790000
  2605.          SPACE 1                                                        24800000
  2606. **********************************************************************/ 24810000
  2607. *   SHARED VARIABLE REQUEST BLOCK - function codes                   */ 24820000
  2608. **********************************************************************/ 24830000
  2609.          SPACE 1                                                        24840000
  2610. SHVFETCH EQU   C'F'            Copy value of shared variable            24850000
  2611. SHVSTORE EQU   C'S'            Set variable from given value            24860000
  2612. SHVDROPV EQU   C'D'            Drop variable                            24870000
  2613. SHVSYFET EQU   C'f'            Symbolic name retrieve                   24880000
  2614. SHVSYSET EQU   C's'            Symbolic name set                        24890000
  2615. SHVSYDRO EQU   C'd'            Symbolic name drop                       24900000
  2616. SHVNEXTV EQU   C'N'            Fetch "next" variable                    24910000
  2617. SHVPRIV  EQU   C'P'            Fetch private information                24920000
  2618.          SPACE 1                                                        24930000
  2619. **********************************************************************/ 24940000
  2620. *        SHARED VARIABLE REQUEST BLOCK - return codes (SHVRET)       */ 24950000
  2621. **********************************************************************/ 24960000
  2622.         SPACE 1                                                         24970000
  2623. SHVCLEAN EQU   X'00'           Execution was OK                         24980000
  2624. SHVNEWV  EQU   X'01'           Variable did not exist                   24990000
  2625. SHVLVAR  EQU   X'02'           Last variable transferred ("N")          25000000
  2626. SHVTRUNC EQU   X'04'           Truncation occurred for "Fetch"          25010000
  2627. SHVBADN  EQU   X'08'           Invalid variable name                    25020000
  2628. SHVBADV  EQU   X'10'           Invalid value specified                  25030000
  2629. SHVBADF  EQU   X'80'           Invalid function code (SHVCODE)          25040000
  2630.          SPACE 1                                                        25050000
  2631. **********************************************************************/ 25060000
  2632. *        R15 return codes                                            */ 25070000
  2633. **********************************************************************/ 25080000
  2634.          SPACE 1                                                        25090000
  2635. SHVRCOK  EQU    0              Entire Plist chain processed             25100000
  2636. SHVRCINV EQU   -1              Invalid entry conditions                 25110000
  2637. SHVRCIST EQU   -2              Insufficient storage available           25120000
  2638.          SPACE                                                          25130000
  2639. *                                                                       25140000
  2640. PVAR     DS    CL256               Area to build input variable name    25150000
  2641. OPTION   DS    CL16                Area to build option name            25160000
  2642.          SPACE 1                                                        25170000
  2643. SIZDATD  EQU   *-DATD              Length of fixed part of work area    25180000
  2644.          SPACE 1                                                        25190000
  2645. WORDCOPY EQU   *                   Area to put copies of keyword names  25200000
  2646.          EJECT                                                          25210000
  2647. POSDDATA DSECT ,                   Info on positional parameter specs   25220000
  2648.          SPACE 1                                                        25230000
  2649. *                                  (POSCOUNT) occurrences of...         25240000
  2650. *                                                                       25250000
  2651. POSDADDR DS    A                   Address of positional parameter name 25260000
  2652. POSDLEN  DS    A                   Length of positional parameter name  25270000
  2653. POSDPCEA DS    A                   Address of PCE for this parameter    25280000
  2654. POSDPCEL DS    A                   Length of PCE for this parameter     25290000
  2655. POSDMAXL DS    A                   Maximum length for prompting message 25300000
  2656. POSDFLGS DS    X                   Flags                                25310000
  2657. POSDOPT  EQU   B'10000000'          1 = parameter is optional           25320000
  2658. POSDCHAR EQU   B'01000000'          1 = value is possibly-quoted string 25330000
  2659. POSDASIS EQU   B'00100000'          1 = value is to be processed asis   25340000
  2660. *        EQU   B'00010000'          Reserved                            25350000
  2661. *        EQU   B'00001000'          Reserved                            25360000
  2662. *        EQU   B'00000100'          Reserved                            25370000
  2663. *        EQU   B'00000010'          Reserved                            25380000
  2664. *        EQU   B'00000001'          Reserved                            25390000
  2665.          DS    0D                  Round to doubleword length           25400000
  2666.          SPACE 1                                                        25410000
  2667. POSDDATL EQU   *-POSDDATA          Length of an occurrence              25420000
  2668.          EJECT                                                          25430000
  2669. KEYDDATA DSECT ,                   Info on keyword/value specs          25440000
  2670.          SPACE 1                                                        25450000
  2671. *                                  some # of occurrences of...          25460000
  2672. *                                                                       25470000
  2673. KEYWORDA DS    A                   Address of keyword                   25480000
  2674. KEYWORDL DS    A                   Length of keyword                    25490000
  2675. KEYDVALA DS    A                   Address of keyword's default value   25500000
  2676. KEYDVALL DS    A                   Length of keyword's default value    25510000
  2677. KEYDPCEA DS    A                   Address of PCE for this parameter    25520000
  2678. KEYDPCEL DS    A                   Length of PCE for this parameter     25530000
  2679. KEYDMAXL DS    A                   Maximum length for prompting message 25540000
  2680. KEYSUBOF DS    A                   Where to store subfield offset       25550000
  2681. KEYFLAGS DS    X                   Flags                                25560000
  2682. KEYFDVAL EQU   B'10000000'          1 = a default value was specified   25570000
  2683. KEYFQUOT EQU   B'01000000'          1 = default value is quoted string  25580000
  2684. KEYFASIS EQU   B'00100000'          1 = value is to be processed asis   25590000
  2685. *        EQU   B'00010000'          Reserved                            25600000
  2686. *        EQU   B'00001000'          Reserved                            25610000
  2687. *        EQU   B'00000100'          Reserved                            25620000
  2688. *        EQU   B'00000010'          Reserved                            25630000
  2689. *        EQU   B'00000001'          Reserved                            25640000
  2690.          DS    0D                  Round to doubleword length           25650000
  2691.          SPACE 1                                                        25660000
  2692. KEYDDATL EQU   *-KEYDDATA          Length of an occurrence              25670000
  2693.          EJECT                                                          25680000
  2694. *********************************************************************** 25690000
  2695. * Macro expansions                                                    * 25700000
  2696. *********************************************************************** 25710000
  2697.          SPACE 1                                                        25720000
  2698.          IKJTSVT                                                        25730000
  2699.          SPACE 1                                                #TSO162 25740000
  2700.          IKJECT ,                                               #TSO162 25750000
  2701.          SPACE 1                                                        25760000
  2702.          CVT   DSECT=YES                                                25770000
  2703.          END                                                            25780000
  2704. ./ ADD NAME=XWRITENR                                                            
  2705.          TITLE 'XWRITENR copyright notice'                              00010001
  2706. *********************************************************************** 00020000
  2707. *                                                                     * 00030000
  2708. *   Copyright (c) 1989 The Charles Stark Draper Laboratory, Inc.      * 00040000
  2709. *                                                                     * 00050000
  2710. *   This program is provided on an "as is" basis.  It may be freely   * 00060000
  2711. *   distributed as long as it is not offered for commercial sale,     * 00070000
  2712. *   and as long as this copyright notice is included.                 * 00080000
  2713. *                                                                     * 00090000
  2714. *********************************************************************** 00100000
  2715.          TITLE 'XWRITENR - REXX external function to simulate WRITENR'  00110000
  2716. XWRITENR CSECT                                                          00120000
  2717. XWRITENR AMODE ANY                                                      00130000
  2718. XWRITENR RMODE ANY                                                      00140000
  2719.          SPACE                                                          00150000
  2720. *********************************************************************** 00160000
  2721. *                                                                       00170000
  2722. * Syntax:  call XWRITENR "anything at all"                              00180000
  2723. *                                                                       00190000
  2724. *********************************************************************** 00200000
  2725. *                                                                *      00210000
  2726. * Input:       (R1) = address of IRXEFPL parameter list:         *      00220000
  2727. *                                                                *      00230000
  2728. *              Offset:                                           *      00240000
  2729. *               00 = Reserved                                    *      00250000
  2730. *               04 = Reserved                                    *      00260000
  2731. *               08 = Reserved                                    *      00270000
  2732. *               0C = Reserved                                    *      00280000
  2733. *               10 = Address of the parsed argument list         *      00290000
  2734. *               14 = Address of the address of the EVALBLOCK     *      00300000
  2735. *                                                                *      00310000
  2736. ******************************************************************      00320000
  2737. *                                                                *      00330000
  2738. * Output:      R15 = return code from PUTLINE                    *      00340000
  2739. *                                                                *      00350000
  2740. ******************************************************************      00360000
  2741.          EJECT                                                          00370000
  2742. R0       EQU   0                                                        00380000
  2743. R1       EQU   1                                                        00390000
  2744. R2       EQU   2                                                        00400000
  2745. R3       EQU   3                                                        00410000
  2746. R4       EQU   4                                                        00420000
  2747. R5       EQU   5                                                        00430000
  2748. R6       EQU   6                                                        00440000
  2749. R7       EQU   7                                                        00450000
  2750. R8       EQU   8                                                        00460000
  2751. R9       EQU   9                                                        00470000
  2752. R10      EQU   10                                                       00480000
  2753. R11      EQU   11                                                       00490000
  2754. R12      EQU   12                                                       00500000
  2755. R13      EQU   13                                                       00510000
  2756. R14      EQU   14                                                       00520000
  2757. R15      EQU   15                                                       00530000
  2758.          EJECT                                                          00540000
  2759.          SAVE  (14,12),,XWRITENR_&SYSDATE._&SYSTIME                     00550000
  2760.          BALR  R12,0                                                    00560000
  2761.          USING *,R12                                                    00570000
  2762.          SPACE                                                          00580000
  2763.          L     R2,16(,R1)          R2 = address of parsed argument list 00590000
  2764.          L     R6,20(,R1)          R6 = address of address of EVALBLOCK 00600000
  2765.          L     R6,0(,R6)           R6 = address of EVALBLOCK            00610000
  2766.          L     R4,4(,R2)           R4 = length of message               00620000
  2767.          L     R5,0(,R2)           R5 = address of text of message      00630000
  2768.          C     R5,=X'FFFFFFFF'     If number of arguments not 1         00640000
  2769.          BE    ERROR               then error                           00650000
  2770.          L     R0,8(,R2)                                                00660000
  2771.          C     R0,=X'FFFFFFFF'     If number of arguments not 1         00670000
  2772.          BNE   ERROR               then error                           00680000
  2773.          LTR   R15,R4              If message length is zero            00690000
  2774.          BZ    RETURN              then return code(zero)               00700000
  2775.          LA    R0,DYSIZE           Get size of dynamic area w/o message 00710000
  2776.          AR    R0,R4               Add length of message                00720000
  2777.          GETMAIN R,LV=(0)          Get dynamic storage area             00730000
  2778.          SPACE                                                          00740000
  2779.          ST    R13,4(,R1)                                               00750000
  2780.          ST    R1,8(,R13)                                               00760000
  2781.          LR    R13,R1                                                   00770000
  2782.          USING DYNAM,R13                                                00780000
  2783.          SPACE                                                          00790000
  2784. LENOK    DS    0H                                                       00800000
  2785.          CH    R4,=H'256'          If message is 256 chars or less      00810000
  2786.          BH    MOVELONG            then...                              00820000
  2787.          LR    R14,R4                                                   00830000
  2788.          BCTR  R14,0                decrement length for move           00840000
  2789.          EX    R14,MOVEMSG          Move message to buffer              00850000
  2790.          B     MSGMOVED            else...                              00860000
  2791. MOVELONG DS    0H                                                       00870000
  2792.          LA    R0,PUTBUF+4         Address of message destination       00880000
  2793.          LR    R1,R4               Length of message destination        00890000
  2794.          LR    R14,R5              Address of message source            00900000
  2795.          LR    R15,R4              Length of message source             00910000
  2796.          MVCL  R0,R14              Move message to buffer               00920000
  2797. MSGMOVED DS    0H                                                       00930000
  2798.          LA    R14,4(,R4)         Add length of header                  00940000
  2799.          SLL   R14,16             Shift: 1st HWD = hdr, 2nd = no 2ndary 00950000
  2800.          ST    R14,PUTBUF         Put in first 2 halfwords in header    00960000
  2801.          SPACE                                                          00970000
  2802.          LA    R1,IOPLSP           Set up IOPL                          00980000
  2803.          USING IOPL,R1                                                  00990000
  2804.          SPACE                                                          01000000
  2805.          USING PSA,0                                                    01010000
  2806.          L     R8,PSATOLD           GET TCB ADDRESS                     01020000
  2807.          USING TCB,R8                                                   01030000
  2808.          L     R8,TCBJSCB           GET JSCB ADDRESS                    01040000
  2809.          USING IEZJSCB,R8                                               01050000
  2810.          L     R8,JSCBACT           GET ADDRESS OF ACTIVE JSCB          01060000
  2811.          L     R8,JSCBPSCB          GET ADDRESS OF PSCB                 01070000
  2812.          USING PSCB,R8                                                  01080000
  2813.          MVC   IOPLUPT,PSCBUPT      PUT UPT ADDRESS IN IOPL             01090000
  2814.          L     R8,PSCBRLGB          GET ADDR OF RELOGON BUFFER          01100000
  2815.          USING RLGB,R8                                                  01110000
  2816.          MVC   IOPLECT,RLGBECT      PUT ADDRESS OF ECT IN IOPL          01120000
  2817.          SPACE                                                          01130000
  2818.          SR    R0,R0                                                    01140000
  2819.          ST    R0,ECB              Zero out ECB                         01150000
  2820.          ST    R0,IOPLIOPB         Zero out IOPL parm block address     01160000
  2821.          LA    R0,ECB                                                   01170000
  2822.          ST    R0,IOPLECB          Finish up IOPL                       01180000
  2823.          MVC   PUTBLK(LPUTBLK),PUTMAST     Build PUTLINE MF=L           01190000
  2824.          DROP  R1                                                       01200000
  2825.          EJECT                                                          01210000
  2826.          PUTLINE PARM=PUTBLK,OUTPUT=(PUTBUF,TERM,SINGLE,DATA),         +01220000
  2827.                TERMPUT=(ASIS),                                         +01230000
  2828.                MF=(E,(1))                                               01240000
  2829.          EJECT                                                          01250000
  2830. ENDIT    LR    R3,R15              Save return code                     01260000
  2831.          LA    R0,2                                                     01270000
  2832.          ST    R0,8(,R6)           Set EVLEN (in EVALBLOCK) to length   01280000
  2833.          CVD   R3,DOUBLE           Return code                          01290000
  2834.          UNPK  16(2,R6),DOUBLE     Generate 2 digits                    01300000
  2835.          OI    17(R6),X'F0'                                             01310000
  2836.          CLI   16(R6),C'0'         If first digit is 0                  01320000
  2837.          BNE   NOTZ                then                                 01330000
  2838.          MVC   16(1,R6),17(R6)      make it a 1-digit number            01340000
  2839.          MVI   17(R6),C' '                                              01350000
  2840.          LA    R0,1                 set length to 1                     01360000
  2841.          ST    R0,8(,R6)            set EVLEN (in EVALBLOCK) to length  01370000
  2842. NOTZ     DS    0H                                                       01380000
  2843.          LA    R0,DYSIZE           Get length of storage w/o message    01390000
  2844.          AR    R0,R4               Add length of message                01400000
  2845.          LA    R1,DYNAM            Get address of storage               01410000
  2846.          L     R13,4(0,R13)                                             01420000
  2847.          FREEMAIN R,LV=(0),A=(1)                                        01430000
  2848. RETURN   DS    0H                                                       01440000
  2849.          RETURN (14,12),T,RC=0                                          01450000
  2850.          SPACE 2                                                        01460000
  2851. ERROR    DS    0H                  Here if wrong # of arguments         01470000
  2852.          LA    R0,2                                                     01480000
  2853.          ST    R0,8(,R6)           Set EVLEN (in EVALBLOCK) to length   01490000
  2854.          MVC   16(2,R6),=C'-2'     Return value                         01500000
  2855.          B     RETURN                                                   01510000
  2856.          SPACE 2                                                        01520000
  2857. MOVEMSG  MVC   PUTBUF+4(0),0(R5)                                        01530000
  2858.          EJECT                                                          01540000
  2859. PUTMAST  PUTLINE MF=L                                                   01550000
  2860.          EJECT                                                          01560000
  2861. DYNAM    DSECT                                                          01570000
  2862.          SPACE                                                          01580000
  2863. SAVEAREA DS    9D                                                       01590000
  2864. DOUBLE   DS    D          Work area for conversions                     01600000
  2865.          SPACE                                                          01610000
  2866. PUTBLK   PUTLINE MF=L                                                   01620000
  2867. LPUTBLK  EQU   *-PUTBLK                                                 01630000
  2868.          SPACE                                                          01640000
  2869. IOPLSP   DS    4F        INPUT OUTPUT PARAMETER BLOCK                   01650000
  2870. ECB      DS    F                                                        01660000
  2871.          SPACE                                                          01670000
  2872. PUTBUF   DS    F          MESSAGE HEADER                                01680000
  2873.          SPACE                                                          01690000
  2874. *                                  (Actual message buffer variable)     01700000
  2875.          SPACE                                                          01710000
  2876. DYSIZE   EQU   *-DYNAM             Length of dynamic area w/o msg buf   01720000
  2877.          EJECT                                                          01730000
  2878. *                                                                       01740000
  2879. *  STORAGE DEFINITIONS:                                                 01750000
  2880. *                                                                       01760000
  2881.          SPACE                                                          01770000
  2882.          IKJIOPL                                                        01780000
  2883.          SPACE                                                          01790000
  2884.          IKJCPPL                                                        01800000
  2885.          SPACE                                                          01810000
  2886.          IKJUPT                                                         01820000
  2887.          SPACE                                                          01830000
  2888.          IKJECT                                                         01840000
  2889.          SPACE                                                          01850000
  2890.          IKJPSCB                                                        01860000
  2891.          EJECT ,                                                        01870000
  2892.          IHAPSA                                                         01880000
  2893.          EJECT ,                                                        01890000
  2894.          IKJTCB                                                         01900000
  2895.          EJECT ,                                                        01910000
  2896.          IEZJSCB                                                        01920000
  2897.          EJECT ,                                                        01930000
  2898.          IKJRLGB                                                        01940000
  2899.          EJECT                                                          01950000
  2900.          SPACE 5                                                        01960000
  2901.          END                                                            01970000
  2902. ./ ENDUP                                                                        
  2903. ?!                                                                              
  2904. //*                                                                             
  2905. //HELP     EXEC MDLOAD,TRK1='5',TO='HELP'                                       
  2906. //SYSIN    DD   DATA,DLM='?!'                                                   
  2907. ./ ADD NAME=XPROC                                                               
  2908. ***********************************************************************         
  2909. *                                                                     *         
  2910. * Copyright (c) 1989, 1992 The Charles Stark Draper Laboratory, Inc.  *         
  2911. *                                                                     *         
  2912. *  This program is provided on an "as is" basis. It may be freely     *         
  2913. *  distributed as long as it is not offered for commercial sale,      *         
  2914. *  nd as long as this copyright notice is included.                   *         
  2915. *                                                                     *         
  2916. ***********************************************************************         
  2917. *                                                                               
  2918. * XPROC 04/13/92 - SEB1525 - Version 2 - /quotable option added                 
  2919. *                                                                               
  2920. )F FUNCTION -                                                                   
  2921.                                                                                 
  2922.  The XPROC command parses an argument string into positional and/or             
  2923.  keyword parameters, similarly to the PROC statement of a CLIST.                
  2924.  However, XPROC can be used inside a REXX exec to parse the argument            
  2925.  to the exec, or inside a CLIST or REXX exec to process the value of            
  2926.  a variable as if it were an argument string.                                   
  2927.                                                                                 
  2928.  The values of the parameters specified on the XPROC command cause the          
  2929.  corresponding REXX or CLIST variables to be set, as they would in a            
  2930.  CLIST PROC statement.                                                          
  2931.                                                                                 
  2932.  The rules for entering parameters to be processed by the XPROC command         
  2933.  are identical to those of the CLIST PROC statement - except that XPROC         
  2934.  supports extensions to the CLIST PROC syntax by means of options               
  2935.  preceded by the slash ("/") character.                                         
  2936.                                                                                 
  2937.  For more information on PROC syntax, consult a TSO/E CLIST manual,             
  2938.  or use the local Draper command XHELPC PROC to view help for PROC.             
  2939.                                                                                 
  2940.  Notes: As for any TSO command, it is best to enclose the entire                
  2941.        XPROC command in "double quotes" when using it from REXX.                
  2942.        This includes the variable names.                                        
  2943.                                                                                 
  2944.        When XPROC is used, prompting is not available by default                
  2945.        (unlike the PROC statement of a CLIST).  Therefore, it is                
  2946.        advisable to precede the call to XPROC with a statement that             
  2947.        activates prompting, e.g.                                                
  2948.                                                                                 
  2949.        CALL PROMPT "ON"  /* for REXX  */                                        
  2950.        CONTROL PROMPT    /* for CLIST */                                        
  2951.                                                                                 
  2952.        Also, if there is an error in the XPROC command, or the parsing          
  2953.        of the argument string fails, a REXX exec (or a CLIST with               
  2954.        CONTROL NOFLUSH active) will NOT be flushed, but will continue           
  2955.        to execute (with none of the parameters set).  Therefore, you            
  2956.        should check the value of RC (for REXX) or &LASTCC (for CLIST)           
  2957.        afterwards and EXIT if it is not zero.                                   
  2958.                                                                                 
  2959. )X SYNTAX -                                                                     
  2960.                                                                                 
  2961.  XPROC  {input-variable}                                                        
  2962.         positional-number                                                       
  2963.         {positional-parameter{/option...} ...}                                  
  2964.         {keyword-parameter{/option...}{({default-value})}{/option...}}          
  2965.                                                                                 
  2966.         The number of positional-parameters must be equal to the                
  2967.         value of positional-number (which must be a number).                    
  2968.                                                                                 
  2969.  Required: positional-number                                                    
  2970.                                                                                 
  2971.  Note that the syntax of XPROC is exactly identical to that of                  
  2972.  the PROC statement of CLIST language, except for the optional                  
  2973.  "input-variable" and the "/option" feature.                                    
  2974.                                                                                 
  2975.  Examples:                                                                      
  2976.                                                                                 
  2977.   The following examples assume a REXX environment:                             
  2978.                                                                                 
  2979.   Example 1: Define one positional parameter (DATASET),                         
  2980.              no keyword parameters:                                             
  2981.                                                                                 
  2982.        "XPROC 1 DATASET"                                                        
  2983.                                                                                 
  2984.   Example 2: Define no positional parameters, and one keyword                   
  2985.              parameter (TESTING) which has a null default value:                
  2986.                                                                                 
  2987.        "XPROC 0 TESTING"                                                        
  2988.                                                                                 
  2989.   Example 3: Define a positional parameter (LIBRARY), one keyword               
  2990.              parameter (TRACE) which has a null default value, and              
  2991.              one (SYSOUT) which has the default value "A":                      
  2992.                                                                                 
  2993.        "XPROC 1 LIBRARY TRACE SYSOUT(A)"                                        
  2994.                                                                                 
  2995.   Example 4: Define three positional parameters (LIBRARY, TYPE and              
  2996.              MEMBER) and a keyword (OWNER) with a default value of              
  2997.              the user's TSO prefix.  Note how we allow REXX to                  
  2998.              generate the desired default value so it appears in                
  2999.              the XPROC command at execution time:                               
  3000.                                                                                 
  3001.        "XPROC 3 LIBRARY TYPE MEMBER OWNER('"SYSVAR(SYSPREF)"')"                 
  3002.                                                                                 
  3003.   Example 5: Define a positional parameter (NAME) and one keyword               
  3004.              parameter (TITLE) which has a null default value, and              
  3005.              one (SUBJECT) which has the default value "None".                  
  3006.              The values of all three parameters will be processed               
  3007.              as is with respect to case.                                        
  3008.                                                                                 
  3009.        XPROC 1 NAME/ASIS TITLE/ASIS() SUBJECT(None)/ASIS                        
  3010.                                                                                 
  3011.   The following examples work under REXX or CLIST (but be sure to               
  3012.   enclose the command in "double quotes" under REXX):                           
  3013.                                                                                 
  3014.   Example 6: Define a positional parameter (LIBRARY), one keyword               
  3015.              parameter (TRACE) which has a null default value, and              
  3016.              one (SYSOUT) which has the default value "A".  The                 
  3017.              argument string to be parsed will be taken from the                
  3018.              value of the variable "SYSDVAL".                                   
  3019.                                                                                 
  3020.        XPROC SYSDVAL 1 LIBRARY TRACE SYSOUT(A)                                  
  3021.                                                                                 
  3022.   Example 7: Define three positional parameters (LIBRARY, TYPE and              
  3023.              MEMBER), and a keyword (MARK) with a default value of              
  3024.              the current time.  Note how we allow REXX to generate              
  3025.              the desired default value so it appears in the XPROC               
  3026.              command at execution time.  The argument string to be              
  3027.              parsed will be taken from the value of the variable                
  3028.              "STRING".                                                          
  3029.                                                                                 
  3030.        "XPROC STRING 3 LIBRARY TYPE MEMBER MARK('"TIME()"')"                    
  3031.                                                                                 
  3032.              Under CLIST, this could be coded as:                               
  3033.                                                                                 
  3034.        XPROC STRING 3 LIBRARY TYPE MEMBER MARK('&SYSTIME')                      
  3035.                                                                                 
  3036.              but note that &SYSTIME gets resolved BEFORE the XPROC              
  3037.              command executes.  This is the only type of situation              
  3038.              where an "&" is appropriate.                                       
  3039.                                                                                 
  3040. )O OPERANDS -                                                                   
  3041.                                                                                 
  3042. ))input-variable                                                                
  3043.                                                                                 
  3044.    the NAME of a variable from which the argument string to be parsed           
  3045.    is to be extracted.  The name must conform to the rules for CLIST or         
  3046.    REXX variable names.  The specified variable must be set to the              
  3047.    argument string to be processed (no command name included) before            
  3048.    XPROC is invoked.                                                            
  3049.                                                                                 
  3050.    The input-variable name may be omitted in a REXX exec ONLY, in which         
  3051.    case the arguments to the REXX exec are accessed.  This provides the         
  3052.    same capability that the PROC statement of a CLIST would.                    
  3053.                                                                                 
  3054. ))positional-number                                                             
  3055.                                                                                 
  3056.    a number (0 or greater) which specifies the number of positional             
  3057.    parameters that follow.  This is required.  If there are no                  
  3058.    positional parameters, specify a 0.                                          
  3059.                                                                                 
  3060. ))positional-parameter                                                          
  3061.                                                                                 
  3062.    A variable name consisting of alphameric and national characters,            
  3063.    of which the first cannot be numeric.  The length of this name must          
  3064.    be between 1 and 252 for CLISTs, and between 1 and 250 for REXX.             
  3065.    Underscores may be part of the name.                                         
  3066.                                                                                 
  3067.    Note: Unlike the CLIST PROC statement, XPROC does not accept                 
  3068.    ampersands in parameter names.  Ampersands in an XPROC command will          
  3069.    cause normal symbolic substitution in CLISTS; they will cause errors         
  3070.    under REXX.                                                                  
  3071.                                                                                 
  3072. ))keyword-parameter                                                             
  3073.                                                                                 
  3074.    A variable name consisting of alphameric and national characters,            
  3075.    of which the first cannot be numeric.  The length of this name must          
  3076.    be between 1 and 252 for CLISTs, and between 1 and 250 for REXX.             
  3077.    A default value in parentheses may optionally follow the parameter;          
  3078.    if there is no default value, the keyword takes on its own name as           
  3079.    a value if given by the caller, and a null string otherwise.                 
  3080.                                                                                 
  3081.    Note: Unlike the CLIST PROC statement, XPROC does not accept                 
  3082.    ampersands ("&") in parameter names.  Ampersands in an XPROC command         
  3083.    will cause normal symbolic substitution in CLISTS; they will cause           
  3084.    errors under REXX.                                                           
  3085.                                                                                 
  3086. ))default-value                                                                 
  3087.                                                                                 
  3088.    Any character string, including the null string.  If it is present,          
  3089.    it must follow a valid keyword parameter and be enclosed in                  
  3090.    parentheses (the right parenthesis may be omitted if this is at the          
  3091.    end of the command).  The value may be quoted (with single quotes,           
  3092.    with two quotes representing one) or unquoted; however, if it                
  3093.    contains any special characters (blanks, unbalanced parentheses,             
  3094.    etc.), it must be quoted.                                                    
  3095.                                                                                 
  3096.    If the caller provides an alternate value for the associated                 
  3097.    keyword, the keyword takes on the that value; otherwise it takes on          
  3098.    the default value specified by XPROC.  Note that although () may be          
  3099.    specified in XPROC for a null string, a caller must type ('') to get         
  3100.    the same result.                                                             
  3101.                                                                                 
  3102. ))option                                                                        
  3103.                                                                                 
  3104.    Processing options may be associated with positional or keyword              
  3105.    parameters by specifying their names following the parameter name            
  3106.    delimited by a slash.  For example, assuming positional parameter            
  3107.    name PP and keyword parameter name KP, and option name OP1 and OP2,          
  3108.    the following are possible:                                                  
  3109.                                                                                 
  3110.    PP/OP1                                                                       
  3111.    KP/OP1                                                                       
  3112.    KP/OP1(default)                                                              
  3113.    KP(default)/OP1                                                              
  3114.    PP/OP1/OP2                                                                   
  3115.    KP/OP1(default)/OP2                                                          
  3116.                                                                                 
  3117.    The supported options at this time are ASIS and QUOTABLE.                    
  3118.                                                                                 
  3119. ))ASIS                                                                          
  3120.                                                                                 
  3121.    If the ASIS option is associated with a positional or keyword                
  3122.    parameter that takes a value, the value specified by the user                
  3123.    for that parameter is processed in case-retention mode.  In                  
  3124.    other words, any lower-case characters present in the value                  
  3125.    are kept as is.  This overrides the default behavior, which                  
  3126.    converts all parameter values to uppercase (the only behavior                
  3127.    available via the PROC statement of CLIST).                                  
  3128.                                                                                 
  3129.    The ASIS option is not valid for keyword parameters that do                  
  3130.    not take a value (i.e. evaluate to themselves or null).                      
  3131.                                                                                 
  3132.    Note that default values in the XPROC prototype are always                   
  3133.    processed asis, regardless of the presence of this option.                   
  3134.                                                                                 
  3135.    Examples: XPROC 1 NAME/ASIS                                                  
  3136.              XPROC 0 TITLE/ASIS(default)                                        
  3137.              XPROC 0 TITLE(default)/ASIS                                        
  3138.                                                                                 
  3139. ))QUOTABLE                                                                      
  3140.                                                                                 
  3141.    If the QUOTABLE option is associated with a positional parameter,            
  3142.    the value specified by the user for that parameter may be entered            
  3143.    as a quoted string.  In other words, embedded blanks or other                
  3144.    special characters may be entered if the string is enclosed in               
  3145.    single quotes by the user.  The quotes do not become part of the             
  3146.    resulting value; to pass in quotes, the user must provide doubled            
  3147.    quotes, similar to the way quotes are specified for keyword values.          
  3148.    This overrides the default behavior, which takes a                           
  3149.    blank-or-comma-delimited string as the value of the positional               
  3150.    parameter, without honoring quotes specially.                                
  3151.                                                                                 
  3152.    Thus, you may define a CLIST or REXX exec that takes a syntax like:          
  3153.                                                                                 
  3154.      MYCLIST 'hi there' 'how are you'                                           
  3155.                                                                                 
  3156.    and have the strings entered as positional parameters.                       
  3157.                                                                                 
  3158.    The QUOTABLE option is valid only for positional parameters,                 
  3159.    not keyword parameters.                                                      
  3160.                                                                                 
  3161.    Examples: XPROC 1 NAME/QUOTABLE                                              
  3162.              XPROC 3 NAME/ASIS/QUOTABLE ADDRESS/QUOTABLE CITY/ASIS              
  3163.                                                                                 
  3164. ./ ADD NAME=XWRITENR                                                            
  3165. )F  XWRITENR is a REXX external routine that functions like the WRITENR         
  3166.  statement of CLIST language.  In other words, it writes the evaluated          
  3167.  <expression> to the TSO terminal, without a carriage return.  This is          
  3168.  available in TSO/E environments only.                                          
  3169.                                                                                 
  3170.  XWRITENR must be invoked via the REXX CALL instruction, in which case          
  3171.  it places a return code (normally 0) in the RESULT variable.  If               
  3172.  XWRITENR is invoked as a REXX function, it returns the return code             
  3173.  as the value.  Exactly one argument must be specified; otherwise               
  3174.  a return code of -2 is returned.                                               
  3175.                                                                                 
  3176.  In general, a call to XWRITENR should be followed by a statement               
  3177.  that requests terminal input (PULL, PARSE PULL, or PARSE EXTERNAL).            
  3178.                                                                                 
  3179. )X Syntax:                                                                      
  3180.             CALL XWRITENR <expression>                                          
  3181.                                                                                 
  3182.  Note:  Some hex control characters may be used in <expression> to              
  3183.         produce certain effects:                                                
  3184.                                                                                 
  3185.   '24'x at the end of <expression> causes the keyboard to unlock                
  3186.   following the message; anything typed in the field where the                  
  3187.   cursor is positioned is NOT DISPLAYED.  A PULL or PARSE EXTERNAL              
  3188.   instruction will pick up the entered data.  This is useful for                
  3189.   password prompts.                                                             
  3190.                                                                                 
  3191.   '15'x at the end of <expression> acts as a "new line" character,              
  3192.   so that the cursor is moved to the beginning of the next line.                
  3193.   In other words, this makes XWRITENR behave like SAY.  Normally                
  3194.   this is not useful, but it may be useful in conjunction with                  
  3195.   3270 data stream orders.                                                      
  3196.                                                                                 
  3197.   Some 3270 data stream commands ('11'x for SBA, '1D'x for SF) may              
  3198.   be embedded in <expression>.  USE THESE WITH CAUTION!  If the                 
  3199.   expression you want to display might contain invalid characters,              
  3200.   use TRANSLATE() to remove them before attempting to display with              
  3201.   XWRITENR, or use SAY instead.                                                 
  3202.                                                                                 
  3203. )O                                                                              
  3204.  Example:                                                                       
  3205.                                                                                 
  3206.   call xwritenr "Enter name:"                                                   
  3207.   parse pull name                                                               
  3208.   /* Would display: Enter name: _                                               
  3209.      where _ represents the cursor */                                           
  3210.                                                                                 
  3211.   call xwritenr "Enter password:" || '24'X                                      
  3212.   parse pull password                                                           
  3213.   /* Would display: Enter password: _                                           
  3214.      where _ represents the cursor.                                             
  3215.      The password would be entered in a print-inhibited input field. */         
  3216.                                                                                 
  3217. ./ ENDUP                                                                        
  3218. ?!                                                                              
  3219.