PENSEQ InFile to output_file
ElSE CREATE output_file
ELSE ERRORCODE=1
For x = 1 to LCnt
LId = LogIdList<x>
vEventDetail = vEventDetail:Field(DSGetLogEntry(hJob,LId),"\",4)
WRITESEQF vEventDetail to output_file
ELSE STOP
WEOFSEQ output_file
Next
CLOSESEQ output_file
is there any issue with code which is writing to file.
OPENSEQ InFile to output_file
THEN
WEOFSEQ output_file
END
ELSE
CREATE output_file ELSE ERRORCODE=1
END
For x = 1 to LCnt
LId = LogIdList<x>
vEventDetail = vEventDetail:Field(DSGetLogEntry(hJob,LId),"\",4)
WRITESEQ vEventDetail ON output_file ELSE STOP "Bad Write"
** WEOFSEQ output_file !! Don't do this, it writes an end-of-file marker and truncates the file
NEXT X
CLOSESEQ output_file
The WEOFSEQ command truncates the sequential file each time it is executed, you have that statement inside your loop. Otherwise I just cleaned up the code a little.
Writing to a sequential file using WRITESEQ will terminate each line. Could it be that your server is on UNIX and you are viewing in Windows? (UNIX uses <LF> while Windows uses <CR><LF>). If that is the case, try using wordpad.exe or notepad++.exe to read the sequential file. If you need windows-type termination when writing in UNIX, add the "Char(13)" to each string line you write with WRITESEQ.
Make a test copy of the routine that writes only 2 (preferably short) lines to a file, then use the UNIX "od" command to dump that to see what you are getting as control characters. I would expect to see only char(10) (<LF>) after the data.
I can't check right now, but assume that your log entries contain either a field-mark or value-mark. If you mask those with spaces, i.e. with "vEventDetail = vEventDetail:CONVERT(@FM:@VM,' ',Field(DSGetLogEntry(hJob,LId),"\",4))" what does your output look like?