Reading only the 1st rec from a secqential file in ver 7.0

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
dsedi
Participant
Posts: 220
Joined: Wed Jun 02, 2004 12:38 am

Reading only the 1st rec from a secqential file in ver 7.0

Post by dsedi »

Is there a way to restirct the seq stage to read only the first record in 7.0 version.Iknow that we have an option in 7.5.1 to do this functionality(Number of records).
If not, wats the best possible way ?Be'coz i don't want to read the whole file but process only the first record.
Thanks for ur help in advance
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

By "read" you mean one read operation than stop, as opposed to using a constraint to only allow the first row to pass the first transformer? There's nothing outside of a filter using the "head -n1 yourfile" statement.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

You have many methods.
You can use filter command and read Head -1 and the file name.
And you can specify /dev/null in the File name option.
Or you can perform the same in Before job subroutine.
Head -1 filename > Filename2.txt
And read the Filename2.txt
Or simply use Head Stage.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply