× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



noooooo.....  i didn't say that.  it was the monkeys that live in my head.

What I was trying to say is that I wonder if you are cutting off the CRLF when you do the trims.

Booth Martin wrote:
See if this works:

Fd=write(RC2:%addr(stringvalW): (%Len(%Trim(stringvalW)) + CRLF))



Grizzly Malchow wrote:
I'm writing records to a stream file opened up as follows:

O_WRONLY          C                   2
D O_CREAT C 8 D O_CODEPAGE C 8388608 D S_IXUSR C 64 D CRLF c const(X'0D25')

RC2=open(TempStmfFile:O_CREAT+O_WRONLY+O_CODEPAGE
         :S_IWUSR
         :819);

StringValW = %TrimR(StringVal) + CRLF; Fd=write(RC2:%addr(stringvalW):%Len(%Trim(stringvalW)));

The write is inside of a loop. The problem I'm having is sometimes lines
are being appended as opposed to being written on a new line. Or at
least that's what it looks like when I view the file. For instance if I had the following?

StringVal = 'LINE 1                   ';
StringValW = %TrimR(StringVal) + CRLF;
Fd=write(RC2:%addr(stringvalW):%Len(%Trim(stringvalW)));

StringVal = 'LINE 2    ';
StringValW = %TrimR(StringVal) + CRLF;
Fd=write(RC2:%addr(stringvalW):%Len(%Trim(stringvalW)));

The output in the IFS file reads as follows:
LINE1 LINE2

I can't seem to figure out what I'm doing wrong. Any ideas? Would I be
better off using O_TEXTDATA in place of O_CODEPAGE if I was dealing with
a text file/HTML file?
Thanks,
Griz




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.