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
Read Only Archives
Cloverleaf
Cloverleaf
Generating a sequence number in an Xlate
Joe Guerra
I'm trying to add a counter that will increment by 1 for each record that is processed from the inbound file. The outbound file requires a unique number for each record, and I cannot figure out how to do this in the Xlate. Any help would be appreciated. Thanks
Find more posts tagged with
Clovertech
Comments
Jim Kosloskey
Joe,
Are you talking about MSH-10 the Control ID or the sequence number field?
I know with the Control ID some systems require the ID to never repeat in other cases they do not care as long as there is some large number before it repeats.
If repetition is not an issue, you can use Tcl to exploit a Counter File which will keep incrementing until it reaches the limit you set.
If it is the sequence number, then there are potential issues with whether the number needs to different (or not) if a message is resent also whether there can be 'gaps' in the number (such as a message getting killed on the outbound TPS then the sequence # might skip one or more numbers).
Just some things to think about.
Jim Kosloskey
System
Originally posted by Rentian Huang
Also I guess, HL7 or FRL?
Joe Guerra
Thanks Jim. This is an FRL from the host system that i'm putting into a VRL comma delimited for the receiving system. The receiving system just needs a unique number (counter incrementing by 1 would be perfect) in one of the fields.
System
Originally posted by Rentian Huang
Joe,
I think you can use the COUNTER mechanism to create a ctr file, and keep your counter there. Then in the IB Data TPS, use a Tcl to call CtrNextValue and assign it to the field.
Sam
Joe Guerra
Thanks all. I did write a proc with the COUNTER function, and calling it from the xlate. It works great.