how to get Reject records

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
marpadga18
Premium Member
Premium Member
Posts: 96
Joined: Fri Aug 20, 2010 8:51 am

how to get Reject records

Post by marpadga18 »

hi all,I am new to datastage need some inputs

my requirement is
source seq-file satge>>transformstage>> sqlserver_tgt stage
I have 7 columns in a row from source
if any column in the row is null i have to reject the entire row
could any one could suggest a way would help me new to datastage
Thanks,
M
natashab
Participant
Posts: 17
Joined: Mon Aug 09, 2010 3:44 am

Post by natashab »

In the transformer stage, give the constraint to check for isNotnull() of all 7 columns.[ IsNotNull(col1) And ...IsNotNull(col7) ] .
udayk_2007
Participant
Posts: 72
Joined: Wed Dec 12, 2007 2:29 am

Post by udayk_2007 »

Other option is,set nullable to 'No' for all columns in the source sequential stage and put a reject link there

Regards
Ulhas
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You won't get an "null" values from your source sequential file unless you explicitly define default values and null replacements for each column in your source.
Or do you mean "empty" values rather than "null" - there is a big difference.
marpadga18
Premium Member
Premium Member
Posts: 96
Joined: Fri Aug 20, 2010 8:51 am

Post by marpadga18 »

natashab wrote:In the transformer stage, give the constraint to check for isNotnull() of all 7 columns.[ IsNotNull(col1) And ...IsNotNull(col7) ] .
hi all,

In transformer stage i gave consraint for
output link:
Trim(Src_Input_link.column1)<> '' And
Trim(Src_Input_link.column2)<>'' And
Trim(Src_Input_link.column3 <>'' And
Trim(Src_Input_link.column4) <>'' And
Trim(Src_Input_link.column5)<> ''
reject link:
Trim(Src_Input_link.column1)='' Or
Trim(Src_Input_link.column2)='' Or
Trim(Src_Input_link.column3 ='' Or
Trim(Src_Input_link.column4) ='' Or
Trim(Src_Input_link.column5)=''
it is working as expected
if i am doing anything wrong please suggest me if I am wrong if it is corect I will resolve this topic ...
Thanks,
M
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It is working as expected.

Good.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
marpadga18
Premium Member
Premium Member
Posts: 96
Joined: Fri Aug 20, 2010 8:51 am

Post by marpadga18 »

ray.wurlod wrote:It is working as expected.

Good. ...

haveing trouble when i use the constraints as above mentioned it is working but when in the source data has junk caharacter in the columns it is not rejecting to reject file it is loading to target which is should not do
I am using constraint
Trim(Src_Input_link.column1)<> '' And
Trim(Src_Input_link.column2)<>'' And
Trim(Src_Input_link.column3 <>'' And
Trim(Src_Input_link.column4) <>'' And
Trim(Src_Input_link.column5)<> ''
reject link:
Trim(Src_Input_link.column1)='' Or
Trim(Src_Input_link.column2)='' Or
Trim(Src_Input_link.column3 ='' Or
Trim(Src_Input_link.column4) ='' Or
Trim(Src_Input_link.column5)=''


need to reject if junk charecters found
Thanks,
M
ajay.vaidyanathan
Participant
Posts: 53
Joined: Fri Apr 18, 2008 8:13 am
Location: United States

how to get Reject records

Post by ajay.vaidyanathan »

To identify junk values you can still make use of the existing transformer stage and filter out the junk values there itself. Just identify the ASCII values for the junk values you are getting in the file and have them filtered in the transformer stage. if it is only 1 or 2 values you can directly use them in the transformer stage instead of their ASCII values.
Regards
Ajay
nitkuar
Participant
Posts: 46
Joined: Mon Jun 23, 2008 3:09 am

Post by nitkuar »

could you please provide sample record having junk characters
marpadga18
Premium Member
Premium Member
Posts: 96
Joined: Fri Aug 20, 2010 8:51 am

Post by marpadga18 »

nitkuar wrote:could you please provide sample record having junk characters
as of now we dnt have junk characters in file working with sample data.
in near future if we found any junk characters we should reject it but anyway asume these are the junk characters
‿‿‿‿×¢×¢ |PRO |sgahtsgsa |17500 |31/12/20|01/01/06

when testing with sample data not able to reject.need some inputs
Thanks,
M
ajay.vaidyanathan
Participant
Posts: 53
Joined: Fri Apr 18, 2008 8:13 am
Location: United States

how to get Reject records

Post by ajay.vaidyanathan »

your junk data itself is very wierd.... ususally junk characters like {},#,....etc. appear which needs to be cleansed... and for that we usually go for the way i suggested earlier.... identify the ASCII value and remove them by adding a constraint.... this will help you solve your problem with less (or) no design change...
Regards
Ajay
Post Reply