Concatenate issue
Moderators: chulett, rschirm, roy
Concatenate issue
Hi
Cud anyone tell me wats wrong with the below stmt... I've used this stmt to concatenate a " to the rec if it contains QuoteChar. but the output returned is that every stmt is appended with a 1 at the end.....
if(DSLink12.F1[1,9]= "QUOTECHAR") THEN DSLink12.F1 :'"' else DSLink12.F2..
thanx
Anee
Cud anyone tell me wats wrong with the below stmt... I've used this stmt to concatenate a " to the rec if it contains QuoteChar. but the output returned is that every stmt is appended with a 1 at the end.....
if(DSLink12.F1[1,9]= "QUOTECHAR") THEN DSLink12.F1 :'"' else DSLink12.F2..
thanx
Anee
I can't tell but a I am assuming you are using a single quote, a double quote, and then a single quote in the statement. What your statement is doing is if the first nine characters of link column DSLink12.F1 is the text "QUOTECHAR" then append your quote to that entire link column value, otherwise return link column DSLink12.F2. So, my guess is that either your text never starts with QUOTECHAR and F2 must contain the value 1.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
what is stmt?
what is stmt anyway?
try to cat in this way
link.field :''':'''
try to cat in this way
link.field :''':'''
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Re: Concatenate issue
Is that the entire expression? (What does the ".." at the end signify?)Anee wrote:Hi
Cud anyone tell me wats wrong with the below stmt... I've used this stmt to concatenate a " to the rec if it contains QuoteChar. but the output returned is that every stmt is appended with a 1 at the end.....
if(DSLink12.F1[1,9]= "QUOTECHAR") THEN DSLink12.F1 :'"' else DSLink12.F2..
thanx
Anee
If it is the entire expression, try
Code: Select all
If (DSLink12.F1[1,9] = "QUOTECHAR") THEN DSLink12.F1 : Char(34) else DSLink12.F2
I remain curious to learn where the 1 actually occurs.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.