My requirement is to get the 6th ISA segment value.
The var_ISASegment contains this value "ISA*00* *00* *01*FIRST *01*98765LCSAPT*090318*1420*U*00401*000442082*0*T*^~"
The var_ISASegment contains this value "ISA*00* *00* *01*FIRST *01*98765LCSAPT*090318*1420*U*00401*000442082*0*T*^~"
Solution:
We will have
to use an expression shape and a loop and Expression shape
var_counter < 8
create 3 variables (var_PrvPosition,
var_curntPosition, var_counter) with int data type.
- var_PrvPosition used to store the startup position.
- var_curntPosition used to store index of our delimiter
- var_counter used to store the segment number.
Place below
code in the expression shape
var_PrvPosition ++;
var_curntPosition = var_ISASegment.IndexOf("*",var_PrvPosition);
var_counter++;
if (counter == 7)
{
Var_SixthSegment = var_ISASegment.Substring(var_PrvPosition, var_curntPosition – var_PrvPosition));
}
var_PrvPosition = indexCurrentPosition;
No comments:
Post a Comment