There is lots of Rexx off of the mainframe; it just doesn't get much press. I 
just wish that it had native regexen with named captures.


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

________________________________________
From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
David Crayford [dcrayf...@gmail.com]
Sent: Tuesday, March 7, 2023 10:39 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Ad TCP/Socket programs in REXX (Re: Mainframe REXX (Re: 
Badmouthing Rexx and ooRexx - again (Re: zOSMF and zOWE for non-mainframers

On 7/3/23 16:59, René Jansen wrote:
> On 7 Mar 2023, at 08:45, David Crayford <dcrayf...@gmail.com> wrote:
>> The industry has spoken! Python is the most popular programming language in 
>> the world so haters will have to just suck that up.
> That is a very funny statement. Nobody hates Python - the hype will blow over 
> like Perl, Visual Basic, Ruby, COBOL, etc. O wait, there is still tons of 
> COBOL around, like there will be tons of Rexx around for ages.

Agreed. And there is lots of REXX on the mainframe.


>
> While we do not hate Python (it was a great television series in the 
> seventies) we can do without the attacks on Rexx. Like the JCL replacement 
> from IBM’s Clunkification department, the examples will speak for themselves. 
> Look at it in all its glory, coming in at 190 lines plus lots of imported 
> zooutils, at 
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FIBM%2Fzoau-samples%2Fblob%2Fmain%2Fsamples%2Fsmpe_list.py&data=05%7C01%7Csmetz3%40gmu.edu%7C60e13f4a45264c70f77308db1f86c60f%7C9e857255df574c47a0c00546460380cb%7C0%7C0%7C638138435933107600%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=jTeCGpNTGInuvsu3RPGPfVlZVphY%2BJu%2FZMkmw%2F%2ByUMs%3D&reserved=0
>  - it replaces about 15 lines of JCL. If that was meant to undercut the 
> credibility of Python, it is a very, very clever attempt by an old mainframer.
>
> If I now ask ChatGPT for a script to list some SMP/E zones, it shows me:
>
> /* REXX program to list the status of all SYSMODs */
>
> /* Set up the SMP/E commands to be executed */
> smp_cmds.1 = "SET BDY(GLOBAL)."
> smp_cmds.2 = "LIST SYSMOD(*) WHERE(SYMBOLICDATE GT 0)."
> smp_cmds.3 = "SET BDY(LOCAL)."
>
> /* Write the SMP/E commands to a temporary data set */
> "ALLOC F(SMPCMD) NEW REUSE SPACE(80 80) TRK"
> do i = 1 to smp_cmds.0
>    "EXECIO 1 DISKW SMPCMD (STEM smp_cmds. " i ")"
> end
> "FREE F(SMPCMD)"
>
> /* Invoke SMP/E to execute the commands */
> "ADDRESS TSO"
> "CALL 'SYS1.SMP.EB2A.EXEC(SMPXMSGS)'"
> "EXECIO 0 DISKR SMPXMSGS (STEM smp_msgs. FINIS)"
> "FREE F(SMPXMSGS)"
>
> /* Display the results */
> do i = 1 to smp_msgs.0
>    say smp_msgs.i
> end

There's bugs in that code ;)


>
> I rest my case. Still not sure why JCL needs to be replaced but hey.

100% agree. Can't say I'm a big fan of JCL but it does the job.


> The curious case with Rexx is that it has been under attack from the 
> beginning, like all good things within IBM, like VM and JES2. Later, in OS/2, 
> it was relentlessly attacked by Microsoft and almost left out of it, only to 
> be introduced in the IBM EE “Extended Edition”, possibly because it was 
> better than BASIC of the day.

Interesting. I know it seems like I'm always attacking REXX but I would
suggest that I'm criticizing, not attacking. I used to work on NetMaster
back in the 90s and danced a jig of joy when I could use REXX instead of
NCL. I ways also delighted when ISPF supported inline REXX panel exits
so I could avoid horrible panel logic.

These days I spend most of my time on z/OS using a bash shell. I have
written REXX scripts that use the SDSF API to interact with the spool,
console etc. I also like REXX to write scripts that call batch programs
redirecting the output to stdout/stderr etc so I can spawn batch
utilities from UNIX processes such as Java web servers. For short
scripts REXX is an excellent language. However, I don't think it scales.
One glance at the ISPF DTL compiler which is 42KLOC confirms this.

/* REXX */

parse arg script_file
if script_file = '' then do
   "Usage: kciomega <script_file>"
   exit 2
end

call syscalls 'ON'
address syscall 'realpath . cwd'
address syscall 'realpath 'script_file' script_file'

call BPXWDYN("ALLOC DD(SYSPRINT) PATH('/dev/fd2') PATHOPTS(OWRONLY)
FILEDATA(TEXT) MSG(2) REUSE")
call BPXWDYN("ALLOC DD(SYSOUT) PATH('/dev/fd2') PATHOPTS(OWRONLY)
FILEDATA(TEXT) MSG(2) REUSE")
call BPXWDYN("ALLOC DD(KCIPRINT) PATH('/dev/fd2') PATHOPTS(OWRONLY)
FILEDATA(TEXT) MSG(2) REUSE")
call BPXWDYN("ALLOC DD(KCIFLOW) PATH('"script_file"') FILEDATA(TEXT)
PATHOPTS(ORDONLY) MSG(2) REUSE")

address ATTCHMVS "KCIOMEGA"

call BPXWDYN("FREE DD(SYSPRINT)")
call BPXWDYN("FREE DD(SYSOUT)")
call BPXWDYN("FREE DD(KCIPRINT)")
call BPXWDYN("FREE DD(KCIFLOW)")

>
> Rexx always has been the tool of systems staff, who, while disallowed to do 
> any programming, saved many an application (and company) with Rexx, and 
> rubber bands. This is why this is such a strange forum to attack Rexx on, and 
> I wonder if you just cannot help yourself, or it is some officially 
> sanctioned action, somewhat akin to the movement of replacing some easy to 
> use SMP/E JCL (the plot comes together here, the unconscious hints give at 
> away) with endless dialogs, like young IT people want to be turned into 
> clerks doing spreadsheets.

I was just responding to Peter Farley's post WRT I/O performance which
gave me an opportunity for a shameless pyzfile plug ;)


> So why don’t you indeed port ooRexx to z/OS, and see what happens? You can 
> change the threads structure, VS Studio Code has nice tools for that. It 
> would be a constructive addition to the discussion. And it would prove some 
> points, like porting to z/OS is easy and IBM now embraces open source, and 
> that that decision to not port Object Rexx has been walked back.

I haven't got the spare cycles to port ooRexx. I managed to build it in
the naughties but it was full of bugs. That was and EBCDIC port. I don't
do EBCDIC ports anymore (nor does Rocket or IBM). A feasibile port of
ooRexx would use the new LLVM/clang compilers and use enhanced ASCII
with file tagging. That's probably not what the majority of REXXers on
this forum would want. They want ooRexx to be native EBCDIC and for the
scripts to be in PDS data sets. And integration to TSO/ISPF and all that
stuff. I can assure you that is a VERY heavy lift.


> best regards,
>
> René.
>
>
>
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to