Routine Error

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
hemant
Participant
Posts: 67
Joined: Mon Dec 15, 2003 6:43 am

Routine Error

Post by hemant »

Hi,

I have created a transform type routine to append user supplied information to an existing text file. Since this routine needs to be called several times during the sequencer, no data should be overwritten in any call.
So, i forward the read pointer by having repeated READSEQ calls until it reaches the EOF. But i'm encountering a abrupt abort whenever this routine is called in the sequencer. 'InputArg' (is a filename) and 'Msg' are the user supplied arguments. Pls find enclosed the code for the routine.

ValidOpen = @FALSE
filename = InputArg
OPENSEQ filename TO FILE Then
ValidOpen = @TRUE
End Else
CREATE FILE Then ValidOpen = @TRUE
End

NewTxt = Msg
FileEnd = 0

Loop
READSEQ A FROM filename Then
End Else
FileEnd=1
End
Until FileEnd
Repeat

WRITESEQ NewTxt TO FILE else
End
WEOFSEQ FILE
CLOSESEQ FILE
Ans=1
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

How about putting some DSLogInfo calls into the "Else" conditions to see why some of those (just a guess) are failing. If the else condition is taken and you don't act accordinly and the logic continues, bad things can happen.
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
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
Use SEEK to get to the EOF.
SEEK is in the basic manual.

IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
Post Reply