Page 1 of 1

partial output from sequential file

Posted: Mon May 23, 2011 6:18 am
by bhanuvlakshmi
Hi,

My job is having ODBC stage--->t/f-->sequential file stage.

I am not able to get properdata to the output.
I have used stage variables in the transformer and built logic according to the requirements.I am getting the proper output but for half of the rows only remaining half are blank.

I was getting warning like "When checking operator: A sequential operator cannot preserve the partitioning
of the parallel data set on input port 0."
I made the flag to clear in the previous stage.Still i am not able to get the proper data.but now it is not giving warning.

I have prepared test data with 4 records and ran the job 2 records are comming with proper out put according to the logic and remaining two re not.Please suggest me what to do ....

it urgent :(

Re: partial output from sequential file

Posted: Mon May 23, 2011 6:38 am
by chulett
bhanuvlakshmi wrote:it urgent :(
No, it's not.

Suggest you fully explain your requirements and the logic you built. Right now we have nothing to work with other than basically "it doesn't work".

Re: partial output from sequential file

Posted: Mon May 23, 2011 7:00 am
by bhanuvlakshmi
My requirement is to seperate the word in to 2 parts if it contains '-' based on this first part should contain the part before '-' and second should contain after the '-'. for that i used the following in t/f stage

I have taken the stage variables:

StageVar : Index(Word1,'-',1)
StageVar1 : Index(to_processing.pri_emp_add1,' ',1)
word1 : to_processing.pri_emp_add1[1, StageVar1-1]
firstpart : Word1[1, StageVar-1]

to get the first part of the word if the word is seperated be '-'
my i/p is SAME-AS -HOME 123 for the column to_processing.pri_emp_add1 which i took the same for all 4 records.

i/p is :
SAME-AS -HOME 123
SAME-AS -HOME 123
SAME-AS -HOME 123
SAME-AS -HOME 123
and o/p is
---- for first row
SAME
---- for 3rd row
SAME

when i converted the execution in sequential mode in t/f i am getting o/p as
--- for first row
SAME
SAME
SAME
for 3 records.

Please give me suggession based on production data which will be in lakhs.

Re: partial output from sequential file

Posted: Mon May 23, 2011 7:36 am
by bhanuvlakshmi
Now when changed the execution mode to sequential in transformer i am getting the o/p for all records except for the first record, still a blank space iam getting for that

Could any body please help me in solving this......

Thanks in advance for your help.

Re: partial output from sequential file

Posted: Mon May 23, 2011 7:58 am
by paultechm
word1 : if StageVar1=0 Then to_processing.pri_emp_add1 Else to_processing.pri_emp_add1[1, StageVar1-1]

firstpart : if StageVar=0 then Word1 else Word1[1, StageVar-1]


-Paul

Re: partial output from sequential file

Posted: Mon May 23, 2011 8:23 am
by bhanuvlakshmi
Thank you Paul for correcting my logic but still i am facing the same problem my first record is giving as

SAME-AS
and remaining all are giving as this

SAME
SAME
SAME
SAME

Please note : (execution mode is sequential in T/F stage)

Re: partial output from sequential file

Posted: Mon May 23, 2011 9:18 am
by paultechm
Can you brief the logic only with example?

Re: partial output from sequential file

Posted: Mon May 23, 2011 9:36 am
by bhanuvlakshmi
Hi

IF the input column contains two words i have to take first word in to one variable and second in to another and again in the first word i have to check for the hyphen(-) and if it is there i have to take the part before the (-) in one variable and part after the (-) in another variable. thats what iam trying to do

eg:
i/p: SAME-AS HOME

o/p:
so my first word is SAME-AS
second word is HOME

and again in first word based on (-) if i partition

first part :SAME
second part: AS

i got the logic and it is working fine.but only for the first record that is giving as "SAME-AS" for both for first part and second part.
and remaining all records are comming as first part as "SAME "and second part as "AS"(as required).

for all the records the i/p is same.
Could you please help me why i am not getting the desired o/p for the first record.

Posted: Mon May 23, 2011 9:47 am
by vinothkumar
Instead of using StageVar : Index(Word1,'-',1) can you try with this
StageVar : Index(to_processing.pri_emp_add1,'-',1)

Re: partial output from sequential file

Posted: Mon May 23, 2011 10:03 am
by paultechm
bhanuvlakshmi wrote:Hi

IF the input column contains two words i have to take first word in to one variable and second in to another and again in the first word i have to check for the hyphen(-) and if it is there i have to take the part before the (-) in one variable and part after the (-) in another variable. thats what iam trying to do

eg:
i/p: SAME-AS HOME

o/p:
so my first word is SAME-AS
second word is HOME

and again in first word based on (-) if i partition

first part :SAME
second part: AS

i got the logic and it is working fine.but only for the first record that is giving as "SAME-AS" for both for first part and second part.
and remaining all records are comming as first part as "SAME "and second part as "AS"(as required).

for all the records the i/p is same.
Could you please help me why i am not getting the desired o/p for the first record.
Means it doesn't recognise the hyphen check the data ,is it a hyphen or underscore

Posted: Mon May 23, 2011 10:04 am
by bhanuvlakshmi
Thank You so much Vinoth.

Its working fine now. :)

Re: partial output from sequential file

Posted: Mon May 23, 2011 10:09 am
by bhanuvlakshmi
Instead of using StageVar : Index(Word1,'-',1) can you try with this
StageVar : Index(to_processing.pri_emp_add1,'-',1)

using the above one solved my issue.

Thank you for your help PAUL:)