View previous topic :: View next topic
|
Author |
Message |
vidyaa
New User
Joined: 02 May 2008 Posts: 77 Location: chennai
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Then you will need some logic to find the number of WORDS that make up the record. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Can you give a few examples of your records and also examples of the desired concatenation. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Looks like one for Dick "Sherlock" Scherrer and the case of the missing poster |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
if instead of asking single disconnected questions Yo' d tell what You want to do
You might get better answers |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Marso,
your code will cause spaces between the concatenated strings.
the OP used || which would preclude spaces. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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
Thanks Dick. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
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 |
|
|
|