Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loop Control Variable Not Working

Status
Not open for further replies.

djmordigal

Technical User
Jun 22, 2015
2
US
Hello all,
I'm new to this forum, so forgive me if this question has already been asked or if I'm not posting in the right place.

I'm a student on co-op, and new to the REXX language, so I'm experimenting with some different things. One of these things is arrays.

On my computer, I have a REXX interpreter that runs the following code just fine:

[tt]
SAY "Enter a value"; PULL value;
array.1 = value;
array.2 = value*2;
array.3 = value*3;
DO i=1 TO 3
SAY array.i;
END
[/tt]

And say, if the user puts in 2, outputs:
[tt]
2
4
6
[/tt]

as expected.

But when I load the same file onto the mainframe and run it under NetView, it's reaches the line that says [tt]SAY array.i[/tt] and complains [tt]"Invalid character in program."[/tt] I'm thinking it's an issue with different versions of the REXX interpreter on my computer vs. the mainframe I'm running it on?

Has anyone else encountered this issue or know of ways to get around it/other ways to treat an array in REXX?
 
Also note: Rexx does not have 'arrays'. They look like arrays but the correct terminology is 'stem variable' with a stem and a tail. I heve never tried running under netview - what happens when you run it from a tso session. Note that you need a comment with 'Rexx' somewhere in it as the first line when running on the mainframe.


Nic
 
Yes, I did remember to include the [tt]/* REXX */[/tt] comment. I also fixed the issue this morning. Turns out that it didn't like the tab character at the beginning of that line. I'm using a Windows-based text editor and transferring that file to the mainframe via FTP, so it got encoded differently.

I've since changed the settings in my text editor so that when I hit the TAB key it just inserts 4 individual spaces. Works fine now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top