Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Concatenatin of a String and Number using Rexx

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
kaos

New User


Joined: 24 Apr 2007
Posts: 9
Location: Bangalore

PostPosted: Thu May 03, 2007 12:57 pm    Post subject: Concatenatin of a String and Number using Rexx
Reply with quote

Hi,

I want to concatenate a String with a Number. If I use the concatenation operator "!!", its not working. It only works for two strings.

/* TO THROW THE TABLE NAMES TO THE PANNEL */
I = 1
DO UNTIL I > TBCNT
T!!I = TBLST.I
I = I + 1
END
/*-------------*/

Can anyone please help me out with this??
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10231
Location: italy

PostPosted: Thu May 03, 2007 1:35 pm    Post subject: Re: Concatenatin of a String and Number using Rexx
Reply with quote

You cannot have an expression on the left side of an assignment,
for a variable vartiable-name You must use the "interpret" instruction


sample code ( generic )
Code:

do i = 1 to 5
   nam = "var" || i
   interpret nam " = i"
end


your code ( maybe )

Code:

DO UNTIL I > TBCNT
varname = "t" !! i
interpret varname " = tblst.i"
I = I + 1
END



regards

e.s
Back to top
View user's profile Send private message
kaos

New User


Joined: 24 Apr 2007
Posts: 9
Location: Bangalore

PostPosted: Thu May 03, 2007 2:03 pm    Post subject: Re: Concatenatin of a String and Number using Rexx
Reply with quote

thnx for tht...
thts not working actually as per my reqmnt...
hmmm.. what i want is...
There is a list of Type(OUTPUT) variables declared in the Panel
Ex: T1, T2, T3..... Tn

Now i have the list of table names in an array TBLST.I ( i = 1 to m) n I have to display these table name into the pannel...
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10231
Location: italy

PostPosted: Thu May 03, 2007 2:51 pm    Post subject: Re: Concatenatin of a String and Number using Rexx
Reply with quote

You got exactly what You asked for...

assign to some variable named t1, t2,......,tn the content of a stemmed variable tblst.1 tblst.2,.........,tblst.n

code snippet with a WORKING test I just run
Code:

say "filling the t. array"
do i = 1 to 5
   tvar.i = i
end

say "assignigning to the composite var"
do i = 1 to 5
   tnam = "var" || i
   interpret tnam " = tvar.i"
end

say "var1" var1
say "var2" var2
say "var3" var3
say "var4" var4
say "var5" var5



if this is not what You asked, please state more clearly,
the code snippet does exactly what You asked in both posts

regards

e.s

P.S.
on the MF substitute the "||" with "!!"
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu May 03, 2007 3:13 pm    Post subject:
Reply with quote

Quote:
on the MF substitute the "||" with "!!"

Depends on the settings, I have to use !! instead of the standard .... which I can't type here because it ain't on my keyboard icon_confused.gif
Back to top
View user's profile Send private message
kaos

New User


Joined: 24 Apr 2007
Posts: 9
Location: Bangalore

PostPosted: Thu May 03, 2007 3:21 pm    Post subject: Re: Concatenatin of a String and Number using Rexx
Reply with quote

thnx enrico and expat....
I had to replace "!!" with "||"...
In one of the manuals it was given as:-

"The following concatenation operators are supported by REXX.
Operator Operation
blank: Concatenate two strings with a blank character
in between.
!! : Concatenate two strings without a blank character in between."


Its workin fine.. exactly the way i wanted it to...
Thnx again...
Back to top
View user's profile Send private message
kaos

New User


Joined: 24 Apr 2007
Posts: 9
Location: Bangalore

PostPosted: Thu May 03, 2007 6:01 pm    Post subject: Re: Concatenatin of a String and Number using Rexx
Reply with quote

The INTERPRET Instruction is really heping a lot.. caz most of the places i have to code in similar way.. to display tables n cols n more tabs n cols again... icon_biggrin.gif icon_biggrin.gif icon_biggrin.gif ....

I just started workin on Rexx a week back... No training nor giudence..
have been able to develop Panels n Interact with DB2 as of now...
All thnx to the IBM manuals and this Forum... icon_wink.gif icon_wink.gif
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu May 03, 2007 6:31 pm    Post subject: Re: Concatenatin of a String and Number using Rexx
Reply with quote

Out of curiosity, what lead you to use REXX rather than a more traditional compiled language like COBOL or PLI?
Back to top
View user's profile Send private message
kaos

New User


Joined: 24 Apr 2007
Posts: 9
Location: Bangalore

PostPosted: Thu May 03, 2007 6:48 pm    Post subject: Re: Concatenatin of a String and Number using Rexx
Reply with quote

caz i wanted to learn Rexx and its easy to create a interactive tool using Rexx...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts REXX cdoe to purge a JOB from spool a... Sulabh Agrawal CLIST & REXX 11 Thu Mar 09, 2017 11:36 am
No new posts what is meaning of the number in dcl Martylin PL/I & Assembler 2 Thu Mar 09, 2017 7:18 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts GDG version number PANDU1 JCL & VSAM 4 Sat Mar 04, 2017 8:28 pm
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us