migrating mainframe z/VM Rexx to linux ooRexx

  • Follow


I need to migrate a few hundred Rexxes that were written under
mainframe z/VM to run under ooRexx/Linux. Its clear I need to create
all sorts of utilitlies to replace CMS commands, but I was wondering if
anyone has experience with syntax problems within the Rexx itself?

0
Reply unikoski (14) 8/29/2006 9:13:31 AM

In <1156842811.180247.68800@m73g2000cwd.googlegroups.com>, on
08/29/2006
   at 02:13 AM, unikoski@yahoo.com said:

>I need to migrate a few hundred Rexxes that were written under
>mainframe z/VM to run under ooRexx/Linux. Its clear I need to create
>all sorts of utilitlies to replace CMS commands, but I was wondering
>if anyone has experience with syntax problems within the Rexx
>itself?

It used to be that CMS REXX interpreted code line by line instead of
first compiling to an internal form. The result was that you could run
a REXX program with syntax errors as long as you never actually
executed the bad code. If that is still the case then you will get
error messages from OREXX when running such programs, because it
compiles the entire program into an internal form before executing it.

-- 
Shmuel (Seymour J.) Metz, SysProg and JOAT  <http://patriot.net/~shmuel>

Unsolicited bulk E-mail subject to legal action.  I reserve the
right to publicly post or ridicule any abusive E-mail.  Reply to
domain Patriot dot net user shmuel+news to contact me.  Do not
reply to spamtrap@library.lspace.org

0
Reply Shmuel 8/29/2006 12:38:17 PM


unikoski@yahoo.com wrote:
> I need to migrate a few hundred Rexxes that were written under
> mainframe z/VM to run under ooRexx/Linux. Its clear I need to create
> all sorts of utilitlies to replace CMS commands, but I was wondering if
> anyone has experience with syntax problems within the Rexx itself?

The classic REXX syntax is fully supported by ooRexx. Unless the CMS 
execs have syntax errors in them, the REXX itself will be just fine. 
Pretty much all the builtin (i.e. standard) functions available under 
CMS are available in ooRexx, but as with commands, there are some system 
dependant functions which may well have been used.

Missing functions and commands can be written in REXX, to either perform 
equivalent tasks, or do nothing if that's acceptable. Two things which 
could bite you good and hard are the PIPE command and DIAG (or DIAGRC) 
function.

Your best bet is to pick the biggest and work your way through it. By 
the time you're done with that, the smaller ones should be easier.

Graham.
0
Reply Graham 8/30/2006 1:44:22 AM

in 34700 20060830 024422 Graham <norrisg@spam_free.linkline.com> wrote:

>Missing functions and commands can be written in REXX, to either perform
>equivalent tasks, or do nothing if that's acceptable. Two things which
>could bite you good and hard are the PIPE command and DIAG (or DIAGRC)
>function.

I was recently forced into a situation where I had to write/convert and test Rexx code intended
for CMS on an OS/2 machine.  Pipe wasn't a problem (code was for IBM so I was able
to use the OS2PIPE package) and DIAG was never required, but what gave me endless
problems was EXECIO - every instance had to be completely rewritten.
0
Reply Bob 8/30/2006 8:25:35 AM

Bob Martin wrote:
> in 34700 20060830 024422 Graham <norrisg@spam_free.linkline.com> wrote:
> 
>> Missing functions and commands can be written in REXX, to either perform
>> equivalent tasks, or do nothing if that's acceptable. Two things which
>> could bite you good and hard are the PIPE command and DIAG (or DIAGRC)
>> function.
> 
> I was recently forced into a situation where I had to write/convert and test Rexx code intended
> for CMS on an OS/2 machine.  Pipe wasn't a problem (code was for IBM so I was able
> to use the OS2PIPE package) and DIAG was never required, but what gave me endless
> problems was EXECIO - every instance had to be completely rewritten.

Unfortunately I don't think there is an equivalent of PIPE or OS2PIPE 
for Linux (or Windows). If there is, I'd like to know where it can be found.

As for EXECIO, and without knowing your problems, if it was coded with 
file descriptions on the EXECIO commands instead of using variables, I 
could see it causing every one to need changing. Other than that, many 
uses of EXECIO should work without change: it depends what options were 
used of course.

The most difficult to convert *to* in my experience is TSO/E, because it 
has failed to keep up and is missing things like STREAM. (And conversely 
a pain to convert *from* due to record sequence numbers.)

Graham.
0
Reply Graham 8/30/2006 2:48:10 PM

in 34705 20060830 154810 Graham <norrisg@spam_free.linkline.com> wrote:

>As for EXECIO, and without knowing your problems, if it was coded with
>file descriptions on the EXECIO commands instead of using variables, I
>could see it causing every one to need changing. Other than that, many
>uses of EXECIO should work without change: it depends what options were
>used of course.

Graham, are you saying that there is an EXECIO for OS/2?
0
Reply Bob 8/30/2006 5:53:06 PM

> I need to migrate a few hundred Rexxes that were written under
> mainframe z/VM to run under ooRexx/Linux. Its clear I need to create
> all sorts of utilitlies to replace CMS commands, but I was wondering if
> anyone has experience with syntax problems within the Rexx itself?

I have been though exactly such a process, albeit with an intermediary 
stage of OS/2

The most obvious syntactical difference was the loss of the "not" symbol 
when moving from the mainframe to OS/2 or Linux. Here is one: � although 
I'm not sure if it will survive in ASCII-land.

You get used to:
If a <> 0 then say 'A is not zero' /* -- or -- */
If \boolean then say "boolean is false"

One thing that I really liked about migrating from Classic Rexx on the 
mainframe to Object Rexx under Linux was the gain of certain abilities:

String = changestr('&',string,'&amp;') /* convert "&" to "&amp;" */

Do I over stem.	/* Show all values defined in stem. */
   Say 'Tail='i 'Value='stem.i
   End

Funnily enough, I discovered the second of the two examples above on 
exactly the same day that I'd spent wondering what values within the 
sqlca. stem might get set when an SQL error occurred.

-- 
Steve Swift
http://www.ringers.org.uk
0
Reply Steve 8/30/2006 6:39:03 PM

Bob Martin wrote:
> in 34705 20060830 154810 Graham <norrisg@spam_free.linkline.com> wrote:
> 
>> As for EXECIO, and without knowing your problems, if it was coded with
>> file descriptions on the EXECIO commands instead of using variables, I
>> could see it causing every one to need changing. Other than that, many
>> uses of EXECIO should work without change: it depends what options were
>> used of course.
> 
> Graham, are you saying that there is an EXECIO for OS/2?

The topic at hand is a port from VM to Linux. I'm not saying anything 
about OS/2!

Graham.
0
Reply Graham 8/31/2006 2:05:40 AM

| Graham wrote:
|> Bob Martin wrote:
|>> Graham wrote:
|>> As for EXECIO, and without knowing your problems, if it was coded with
|>> file descriptions on the EXECIO commands instead of using variables, I
|>> could see it causing every one to need changing. Other than that, many
|>> uses of EXECIO should work without change: it depends what options were
|>> used of course.

|> Graham, are you saying that there is an EXECIO for OS/2?
|
| The topic at hand is a port from VM to Linux. I'm not saying anything
| about OS/2!

PC/REXX (for under OS/2) does have a more-or-less full EXECIO that works
with REXX.  I'm not sure, but I don't think it's marketed anymore, but
don't know for sure. ___________________________________________Gerard S.

 


0
Reply Gerard 8/31/2006 2:40:45 AM

in 34709 20060831 030540 Graham <norrisg@spam_free.linkline.com> wrote:
>Bob Martin wrote:
>> in 34705 20060830 154810 Graham <norrisg@spam_free.linkline.com> wrote:
>>
>>> As for EXECIO, and without knowing your problems, if it was coded with
>>> file descriptions on the EXECIO commands instead of using variables, I
>>> could see it causing every one to need changing. Other than that, many
>>> uses of EXECIO should work without change: it depends what options were
>>> used of course.
>>
>> Graham, are you saying that there is an EXECIO for OS/2?
>
>The topic at hand is a port from VM to Linux. I'm not saying anything
>about OS/2!

OK, but you replied to my experience of porting Rexx from CMS to OS/2.
So, is there an EXECIO for Linux ?  ;-)
0
Reply Bob 8/31/2006 7:57:22 AM

Graham wrote:
> Bob Martin wrote:
> > in 34700 20060830 024422 Graham <norrisg@spam_free.linkline.com> wrote:
> >
> >> Missing functions and commands can be written in REXX, to either perform
> >> equivalent tasks, or do nothing if that's acceptable. Two things which
> >> could bite you good and hard are the PIPE command and DIAG (or DIAGRC)
> >> function.
> >
> > I was recently forced into a situation where I had to write/convert and test Rexx code intended
> > for CMS on an OS/2 machine.  Pipe wasn't a problem (code was for IBM so I was able
> > to use the OS2PIPE package) and DIAG was never required, but what gave me endless
> > problems was EXECIO - every instance had to be completely rewritten.
>
> Unfortunately I don't think there is an equivalent of PIPE or OS2PIPE
> for Linux (or Windows). If there is, I'd like to know where it can be found.
>
> As for EXECIO, and without knowing your problems, if it was coded with
> file descriptions on the EXECIO commands instead of using variables, I
> could see it causing every one to need changing. Other than that, many
> uses of EXECIO should work without change: it depends what options were
> used of course.
>
> The most difficult to convert *to* in my experience is TSO/E, because it
> has failed to keep up and is missing things like STREAM. (And conversely
> a pain to convert *from* due to record sequence numbers.)
>
> Graham.

Graham,

For stream I/O on z/OS see:
http://www-1.ibm.com/support/docview.wss?rs=203&q=rexx+REXX+Stream&uid=swg24001170&loc=en_US&cs=utf-8&lang=en+en

Best regards,
Steve

0
Reply google 8/31/2006 4:39:51 PM

Bob Martin wrote:
> OK, but you replied to my experience of porting Rexx from CMS to OS/2.
> So, is there an EXECIO for Linux ?  ;-)

Good, question! I was kind of assuming there was, but I appear to be 
wrong. Unfortunately, due to the fact it can read or set variables, it 
isn't any easy program to substitute.

I may have been thinking of Personal REXX, which does.

Graham.
0
Reply Graham 9/1/2006 2:02:11 AM

Graham wrote:
> Bob Martin wrote:
> > OK, but you replied to my experience of porting Rexx from CMS to OS/2.
> > So, is there an EXECIO for Linux ?  ;-)
>
> Good, question! I was kind of assuming there was, but I appear to be
> wrong. Unfortunately, due to the fact it can read or set variables, it
> isn't any easy program to substitute.
>
> I may have been thinking of Personal REXX, which does.

I'd be thrilled just to have the MVS implementtion of EXECIO, to be
able to read or write a file from a stem in one instruction.

Mickey

0
Reply Mickey 9/1/2006 2:17:49 PM

Steve Swift wrote:
> > I need to migrate a few hundred Rexxes that were written under
> > mainframe z/VM to run under ooRexx/Linux. Its clear I need to create
> > all sorts of utilitlies to replace CMS commands, but I was wondering if
> > anyone has experience with syntax problems within the Rexx itself?
>
> I have been though exactly such a process, albeit with an intermediary
> stage of OS/2
>
> The most obvious syntactical difference was the loss of the "not" symbol
> when moving from the mainframe to OS/2 or Linux. Here is one: =AC although
> I'm not sure if it will survive in ASCII-land.
>
> You get used to:
> If a <> 0 then say 'A is not zero' /* -- or -- */
> If \boolean then say "boolean is false"
>
> One thing that I really liked about migrating from Classic Rexx on the
> mainframe to Object Rexx under Linux was the gain of certain abilities:
>
> String =3D changestr('&',string,'&amp;') /* convert "&" to "&amp;" */

This ability has existed in Rexx for as long as I can recall, via the
OVERLAY command.

>
> Do I over stem.	/* Show all values defined in stem. */
>    Say 'Tail=3D'i 'Value=3D'stem.i
>    End

This is a nice feature.

Mickey

>
> Funnily enough, I discovered the second of the two examples above on
> exactly the same day that I'd spent wondering what values within the
> sqlca. stem might get set when an SQL error occurred.

0
Reply Mickey 9/1/2006 2:20:10 PM

In Message-ID:<CDwJg.2488$wo3.2136@newsfe7-gui.ntli.net>,
Bob Martin <bob.martin@excite.com> wrote: 

>OK, but you replied to my experience of porting Rexx from CMS to OS/2.
>So, is there an EXECIO for Linux ?  ;-)

     If you're not limited to ooREXX, Regina runs on Linux.  There
is an add-on package (also ported to Linux, I think) called
Regutil.  Regutil has a functions similar to EXECIO called
RegStemRead and RegStemWrite.

7.9 RegStemRead

RegStemRead(filename, stem)

RegStemRead reads the contents of file filename into stem stem
using the numeric index convention (number of lines in the 0
element, data in numbered elements starting at 1). When possible,
it uses memory-mapped I/O to read the values, which should be the
most efficient method possible. As a result, RegStemRead is
expected to be measurably faster than, eg, using linein, as well
as being more convenient.

     Regina Home Page at: http://regina-rexx.sourceforge.net

     Google for Regutil.  It is written by Patrick TJ McPhee, and
that should help your Googling.

-- 
Arthur T. - ar23hur "at" intergate "dot" com
Looking for a good MVS systems programmer position
0
Reply Arthur 9/2/2006 2:11:28 AM

Hi,

somewhat slower bug not really slow if the ANSI address feature.
Just use

ADDRESS PATH "cat" "file_of_desire" WITH OUTPUT STEM stem.

Works well, even input and error are redirectable to and
from REXX source, and you have one action with the complete
redirection in just one line.

But you need Regina, too. ooRexx still misses ADDRESS WITH,
doesn't it?

Cheers, Florian


Arthur T. schrieb:
>      If you're not limited to ooREXX, Regina runs on Linux.  There
> is an add-on package (also ported to Linux, I think) called
> Regutil.  Regutil has a functions similar to EXECIO called
> RegStemRead and RegStemWrite.
> 
> 7.9 RegStemRead
> 
> RegStemRead(filename, stem)
> 
> RegStemRead reads the contents of file filename into stem stem
> using the numeric index convention (number of lines in the 0
> element, data in numbered elements starting at 1). When possible,
> it uses memory-mapped I/O to read the values, which should be the
> most efficient method possible. As a result, RegStemRead is
> expected to be measurably faster than, eg, using linein, as well
> as being more convenient.
> 
>      Regina Home Page at: http://regina-rexx.sourceforge.net
> 
>      Google for Regutil.  It is written by Patrick TJ McPhee, and
> that should help your Googling.
> 
0
Reply ISO 9/3/2006 6:22:11 AM

> I'd be thrilled just to have the MVS implementtion of EXECIO, to be
> able to read or write a file from a stem in one instruction.

This isn't a difficult process to emulate on systems where you can use 
charin() to read an entire file in one call (OS/2, Windows, Linux, etc).

I use the mechanism frequently to improve the performance of my CGI 
scripts. They run faster with Rexx deblocking the data into lines than 
multiple calls to linein().

Here is a working sample, it can be optimised with some knowledge about 
the lines of data:

Le = '0A'x 		/* Set to system linend '0D0A'x for OS2,Win*/
File = 'my.dat'
Length = stream(file,'c','query size')
Data = charin(file,1,length)
Call stream file,'c','close'
I = 1
N = 0
Do until I = length(le)
   N = N + 1
   Parse value substr(data,i) with Line.n (le)
   I = pos(le,data,i+1)
   End

Of course, if your intention is just to loop through the lines, you can 
do it inside that "Do until"

-- 
Steve Swift
http://www.ringers.org.uk
0
Reply Steve 9/5/2006 6:04:02 AM

>> String = changestr('&',string,'&amp;') /* convert "&" to "&amp;" */
> 
> This ability has existed in Rexx for as long as I can recall, via the
> OVERLAY command.

Well, retaining my original example, you'd have a tough time OVERLAYing 
'&amp;' where you found "&" in "Bill&Ben"

For UK readers, I'm showing my age using "Bill&Ben" :-)

-- 
Steve Swift
http://www.ringers.org.uk
0
Reply Steve 9/5/2006 6:08:44 AM

in 34728 20060905 070844 Steve Swift <Steve.J.Swift@gmail.com> wrote:
>>> String = changestr('&',string,'&amp;') /* convert "&" to "&amp;" */
>>
>> This ability has existed in Rexx for as long as I can recall, via the
>> OVERLAY command.
>
>Well, retaining my original example, you'd have a tough time OVERLAYing
>'&amp;' where you found "&" in "Bill&Ben"
>
>For UK readers, I'm showing my age using "Bill&Ben" :-)
>
>--
>Steve Swift
>http://www.ringers.org.uk

I dunno - "2.4 Children" wasn't that long ago  ;-)
0
Reply Bob 9/5/2006 8:05:36 AM

On Tue, 05 Sep 2006 07:04:02 +0100, Steve Swift
<Steve.J.Swift@gmail.com> wrote:

>> I'd be thrilled just to have the MVS implementtion of EXECIO, to be
>> able to read or write a file from a stem in one instruction.
>
>This isn't a difficult process to emulate on systems where you can use 
>charin() to read an entire file in one call (OS/2, Windows, Linux, etc).
>
>I use the mechanism frequently to improve the performance of my CGI 
>scripts. They run faster with Rexx deblocking the data into lines than 
>multiple calls to linein().
>
>Here is a working sample, it can be optimised with some knowledge about 
>the lines of data:
>
>Le = '0A'x 		/* Set to system linend '0D0A'x for OS2,Win*/
>File = 'my.dat'
>Length = stream(file,'c','query size')
>Data = charin(file,1,length)
>Call stream file,'c','close'
>I = 1
>N = 0
>Do until I = length(le)
>   N = N + 1
>   Parse value substr(data,i) with Line.n (le)
>   I = pos(le,data,i+1)
>   End
>
>Of course, if your intention is just to loop through the lines, you can 
>do it inside that "Do until"

Steve,
Here's a sample i/o script that more than proves your point.  The file
involved has 52268 lines as is 9,734,400 bytes.  In the comments at
the end is the results of running this script.  charin is by far the
hands down winner.

Lee


/* test_stream_input.rex */

    call SysCls
    infile = '.\abigfile.txt'

-- Test time to load using arrayin
    call time('r')
    say 'Load using arrayin'
    istream = .stream~new(infile)
    iarray = istream~arrayin
    say time('e') 'Seconds'
    say iarray~items
    istream~close
    drop iarray
    say

-- Test time to load using linein
    call time('r')
    say 'Load using linein'
    istream = .stream~new(infile)
    iarray = .array~new
    do while istream~lines > 0
        iarray[iarray~items + 1] = istream~linein
    end
    say time('e') 'Seconds'
    say iarray~items
    istream~close
    drop iarray
    say

-- Test time to load using charin~makearray
    call time('r')
    say 'Load using charin~makearray'
    istream = .stream~new(infile)
    iarray = istream~charin(,istream~chars)~makearray
    say time('e') 'Seconds'
    say iarray~items
    istream~close
    drop iarray

/*
Results:

Load using arrayin
43.672000 Seconds
52268

Load using linein
11.000000 Seconds
52268

Load using charin~makearray
0.062000 Seconds
52268

*/

0
Reply Lee 9/5/2006 11:41:25 AM

In article <jcoqf2tsjscqm6gcut8kajvf0cg5rccv39@4ax.com>, 
lpeedinDONOTSPAME@nc.rr.com says...
> Steve,
> Here's a sample i/o script that more than proves your point.  The file
> involved has 52268 lines as is 9,734,400 bytes.  In the comments at
> the end is the results of running this script.  charin is by far the
> hands down winner.
> 

Hi Lee,

How about filesystem caching messing up the results when running it this 
way? 

Gert
0
Reply Gert 9/5/2006 12:52:38 PM

20 Replies
427 Views

(page loaded in 0.244 seconds)

Similiar Articles:


















7/23/2012 12:40:15 PM


Reply: