×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Running REXX on a PC

Running REXX on a PC

Running REXX on a PC

(OP)
Is anybody running REXX on their PC and willing to help me get to that point?

Frank Clarke
--America's source for adverse opinions since 1943.

RE: Running REXX on a PC

Hi rexxhead,
I'm running REXX on Linux and Windows. How can I help you ?

RE: Running REXX on a PC

(OP)
What interpreter are you using?
How do I get one?
Where do I put it?
What do I have to do to get <program-file> handled by <interpreter>?

Frank Clarke
--America's source for adverse opinions since 1943.

RE: Running REXX on a PC

To your questions:

> What interpreter are you using?
I'm using both free available interpreters:
1) Open Object Rexx (which is open sourced IBM Object REXX) - available here: https://www.oorexx.org/
2) Regina REXX Interpreter - available here: https://regina-rexx.sourceforge.io/
both are classic REXX interpreters - althought ooRexx allows Object Orientation - but you can ignore that and use it as classic Rexx

> How do I get one?
> Where do I put it?
It depends what Operating System you have on your PC.
On my Linux PC I installed ooRexx from repository. On my Windows PC I installed both ooRexx and Regina from their home pages.

If you are on Windows download the installers, run them and everything will be done automatically.

ooRexx installer is here: https://sourceforge.net/projects/oorexx/files/oore...
Download ooRexx-4.2.0.windows.x86_64.exe and run it, it installs by default in the directory: c:\Program Files\ooRexx
It's associated with file type extension *.rex

Regina installers are here: https://sourceforge.net/projects/regina-rexx/files...
I have this version 3.9.3 Regina393w64.exe but you can download newer version 3.9.4. In my case it installed by default in the directory: c:\Program Files\rexx.org\Regina
It's associated with file type extension *.rexx

> What do I have to do to get <program-file> handled by <interpreter>?
If I click on the file with extension *.rex, then the file will be executed by ooREXX
If I click on the file with extension *.rexx, then the file will be executed by Regina
But when I'm writing or testing a program I'm rather running it on command line to see all messages

Running ooREXX:

CODE

rexx <program_file> 

Running Regina:

CODE

regina <program_file> 

see the screenshot:

RE: Running REXX on a PC

(OP)
Great! Thank you! What do you do for I/O?

Frank Clarke
--America's source for adverse opinions since 1943.

RE: Running REXX on a PC

> What do you do for I/O?
If you mean console I/O, then for example this works for me:

rexx_console_io.rex

CODE

my_prompt = "enter something: "

/* display prompt and enter input on the new line */
say "enter something:"
parse pull my_word
say "entered:" my_word

/* display prompt and enter input on the same line */
call charout , my_prompt 
parse pull my_word
say "entered:" my_word 

run it
with ooREXX:

CODE

rexx rexx_console_io.rex 

with Regina REXX

CODE

regina rexx_console_io.rex 



RE: Running REXX on a PC

(OP)
Ugh! Homework! winky smile

Oh, well, into each life some rain must fall smile

Thanks for the head start.

Frank Clarke
--America's source for adverse opinions since 1943.

RE: Running REXX on a PC

Hi Frank,

Have you tried both interpreters, Open Object Rexx and Regina Rexx?
Which one do you like better?

RE: Running REXX on a PC

(OP)
Not yet. I'm right now deciphering the differences between mainframe REXX and littlebox REXX so that I'll know which techniques work (or not).

Frank Clarke
--America's source for adverse opinions since 1943.

RE: Running REXX on a PC

(OP)
Is there a way to clear the screen/command window ?

Frank Clarke
--America's source for adverse opinions since 1943.

RE: Running REXX on a PC

If you are on windows you can use windows system command CLS (CLear Screen)

CODE

say "press ENTER to clear the screen"
parse pull
cls 

RE: Running REXX on a PC

(OP)
Will REXX want that quoted ("CLS") ?

Frank Clarke
--America's source for adverse opinions since 1943.

RE: Running REXX on a PC

one-word commands work unquoted or quoted, you can use CLS or "CLS"
but if the command consists of more words then you need to use quoted, e.g.: "DIR C:\TEMP"

RE: Running REXX on a PC

(OP)
Any examples of "command output to stack" you might like to share? Specifically, I'm looking to "DIR" onto the stack and pull each line separately.

Frank Clarke
--America's source for adverse opinions since 1943.

RE: Running REXX on a PC

You can pipe the command output from STDIN to RXQUEUE and then process the queue.
Queue organization could be FIFO or LIFO, default seems to be FIFO.
The following example works in ooRexx and Regina on Windows:

cmd2queue_Win.rex

CODE

my_cmd = "DIR * /B"

my_cmd_queue = my_cmd "| rxqueue"
call execute_command_and_get_output

-- FIFO
my_cmd_queue = my_cmd "| rxqueue /FIFO"
call execute_command_and_get_output

-- LIFO
my_cmd_queue = my_cmd "| rxqueue /LIFO"
call execute_command_and_get_output
exit

---------------------------------------
execute_command_and_get_output:
  say "Command to Execute: "
  say " " my_cmd_queue
  my_cmd_queue
  say "Command Output:"
  do i=1 while queued() \= 0
    parse pull line
    say " " right(i,2,0) || ". " || line
  end
  say
return 

RE: Running REXX on a PC

(OP)
F:\REXX\ooREXXcode>pipecmd
Command to Execute:
  DIR * /B | rxqueue
Command Output:

Command to Execute:
  DIR * /B | rxqueue /FIFO
Error:94.108 - Invalid switch passed. Must be one of "/fifo, /lifo, /clear, /queued, /pull, /list"
Command Output:

Command to Execute:
  DIR * /B | rxqueue /LIFO
Error:94.108 - Invalid switch passed. Must be one of "/fifo, /lifo, /clear, /queued, /pull, /list"
Command Output:


F:\REXX\ooREXXcode>
 
...so I changed the switches to lower case and...

F:\REXX\ooREXXcode>pipecmd
Command to Execute:
  DIR * /B | rxqueue
Command Output:

Command to Execute:
  DIR * /B | rxqueue /fifo
Command Output:

Command to Execute:
  DIR * /B | rxqueue /lifo
Command Output:

F:\REXX\ooREXXcode>
 

...which says that it recognizes "RXQUEUE", but it doesn't work.

I'm also surprised to discover that "--" marks a line as a comment.

Frank Clarke
--America's source for adverse opinions since 1943.

RE: Running REXX on a PC

Before I posted the example above I tested it and it worked for me with both ooRexx and Regina.
REXX recognized as comments /* */ or --

RE: Running REXX on a PC

I got it !
It's installation problem. When you installed ooRexx and Regina both have its own RXQUEUE.EXE

If ooRexx finds first the rxqueue of Regina, then I get this error

CODE

Command to Execute:
  DIR * /B | rxqueue
Error:94.101 - Error connecting to 127.0.0.1 on port 5757: "No error"
Command Output:

Command to Execute:
  DIR * /B | rxqueue /FIFO
Error:94.108 - Invalid switch passed. Must be one of "/fifo, /lifo, /clear, /queued, /pull, /list"
Command Output:

Command to Execute:
  DIR * /B | rxqueue /LIFO
Error:94.108 - Invalid switch passed. Must be one of "/fifo, /lifo, /clear, /queued, /pull, /list"
Command Output: 

I have the luck that I installed ooRexx before Regina and I have in the PATH first ooREXX, like this
PATH=...;C:\Program Files\ooRexx;C:\Program Files\rexx.org\Regina;.... 
so ooRexx finds the right rxqueue.

I tried out that ooRexx does not work with rxqueue of Regina, but Regina works with rxqueue of ooRexx

You probably installed first Regina and then ooRexx, so ooRexx finds the rxqueue.exe of Regina.

Solution would be one of these:
1) Rearange your PATH so that ooRexx comes before Regina, like I have, i.e.:
PATH=...;C:\Program Files\ooRexx;C:\Program Files\rexx.org\Regina;.... 

2) Copy rxqueue.exe of ooRexx (i.e. the file c:\Program Files\ooRexx\rxqueue.exe ) into your working directory where you run your ooRexx scripts

3) Remove Regina installation

RE: Running REXX on a PC

(OP)
I chose option#2, copying RXQUEUE.EXE of ooREXX into my working directory and that worked; thank you very much.

Oddly, when I did a search at C:\ for 'rxqueue', it wasn't found, but searching in C:\Program Files revealed the Regina RXQUEUE, and searching in C:\Program Files (x86) found the ooREXX RXQUEUE.

I hate PCs.

Frank Clarke
--America's source for adverse opinions since 1943.

RE: Running REXX on a PC

> I hate PCs
Do you no longer have access to the mainframe if you are now dealing with REXX on the PCs?

RE: Running REXX on a PC

(OP)
Mikrom, contact me via my blog: REXXpertise

Frank Clarke
--America's source for adverse opinions since 1943.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close