View previous topic :: View next topic
|
Author |
Message |
FloGerman
New User
Joined: 10 Feb 2010 Posts: 7 Location: Germany
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Not sure if &NRSTR might work, I gave up CLISTs decades ago
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 |
|
|
FloGerman
New User
Joined: 10 Feb 2010 Posts: 7 Location: Germany
|
|
|
|
expat wrote: |
Not sure if &NRSTR might work, I gave up CLISTs decades ago
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 |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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 |
|
|
|