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

Combining two Strings with a "/"


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

New User


Joined: 10 Feb 2010
Posts: 7
Location: Germany

PostPosted: Mon Mar 22, 2010 8:58 pm
Reply with quote

Hi,

I have two Strings in my CLIST:

Code:
SET &MYPARM2 = &STR(111/12)                                     
SET &MYPARM = &STR(DDDD/DD)


and I try to combine it, like this:

Code:
SET &MYPARM = &STR(DDDD/DD)&MYPARM2


If there is no "/" in "MYPARM2", then it works.

But if there is one I get the message "THIS STATEMENT HAS AN EXPRESSION WITH A CHARACTER DATA ITEM USED NUMERICALLY".

Why an what can I do?
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Mar 22, 2010 9:09 pm
Reply with quote

Not sure if &NRSTR might work, I gave up CLISTs decades ago icon_lol.gif
Something like this works for me

Result is ABC/DEFGHI/CBA

Code:
SET STR1 = ABC/DEF
SET STR2 = GHI/CBA
SET STR3 = &NRSTR(&STR1.&STR2)
WRITE &STR3
Back to top
View user's profile Send private message
FloGerman

New User


Joined: 10 Feb 2010
Posts: 7
Location: Germany

PostPosted: Tue Mar 23, 2010 12:15 pm
Reply with quote

expat wrote:
Not sure if &NRSTR might work, I gave up CLISTs decades ago icon_lol.gif
Something like this works for me

Result is ABC/DEFGHI/CBA

Code:
SET SSTR1 = ABC/DEF
SET STR2 = GHI/CBA
SET STR3 = &NRSTR(&STR1.&STR2)
WRITE &STR3


I get the same error Message, as before. Thanks for help, but I should do this in REXX ;-)
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Mar 24, 2010 5:16 am
Reply with quote

Hi,

try the following
Code:
SET &STR1 = &STR(ABC/DEF)         
SET &STR2 = &STR(GHI/CBA)         
SET &STR3 = &STR(&STR1.&STR2)     
WRITE &STR3                       
SET &STR4 = &STR(111/12)         
SET &STR5 = &STR(DDDD/DD)         
SET &STR6 = &STR(&STR4.&STR5)     
WRITE &STR6                       



Gerry
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 PuTTY - "User is not a surrogate... IBM Tools 5
No new posts Newbie Stuck on "Duplicate Datas... TSO/ISPF 5
No new posts RABBIT HOLE NEEDED - "Live"... All Other Mainframe Topics 0
No new posts Using PARM=('JPn"&SYMBOL&quo... DFSORT/ICETOOL 2
No new posts Syncsort "Y2C" Function SYNCSORT 1
Search our Forums:

Back to Top