MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Concatenation error in REXX

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
me_naveen
Beginner


Joined: 21 Dec 2007
Posts: 23
Topics: 12

PostPosted: Thu May 05, 2011 7:59 am    Post subject: Concatenation error in REXX Reply with quote

Hi,

I'm getting below error in REXX.

4 +++ LINEDATA = SUBSTR(LINE1 ,1 ,6) |
IRX0013I Error running REXX99, line 4: Invalid character in program


Sample Code:
Code:

/* REXX */                                                             
LINE1 =12345611
LINE2 =98765422
LINEDATA = SUBSTR(LINE1 ,1 ,6) || '*' || SUBSTR(LINE2 ,1 ,6)     
SAY LINEDATA


Could you please suggest , what is the error in line number 4.
I am unable to concatenate.

Thanks,
Naveen
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Thu May 05, 2011 8:22 am    Post subject: Reply with quote

Works for me.

Is your concatention symbol (|) coded as a hex '4F'?
Back to top
View user's profile Send private message
taltyman
JCL Forum Moderator
JCL Forum Moderator


Joined: 02 Dec 2002
Posts: 310
Topics: 8
Location: Texas

PostPosted: Thu May 05, 2011 8:36 am    Post subject: Reply with quote

Code:

LINEDATA = SUBSTR(LINE1 ,1 ,6) || '*' || SUBSTR(LINE2 ,1 ,6)
appears to have spaces after line1 and line2
Back to top
View user's profile Send private message
stefan
Beginner


Joined: 20 Nov 2003
Posts: 41
Topics: 2
Location: Germany

PostPosted: Thu May 05, 2011 9:03 am    Post subject: Re: Concatenation error in REXX Reply with quote

me_naveen wrote:
4 +++ LINEDATA = SUBSTR(LINE1 ,1 ,6) |
IRX0013I Error running REXX99, line 4: Invalid character in program [/i]

On my machine the concatenation operator x'4F' is represented by a ! (an exclamation point).
Give it a try
_________________
Stefan
There are 10 types of people in the world: Those who understand binary, and those who don't.
Back to top
View user's profile Send private message
stefan
Beginner


Joined: 20 Nov 2003
Posts: 41
Topics: 2
Location: Germany

PostPosted: Thu May 05, 2011 9:07 am    Post subject: Reply with quote

taltyman wrote:
Code:
LINEDATA = SUBSTR(LINE1 ,1 ,6) || '*' || SUBSTR(LINE2 ,1 ,6) 
appears to have spaces after line1 and line2

This should not make any difference.
Code:
substr(a,2,3)
substr(a  ,2  ,3  )
substr(  a  ,  2  ,  3  )

all give the same results
_________________
Stefan
There are 10 types of people in the world: Those who understand binary, and those who don't.
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Thu May 05, 2011 11:38 am    Post subject: Reply with quote

stefan wrote:
taltyman wrote:
Code:
LINEDATA = SUBSTR(LINE1 ,1 ,6) || '*' || SUBSTR(LINE2 ,1 ,6) 
appears to have spaces after line1 and line2

This should not make any difference.
Code:
substr(a,2,3)
substr(a  ,2  ,3  )
substr(  a  ,  2  ,  3  )

all give the same results


I had an issue with spaces earlier and that was if you have spcaes between 'substr' and '('. As already pointed out by others, the spaces within '(' and ')' doesn't make difference.
_________________
Regards,
Diba
Back to top
View user's profile Send private message Send e-mail
taltyman
JCL Forum Moderator
JCL Forum Moderator


Joined: 02 Dec 2002
Posts: 310
Topics: 8
Location: Texas

PostPosted: Mon May 09, 2011 8:10 am    Post subject: Reply with quote

As others have said, turn HEX on and look at your line of code to verify your vertical bar character is correct.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group