Regarding Content validation

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
veera24
Premium Member
Premium Member
Posts: 150
Joined: Thu Feb 07, 2008 9:37 pm
Location: NewYork

Regarding Content validation

Post by veera24 »

Hai Everyone,

I am requiring a solution for this problem. I got a field name as "POLICYNO", the content of the field resembles like 1234, 1234-01, 1234-02, 236789, 45467, 45456-03.5645.45456-02, 45456-01, 45456.

In the above example 1234 is the primary record, and the 1234-01, 1234-02 are the two child records. I want to reject both the parent record (1234) and the child record (1234-01, 1234-02).

The complexity involved in this query is, i need to extract the value that exist before this symbol "-" into a sequential file. After extracting I need to give lookup this extracted one in order to extract/reject the child records from the input data. Is there is any function exist to extract the above said values.

We come up with a solution. In first transformer, we appended "-" as a prefix for all the POLICYNO. In the next transformer we used "[] operator" for extracting the values that exist between two "-", extracted to a sequential file. By keeping this sequential file as a lookup, we rejected both the parent & child record.

Is there is any other solution to increase the code efficiency

Thanks in advance....
ShaneMuir
Premium Member
Premium Member
Posts: 508
Joined: Tue Jun 15, 2004 5:00 am
Location: London

Post by ShaneMuir »

Please delete one of your posts on this topic.

Firstly - the actual value of one field "1234, 1234-01, 1234-02, 236789, 45467, 45456-03.5645.45456-02, 45456-01, 45456" or does that represent multiple rows?

If multiple rows then using Field with the delimiter set to "-" and selecting the first "field" of that input will give you the value before the hyphen.

Code: Select all

eg Input.String["-",1,1] 

This will however also give you values where there is no hyphen in the input value, so you might want to check for a hyphen in the field beforehand.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

That's another way of writing the Field() function mentioned in my reply to your other post. ONE of your other posts.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply