× 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.



I haven't read any replies to this note yet, as I'm just getting into my
email now, but it seems that your problem is the trailing blanks, not so
much the stream file issue.
CPYTOSTMF will include the extra blanks at the end of the SRCDTA field
anyway, so it may be not be the best choice.
-Bob


-----Original Message-----
From: mi400-bounces@xxxxxxxxxxxx [mailto:mi400-bounces@xxxxxxxxxxxx] On
Behalf Of Hewitt, Rory
Sent: Thursday, October 28, 2004 4:32 PM
To: mi400@xxxxxxxxxxxx
Subject: [MI400] CPYTOSTMF under the covers

All,

More of a C question than an MI question, but...
 
I'm trying to do a read of a database source member using the read()
"UNIX-type" API. However, because OS/400 recognizes that it isn't a
'true' stream file but is a fixed-record-length file, it includes all
the trailing blanks. Since my source file contains text data, I don't
care about all the trailing blanks.
 
I can get round this by either simply reading each record in the source
file and trimming/concatenating them into a variable (my current
approach) or using the CPYTOSTMF command to copy the source member into
a 'true' stream file and then reading that. However, the multiple read
approach is time-consuming and the CPYTOSTMF isn't much faster and
involves a command-interface using QCAPCMD.

Is there any way that I can either directly access the processing which
underlies the CPYTOSTMF command (I notice that there is a called
procedure called
copy_database_file_member__FP23qp0l_stmf_description_tP22qp0l_dbf_descri
ption_tP12qlg_pathnameUsPvPV22qp0l_STMF_DBF_commarea() in one of the
service programs called by the CPYTOSTMF CPP which could be something
useful...) or somehow convince OS/400 that my database file (for the
purposes of the read() API) is actually a 'true' stream file? Is this
information that is held in the file header or is it determined by
OS/400 seeing that the file is in the QSYS file system?

Thanks in advance,

Rory

_______________________________________________
This is the MI Programming on the AS400 / iSeries (MI400) mailing list
To post a message email: MI400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/mi400
or email: MI400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/mi400.




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.