IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

concatenatin n number of variables using rexx


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vidyaa

New User


Joined: 02 May 2008
Posts: 77
Location: chennai

PostPosted: Wed Jun 11, 2008 1:17 pm
Reply with quote

Hi,

How to concatenate 'n' number of varibles using rexx. The n may vary for each record

ex: A||B||C can be done for simple 3 fields if u know them
what if i have 'n' fileds and need to concatenate.

please provide help on the same.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jun 11, 2008 2:05 pm
Reply with quote

Then you will need some logic to find the number of WORDS that make up the record.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Wed Jun 11, 2008 9:04 pm
Reply with quote

Can you give a few examples of your records and also examples of the desired concatenation.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Jun 11, 2008 10:43 pm
Reply with quote

Quote:
The n may vary for each record


just explain how You are going to parse the record,
and we will be able to tell how to rebuild it
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jun 12, 2008 11:32 am
Reply with quote

Looks like one for Dick "Sherlock" Scherrer and the case of the missing poster icon_biggrin.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jun 12, 2008 11:40 am
Reply with quote

if instead of asking single disconnected questions Yo' d tell what You want to do
You might get better answers
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jun 12, 2008 1:12 pm
Reply with quote

Elementary, my dear Expat. . .

'Tis early and the TS may not yet be afoot. . .

If we wait here in our rooms, surely a visitor will bring news.

Besides, Mrs. Hudson has laid on an excellent meal and we should dine before concerning ourselves further.

SH
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Thu Jun 12, 2008 3:14 pm
Reply with quote

The following is a correct answer, but does it apply for you ???
That's why, again, we always ask to post examples!

Code:
/* data is in a stem variable */
concatstr = ''
do X = 1 to stemvar.0
   concatstr = concatstr stemvar.X
end
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jun 12, 2008 3:28 pm
Reply with quote

Marso,

your code will cause spaces between the concatenated strings.

the OP used || which would preclude spaces.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jun 12, 2008 5:17 pm
Reply with quote

dick scherrer wrote:
Elementary, my dear Expat. . .
'Tis early and the TS may not yet be afoot. . .
If we wait here in our rooms, surely a visitor will bring news.
Besides, Mrs. Hudson has laid on an excellent meal and we should dine before concerning ourselves further.
SH

Well, you certainly brought a smile to my face as your reply reminded me of an old Sherlock Holmes joke, but I don't think that this forum is the correct place to go into the 'lemon entry my dear Watson' punchline icon_biggrin.gif

Thanks Dick.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Thu Jun 12, 2008 9:02 pm
Reply with quote

The original poster asked about fields in a record, but did not explain the record format. As far as I am concerned, the original record ALREADY has the fields concatenated.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top