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
hargun
Participant
Posts: 188 Joined: Mon May 16, 2011 7:41 pm
Location: United States
Post
by hargun » Mon Oct 17, 2011 7:47 pm
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
Posts: 1229 Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney
Post
by SURA » Mon Oct 17, 2011 8:28 pm
Can't you do it using Stage Variables?
There are different way to handle this!!
DS User
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Mon Oct 17, 2011 9:39 pm
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 » Mon Oct 17, 2011 10:00 pm
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 » Tue Oct 18, 2011 6:02 am
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 » Tue Oct 18, 2011 6:06 am
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
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Tue Oct 18, 2011 6:44 am
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 » Tue Oct 18, 2011 8:26 am
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 » Tue Oct 18, 2011 3:43 pm
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
Posts: 1229 Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney
Post
by SURA » Tue Oct 18, 2011 4:22 pm
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 » Tue Oct 18, 2011 5:15 pm
thanks all .......