> I could be wrong, but I think the first use of "macro" in a
> programming/computer context was introduced in Assembler languages:

The first programming use of the term macro that I'm aware of was 705 
Autocoder. The first macro assembler that I'm aware of to allow conditional 
code generation was FAP. Did SAP have conditional assembly? The first assembler 
I'm aware of whose macro capability was turing complete was 7070 Autocoder (a 
macro was actually a 7070 proogram with special macros to emit code.)

> In order to perform that role, Assembler Macros definitely are required to 
> include
> statements that support conditional logic and looping and symbolic values;

Some macro assemblers lack conditional logic and looping. They could emit long 
sequences of code, but other than replacing parameter with arguments the 
sequence was the same for every call.

Micros in COMPASS were just variables; roughly the same as SETx symbols in 
HLASM.

Macros in, e.g., HLASM can generate things other than code, using the PUNCH 
statement.

--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List [[email protected]] on behalf of 
Joel C. Ewing [[email protected]]
Sent: Saturday, January 8, 2022 12:19 AM
To: [email protected]
Subject: Re: Macro/script/program (Re: ... Re: Top 8 Reasons for using Python 
instead of REXX for z/OS

I could be wrong, but I think the first use of "macro" in a
programming/computer context was introduced in Assembler languages:  A
macro invocation statement basically looked like an assembly statement
with parameters, but instead of generating a single machine instruction
or data definition could generate a whole series of assembly
instructions.  The Macro definition typically includes both Assembly
statements and special macro control statements.  I was first introduced
to them in IBM 1410 Assembler, where they were used to generate the
relatively complex interfaces required to do I/O.  In 360/370/etc
Assembler, macros are extensively used to enforce the conventions for
requesting any service from the Operating System, not just I/O.   As
hardware architectures became more complex, programmers quickly
discovered there were many repetitive instruction sequences in a typical
assembler program, and macros were designed to allow a single statement
to generate the entire sequence with minimal effort.  In order to
perform that role, Assembler Macros definitely are required to include
statements that support conditional logic and looping and symbolic
values; but it is a pretty restrictive language, as its only intended
capability is to generate, perhaps conditionally, other Assembly
language statements, not to solve general purpose problems.

CDC 6000 Assembly Language included not only "macros" but "micros".   A
"micro" allowed you do create a definition of a new "machine
instruction" that would create a 15-bit, 30-bit, or 60-bit "instruction"
with binary sub-fields and parameter rules similar to actual machine
instructions statements, with a one-to-one correspondence between a
statement and an "instruction".  Could be used for "new" hardware
instructions not yet supported by the Assembler, for creating a
customized version of an instruction where some fields were desired to
be constrained, and possibly other bizarre applications.

The main distinction between a macro language and a full programming
language seems to be the context in which it is executed.   Macros are
embedded with statements of another language and "executed" when
processing or pre-processing those statements to generate additional
statements in that language to generate the complete program.   They are
part of the process of generating the statements for the full program,
not actually part of the final program.

     Joel C Ewing

On 1/7/22 06:57, Rony G. Flatscher wrote:
> On 07.01.2022 03:00, Bob Bridges wrote:
>> I usually include JCL under the ~very~ general rubric of "programming 
>> language", but even mentally I think that's a stretch.  It's more like a 
>> macro language, sort of like .bat I guess.
>>
>> I may as well take this opportunity to include a mild rant.  I've often 
>> heard the programs you can write for automating some applications referred 
>> to as "macros"; I have in mind VBA, for example, and what WordPerfect used 
>> to have if WordPerfect is still around.  It always seemed to me that VBA 
>> qualifies just fine as a programming language, and what I write in VBA is 
>> not a "macro", just a program.
>>
>> But then what is a macro?  In searching for some sort of distinction that 
>> would justify there being two different words, I've concluded to my own 
>> satisfaction that a macro is a set of instructions that have no 
>> decision-making capability, maybe no if-then syntax and definitely no 
>> looping, probably no arithmetic, possibly some rudimentary logic operators 
>> like NOT (and may only NOT).  The old .bat language would fit this 
>> description; so would JCL, especially before they added IF statements.  So, 
>> if I remember right, are the instruction sets I used to write for QMF.  But 
>> not VBA; not even TECO.  (Anyone remember TECO?)
>>
>> Now I sit back and wait for someone more knowledgeable to correct me either 
>> on the capabilities of the languages I named, or on the definition of 
>> "macro".
> Most of the time Wikipedia is a quite good starting point, e.g.
> <https://secure-web.cisco.com/1bidLjuWKJJ_vEpgnkHuXPusXEdjEpE3VVcRWerr3pzXAc_WgEVzlF-BTj_QxSEKHq79kCSXJmdASbXhLLX4ORUPjF2f2Mthhs84e05E6e8slJshTHMHO9PuGHwaPyUQwzcskuXi-8I3QDW84FyZT6flS0p4xmqjL78aDWRA5efv0a1SUziCPpNPIlxoxBZEwLI9BrWmaKd8NfHdXr2mmqsTZBBVOfax8hbbWwXkkjW5hcdpa7LWzrdGZnupudEj_BYYCMIRRtOZG7IkIGl9ngzpscEkka7506UddM-hX0RGVy2pQkvW9Nc06p5lDi-YPd6RWZS4_BAmoEqh_r47c1pVCTEBm86uzTX5U1wAgTS62nOwepp0tJcaFV_UngIjHbufwwhQPGpMMpzyROLK7VrPT7NMZREGD6LyBZTSQhqNUP3Wx8WDNCsCb7AyCH1bN/https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FMacro_%28computer_science)>.
>
> The distinction between a macro/script (a set of statements allowing for 
> executing repetitively in
> the context of a hosting application) and a stand-alone program can be even 
> totally blurred, e.g.
> the following ooRexx program can be run from the macro menu of OpenOffice 
> (OOO)/LibreOffice (LO) or
> as a stand-alone program from the command line:
>
>      #!/usr/bin/env rexx
>      use arg slotArg   /* if called as a macro, we can access the document 
> for which we were called  */
>
>      scriptContext=uno.getScriptContext(slotArg)  /* get the xScriptContext 
> object                   */
>      if scriptContext<>.nil then                  /* o.k., we are invoked as 
> a macro from OOo/LO     */
>      do
>         xContext=scriptContext~getComponentContext   /* get the context (a 
> XComponentContext) object */
>         xDesktop=scriptContext~getDesktop            /* get the desktop (a 
> XDesktop) object          */
>         oDoc=scriptContext~getInvocationContext      /* get the document for 
> which this macro got invoked */
>      end
>      else  /* this program was called from outside of OOo, e.g. from the 
> commandline  */
>      do
>         xContext = UNO.connect()                     /* get a connection to 
> the OOo/LO server        */
>         xDesktop = UNO.createDesktop(xContext)       /* create the XDesktop 
> from xContext            */
>            /* create a word processor document: */
>         
> oDoc=xDesktop~XComponentLoader~loadComponentFromURL("private:factory/swriter",
>  "_blank", 0, .UNO~noProps)
>      end
>
>      str="Hello IBM-Main ["date() time()"], this is ooRexx (cf. 
> <https://secure-web.cisco.com/1_EhD8SZEluvp8egZpMqloZPXcB0yQNTGyST-l9qO_Sm-9c8EBA4KYd9PThMkoSAvNcyuYVl79fUnz7SGJAmC9lAs7KFyHDdOPitDcULID9VpyB23VDqK6-f9ju0QDQLAZMpqJc0EC3JAoU6-NAgqDLaRGmnY7u75cOI7VWjYsG7CEmm4szqTeaz_O_h3QpJT7yi2lBWS4WYbZNN2QkZHqFyUi7S8qRv8JrgvYbyXM5LChG7lA4KX2raeqNK4e-CgLw2AL80me4toU9_fk_cjYewWWYNlIquwHzwxbcGiLwibcJS9avOoJqB5frk7snYbbzMK3H2MXcJBaGZfiX8PgWGbvwqv9rrN-9BHNOkLkL2BMGCVCJKdotUh3gREE_gUt31b-kCX6JbXmsBGZVU6nkwzDv8Ghe6kxZV7DMc-O0lxcrEOYy4AE53qJ36qz_rQ/https%3A%2F%2Fwww.RexxLA.org>)
>  speaking ! "
>      oDoc~XTextDocument~getText~getEnd~setString(str)
>
>      ::requires UNO.CLS   /* load UNO support (OpenOffice/LibreOffice) for 
> ooRexx  */
>
> This ooRexx macro/script/program runs unchanged on Windows, MacOS and Linux 
> and will add a string at
> the end of an OOO/LO word document that greets the members of this list and 
> supplies the date and
> time of its invocation.
>
> A few remarks:
>
>    * ooRexx allows for the "USE ARG" keyword in addition to "PARSE ARG": "USE 
> ARG" fetches arguments
>      by reference and can be used to fetch stems by reference
>
>    * The tilde (~) is the ooRexx message operator; one can send messages to 
> any value/object/instance
>      in an ooRexx program. Left of the tilde is the receiving 
> value/object/instance/receiver (these
>      are synonyms), right of it the name of a method routine that 
> conceptually the receiver is
>      supposed to look up and invoke on behalf of the programmer. If the 
> invoked method routine
>      returns a result one can immediately send it a message too, if needed.
>
>    * At the end of the program you see an ooRexx directive led in by the 
> double-colons, in this case
>      the "requires" directive. The ooRexx interpreter will first syntax check 
> the entire REXX program
>      and if no syntax errors were found it will proceed carrying out all 
> directives, in this case it
>      will call the ooRexx program named UNO.CLS which is a package of useful 
> public routines and
>      public ooRexx classes to ease interfacing with OpenOffice/LibreOffice. 
> After all directives got
>      carried out by the interpreter the execution of the program starts 
> having all resources
>      available at that point in time that got brought in by the directives.
>
>        o "UNO" is the acronym for "universal network objects" (cf.
>          <https://wiki.openoffice.org/wiki/Uno>) the c++ class model OOo/LO 
> got built upon, using as
>          protocol "urp" (uno remote protocol) which is a client/server 
> protocol.
>
>    * The macro/script/program checks whether it got called as a macro and if 
> so, gets the document
>      for which the macro should get invoked; if not, then the program was 
> started from outside of a
>      running OOO/LO and therefore starts up OOO/LO and creates a new word 
> document to work on. After
>      having a reference to the OOO/LO word document it realizes the necessary 
> UNO interface to allow
>      setting (adding) a new string at the end of the word document.
>
> ---rony
>
>
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN

--
Joel C. Ewing

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to