×
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.
This is new to me to write to files in the IFS.
I have writing to a file used as a log file. The program worked at some
point, but changed. Now it is writing to the log file, but it does not in a
readable form.
At this point I have chased my tail and there seem to be too many options so
I am asking for help. I have a snippet of the code below.
Could the problem be in the combinations of the open flags?
d Path s 1024a varying
d LogName s 128a varying
d LogRecord s 32767a varying
d Message s 256a varying
d fd s 10i 0
d len s 10i 0
d rc s 10i 0
d
d*//----------------------------------------------------------
c/free
LogName = 'ACTlogs_' + %char(%Date()) + '.txt';
Path = '/A4G/ACT/logs/' + LogName ;
if (access(%trimr(path) : F_OK)) = 0;
fd = open( %trimr(path)
: O_APPEND + O_TRUNC + O_CCSID + O_TextData + O_WrOnly
: M_RDONLY
: 819
: 0 );
Else;
fd = open( %trimr(path)
: O_TEXT_CREAT + O_TEXTDATA + O_CREAT
+ O_WRONLY + O_APPEND + O_TRUNC + O_CCSID
: M_RDONLY
: 819
: 0 );
ENDIF;
// -----------------------------------------------------------
// write to the log file
// -----------------------------------------------------------
LogRecord = %char(%Timestamp()) ;
If p1ErrorStatus <> ' ';
LogRecord += ' SQL' + p1ErrorStatus;
EndIf;
LogRecord += ' ' + Message + ' Command ==>> ' + p1SQLcmd;
LogRecord = %trim(LogRecord);
len = write( fd : %Addr(LogRecord) : %len(LogRecord));
rc = close(fd);
Return;
TIA
Darryl Freinkel
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.