All The z390 Portable Macro Assembler offers an easy solution using extensions to the AREAD and PUNCH statements to allow specifying DDNAME to read and/or write multiple text files. These extensions allow you to use conditional assembler to code utilities that read and write multiple text files to perform any text processing functions you like such as generating different source languages including assembler, COBOL, PL/I, C, Java, HTML, etc. The full power of the HLASM macro variable capability can be used to substitute text from variables. This is not a new concept, but the extensions do make it easier to code and manage. The 3GL product named TELON now owned by CA used the conditional macro assembler language to generate COBOL, PL/I, TSO, CICS, IMS, and DB2 code from its own 3 GL language using about 3 million lines of conditional macro code.
For example after you download and install z390 via www.z390.org, you could assemble the following conditional macro assembler code to create a COBOL program to say "HELLO WORLD" on the SYSUT2 ddname defined via SET DDNAME=file spec prior to the assembly. PUNCH ' IDENTIFICATION DIVISON. HELLO.',DDNAME=SYSUT2 PUNCH ' ENVIRONMENT DIVISION.',DDNAME=SYSUT2 PUNCH ' DATA DIVISION.',DDNAME=SYSUT2 PUNCH ' PROCEDURE DIVISION.',DDNAME=SYSUT2 PUNCH ' DISPLAY ''HELLO WORLD''',DDNAME=SYSUT2 PUNCH ' STOP RUN',DDNAME=SYSUT2 END For a more complex exmaple which reads and writes text to convert structured conditional macro assembler into standard HLASM assembler, see the z390\linklib\ZSTRMAC.MLC source (about 31,000 lines). There is also the bootstrap version written in pure HLASM in z390\rt\test\zstrmac2.mlc (about 68,000 lines). Don Higgins [email protected]
