Page 1 of 1

Spaces error at sequence level

Posted: Mon Jan 10, 2011 3:30 am
by devesh_ssingh
Hi Mentors,
i have one sequence attached with several job like
job1--->job2---->job3---->job4--->job5
there is no abosolute depedency between these jobs. only it shuld be run one after on like after job1 then job2 then job 3
now problem is when i run this sequence and when check o/p of job4 it produce o/p like op1
and when same job4 i am running alone it gives proper o/p like op2:

Code: Select all

op 1:

"12","TGMIS00                       ","MSR_PRD_MO                                                                                                                      ","TGMIS00                       ","MSR_PRD_MO                                                                                                                      ","INSERT              "
"12","TGMIS00                       ","TEL_ADR                                                                                                                         ","TGMIS00                       ","TEL_ADR                                                                                                                         ","REPLACE             "

op2:

"12","TGMIS00","MSR_PRD_MO","TGMIS00","MSR_PRD_MO","INSERT"
"12","TGMIS00","TEL_ADR","TGMIS00 ","TEL_ADR","REPLACE"
job4 designe is like :
db---trx--o/p(seqfile)
the column are of manily char type. i suspected some space so used trimleading trailing and stripextra space function.

it gives me proper output when i alone run the job, but when run with sequence it gives lods of space as shown(op1:)
on sequencer level i have used trigger conditional like
job.$JobStatus<3
also used APT_PADCHAR paramaeter and value is 0x20 to remove any junk and spaces from db.
i hope given a clear picture.
please let me know if you need anything else.
this have stucked me in my testing :(

thanks,
Devesh

Posted: Mon Jan 10, 2011 5:12 am
by devesh_ssingh
the op1 is not propely appering

it have huge space between columns, somehow its appering incorrect!!!

Posted: Mon Jan 10, 2011 6:07 am
by ppgoml
you can try changing the data type from char to varchar in column definition, hope that helps

Posted: Mon Jan 10, 2011 8:26 am
by chulett
devesh_ssingh wrote:the op1 is not propely appering

it have huge space between columns, somehow its appering incorrect!!!
You need to get used to how forums like this work - any "extra" whitespace is automatically removed. The only way to preserve it is to use the "code" tags... like so. :wink:

Posted: Mon Jan 10, 2011 11:42 pm
by devesh_ssingh
Thanks craig for making correction....
may i have any i/p to solution???
i m stuck... :evil:

Recently i have removed APT_PAD_CHAR at job level and used on sequence level...
then also appering same issue....

Posted: Tue Jan 11, 2011 12:13 am
by Kirtikumar
Have you tried using trip function? Also did you check the filename in job 4 and 5. May be the file is getting overwritten?

What is the timestamp of file when run through seq? Is this timestamp same as the timestamps shown for job 4 as per director?

Checking these things might help. Also try adding peek stage may be in the job4 and see what it reports when running individual and in seq.

Posted: Tue Jan 11, 2011 12:28 am
by devesh_ssingh
Hi Kirti,
Thanks for quick reply...
Have you tried using trip function? Also did you check the filename in job 4 and 5. May be the file is getting overwritten?
I believ you reffering to strip function , i have already used this strip
are you reffering to strip function , i have already used this strip whitespace...
yes my file is in overwrite mode, because evertime it has to write in ovewrit mode but how does it make difference....
What is the timestamp of file when run through seq? Is this timestamp same as the timestamps shown for job 4 as per director?
The timestamp is same at job level as well as Sequence level....
i will be debuggin by using peek function....

Posted: Tue Jan 11, 2011 12:31 am
by chulett
devesh_ssingh wrote:Thanks craig for making correction....
may i have any i/p to solution???
If I had anything to add at the time, I would have done so. Patience.
devesh_ssingh also wrote:Recently i have removed APT_PAD_CHAR at job level and used on sequence level... then also appering same issue....
Well, it seems your answer lies there. I assume you mean APT_STRING_PADCHAR, yes? You've spelled it here a couple of different ways, neither of which are correct. If you removed one version and "used on sequence level" with a different spelling, I can see why things may not be operating as you had envisioned. Can you confirm what you are using, please?

Posted: Tue Jan 11, 2011 12:37 am
by devesh_ssingh
hey craig...

apology for being impatiance but i am stuck badly at this satge nearing to my delevery date... :?

i have used APT_STRING_PADCHAR .....
i have used by using selecting env variable so no chance of typo at anywhere...

Posted: Tue Jan 11, 2011 2:45 am
by Kirtikumar
what is the value of the env variable APT_STRING_PADCHAR in the sequence logs and then the job4 logs?

When you run job4 individually what is its value? Also I had miss-spelt the function to be used. Use function TrimLeadingTrailing function when writing data to sequential file. Make sure you use VC datatype for sequential file.

Posted: Tue Jan 11, 2011 4:59 am
by devesh_ssingh
0x20 is the value for APT_STRING_PADCHAR.

i have already tried with all space removing function...but its not resolving.

Posted: Tue Jan 11, 2011 8:02 am
by chulett
devesh_ssingh wrote:0x20 is the value for APT_STRING_PADCHAR.

i have already tried with all space removing function...but its not resolving.
Of course not. You've said these are CHAR fields and based on the 0x20 value you are using, you want them padded with a space so that's exactly what is happening. You can trim them out all you want but once that's done they just get added back in.

What do you want the output to be? If you don't want the fields to be a fixed size, then don't use a CHAR data type, use a VARCHAR as people have been suggesting. If you leave them as CHAR and set the APT value back to 0x0 they will look like you posted first but will actually be padded with "nulls" rather than spaces, which will probably screw things up later when someone/something tries to actually use your output.

So... what output do you need?

Posted: Wed Jan 12, 2011 12:23 am
by devesh_ssingh
Hi Craig.

i am expecting OP1: as shown in 1st post.

i will be modifying codes as per your input...
let see if it work

thanks.

Cheers!!!!
Devesh