Page 1 of 1

header and trailer validation

Posted: Mon Oct 17, 2011 7:47 pm
by hargun
hi,

My job design is

Code: Select all

seq file..........>xfm............>seq file(header)
                            ...............>seq file(trailer)
i have comma delimiter seq file and file have header ,detail and trailer records.I want to validate header and trailer.

Can you please advice me how can i do header and trailer validation.


i split the job into two outputs one for header and one for trailer what kind of transformation i need to use in transformer to get header and trailer validation
Header contains date also and trialer contains total rec count like

header: HD 02/06/2011
trailer : TR 149

Please advice me on this.

Re: header and trailer validation

Posted: Mon Oct 17, 2011 8:28 pm
by SURA
Can't you do it using Stage Variables?

There are different way to handle this!!

DS User

Posted: Mon Oct 17, 2011 9:39 pm
by chulett
So, do you just literally need to validate the file? What kind of date validation do you need to do? What needs to happen if the validation fails?

Posted: Mon Oct 17, 2011 10:00 pm
by deeplind07
In my project i handelled this requirment in unix by writing a small shell script
head -1 sourcfile> header_file
tail -1 sourcefile>trailer_file.

Posted: Tue Oct 18, 2011 6:02 am
by hargun
hi sura,

can you tell me what kind of logic i have to use in stage varaiables.Can you send me some kind of coding so that i can use that one.

Posted: Tue Oct 18, 2011 6:06 am
by hargun
hi chulett

i want to use the header and trailer in sequence job if it fails it send email to sequencer and job abort.

Posted: Tue Oct 18, 2011 6:44 am
by chulett
Again, what kind of 'date validation' do you need to do? The trailer validation is just a record count compared to the number in the trailer.

Posted: Tue Oct 18, 2011 8:26 am
by dinakaran_s
Seq File --> Xfm1 --> Sort1 stg --> xfm2 --> output


Xfm1 --> using stage variable count all the records and pass it to new column ( Count1)

Sort1 stg --> Sort all the records based on Count1 column in decending order

xfm2 --> put constraint to pass only first and last record ( constraint ==> INROWNUM=1 or Count1 column =1)

Please let me know if you need more information.

Posted: Tue Oct 18, 2011 3:43 pm
by ray.wurlod
Perhaps you need to specify more exactly what you mean by "validate".

Posted: Tue Oct 18, 2011 4:22 pm
by SURA
When i reply to your query, first i typed the same what chulett asked! Then i thought of, you might know what to do and left like that.

But now you need to say, what action are you expecting when the date is not the current date?

Do you want to abort the job? Or what else you need?

Please confirm it. Based on that solution will differ.

DS User

Posted: Tue Oct 18, 2011 5:15 pm
by hargun
thanks all .......