infor.com
concierge
infor u
developer portal
documentation central
customer center
Posts
Categories
Groups
ERPs
CSD
FSM/HRT
LN
M3
Syteline/ CSI
Hubs
Developer
Healthcare
Hospitality
Public Sector
Onboarding
Release Center
CloudSuites
Aerospace & Defense (LN)
Automotive (LN)
Chemicals (M3)
Corporate (FSM/HRT)
Distribution (Sx.e/CSD)
Distribution Enterprise (M3)
Engineering & Construction (LN)
Fashion (M3)
Food & Beverage (M3)
Healthcare (FSM/HRT)
Industrial (Syteline/CSI)
Industrial Enterprise (LN)
Manufacturing (M3)
Public Sector (FSM/HRT)
Solutions
Supply Chain Management (SCM)
Human Capital Management (HCM)
Events
Groups
User Groups
Your Groups
About
Email Community Support
Infor News
Migrated Forums
Home
Clovertech
Clovertech Archive
Cloverleaf
Slit Long OB.5 into Multiple OBX segment with fixed OBX.5 lenth
Roland Keuter
Hi,
I have a long OBX.5 value and I want to convert the OBX.5 value into multiple OBX segment where the length of OBX.5 can be no greater the 60 chars. Ideally you want to split on the last space before the next 60th character. I have done some TCL scripting for this but I don't quite get what I want yet. I don't think we can do this in a XLATE on it's own but if possible that would be best. Does anyone have (partial) examples of how to accomplish this?
Thanks, Roland
Find more posts tagged with
Clovertech
Comments
Jim Kosloskey
I do not think there is anything native in Xlate to do the split portion. So you will need Tcl do do that specialized split.
You could have the result of that split be a list then use ITERATE (either list or user type depending on your release level of Cloverleaf) to actually build the OBX segments from the list entries.
I suspect the issue is the receiving system wants to display OBX-5 but has a 60 character line limit. In my opinion this is a failing of their software and they should make the appropriate accommodations.
Gene Millard
Here is the tcl I use to change a NTE segment where NTE-3 is longer than 120 to multiple NTEs.
Gene Millard
The Guthrie Clinic
tpsChangeNteGreater120.tcl
Paul Bishop
There is a package of text utilities that I have used to split a line into specific lengths. At the top of your proc, include the line "package require textutil", then the function "textutil::adjust" will split the line to the specified length, returning the lines in a list separated by a line feed. In the tcl proc we use it in, I have the command:
set split_OBX5_list [split [textutil::adjust $obx5 -full 1 -length $max_length] \n]
where $obx5 is the original value in obx-5 from the message and $max_length is the maximum length each line can be on the returned value. The value placed in split_OBX5_list is the returned value split by the carriage return. You can then loop through split_OBX5_list and create the new OBX lines.
If you search for "tcl textutil" you can find the full help text of all the package procedures and options for textutil.
Roland Keuter
That has worked nicely. Thank you
Jim Kosloskey
Paul,
So where is that package located?
Good info to know.
Thanks
Jim Kosloskey
Never mind - I see it is part of the Tcl distribution.