Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

request: logic to fetch varying characters

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
yuva_chowdary

New User


Joined: 07 Feb 2009
Posts: 4
Location: India

PostPosted: Wed Dec 02, 2009 8:14 pm    Post subject: request: logic to fetch varying characters
Reply with quote

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
View user's profile Send private message

PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Wed Dec 02, 2009 8:41 pm    Post subject:
Reply with quote

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
View user's profile Send private message
prino

Active Member


Joined: 07 Feb 2009
Posts: 989
Location: Oostende, Belgium

PostPosted: Wed Dec 02, 2009 9:04 pm    Post subject:
Reply with quote

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
View user's profile Send private message
yuva_chowdary

New User


Joined: 07 Feb 2009
Posts: 4
Location: India

PostPosted: Thu Dec 03, 2009 10:04 am    Post subject:
Reply with quote

sorry folks...i have an idea abt the EDIFACT standards....but im asking about the logic please.....
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Dec 03, 2009 10:38 am    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts How can we have the varying lenth of ... Gunapala CN DFSORT/ICETOOL 6 Fri Oct 14, 2016 7:31 pm
No new posts Wildcard logic in COBOL dudenithy COBOL Programming 13 Thu Sep 01, 2016 7:36 pm
No new posts Multi row fetch - "for read only... Nileshkul DB2 3 Sun Aug 14, 2016 12:52 am
No new posts Execute multiple DB2 Load commands in... faizm DB2 4 Wed Aug 03, 2016 12:53 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us