View previous topic :: View next topic
|
Author |
Message |
yuva_chowdary
New User
Joined: 07 Feb 2009 Posts: 4 Location: India
|
|
|
|
hi, i'm new in pli coding. Requesting members help in getting logic:
here is the example of records which i will be receiving:
UNA:+.? '
UNB+UNOA:1+EED1 NYIE115:ZZ+5102262552:12+091201:1603+83++CONTRL'
UNG+CT+NYIE1150909:ZZ+5102262552:12+091201:1603+83+UN+00D:97A'
UNH+106+CONTRL:2:97A:UN'
UCI+000000022+5102262552:12+EED1 NYIE115:ZZ+7'
UNT+3+106'UNE+1+83'
UNZ+1+83'
here :
(1)UNA,UNB,UNG,UNH,UCI,UNT,UNZ are segments
(2)
' is a segment seperator
+ is an element seperator
: is a sub-element seperator
Note1:
The + and : will vary.
Like the element seperator may be + or ~ or ! etc, similarly the sub-element seperator.
But there will be another record called UNA which comes before this UCI will indicate which is the segment seperator, which is the element seperator, which is the sub-element seperator.
Note2:
The elements
UCI-01 : 000000022 can be a maximum of 14 characters and the min length is 1.
UCI-02 : 5102262552 can be a maximum of 35 characters and the min length is 1.
The sub-element
UCI-02-01: 12 will have a fixed length of 2 characters.
The element
UCI-03 : EED1 NYIE115 will be varying from 1 to 35.
The Sub-element
UCI-03-01: ZZ is fixed 2 character length
The element
UCI-04 is a varying alphanumeric data from 1 to 3 length according to the standard, but i'm sure that we are receiving only either a 7 or 4
( single length numeric)
Requirement:
I have to fetch UCI-04 for further processing. Depending on UCI-04, i will be determing this record is valid or not.
Concerns:
(1)With these variable length elements in the UCI segment, im not sure how i can fetch the UCI-04 element.
(2)I'm thinking of depending on the UNA first by taking which is the segment seperator, then
(3)when the record begins with UCI,read this entire UCI record into an array, then running the array till it reaches the segment seperator.
(4)As always the UCI-04 is the last element in that record, i can fetch the UCI-04 just before the segment seperator, but how can i stop that array fetching is again a question, because there are few more segments after this UCI which also will have same segment seperator.
Could anyone throw some light on how to achieve this....
Thanks
Yuva. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
If we are talking about EDIFACT standards then :
+ = data element separator
' = segment terminator
: = sub element separator
And the segments are service segments :
• Envelopes (UNB-UNZ, UNG-UNE, UNH-UNT)
• Delimiter String Advice (UNA)
• Section Separator (UNS) |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
You don't code EDIFACT software (de)coding yourself, you buy it.
The financial risk of getting it wrong with home-cooked stuff will wipe out any savings you might think you will make. |
|
Back to top |
|
|
yuva_chowdary
New User
Joined: 07 Feb 2009 Posts: 4 Location: India
|
|
|
|
sorry folks...i have an idea abt the EDIFACT standards....but im asking about the logic please..... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
....but im asking about the logic please... |
If you don't already have a clear understanding of how this is done, it is downright foolish to even consider doing this. . .
Which part of "Don't do that. . ." was not clear? |
|
Back to top |
|
|
|