Header & Trailer Record Warning

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
nvalia
Premium Member
Premium Member
Posts: 180
Joined: Thu May 26, 2005 6:44 am

Header & Trailer Record Warning

Post by nvalia »

Hi,

I get the following warning message when I try to read from the Source Sequential file "SEQ_Histpion,0: Delimiter for field "Field004" not found; input: {0d}, at offset: 107"
The reason is that the Header (and also Trailer) record do not have same metadata as all other data rows i.e. data rows have 28 cols where as these 2 (header & footer) have only 3 cols

How to do away with this warning.

Thanks,
NV
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post by Krazykoolrohit »

To ignore the header, check "First line contains column names" check box in 'output->format' tab.

I dont know how you can remove a trailor with datastage.


Sinc you are in unix, you can try removing them by using a filter command or writing a Script which can be called through "before job subroutine"
mansoor_nb
Participant
Posts: 48
Joined: Wed Jun 01, 2005 7:10 am

Post by mansoor_nb »

Use the Filter option in the Format tab.If your Header, Detail and Trailer records are identified by the Record type then you can use the Grep command in the filter in the Format tab to read the detail records.
nvalia
Premium Member
Premium Member
Posts: 180
Joined: Thu May 26, 2005 6:44 am

Post by nvalia »

Hi,

We do not get any record type identifier.We simply get a header rec as the first record and the Trailer rec as the second last record with an empty line as the last one.
thumsup9
Charter Member
Charter Member
Posts: 168
Joined: Fri Feb 18, 2005 11:29 am

Post by thumsup9 »

What Mansoor said is a good option. If we have a record identifier tagged to header and trailer records, you can grep and get just the detail records. What about skipping the rows if you know the number of header and trailer rows.
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post by Krazykoolrohit »

why dont you just cut off the first and last rows coding a shell script as i suggested earlier?
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Code: Select all

head -$(expr $(wc -l filename | awk '{ print $1 }') \- 1) filename | tail +2
Use this in Beforejob subroutine or in FilterCommand in you sequential stage to strip out both header and trailer.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Make sure your O/S supports positive offsets with the 'head' function if you are thinking about doing this. HP-UX 11 does not, for example.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Also not all UNIX operating systems/emulators support positive arguments for the tail command.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nvalia
Premium Member
Premium Member
Posts: 180
Joined: Thu May 26, 2005 6:44 am

Post by nvalia »

Thanks to All..
I will test it out
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use a rejects link from the Sequential File stage to capture the header and trailer row (as raw strings) into a separate data stream. You can process them separately or just ignore them.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nvalia
Premium Member
Premium Member
Posts: 180
Joined: Thu May 26, 2005 6:44 am

Post by nvalia »

Hi,

I had already tried it, but it still throws the warnings. It seems writting a Unix script for this might be the only option.

Thanks,
Nirav
Post Reply