header and trailer validation

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
hargun
Participant
Posts: 188
Joined: Mon May 16, 2011 7:41 pm
Location: United States

header and trailer validation

Post 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.
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Re: header and trailer validation

Post by SURA »

Can't you do it using Stage Variables?

There are different way to handle this!!

DS User
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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?
-craig

"You can never have too many knives" -- Logan Nine Fingers
deeplind07
Participant
Posts: 31
Joined: Mon Jun 28, 2010 5:15 am
Location: pune

Post 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.
hargun
Participant
Posts: 188
Joined: Mon May 16, 2011 7:41 pm
Location: United States

Post 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.
hargun
Participant
Posts: 188
Joined: Mon May 16, 2011 7:41 pm
Location: United States

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

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

"You can never have too many knives" -- Logan Nine Fingers
dinakaran_s
Participant
Posts: 22
Joined: Wed Jul 02, 2008 7:01 am
Location: London

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Perhaps you need to specify more exactly what you mean by "validate".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Post 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
hargun
Participant
Posts: 188
Joined: Mon May 16, 2011 7:41 pm
Location: United States

Post by hargun »

thanks all .......
Post Reply