WEOFSEQ Subroutine doesn´t work.

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

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

Post by ray.wurlod »

Your problem, it seems to me, is the CHAR() functions in your WRITESEQ statement. WRITESEQ itself adds a line terminator - that's why you're getting two lines. All you need is

Code: Select all

WRITESEQ Oconv(@DATE,"D/DMY[2,2,4]"):"|1" TO VerificaArquivo 
ELSE 
FlagIns = 0 
END
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
joycerecacho
Participant
Posts: 298
Joined: Tue Aug 26, 2008 12:17 pm

Post by joycerecacho »

Actually I think I was not clear and you didnt get it. When the routine is called for the third time, the last register inserted is updated, and it happens every time the routine is called. In short, the file has always only two registers.
Even if I call it thousand of times.

Ex. If I call the routine for the fourth time, the last register - which was updated by the third execution - is updated again. Keeping only the number of two registers.

With or without 'Char(10):Char(13)' it happens.

My friend, thank u for your help.

Best Regards,
Joyce A. Recacho
São Paulo/SP
Brazil
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

So what you seem to be saying is that WEOFSEQ is not truncating the file?

Try using the OpenSequentialFile routine.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Again, try (or look at the source for) OpenSequentialFile routine - there's a link to it in my earlier post. You need to SEEK to end of file before using WRITESEQ to insert the new line.
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