× 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'm not an AS/400 type, although I have written several C programs for it 
due to a requirement to provide cross-platform compatibility.  I have some 
questions regarding record I/O processing (non-IFS files).

1. How is support for variable records provided or enforced?  For example, 
suppose you specify "type=record, recfm=vb, lrecl=84, blksize=172" as part 
of the fopen() attribute for a file. 
        a. In the case of output, are you suppose to provide a record 
descriptor word of 4-bytes (e.g. LLbb) at the beginning of the record that 
describes the length of the RDW and data           portion of the record? 
In MVS, this is a requirement. 
        b. In the case of input, are you provided with an RDW preceding 
the data portion of the record?
        c. If a record is written that actually exceeds 84 bytes, does 
fwrite() care (e.g. returns a value of 0)?
        d, Does fwrite() check if the record size is a multiple of 
blksize?

2.  I haven't tried using variable length records, but I have tried doing 
record I/O using fixed length records.  For example, I specified 
"type=record,recfm=f,lrecl=80" as part of the fopen()
     attribute.
        a.  In the case of output, fopen() did not complain if I wrote a 
record that exceeded 80 bytes.  And, in the case of input, I specified 
"lrecl=100", which did not match the lrecl that I 
             used to write the data (e.g. lrecl=80), and fread() didn't 
complain.  I just got 100 bytes.  Is it fair to assume that the I/O system 
does not enforce/check the fopen() attributes with
            respect to the file?  In MVS, the file's attributes are stored 
on disk with the file, and they are strictly enforced and checked.

TIA

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.