How to overwrite seqfile through basic command.

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

Post Reply
hhh
Participant
Posts: 86
Joined: Tue Aug 02, 2005 7:39 am

How to overwrite seqfile through basic command.

Post by hhh »

Hello,

While using following command in our routine
OpenSeq PathName To FileVar Else ; * Open the sequential file or if not exist then create seq file
CREATE FileVar ELSE ABORT

,If file already exists and we want to overwrite our data so we can not able to overwrite the i/p data on particular file with this command.

what is the way to overwrite file if it is already existed.

Pl suggest your ideas on same.

regards,
Hiten
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Search the forum for a routine called OpenSequentialFile and use that. It handles all possibilities.

The actual statement you require is WEOFSEQ, but there are other possibilities you haven't even thought about thus far.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
maheshsada
Participant
Posts: 69
Joined: Tue Jan 18, 2005 12:15 am

Post by maheshsada »

you can use the status function to check the how the Openseq was executed based on which you can overwrite the seq file

the possible return values are 0 - successful, 1 - failed to open
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What about where the file does not exist, but is nonetheless opened for writing? What about where there exists a record level lock on the file taken by another process? As I said, there are very many possibilities, which is why the OpenSequentialFile routine exists.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply