before record and after record !

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
chandra
Participant
Posts: 88
Joined: Sun Apr 02, 2006 6:50 pm
Location: India

before record and after record !

Post by chandra »

explanation :-
rec :-
1good
2good
3bad
4good
5bad
6good

these are the records comming from inputs file...

i want to capute the bad record as well as before and after records of bad i.e good rec.

like :- 3bad ,2good,4good as output
5bad,4good,6good.

ideas will be appricated
thanks in adv !
chandra ,
Hyd
Nageshsunkoji
Participant
Posts: 222
Joined: Tue Aug 30, 2005 2:07 am
Location: pune
Contact:

Post by Nageshsunkoji »

Hi,

If your input data is coming from a database, first perform order by to group the data based on keys number and Good or Bad key and after that use the sort stage and select the keys and select the option Don't sort if previously grouped and change the settings of Create cluster key change column as 'True'. Now, If the record is order by based on keys, you will get the result for Create cluster key as 1 or 0. First if good is there it will be 0 and if its changed to 1 means it is Bad. Like that, for every change to good or bad. you will get the cluster key value as 1 or 0. Based on these perform some operations in the Transformer to get your required data.
Its just Idea, implement it, if it is satisfies your requirement.
NageshSunkoji

If you know anything SHARE it.............
If you Don't know anything LEARN it...............
chandra
Participant
Posts: 88
Joined: Sun Apr 02, 2006 6:50 pm
Location: India

Post by chandra »

good and bad are two different input file !
1- I think we need to merge both the good and bad .
2- then sort the good and bad based on some commom key !
3- assign some surrogate key to track the records .
< my question is i have to caputer the above and below record of bad>

4- collect the records of goodseq > badseq
5- goodseq < badseq.

now we got the records above ,below of bad .

FROM HERE -----ANY IDEAS .
chandra ,
Hyd
bsreenu
Participant
Posts: 22
Joined: Mon Aug 16, 2004 3:57 pm

before record and after record !

Post by bsreenu »

I think you can do this in 2 passes.

1- I think we need to merge both the good and bad .
2- then sort the good and bad based on some commom key !
3- assign some surrogate key to track the records . i.e assign a sequence number

4- collect the bad records and good records into a2 seperate files.

5- Take the bad records file and derive pre&post seq number. i.e.

seq1=badseq-1
seq2=badseq+1

6- Look-up good file using above seq1 and seq2.

now we got the records above ,below of bad .
chandra
Participant
Posts: 88
Joined: Sun Apr 02, 2006 6:50 pm
Location: India

Post by chandra »

Yea ! Sounds grt8..
chandra ,
Hyd
Post Reply