home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 32 Periodic / 32-Periodic.zip / pli494.inf (.txt) < prev    next >
OS/2 Help File  |  1995-01-10  |  35KB  |  737 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Welcome! ΓòÉΓòÉΓòÉ
  3.  
  4. Welcome to the first edition of The PL/I Connection, a newsletter for the PL/I 
  5. development community.  This newsletter is produced by IBM PL/I Development, 
  6. but we don't want to be the only contributors!  If you have a tool you 
  7. developed, a favorite language feature, a performance tip, a tricky problem you 
  8. solved, or anything you think other PL/I folks would like to hear about, pass 
  9. it on!  This is a place to share experiences and information.  We also want you 
  10. to know that you're not alone - there are lots of other folks out there who 
  11. love and use PL/I.  Hopefully we can help each other do our jobs better.  We 
  12. plan to publish the newsletter quarterly, but that may vary depending on how 
  13. many articles accumulate.  If you have any questions, comments or ideas, please 
  14. let us know using the addresses at the end of the newsletter.  We hope you 
  15. enjoy what we've come up with this time! 
  16.  
  17.  
  18. ΓòÉΓòÉΓòÉ 2. Travel Reports ΓòÉΓòÉΓòÉ
  19.  
  20.  
  21. ΓòÉΓòÉΓòÉ 2.1. GUIDE ΓòÉΓòÉΓòÉ
  22.  
  23.                       by Karen Barney, IBM PL/I Development
  24.  
  25. The Fall GUIDE meeting was held in Atlanta, Georgia, from November 5 to 
  26. November 11, 1994. The keynote address, "The Information Highway:  Moving Data 
  27. to the Fast Lane" was given by IBM Senior Vice President, Ellen Hancock.  She 
  28. presented possibilities becoming reality and pointed out that this is more than 
  29. a vision - it is understanding technology and taking advantage of what it can 
  30. do for you.  The key to unlocking the power of the information highway is 
  31. software:  operating system, network connection, system management, data base, 
  32. application development, desktop software - the right software. A demo of WARP 
  33. included the ease with which one can find the on-ramp. 
  34.  
  35. Jim Archer, IBM Division Director of Object Strategy and Implementation, 
  36. presented IBM's OO Strategy.  He discussed objects being shared across language 
  37. environments (using SOM) and the building of parts catalogues which are used by 
  38. professional specialists, the end users, to build applications meaningful to 
  39. their business, using OpenDoc. If you're interested in OO PL/I, please let us 
  40. know! 
  41.  
  42. There were two presentations specifically  for PL/I.  The first addressed the 
  43. removal of several inhibitors of migrating to LE.  These changes will be 
  44. available in the next releases of PL/I for MVS & VM and Language Environment 
  45. for MVS & VM.  Note the name changes from the xxx/370 form.  (Editor's Note: 
  46. See the article, "PL/I Migration to LE - Compatibility Support", for more 
  47. details.) There was also an update on vendor enablement for LE.  The advice for 
  48. those of you who have a migration problem due to packages which are not yet 
  49. enabled for LE is to let us know and also contact the vendor. IBM is there to 
  50. help them out, but you have more leverage in getting them to do the enablement. 
  51.  
  52. The second PL/I presentation was a demo of the new Visual PL/I for OS/2, which 
  53. allows you to "paint" PM windows and controls rather than coding those tedious 
  54. calls; and the code generated is all PL/I!  Neat stuff. You can easily and 
  55. quickly develop graphical front ends for existing mainframe applications, get 
  56. started with Client/Server, or use it to develop OS/2 applications.  Visual 
  57. PL/I comes with quite an assortment of code blocks, all ready to use, and 
  58. allows you to add your own code blocks to its libraries.  If you are interested 
  59. in seeing some demo's of Visual PL/I for OS/2, we have a video tape that we can 
  60. send you.  For more information, send in the Response Form at the end of the 
  61. newsletter with a comment to that effect. 
  62.  
  63.  
  64. ΓòÉΓòÉΓòÉ 2.2. COMDEX ΓòÉΓòÉΓòÉ
  65.  
  66.                    by Christie Nieuwsma, IBM PL/I Development
  67.  
  68. The COMDEX PC trade show was in Las Vegas, Nevada again this year. It ran for 5 
  69. days from November 14th to the 18th.  An estimated 200,000 people attended! We 
  70. noticed that it had a very international feeling.  I was there demo'ing Visual 
  71. PL/I for OS/2. All IBM products were being demo'ed in the same area (supposedly 
  72. the biggest one there). There were two other products being demo'ed at the same 
  73. booth as PL/I - Visual COBOL and Visual RPG. As you may have guessed, we were 
  74. focusing on Visual programming languages, particularly ones with which people 
  75. moving from mainframes to the Client/Server world might already be familiar. We 
  76. were right next to the OS/2 WARP theatre presentation, so we had quite a bit of 
  77. traffic.  It seems that people are starting to think about porting their 
  78. products to OS/2 and are interested in what tools exist to help them.  We had 
  79. several people come by and say: "What!  PL/I is still alive?!  I studied that 
  80. back in college.  Wow - look at it!"  Hopefully, some of the people we talked 
  81. to will remember PL/I when they think about future development! 
  82.  
  83.  
  84. ΓòÉΓòÉΓòÉ 3. Peter's Performance Tips ΓòÉΓòÉΓòÉ
  85.  
  86.                      by Peter Elderon, IBM PL/I Development
  87.                         (This will be a regular column).
  88.  
  89. One theme in this series of performance tips will be that the more information 
  90. you tell the compiler, the better your program will perform.  By following this 
  91. maxim, as illustrated in the discussion below, I reduced one application's 
  92. running time from over 30 minutes to under 15 seconds. 
  93.  
  94. This application, and several others that I have recently seen, have been 
  95. suffering from woefully poor performance - and because of a statement that you 
  96. might think could only help performance. This statement is a GOTO statement, as 
  97. in the following example: 
  98.  
  99.   dcl next      fixed bin;
  100.   dcl states(4) label init( first, add, delete, last );
  101.  
  102.     loop:
  103.      goto states(next);
  104.     first:
  105.       /* ..... */
  106.       goto loop;
  107.     add:
  108.       /* ..... */
  109.       goto loop;
  110.     delete:
  111.       /* ..... */
  112.       goto loop;
  113.     last:
  114.       /* ..... */
  115.       goto loop;
  116.     exit
  117.  
  118. The branch in this loop could have been coded as a SELECT statement, but I 
  119. don't want to discuss here which is the better choice.  I want to discuss the 
  120. consequences of the code in the preceding example. 
  121.  
  122. As it appears in the example, this code performs terribly in the versions of 
  123. OS/2 PL/I that have been offered to date. The GOTO statement becomes a call to 
  124. a library routine. That library routine deserves the largest share of the blame 
  125. for how poorly this code performs, but a simple change allows you to avoid the 
  126. library call altogether. 
  127.  
  128. To understand this change, it helps to understand why there is a library call 
  129. at all. The target of the GOTO is an element of a label array. This label 
  130. array, states, is a variable that is initialized upon entry into the block 
  131. containing the GOTO.  However, since the array may be assigned other labels, 
  132. including labels in other blocks, the compiler pessimistically assumes that the 
  133. GOTO may be an out-of-block GOTO and hence makes a library call. 
  134.  
  135. You can help the compiler make the simple jump you expect (and also avoid the 
  136. cost of initializing the array upon every entry to the block) by adding the 
  137. attribute static to the declaration of the label array: 
  138.  
  139.      dcl states(4) label static init( first, add, delete, last );
  140.  
  141. The compiler assumes that any static label array has a constant set of values 
  142. and that any GOTO to an element of the array must be a simple, in-block GOTO. 
  143.  
  144.  
  145. ΓòÉΓòÉΓòÉ 4. IBM PL/I...AND THE BEAT GOES ON! ΓòÉΓòÉΓòÉ
  146.  
  147.                         by Bob Thimsen, IBM PL/I Planning
  148.  
  149. IBM PL/I has been rumored to be on the skids...you hear things like "IBM isn't 
  150. investing in PL/I anymore" or "PL/I can't compete with COBOL or C".  We're here 
  151. to say that IBM does believe in PL/I and is continuing to make significant 
  152. investments in this major enterprise product!  Here are a few examples of what 
  153. has happened recently and some of what you can expect in the future as a PL/I 
  154. customer: 
  155.  
  156. o March 1993:  IBM announced  PL/I support for the Language Environment/370 
  157.   (LE/370). First delivery of the LE/370 PL/I product named PL/I for MVS and VM 
  158.   was in April 1993. This product allows the customer that has both PL/I and 
  159.   COBOL to use a common development and runtime environment with the added 
  160.   feature of having IBM supported interlanguage communication between PL/I, 
  161.   COBOL, and C.  In addition, a common debugger is available for the LE/370 
  162.   languages (COBOL and C today and PL/I in December 1994). 
  163.  
  164. o May 1994:  IBM announced a Visual PL/I for OS/2 product set with a 
  165.   Professional, Personal, and Toolkit version that became available in 
  166.   June/July 1994.  This product set introduced a full PL/I on OS/2 with visual 
  167.   capabilities, SQL preprocessor, CICS preprocessor, VSAM  support, IMS Client 
  168.   Server/2 support, macro facility, and source level debugging.  The 
  169.   Professional and Personal products come with IBM's Workframe/2 Version 2 
  170.   product as a basis for a complete development environment. The Toolkit 
  171.   provides a state of the art visual programming environment for the PL/I 
  172.   programmer. The drag and drop interface lets you develop Presentation Manager 
  173.   (PM) applications using objects in a format that is expandable as well as 
  174.   being easy to use. 
  175.  
  176. o September 1994:  IBM announced PL/I for VSE/ESA with product delivery 
  177.   scheduled for February 1995.  The long awaited update to the DOS PL/I product 
  178.   has been announced and promises to extend the life of PL/I applications 
  179.   running in the VSE environment. 
  180.  
  181. o October 1994:  IBM announced PL/I for AIX. The product delivery date will be 
  182.   announced in first quarter 1995.  This promises to be an important delivery 
  183.   for the PL/I customer because it provides a product on the only major IBM 
  184.   platform that does not have a PL/I product from IBM.  This PL/I for AIX 
  185.   product will be compatible with the other IBM PL/I products on the host and 
  186.   OS/2 as well as provide some important features for the RS/6000 customer. 
  187.  
  188.   IBM also announced enhancements to the host PL/I product in October.  These 
  189.   enhancements include PLICALLA/PLICALLB support to be delivered in first 
  190.   quarter 1995 along with the follow on release of Language Environment/370 
  191.   which will contain the PL/I multi-tasking feature for LE/370 customers. In 
  192.   addition, CODE/370 support for PL/I will be delivered in December 1994 with 
  193.   multi-tasking debugging support available in first quarter 1995. 
  194.  
  195. o January 1995: IBM is announcing a host PL/I feature that allows the host PL/I 
  196.   customer to buy, at a monthly charge, PL/I for OS/2-Professional and PL/I for 
  197.   OS/2-Toolkit.  The workstation product will be shipped on the host product 
  198.   delivery medium. 
  199.  
  200.   In addition, starting December 1994, you can get a PL/I Solutions CD from 
  201.   IBM.  This CD contains actual copies of the following products: 
  202.  
  203.    - PL/I for OS/2 - Professional, Personal, Toolkit 
  204.    - IMS Client Server/2 
  205.    - DB2/2 
  206.    - CICS OS/2 
  207.    - Data Access Services for OS/2 
  208.    - Workstation Interactive Test Tool 
  209.    - WITT/PM 
  210.    - IBM Softcopy Receiver Tool 
  211.  
  212.   You can browse or try out the products, read about the products, go through a 
  213.   multimedia presentation, or order the products using an electronic key! 
  214.  
  215. IBM is investing millions of dollars in the PL/I language and development 
  216. environment technology. We firmly believe that customers can reap the benefits 
  217. of new technology, optimize their skills base, and, at the same time, protect 
  218. their business assets through the power of native PL/I and the ease of 
  219. maintainability that PL/I offers. 
  220.  
  221.  
  222. ΓòÉΓòÉΓòÉ 5. PL/I Migration to LE - Compatibility Support ΓòÉΓòÉΓòÉ
  223.  
  224.                        by Irene Liu, IBM PL/I Development
  225.  
  226. More OS PL/I compatibility support will soon become available in PL/I for MVS & 
  227. VM and Language Environment (LE) for MVS & VM. The following lists some major 
  228. items of the support: 
  229.  
  230. o CODE/370 support 
  231.   CODE/370 R2 in conjunction with PL/I for MVS & VM R1 and LE for MVS & VM R3 
  232.   with a PTF provides a debugging capability superior to that found in INSPECT 
  233.   for C and PL/I, and equivalent to that found in PL/I PLITEST. The support 
  234.   includes interactive CICS debugging and ILC debugging with C and COBOL. It 
  235.   also provides cooperative edit/compile/debug with a language sensitive 
  236.   editor, compiler invocation from workstation, a windowed debug interface, 
  237.   language specific help on OS/2, and compilation and execution on the host. 
  238.  
  239. o OS PL/I Multitasking facility (MTF) support 
  240.   The next release of PL/I for MVS & VM and LE for MVS & VM will support OS 
  241.   PL/I MTF by using the POSIX-defined multi-threaded environment. A PL/I task 
  242.   will be built on the top of a POSIX Heavy Weight Thread (HWT). Each POSIX HWT 
  243.   has an MVS TCB underneath it. Therefore, a PL/I task is still an MVS TCB 
  244.   based task. When a PL/I task terminates, the underlying POSIX HWT and MVS TCB 
  245.   go away as well. The hierarchical relationship among PL/I tasks is maintained 
  246.   to ensure OS PL/I MTF semantics. 
  247.  
  248.   The support requires MVS/ESA SP V5R1 with OpenEdition R2. The OS PL/I MTF 
  249.   syntax and semantics remain the same but each task in an application may 
  250.   experience a timing difference on task initialization and termination. If 
  251.   such a difference occurs, it is imposed by the underlying POSIX 
  252.   multi-threading services and the different priority algorithm used by MVS/ESA 
  253.   SP V5R1. Instead of relying on the underlying system services and PL/I 
  254.   default tasking hierarchy, it is always true that the application must use 
  255.   the EVENT option or variable and the WAIT statement to control the desired 
  256.   execution sequence among tasks. 
  257.  
  258. o OS PL/I PLICALLA entry point support 
  259.   The next release of LE for MVS & VM will support an OS PL/I PLICALLA main 
  260.   procedure recompiled with PL/I for MVS & VM. A separate dataset or txtlib, 
  261.   SIBMCALL, must be placed before SCEELKED at link time for the recompiled 
  262.   procedure. 
  263.  
  264. o OS PL/I PLICALLB entry point support 
  265.   The next release of LE for MVS & VM will support the OS PL/I PLICALLB 
  266.   application as follows, subject to the general rule of the version/release 
  267.   support for the OS PL/I applications: 
  268.  
  269.    - OS PL/I load module 
  270.    - OS PL/I object module 
  271.    - OS PL/I main procedure recompiled with PL/I for MVS & VM. A separate 
  272.      dataset or txtlib, SIBMCALL, must be placed before SCEELKED at link time 
  273.      for the recompiled procedure. 
  274.  
  275. o OS PL/I object and load module support 
  276.   The next release of LE for MVS & VM will extend the OS PL/I object and load 
  277.   module support to following: 
  278.  
  279.    - Object module - OS PL/I V1R3.0 
  280.      CICS macro language is not supported 
  281.    - Load module - OS PL/I V1R5.1 
  282.      Non-shared library, non-CICS, and non-tasking load module must first be 
  283.      ZAPed by IBMRZAPM or IBMRZAPV. 
  284.  
  285.   The language support is at the OS PL/I V2R3 level. Other migration tools are 
  286.   extended accordingly. OS PL/I IBMBEER is ignored. 
  287.  
  288. o OS PL/I PLISRTx support 
  289.   The next release of LE for MVS & VM will no longer require the OS PL/I 
  290.   PLISRTx application to relink. All known problems will be fixed. However, it 
  291.   is still recommended to relink those load modules to: 
  292.  
  293.    - Avoid any potential problem that hasn't been uncovered 
  294.    - Allow the next release of DFSORT to be installed with a LOCALE value other 
  295.      than NONE 
  296.    - Allow the library routine to replace the 24-bit parameter list with the 
  297.      extended parameter list when it invokes DFSORT 
  298.  
  299. o OS PL/I heap storage location support 
  300.   The next release of LE for MVS & VM will use the same rules that OS PL/I used 
  301.   to allocate the heap storage.  The following rules control the heap storage 
  302.   allocated above the 16M line: 
  303.  
  304.    - The requestor is in AMODE(31) 
  305.    - HEAP(,,ANYWHERE) is in effect 
  306.    - The main procedure is in AMODE(31) 
  307.  
  308.   This support allows HEAP(,,ANYWHERE) as an installation default yet the 
  309.   location of the allocated storage is sensitive to the AMODE of both the 
  310.   requestor and the main procedure. 
  311.  
  312.  
  313. ΓòÉΓòÉΓòÉ 6. Team PL/I ΓòÉΓòÉΓòÉ
  314.  
  315. Are you tired of hearing that PL/I is dead?  You're not alone!  We think it's 
  316. time for people who love and use PL/I to get together and start letting other 
  317. folks know what a great language it is!  You may already have tried to do that, 
  318. but we at IBM PL/I Development would like to give you some help.  We don't care 
  319. where you work or what PL/I products you use.  If you love the language, you're 
  320. invited to join 
  321.  
  322.           Team PL/I. 
  323.  
  324.  What can a member of Team PL/I do? 
  325.  
  326.  o Talk it up and answer questions about it on bulletin boards 
  327.  o Give demos at user groups or trade shows 
  328.  o Teach classes at community colleges or universities 
  329.  o Write articles for magazines (or our newsletter!) 
  330.  o Be available as a reference for potential customers or users 
  331.  o Share tools and code samples 
  332.  o and so on, and so on... 
  333.  
  334.  What will IBM's Team PL/I support do for you? 
  335.  
  336.  o Publish a PL/I newsletter (you're reading it right now!) 
  337.  o Provide demo material for IBM's PL/I products 
  338.  o Provide information on user groups and trade shows 
  339.  o Distribute information on PL/I bulletin boards 
  340.  o Provide information about PL/I tool vendors 
  341.  o and so on, and so on... 
  342.  
  343.  It's easy (and free) to join Team PL/I!  Just send us the following 
  344.  information: 
  345.  
  346.   1. Your name 
  347.   2. Your company name 
  348.   3. Your mailing address 
  349.   4. Your electronic mail address(es) 
  350.   5. Your phone and FAX numbers 
  351.   6. What PL/I product(s) you use 
  352.  
  353.  We'd also love to hear your ideas and plans for what you can do to promote 
  354.  PL/I and how we can help. It would also be helpful to know what bulletin 
  355.  boards you know of where PL/I people congregate. 
  356.  
  357.  You can send the above information, and any other comments or questions to any 
  358.  of the following: 
  359.  
  360.    Internet: TEAMPLI@VNET.IBM.COM 
  361.    IBMMAIL: USIB5RLG at IBMMAIL 
  362.    IBM internal network: TEAMPLI at STLVM20 
  363.    FAX: (408) 463-4820 
  364.    Mailing Address: Team PL/I 
  365.                       IBM - Santa Teresa Lab. 
  366.                       555 Bailey Avenue, J84/D345 
  367.                       P.O. Box 49023 
  368.                       San Jose, CA 95161-9023 
  369.                       U.S.A. 
  370.  
  371.  Wouldn't it be great to hear people saying:  "PL/I... that's a language I need 
  372.  to learn!"  Let's make it happen! 
  373.  
  374.  
  375. ΓòÉΓòÉΓòÉ 7. The REXX PARSE Statement as a PL/I Preprocessor Macro ΓòÉΓòÉΓòÉ
  376.  
  377.                          by Dave Jones, Team PL/I Member
  378.  
  379. parse  (par`s, par~z), (v.t., Gram). (1) to describe (a word or series of 
  380. words) grammatically, telling the part of speech, syntactic relations, etc. (2) 
  381. To break apart into constituent components. 
  382.  
  383. For the last several years, the programming language REXX  has been gaining 
  384. popularity in both the mainframe environment (where it was first developed in 
  385. the early '80s under VM/SP as a replacement for CMS's EXEC and EXEC2 command 
  386. languages) and in the PC environment. REXX (short for REstructured eXtended 
  387. eXecutor) is particularly suitable for writing command procedures and user 
  388. defined macros for applications like text editors because it has some very 
  389. powerful string and text handling capabilities. Like PL/I, which inspired many 
  390. of its features, REXX is a general purpose programming language with the usual 
  391. structured programming constructs - IF, SELECT, DO WHILE, LEAVE, etc. -  but it 
  392. also contains a number of other constructs not found in most other languages. 
  393. One of these powerful statements is the PARSE instruction. 
  394.  
  395. In a REXX program the data to be parsed is called the source string. The PARSE 
  396. instruction splits up the data in the source string and assigns pieces of it to 
  397. variables named in a "template".  The "template" is a model that tells PARSE 
  398. how to split up the source string and to what variables it should assign the 
  399. split-up pieces. Here's a simple example: 
  400.  
  401.      name='Williams, Scott'
  402.      parse var name last_name ',' first_name
  403.  
  404. The character string "Williams"  is assigned to the REXX variable last_name and 
  405. the string "Scott" to the variable first_name, based on the position of the 
  406. comma in the input REXX variable "name". The template in this example is 
  407. "last_name ',' first_name". 
  408.  
  409. Templates can contain "string patterns" (like the one above), "positional 
  410. patterns" or both. A string pattern matches characters in the source string to 
  411. indicate where to split it; the string pattern can be either a "literal string 
  412. pattern" (one or more characters within quotation marks), or a "variable string 
  413. pattern" (a REXX variable name within parentheses). In the variable pattern 
  414. case, the content of the REXX variable determines where PARSE will break the 
  415. source string. Here's another example: 
  416.  
  417.      comma = ','
  418.      type = 'guru'
  419.      name = 'Shaw, Mary  --  PL/I guru extraordinaire'
  420.      parse var name last_name (comma) first_name . (type) level
  421.  
  422.  yields 
  423.  
  424.      last_name = 'Shaw'
  425.      first_name = ' Mary'
  426.      level = ' extraordinaire'
  427.  
  428. The period toward the end of the PARSE statement acts as a placeholder or 
  429. "dummy variable" to hold unwanted  parts of the parsed string - in this case 
  430. the string ' --  PL/I'.  It helps avoid the overhead of creating unneeded 
  431. variables. Note that all blanks between words are not discarded. 
  432.  
  433. Positional patterns are whole numbers that identify the character positions 
  434. where the source string is to be split. They can be either "absolute" or 
  435. "relative"; an absolute positional pattern specifies a number that is the 
  436. absolute character position at which to split the source string,  while a 
  437. relative positional pattern is a signed number that specifies the relative 
  438. character position at which to split the source. The sign of the number (plus 
  439. or minus) indicates the direction of movement from the start of the source 
  440. string (for the first pattern) or from the position of the last match; right 
  441. for positive, left for negative. For example, an absolute positional template 
  442. might look like this: 
  443.  
  444.      parse var input var_1 11 var_2 21 var_3
  445.  
  446. This parse statement would: 1) place characters 1 through 10 (including blank 
  447. characters) from the source variable "input" into var_1,  2) place characters 
  448. 11 through 20 into var_2, and 3) put characters 21 through the end of the 
  449. string into var_3. Relative positional patterns can be used to accomplish the 
  450. same thing: 
  451.  
  452.      parse var input var_1 +10 var_2 +10 var_3
  453.  
  454. Here the plus or minus sign indicates movement, to the right or left, 
  455. respectively, from the start of the string (for the first pattern) or from the 
  456. position of the last match. The position of the last match is the position of 
  457. the first character of the last match; so the last two examples have exactly 
  458. the same effect. It's important to note that only by using positional 
  459. parameters can the matching operation "back up" to an earlier point in the 
  460. source string. 
  461.  
  462. If you wish to parse the value of an expression, REXX provides the PARSE VALUE 
  463. (...) WITH ...  form of the PARSE instruction. The expression, contained within 
  464. the parentheses of the VALUE keyword, is evaluated and the result is parsed 
  465. using the template following the  WITH keyword. In this format our first 
  466. example would look like this: 
  467.  
  468.      parse value('Williams, Scott') with  last_name ',' first_name
  469.  
  470. A more complete explanation of the rules and usage of the REXX PARSE 
  471. instruction can be found in the REXX reference documents for VM/ESA or in most 
  472. textbooks on the REXX  programming language. 
  473.  
  474. If you've read this far, you might be wondering "What does this have to do with 
  475. PL/I?" or maybe "Hey, this PARSE instruction is really powerful. I wish I could 
  476. use it in my PL/I applications." What this has to do with PL/I is that a fellow 
  477. named Eberhard Sturm at the University of Muenster's Computing Center in 
  478. Germany (sturm@uni-muenster.de) wanted to be able to use this powerful 
  479. programming construct in his PL/I applications, so he wrote a PL/I macro 
  480. preprocessor procedure that implements all of the REXX PARSE instruction 
  481. features we've discussed above. The PL/I macro can be found on the OS2BBS PL/I 
  482. forum, or you can request a copy of it directly from me (IBMMAIL(USQVHWVH), or, 
  483. for those of you who are on the InterNet: usqvhwvh@ibmmail.com). 
  484.  
  485. In only 320 lines of preprocessor source code, including comments, Eberhard was 
  486. able to construct a full implementation of the PARSE statement, as far as it is 
  487. applicable to the PL/I environment. The only difference to the REXX PARSE 
  488. statement is that items in the templates are separated by commas instead of 
  489. blanks. For example, the REXX statements: 
  490.  
  491.      fileid='PROFILE EXEC A1'
  492.      parse value (fileid) with file_name . file_type
  493.  
  494. would become in PL/I: 
  495.  
  496.      fileid = 'PROFILE EXEC A1';
  497.      parse value (fileid) with (file_name, . , file_type);
  498.  
  499. All of the expected REXX PARSE statement options are supported including: 
  500.  
  501.   1. Comments  (balanced /*...*/ pairs like in PL/I) inside the WITH template 
  502.   2. Literal patterns, e.g., '(' 
  503.   3. Placeholders, that is, the period '.' 
  504.   4. Positional patterns, e.g., 11, +5, -10 
  505.   5. Variable patterns, e.g., (var_name) 
  506.   6. The UPPER keyword to uppercase the source string before parsing begins 
  507.  
  508.  A typical use for this macro is in parsing command arguments and options when 
  509.  writing VM command processors in PL/I. A VM program to plot an HP-GL plot file 
  510.  on a pen plotter might be invoked by an end-user as 
  511.  
  512.       PLTHPGL fn <ft <fm>> <( WIDTH www  HEIGHT hhh>,
  513.  
  514.  where fn is the (required) file name of the plot file, ft is the (optional) 
  515.  file type (default is HPGL) and fm is the (optional) file mode (default A). 
  516.  WIDTH and DEPTH are options indicating the desired plot size; if not 
  517.  specified, they default to WIDTH 8.5 and HEIGHT 11.0. The beginning of this 
  518.  PL/I application might look something like this: 
  519.  
  520.           PLTHPGL:
  521.              Proc(Arguments) Options(Main);
  522.                 Dcl Arguments Char(100) Varying;
  523.                 Dcl Fn Char(8) Initial(' '); /* File name */
  524.                 Dcl Ft Char(8) Initial(' '); /* File type */
  525.                 Dcl Fm Char(2) Initial(' '); /* File mode */
  526.                 Dcl Options Char(100) Varying;
  527.                 Dcl Width  Char(4) Initial(' '); /* Plot width */
  528.                 Dcl Height Char(4) Initial(' '); /* Plot height */
  529.             /* Break apart the user-specified arguments */
  530.             /* get the file id first, substituting defaults */
  531.             /* where necessary. Uppercase everything first. */
  532.             PARSE UPPER VALUE(Arguments) With(Fn, Ft, Fm, '(', Options);
  533.             If Fn = '' Then
  534.                Put List('ERROR, File name must be given');
  535.             If Ft = '' Then /* Use default */
  536.                Ft = 'HPGL';
  537.             If Fm = '' Then /* Use default */
  538.                Fm = 'A1';
  539.             /* Now see what options were given, if any */
  540.             Width = ' 8.5';
  541.             Height = '11.0';
  542.             If Options ╨║= '' Then
  543.                Parse UPPER VALUE(Options) With('WIDTH', width, . , 1,
  544.                     'HEIGHT', height, . );
  545.  
  546.  Using the PARSE macro makes this code easy to write and document for others to 
  547.  understand at a later date. 
  548.  
  549.  The fact that a programming construct as sophisticated as the REXX PARSE 
  550.  instruction can be implemented in only a few hundred lines of PL/I 
  551.  preprocessor code clearly demonstrates how powerful that tool really is. It is 
  552.  doubtful that any of the other commonly used preprocessors for third 
  553.  generation languages (e.g., the C preprocessor) could be used as a vehicle to 
  554.  build such a complex yet compact macro. Eberhard used the standard 
  555.  preprocessor facilities of the OS PL/I Version 2 Release 3 compiler; the "new 
  556.  and improved" preprocessor found in the OS/2 PL/I products offers even more 
  557.  usability and functionality. Take a few minutes to study the PL/I macro 
  558.  concepts and facilities and increase your effectiveness when using either the 
  559.  host System/390 PL/I products or the newer OS/2 ones. PL/I -- Productivity 
  560.  Language / One. 
  561.  
  562.  
  563. ΓòÉΓòÉΓòÉ 8. Questions and Answers ΓòÉΓòÉΓòÉ
  564.  
  565. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  566. ΓöéQUESTION                                ΓöéANSWER                                  Γöé
  567. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  568. ΓöéI'm trying to declare a structure of    ΓöéThe REFER option should work:           Γöé
  569. Γöésize unknown, based on a pointer, L_PTR,Γöé                                        Γöé
  570. Γöépassed to me.  It points to the         Γöé DCL 1 struct based(L_PTR),             Γöé
  571. Γöéfollowing:                              Γöé       3 amount fixed bin(15),          Γöé
  572. Γöé                                        Γöé       3 array (max_amt REFER amount),  Γöé
  573. Γöé  amount              fixed bin(15)     Γöé        5 element1    char(8),          Γöé
  574. Γöé  element1            char(8)           Γöé        5 element2    char(16);         Γöé
  575. Γöé  element2            char(16)          Γöé DCL max_amt  fixed bin(15) init(?);    Γöé
  576. Γöé     :                    :             Γöé    /* Init with your maximum value */  Γöé
  577. Γöéand so on, where amount tells me how    Γöé                                        Γöé
  578. Γöémany (element1,element2) pairs there    ΓöéYou can then have:                      Γöé
  579. Γöéare.                                    Γöé  Do i = 1 to amount;                   Γöé
  580. Γöé                                        Γöé    do something with element1, element2Γöé
  581. Γöé                                        Γöé  End;                                  Γöé
  582. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  583. ΓöéI'm creating a window with Visual PL/I  ΓöéThis takes a few steps!                 Γöé
  584. Γöéfor OS/2 that has several entry fields  Γöé1. For each entryfield, click Mouse     Γöé
  585. Γöéin it. How do I set it up so that I can Γöé   button 2 and select "Styles" from theΓöé
  586. ΓöéTab from one entry field to another?    Γöé   popup menu. In the "Window Styles"   Γöé
  587. Γöé                                        Γöé   dialog box, select WS_TABSTOP from   Γöé
  588. Γöé                                        Γöé   the "WS_  Styles" listbox.           Γöé
  589. Γöé                                        Γöé2. Pick the order in which you want to  Γöé
  590. Γöé                                        Γöé   tab between entry fields.  Hold down Γöé
  591. Γöé                                        Γöé   the shift key and click Mouse button Γöé
  592. Γöé                                        Γöé   1 in each entry field, in the REVERSEΓöé
  593. Γöé                                        Γöé   order that you want tabbing to occur Γöé
  594. Γöé                                        Γöé   in.  Release the shift key!  Go back Γöé
  595. Γöé                                        Γöé   to the first entry field you selectedΓöé
  596. Γöé                                        Γöé   and click Mouse button 2.  Select    Γöé
  597. Γöé                                        Γöé   "Layout" and then "Order group".     Γöé
  598. Γöé                                        Γöé3. Set up a link for the window by      Γöé
  599. Γöé                                        Γöé   clicking Mouse button 2 in the clientΓöé
  600. Γöé                                        Γöé   area and selecting "Links".  Then,   Γöé
  601. Γöé                                        Γöé   select the WM_CHAR event and the     Γöé
  602. Γöé                                        Γöé   "Tabbing Functions" from the         Γöé
  603. Γöé                                        Γöé   "Library" listbox.  Add the "Do groupΓöé
  604. Γöé                                        Γöé   tabbing" code block.                 Γöé
  605. Γöé                                        Γöé                                        Γöé
  606. Γöé                                        ΓöéThat should be all you need!            Γöé
  607. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  608. ΓöéCan PL/I 2.3 sub-tasks take advantage ofΓöéNo. PL/I routines do not check the VSAM Γöé
  609. ΓöéVSAM's multiple string reads by using   Γöécontrol block for this information.     Γöé
  610. Γöéthe STRNO sub-parameter in the VSAM AMP ΓöéInstead, they check their own control   Γöé
  611. Γöéparameter?                              Γöéblocks, which only allow a single read. Γöé
  612. Γöé                                        ΓöéRead access would have to be serialized Γöé
  613. Γöé                                        Γöéby using either the PL/I WAIT statement Γöé
  614. Γöé                                        Γöéor an assembler routine.                Γöé
  615. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  616. ΓöéI followed the tutorial in PL/I for OS/2ΓöéYou can get your application into the   Γöé
  617. ΓöéToolkit Reference V1R1 and created      ΓöéTaskList by using the FCF_TASKLIST styleΓöé
  618. ΓöéMyProj.  When I ran it, I noticed MyProjΓöéfor your window.  This frame creation   Γöé
  619. Γöédid not appear in the TaskList.  If I   Γöéflag tells Presentation Manager to put  Γöé
  620. Γöéminimize MyProj, I have no way of       Γöéyour application name in the TaskList.  Γöé
  621. Γöégetting it back!                        ΓöéTo specify this flag, single click mouseΓöé
  622. Γöé                                        Γöébutton 2 in the client area for your    Γöé
  623. Γöé                                        Γöémain window.  Select "Styles" from the  Γöé
  624. Γöé                                        Γöépop-up menu.  A "Window Styles" dialog  Γöé
  625. Γöé                                        Γöébox should appear.  A listbox named     Γöé
  626. Γöé                                        Γöé"Item Styles" is in the dialog, and fromΓöé
  627. Γöé                                        Γöéhere you can choose FCF_TASKLIST.  This Γöé
  628. Γöé                                        Γöéwill cause the Title bar text for your  Γöé
  629. Γöé                                        Γöémain window to appear in the TaskList.  Γöé
  630. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  631.  
  632.  
  633. ΓòÉΓòÉΓòÉ 9. I know they're around here somewhere... ΓòÉΓòÉΓòÉ
  634.  
  635. Have you ever wondered if there was a place where folks hang out and talk about 
  636. PL/I? Well, there are quite a few places on-line where PL/I issues are 
  637. discussed.  Here's how to get to some of them: 
  638.  
  639. Compuserve 
  640.           Enter:  go os2df1 
  641.           Then go to subsection 6: "Rexx and other languages". 
  642.  This bulletin board is used to discuss OS/2 languages, PL/I among them. 
  643.  
  644.  Internet 
  645.  There is a LISTSERV list that you can subscribe to.  To do so, send a note to: 
  646.           LISTSERV@UIUCVMD.BITNET (or LISTSERV@VMD.CSO.UIUC.EDU) 
  647.  containing the line: 
  648.           SUB PL1-L Your Name 
  649.  This list is devoted to discussions of the PL/I language. 
  650.  
  651.  IBM Customer Forum 
  652.  There is an IBM customer forum devoted to OS/2 PL/I on IBMLink.  Even though 
  653.  it is officially dedicated to the OS/2 product, we are in the process of 
  654.  trying to open it up for discussion of all IBM PL/I products.  So, if you have 
  655.  a host question, please feel free to ask it on this forum. To access it, do 
  656.  one of the following: 
  657.           From the IBMLink Main Menu, select option 5, Martlink 
  658.           From the Martlink menu, select option 2, New Talklink 
  659.           From the NewTalklink menu, select option 6, OS2bbs1 
  660.           From the OS2bbs1 menu, select option 1, QAndabbs 
  661.           From the QAndabbs menu, select option 10, TLpgcat 
  662.           From the TLpgcat menu, select option 20, OS2PLI 
  663.  OR 
  664.           Enter the fastpath OS2;OS2PLI from the IBMLink main menu! 
  665.  
  666.  IBM PL/I developers monitor all of these.  If you know of any other bulletin 
  667.  boards, we'd love to hear about them! 
  668.  
  669.  
  670. ΓòÉΓòÉΓòÉ 10. What Next? ΓòÉΓòÉΓòÉ
  671.  
  672. If you'd like to receive a hard copy version of "The PL/I Connection" 
  673. newsletter, please let us know.  We'd also appreciate any comments or 
  674. suggestions you may have.  You may either mail or Fax your response to one of 
  675. the following: 
  676.  
  677. PL/I Newsletter 
  678. IBM - Santa Teresa Lab. 
  679. 555 Bailey Avenue, J84/D345 
  680. P.O. Box 49023 
  681. San Jose, CA 95161-9023 
  682. U.S.A. 
  683.  
  684. Fax: (408) 463-4820 
  685.  
  686.  
  687. ΓòÉΓòÉΓòÉ 11. The PL/I Connection Response Form ΓòÉΓòÉΓòÉ
  688.  
  689. Yes, I would like to receive a hard copy version of the PL/I Newsletter. 
  690.  
  691. Name: 
  692. _____________________________________________________________________________ 
  693.  
  694. Company: 
  695. __________________________________________________________________________ 
  696.  
  697. Address: 
  698. ___________________________________________________________________________ 
  699.  
  700.    ____________________________________________________________________________ 
  701.  
  702.    ____________________________________________________________________________ 
  703.  
  704.    ____________________________________________________________________________ 
  705.  
  706.    ____________________________________________________________________________ 
  707.  
  708. Phone Number: 
  709. _____________________________________________________________________ 
  710.  
  711. What PL/I Products do you use? 
  712. _______________________________________________________ 
  713.  
  714.    ____________________________________________________________________________ 
  715.  
  716. Comments: 
  717. _________________________________________________________________________ 
  718.  
  719.    ____________________________________________________________________________ 
  720.  
  721.    ____________________________________________________________________________ 
  722.  
  723.    ____________________________________________________________________________ 
  724.  
  725.    ____________________________________________________________________________ 
  726.  
  727.    ____________________________________________________________________________ 
  728.  
  729.    ____________________________________________________________________________ 
  730.  
  731.    ____________________________________________________________________________ 
  732.  
  733.    ____________________________________________________________________________ 
  734.  
  735.    ____________________________________________________________________________ 
  736.  
  737.    ____________________________________________________________________________