Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
concatenatin n number of variables using rexx

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: concatenatin n number of variables using rexx
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jun 11, 2008 2:05 pm    Post subject:
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

Senior Member


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

PostPosted: Wed Jun 11, 2008 9:04 pm    Post subject: Reply to: concatenatin n number of variables using rexx
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10327
Location: italy

PostPosted: Wed Jun 11, 2008 10:43 pm    Post subject: Reply to: concatenatin n number of variables using rexx
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: 8593
Location: Back in jolly old England

PostPosted: Thu Jun 12, 2008 11:32 am    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10327
Location: italy

PostPosted: Thu Jun 12, 2008 11:40 am    Post subject: Reply to: concatenatin n number of variables using rexx
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

Site Director


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

PostPosted: Thu Jun 12, 2008 1:12 pm    Post subject: Reply to: concatenatin n number of variables using rexx
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: 1243
Location: Israel

PostPosted: Thu Jun 12, 2008 3:14 pm    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Thu Jun 12, 2008 3:28 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Thu Jun 12, 2008 5:17 pm    Post subject: Re: Reply to: concatenatin n number of variables using rexx
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

Senior Member


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

PostPosted: Thu Jun 12, 2008 9:02 pm    Post subject: Reply to: concatenatin n number of variables using rexx
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    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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 5 Wed Oct 04, 2017 6:54 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 47 Fri Sep 29, 2017 1:08 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us