partial output from sequential file

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
bhanuvlakshmi
Participant
Posts: 23
Joined: Fri Oct 22, 2010 7:08 am

partial output from sequential file

Post 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 :(
Thanks & Regards,
Bhanu
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: partial output from sequential file

Post 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".
-craig

"You can never have too many knives" -- Logan Nine Fingers
bhanuvlakshmi
Participant
Posts: 23
Joined: Fri Oct 22, 2010 7:08 am

Re: partial output from sequential file

Post 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.
Thanks & Regards,
Bhanu
bhanuvlakshmi
Participant
Posts: 23
Joined: Fri Oct 22, 2010 7:08 am

Re: partial output from sequential file

Post 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.
Thanks & Regards,
Bhanu
paultechm
Participant
Posts: 27
Joined: Wed Jul 25, 2007 2:09 am

Re: partial output from sequential file

Post 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
bhanuvlakshmi
Participant
Posts: 23
Joined: Fri Oct 22, 2010 7:08 am

Re: partial output from sequential file

Post 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)
Thanks & Regards,
Bhanu
paultechm
Participant
Posts: 27
Joined: Wed Jul 25, 2007 2:09 am

Re: partial output from sequential file

Post by paultechm »

Can you brief the logic only with example?
bhanuvlakshmi
Participant
Posts: 23
Joined: Fri Oct 22, 2010 7:08 am

Re: partial output from sequential file

Post 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.
Thanks & Regards,
Bhanu
vinothkumar
Participant
Posts: 342
Joined: Tue Nov 04, 2008 10:38 am
Location: Chennai, India

Post by vinothkumar »

Instead of using StageVar : Index(Word1,'-',1) can you try with this
StageVar : Index(to_processing.pri_emp_add1,'-',1)
paultechm
Participant
Posts: 27
Joined: Wed Jul 25, 2007 2:09 am

Re: partial output from sequential file

Post 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
bhanuvlakshmi
Participant
Posts: 23
Joined: Fri Oct 22, 2010 7:08 am

Post by bhanuvlakshmi »

Thank You so much Vinoth.

Its working fine now. :)
Thanks & Regards,
Bhanu
bhanuvlakshmi
Participant
Posts: 23
Joined: Fri Oct 22, 2010 7:08 am

Re: partial output from sequential file

Post 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:)
Thanks & Regards,
Bhanu
Post Reply