|
Jevgeni, You need "rr nullcap=Y" when you open the file so you can handle the null capable fields. If that doesn't suffice you may want to learn more about file handle's null input map (fp->in_null_map). Elvis -----Original Message----- From: c400-l-bounces@xxxxxxxxxxxx [mailto:c400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jevgeni Astanovski Sent: Wednesday, December 17, 2003 4:13 PM To: C programming iSeries / AS400 Subject: [C400-L] Reading file with NULL fields There should be some trick about reading files with NULL-capable fields! But I deal with it for the first time.... Have a file Y6CPF: A R Y6CPFR A CPNC 6A TEXT('Account number') A DLP 3A TEXT('Deal type') ALWNULL Try to read it : fp = _Ropen("*LIBL/Y6CPF", "rr") ; fb = _Rreadf(fp, &Collateral, sizeof(y6cpf), __NO_LOCK) ; while (fb->num_bytes == sizeof(y6cpf)) { ... fb = _Rreadn(fp, &Collateral, sizeof(y6cpf), __NO_LOCK) ; } Nothing strange, I always do it like this. Program gets out of the loop on first record, having field DLP=NULL. Shit! And my goal was to find just these records... What's wrong? It SHOULD be as simple as usual! Any help will be really appreciated. Jevgeni Astanovski.
As an Amazon Associate we earn from qualifying purchases.
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.