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
 

 

To concatenate String in REXX

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

New User


Joined: 08 Nov 2006
Posts: 21
Location: india

PostPosted: Fri Dec 29, 2006 1:05 pm    Post subject: To concatenate String in REXX
Reply with quote

hi guys....

my requirement is to concatenate tow strings....

following is the
String1 = 'comment'

String2 = 'application'

string = string1 string2
this command inserts a single space in between two string... now my requirement is that string2 should start from 40th position in string as the max leg of the string can be 20...they should be seperated by spaces in string...
how can i do it.. please help
Back to top
View user's profile Send private message

banuradha

New User


Joined: 20 Dec 2006
Posts: 19
Location: India

PostPosted: Fri Dec 29, 2006 1:24 pm    Post subject: Re: To concatenate String in REXX
Reply with quote

amolj wrote:
hi guys....

my requirement is to concatenate tow strings....

following is the
String1 = 'comment'

String2 = 'application'

string = string1 string2
this command inserts a single space in between two string... now my requirement is that string2 should start from 40th position in string as the max leg of the string can be 20...they should be seperated by spaces in string...
how can i do it.. please help



Hi I just need to clarify the output you are expecting ,is it like the following one
|----------------------40char------------|
string = comment-------------|------------------|application
|<----string1------->| |<-string2-->|
Back to top
View user's profile Send private message
banuradha

New User


Joined: 20 Dec 2006
Posts: 19
Location: India

PostPosted: Fri Dec 29, 2006 1:26 pm    Post subject:
Reply with quote

oops! output format got changed

Is it like this
|----------------------40char------------|
string = comment-------------|------------------|application
|<----string1------->| |<-string2-->|
Back to top
View user's profile Send private message
banuradha

New User


Joined: 20 Dec 2006
Posts: 19
Location: India

PostPosted: Fri Dec 29, 2006 1:32 pm    Post subject:
Reply with quote

icon_confused.gif
string =|----------------------40char------------|
string = comment-------------|------------------|application
string =|<----string1-------->|------------------|<-string2-->|
Back to top
View user's profile Send private message
amolj

New User


Joined: 08 Nov 2006
Posts: 21
Location: india

PostPosted: Fri Dec 29, 2006 2:33 pm    Post subject:
Reply with quote

string =|<----string1-------->|------------------|<-string2-->|
<----20-------------> <-------20----->

right this the format of output
Back to top
View user's profile Send private message
amolj

New User


Joined: 08 Nov 2006
Posts: 21
Location: india

PostPosted: Fri Dec 29, 2006 2:58 pm    Post subject:
Reply with quote

string =|<----string1-------->|------------------|<-string2-->|
string =|<----20------------->|<-------20---->|
Back to top
View user's profile Send private message
banuradha

New User


Joined: 20 Dec 2006
Posts: 19
Location: India

PostPosted: Fri Dec 29, 2006 3:44 pm    Post subject:
Reply with quote

/*REXX*/
STRING1 = 'COMMENTS'
SPACESTRING ='____________________'
STRING2 = 'APPLICATION'
STRNG=STRING1||SPACESTRING
SAY STRNG
FINALSTRING = STRNG||STRING2
SAY FINALSTRING

Hope this might help you
Back to top
View user's profile Send private message
amolj

New User


Joined: 08 Nov 2006
Posts: 21
Location: india

PostPosted: Fri Dec 29, 2006 5:59 pm    Post subject:
Reply with quote

banuradha wrote:
/*REXX*/
STRING1 = 'COMMENTS'
SPACESTRING ='____________________'
STRING2 = 'APPLICATION'
STRNG=STRING1||SPACESTRING
SAY STRNG
FINALSTRING = STRNG||STRING2
SAY FINALSTRING

Hope this might help you


hi banuradha ..
this would surely work...
but i foud out some other way .. thought of sharing it with u...

/*REXX*/
STRING1= 'COMMENTS'
STRING2='APPLICATION'
STRING1= LEFT(STRING1,39)
/*THIS WOULD ADD SPACES TO END OF THE STRING SO THAT */
/*LENGTH BECOME 39 */
STRING3=STRING1 STRING2
/*THIS CONCATENATES TWO STRING WITH SPACE IN BETWEEN*/

BYE..
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
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm


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