Homepage › Clovertech Forums › Cloverleaf › substring failing
- This topic has 19 replies, 5 voices, and was last updated 4 years, 1 month ago by Jim Kosloskey.
-
CreatorTopic
-
July 16, 2020 at 1:38 pm #117414
-
CreatorTopic
-
AuthorReplies
-
-
July 16, 2020 at 1:44 pm #117416Jared ParishParticipant
What version of Cloverleaf? What error are you receiving?
- Jared Parish
-
July 16, 2020 at 1:46 pm #117417RichParticipant
I’m using 6.0, and I’m not receiving an error, it just doesn’t pass messages unless I deactivate the substring.
-
July 16, 2020 at 1:49 pm #117418RichParticipant
To clarify, The substring is toward the end of my xlate, and it just stops processing the xlate, and no message is sent.
-
-
July 16, 2020 at 1:55 pm #117419Jared ParishParticipant
Could this be your issue? Archive KB 1550447
<td class=”KBDefaultLabel_Bold”>Description:
<td class=”KBDefaultLabel”>Hello, Using the STRING function, xlateStrLength to determine the length of a string in his xlate. Your encountering the following error:
Tcl callout error
xlateStrLength:
errorCode: NONE
errorInfo:
bad type “st”: must be c, d, v, or x
while executing
“xpmstore $xlateId $outAdd $outType [string length $inValue] ”
(procedure “xlateStrLength” line 7)
invoked from within
“xlateStrLength”
<td class=”KBDefaultLabel_Bold”>Work Around:
<td class=”KBDefaultLabel”>Workaround is to set outType to c
<td class=”KBDefaultLabel_Bold”>Resolution:
<td class=”KBDefaultLabel”>Reported as a bug and will be addressed in a later version or patch.
- Jared Parish
-
July 16, 2020 at 2:00 pm #117421RichParticipant
Since I’m not using string length, I don’t think so, but you did make me think of something. The value I’m trying to get in PID.13.6 is phone number in the format of 1234567. Could that be the issue, and if so, What do I use to parse just the first three digits?
Thanks,
-> Rich
-
July 16, 2020 at 2:04 pm #117422Jim KosloskeyParticipant
You could just use 0 and 2 (I think that function is zero based if not then 1 and 3).
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.
-
July 16, 2020 at 2:07 pm #117424RichParticipant
Jim,
I’ve tried 0 2 and 1 3
Both fail in the exact same way. The odd thing is that I’ve got other xlates using the same function in the same way that do not fail. I’ve also tried removing the line, and recreating it. I’m befuddled! The only difference is that I’m dealing with numeric values instead of alpha characters.
-
July 16, 2020 at 2:17 pm #117425Jim KosloskeyParticipant
So is the input a field with components or subcomponents?
Eg |^123456| or |&123456| or the like?
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.
-
July 16, 2020 at 2:21 pm #117426RichParticipant
Jim,
I’m parsing PH^^^601^1234567|
into (601)123-4567
So, component level only.
-
July 16, 2020 at 2:32 pm #117427Jim KosloskeyParticipant
So should the component value in the Source be [4] and not [6]?
If you echo out the Source value as it is what do you get?
- This reply was modified 4 years, 2 months ago by Jim Kosloskey. Reason: Change [5] to [4]
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.
-
July 16, 2020 at 2:54 pm #117430RichParticipant
How do I echo out the value?
Thanks!
-
July 16, 2020 at 3:20 pm #117434Jim KosloskeyParticipant
Refer to David Perry’s post below to echo out the value. But I think you have the incorrect value in the component notation.
My theory is the temp variable which is the target is being created in this Action (it did not exist before this Action). You are pointing to a non-existent input value by using the incorrect component value so the STRING Action does not populate the temp variable at all.
I think then the CONCAT has issues with the non existent temp variable.
To prove the point before adjusting the component value, you could add a COPY Action copying @null to the temp variable (@AD??) at the beginning of your Xlate. That will establish the existence of the temp variable so if the STRING Action does nothing the CONCAT will still find the temp variable (which has a value of null).
Of course, I could be way off base on that, but I am fairly sure you don’t have the correct value in the component notation.
To validate what it should be, run the input message through the HL/7 tester for your variant with the ‘noise’ level turned up so you can see hat the value should be in the address path for that component. The value shown there is what you should use in your Xlate.
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.
-
July 16, 2020 at 4:30 pm #117440RichParticipant
If I
copy 0(0).PID(0).#13(0).[5] to @AC
then copy 0(0).PID(0).#13(0).[6] to @AD then
Concat: =(
@AC
=)
@ADI get (601)551XXXX – redacted number
so I know the segment is correct. However, as soon as I try to
xlateStrSubstring 0 2 with an input of @AD and output to @AE it fails.
All I can conclude is that we have a failure trying to substring a numeric value. I even tried putting @null in both @AE and @AF to make sure it had a value. The message still fails to send. Unfortunately, my testing tool is acting up and I’m unable to echo out values.
Thoughts?
-
July 16, 2020 at 4:52 pm #117441Jim KosloskeyParticipant
OK if echo is not working, another trick is you can find unused fields in the OB message and COPY data items (IB or temp variables) you want to know the values of to those fields. Then those unused fields will contain the values.
If that does not shed any light and you have exhausted the various options for resolution perhaps contacting support is in order.
I don’t have access to Cloverleaf so unfortunately I cannot try to duplicate what you have.
Maybe someone who has the same release you are on may be willing to try to duplicate your effort.
If you think it would help, feel free to email me and I will try to work directly with you so I can look over your shoulder at your system.
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.
-
-
July 16, 2020 at 1:56 pm #117420Jim KosloskeyParticipant
Have you tried replacing end-4 with a fixed number just to see if that gets past the issue?
Is this happening in the testing tool?
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.
-
July 16, 2020 at 2:05 pm #117423RichParticipant
Jim,
I’m using this xlate to reformat the phone number as (999)999-9999. In the testing tool, it just leave the field that should be populated by my concatenate as a blank. I’ve tried putting constants in the variables in my concatenate, and see that that part is working fine.
-
-
July 16, 2020 at 3:11 pm #117433AnonymousInactive
Add this to the PreProc and let us know the output:
echo “inVals: $xlateInVals”
echo “inTypes: $xlateInTypes” -
July 17, 2020 at 12:28 am #117443Charlie BursellParticipant
Simplify to one xlate action:
copy In: PID.13.5 and PID.13.6 Out: PID.13
lassign $xlateInVals pre post
set pre ($pre)
set post [string range $post 0 2]-[string range $post 3 end]
set xlateOutVals
-
July 27, 2020 at 9:23 am #117536Jim KosloskeyParticipant
Rich,
So did you ever get this resolved? Is this a bug with numerics?
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.
-
-
AuthorReplies
- You must be logged in to reply to this topic.