to remove first line from mutiple files

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

developeretl
Participant
Posts: 89
Joined: Sat Jul 24, 2010 11:33 pm

Post by developeretl »

Franklin,
I should exclude the first line of the files. If I keep it true it will consider first line as column . In target I need to populate to target with columns name excluding the first line from source
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No, setting that option to true will cause the first record in the file to be skipped over.
-craig

"You can never have too many knives" -- Logan Nine Fingers
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

Remember: I'm using 7x, not 8x, so if 8x is different I'll be wrong... That said, may I state the obvious?

The sequential file stage(s) that read(s) the file(s) will simply ignore (as in not pass through the output link) the first record. It doesn't matter what's in that record. The attribute in this case has a misleading name.

The sequential file stage that writes a file can have different attributes.

:)
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

FranklinE wrote:Remember: I'm using 7x, not 8x, so if 8x is different I'll be wrong...
It's not... nor are you.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Did you get this working?

It has been bugging me, I finally got a chance to dig thru the 8.5 docs and see how it was explained. Turns out... poorly.

For an Output (reading) link:

First Line is Column Names

Specifies that the first line of the file contains column names. This property is false by default.

For an Input (writing) link:

First Line is Column Names

Specifies that the first line of the file contains column names. This property is false by default.

Gee, that's helpful and really highlights the difference between the two. :roll:

Still surprised it's just a boolean value, Informatica has a "Records to skip" option that I can set to 0, 1 or any other appropriate number... just had a file with two header records, no automatic way to handle that in DataStage.
-craig

"You can never have too many knives" -- Logan Nine Fingers
developeretl
Participant
Posts: 89
Joined: Sat Jul 24, 2010 11:33 pm

Post by developeretl »

I have tried that option " First line is column names " . It did not work . Will try to use the row number logic to exclude the first row in transformer.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Tell us what "did not work" about it as it certainly should have as that's exactly what it is for.
-craig

"You can never have too many knives" -- Logan Nine Fingers
developeretl
Participant
Posts: 89
Joined: Sat Jul 24, 2010 11:33 pm

Post by developeretl »

I was getting import error for the columns. So we have removed the first line using shell scripts. Thanks for the information
imfarhan
Participant
Posts: 53
Joined: Tue Jul 24, 2012 9:34 am

Post by imfarhan »

Select the first line as Header and then

Under "Format" tab
I've done the settings as follows:
Final delimiter = end
Recod Delimiter = newline
Field defaults:
Delimeter = comma
Quote = Double
Farhan Syed
Post Reply