datastage script(basic)
Moderators: chulett, rschirm, roy
datastage script(basic)
I want to extract records from a flat file using datastage script(basic).Can anyone PLease Post The Script?
-
- Participant
- Posts: 437
- Joined: Fri Oct 15, 2004 6:13 am
- Location: Pune, India
Ravindrag,
Are you sure you want to do this? The DataStage Sequential file stage does this in a quick, simple and understandable manner. If you really wish to write a script you will find many examples in this forum using search.
The main components will be:
- OPENSEQ to open the sequential file
- READSEQ to read a record on an opened file
- CLOSESEQ to close the file handle when finished
- A "FOR / NEXT" or "LOOP / UNTIL" construct or {I don't like this way} using "IF / GOTO".
Are you sure you want to do this? The DataStage Sequential file stage does this in a quick, simple and understandable manner. If you really wish to write a script you will find many examples in this forum using search.
The main components will be:
- OPENSEQ to open the sequential file
- READSEQ to read a record on an opened file
- CLOSESEQ to close the file handle when finished
- A "FOR / NEXT" or "LOOP / UNTIL" construct or {I don't like this way} using "IF / GOTO".
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Code: Select all
OpenSeq PathName To F.Var Then
Loop
ReadSeq Dummy From F.Var Else Exit ;* at end-of-file
Repeat
WriteSeq ReportText To F.Var Else
Call DSLogFatal("Cannot write to ":PathName, "MyRoutine")
End
End Else
Call DSLogFatal("Cannot open file ":PathName, "MyRoutine")
End
in append mode.
Why dont you use a sequential file stage to read from file?