INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

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.

Jobs

Loop Control Variable Not Working

Loop Control Variable Not Working

(OP)
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:


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


And say, if the user puts in 2, outputs:

2
4
6


as expected.

But when I load the same file onto the mainframe and run it under NetView, it's reaches the line that says SAY array.i and complains "Invalid character in program." 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?

RE: Loop Control Variable Not Working

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

RE: Loop Control Variable Not Working

(OP)
Yes, I did remember to include the /* REXX */ 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.

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!

Resources

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