Page 1 of 2

Rexx Code continution on next line..

PostPosted: Sat Feb 04, 2012 5:48 am
by shiva7582
Hi Friends,
Can any one knows, which character can be used to continue the code in REXX langueage ....

Code:
000106 IF SUBSTR(DATA,6,3) = 'G1I' | SUBSTR(DATA,6,3) = 'G2I'
000107 SUBSTR(DATA,6,3) = 'GEE' | SUBSTR(DATA,6,4) = 'G1BV'
000108 SUBSTR(DATA,6,4) = 'G1YZ' THEN

here I want use 5 'substr' function in IF condition....

Please advice me.....

Re: Rexx Code continution on next line..

PostPosted: Sat Feb 04, 2012 6:19 am
by Pedro
Use a comma.

Re: Rexx Code continution on next line..

PostPosted: Sat Feb 04, 2012 1:45 pm
by NicC
Why not usde the manual? It is there to be used. All you had to do was look in the index for 'continuation'. That would have been much quicker than posting on the forum because not only would you need to type out your question, but before doing that, you would have had to search to see if the question had been raised before.

Re: Rexx Code continution on next line..

PostPosted: Sat Feb 04, 2012 1:52 pm
by enrico-sorichetti
when asking these questions, usually the TS does not give a sith about researching,
he/she just hopes that some dummy ;) will reply with the right suggestions.

yep, even us sometimes suffer from a bit of laziness...
faster to write use a frigging comma than go thru the bookmarks and post the link to the manuals
and after posting a link somebody will certainly complain that the manual is not for the zOS version they use BTSTGTTS :geek:

... and googling for REXX CONTINUATION gave back only 213000 links

Re: Rexx Code continution on next line..

PostPosted: Sat Feb 04, 2012 1:55 pm
by NicC
I rarely use the links - download a manual when I need it. Of course, I then need to keep it current! And I have loads of manuals that I have not read yet - most of the ABCs

Re: Rexx Code continution on next line..

PostPosted: Sat Feb 04, 2012 10:42 pm
by shiva7582
Thanks Pedro....

Enrico,
Thanks for your remarks....... But I posted this quistion after reading the manual and i found also comma can be used for continuation of line...but it did not work and out put file showing empty....
Then I thought to find any other alternative for this....
Any way thanks to all for reply
.....
I think all my POSTs are frustrating Enrico....
Shivaji Patil

Re: Rexx Code continution on next line..

PostPosted: Sat Feb 04, 2012 10:54 pm
by enrico-sorichetti
... but it did not work and out put file showing empty....


please be more specific ...
the only situation where continuation is a bit murky is when concatenating strings using abuttal
REXX will always insert a blank when concatenating the variables in the continuation lines

Re: Rexx Code continution on next line..

PostPosted: Sat Feb 04, 2012 11:10 pm
by shiva7582
******************************************************************
IF SUBSTR(DATA,6,3) = 'GEE' | SUBSTR(DATA,6,3) = 'G2I' ,
SUBSTR(DATA,6,3) = 'G1I' | SUBSTR(DATA,6,4) = 'G1BV' ,
SUBSTR(DATA,6,4) = 'G1YZ' THEN
SIGNAL AGECAL
*****************************************************************
This is the part of the rexx programe... where I want to check logonids which starts with GEE,G2I,G1I,G1bV & G1YZ characters...
When I use IF SUBSTR(DATA,6,3) = 'G1I' as first condition... I could find the logonids starts with G1I****, But for same check (IF SUBSTR(DATA,6,3) = 'G1I' ) if I use in next line.... I'm getting the empty result.

Re: Rexx Code continution on next line..

PostPosted: Sat Feb 04, 2012 11:55 pm
by BillyBoyo
IF SUBSTR(DATA,6,3) = 'GEE' | SUBSTR(DATA,6,3) = 'G2I' SUBSTR(DATA,6,3) = 'G1I' | SUBSTR(DATA,6,4) = 'G1BV' SUBSTR(DATA,6,4) = 'G1YZ' THEN                       
SIGNAL AGECAL                                           


If you forget about the continuations for the moment, take them out and you should get some idea about what is not working as an "if". Then fix, put them back in.

There are various way to make that code neater, mor understandable and more difficult to get wrong.

Edit: Running the code the Trace is always a good idea when you don't get what is happening. I think the "IF" would look very interesting in the Trace...

Re: Rexx Code continution on next line..

PostPosted: Sun Feb 05, 2012 12:44 am
by enrico-sorichetti
IF SUBSTR(DATA,6,3) = 'GEE' | SUBSTR(DATA,6,3) = 'G2I' ,
SUBSTR(DATA,6,3) = 'G1I' | SUBSTR(DATA,6,4) = 'G1BV' ,


if the code is as posted no wonder that it does not work ...
You forgot the logical OR | before/after the continuation