Page 1 of 2

Posted: Wed Mar 10, 2010 9:15 am
by hitmanthesilentassasin
try this in your filter option of either sequential file or cff.

Code: Select all

 sed '1d;$d' 
or

Code: Select all

 sed '/HDR/d; /TRL/d'

Posted: Wed Mar 10, 2010 9:22 am
by asorrell
Add a constraint to your transformer output links that prevents those rows from being output... something like:

InputLinkName.FirstColName[1,3] <> "HDR" and InputLinkName.FirstColname[1,3] <> "TRL"

Posted: Wed Mar 10, 2010 9:23 am
by kaushal.kumar@igate.com
hitmanthesilentassasin wrote:try this in your filter option of either sequential file or cff.

Code: Select all

 sed '1d;$d' 
or

Code: Select all

 sed '/HDR/d; /TRL/d'
Hi Hitman,

Can you please help me out ,in sequential file where i can define sed '/HDR/d; /TRL/d' to remove header and trailer .Please advice :(

Posted: Wed Mar 10, 2010 9:26 am
by hitmanthesilentassasin
you have to define that in the filter option of the sequential file stage.

Posted: Wed Mar 10, 2010 9:37 am
by kaushal.kumar@igate.com
hitmanthesilentassasin wrote:you have to define that in the filter option of the sequential file stage.
Hi HITMAN,

actually i will have two columns first column= filen name,second column=records detail.
i have to filter header and trailer from records column.
in my records column sample data will look like given above.
please advice

Posted: Wed Mar 10, 2010 9:41 am
by ArndW
If you google the UNIX "sed" command, you'll see that changing the suggest command to

Code: Select all

sed '1,2d;$d' 
should do the trick.

Posted: Wed Mar 10, 2010 10:16 am
by kaushal.kumar@igate.com
ArndW wrote:If you google the UNIX "sed" command, you'll see that changing the suggest command to

Code: Select all

sed '1,2d;$d' 
should do the trick. ...
my datastage server is in window..can i use unix command in this ?

Posted: Wed Mar 10, 2010 10:30 am
by ArndW
Windows DataStage servers come with the MKS Toolkit, which also includes the 'sed' command.

Posted: Wed Mar 10, 2010 10:41 am
by chulett
Define your file metadata to match your "detail" records and the others will be filtered automagically, assuming their record layout is different enough to be rejected by the stage.

Posted: Wed Mar 10, 2010 10:50 am
by kaushal.kumar@igate.com
chulett wrote:Define your file metadata to match your "detail" records and the others will be filtered automagically, assuming their record layout is different enough to be rejected by the stage. ...
Hi chulett,

i dont have any metadata.i have records in single column.
i am using sequential file as input.which will have two column.
1 column repreasent file name
2 column represent records of particular file.
from this colmun i have to remove header and trailer. :cry:

Posted: Wed Mar 10, 2010 10:54 am
by chulett
OK, simple enough, then just use a contraint to filter out any records where the first three characters in your big field are "HDR" or "TRL".

Posted: Wed Mar 10, 2010 11:01 am
by kaushal.kumar@igate.com
chulett wrote:OK, simple enough, then just use a contraint to filter out any records where the first three characters in your big field are "HDR" or "TRL". ...
Hi chulett,

please advice me .
i tried with dslink.column_name[1,3] <>'HDR' AND dslink.column_name[1,3] <>'TRL'.
as constraint.but its not working

Posted: Wed Mar 10, 2010 11:09 am
by chulett
<bzzzztttt> Sorry Andy, thanks for playing. :P

D'oh... where the heck did Andy go? Silly Wabbit.

Define 'not working', that looks perfectly fine to me. Are you sure you are checking the right 'column name'?

Posted: Wed Mar 10, 2010 11:10 am
by asorrell
Can you tell us HOW it isn't working? What happens?

Posted: Wed Mar 10, 2010 11:14 am
by kaushal.kumar@igate.com
chulett wrote:<bzzzztttt> Sorry Andy, thanks for playing. :P

D'oh... where the heck did Andy go? Silly Wabbit.

Define 'not working', that looks perfectly fine to me. Are you sure you are checking the right 'column name'?
yah,problem is i have records in single column.
which contain header ,details and trailer.