|
On Jul 25, 2021, at 2:39 PM, Alan Shore via MIDRANGE-L <midrange-l@xxxxxxxxxxxxxxxxxx<mailto:midrange-l@xxxxxxxxxxxxxxxxxx>> wrote:
Hi everyone
I just re-read my e-mail and realized that it is misleading
Using that web site -
A better way to read a file in the IFS with RPG @ RPGPGM.COM<https://www.rpgpgm.com/2016/03/a-better-way-to-read-file-in-ifs-with.html<https://www.rpgpgm.com/2016/03/a-better-way-to-read-file-in-ifs-with.html>>
The problem is with the the OpenFile
Here is the pertinent code
dcl-pr OpenFile pointer extproc('_C_IFS_fopen') ;
*n pointer value ; //File name
*n pointer value ; //File mode
end-pr ;
dcl-pr ReadFile pointer extproc('_C_IFS_fgets') ;
*n pointer value ; //Retrieved data
*n int(10) value ; //Data size
*n pointer value ; //Misc pointer
end-pr ;
dcl-pr CloseFile extproc('_C_IFS_fclose') ;
*n pointer value ; //Misc pointer
end-pr ;
PathFile2read = %trim(PriorPathfile) + x'00' ;
OpenMode = 'r' + x'00' ;
FilePtr = OpenFile(%addr(PathFile2read):%addr(OpenMode)) ;
if (FilePtr = *null) ;
CannotreadPriorBAI2();
return;
endif ;
Alan Shore
Solutions Architect
IT Supply Chain Execution
[cid:image001.png@01D78162.E7C4C710]
60 Orville Drive
Bohemia, NY 11716
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
E-mail : ASHORE@xxxxxxxxxxxxxxxxxxxx<mailto:ASHORE@xxxxxxxxxxxxxxxxxxxx>
'If you're going through hell, keep going.'
Winston Churchill
From: Alan Shore
Sent: Sunday, July 25, 2021 1:26 PM
To: midrange-l@xxxxxxxxxxxxxxxxxx<mailto:midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Using _C_IFS_fopen and _C_IFS_fgets to read files in the ifs
Hi everyone
We are on V7r3
We have a number of files in the ifs that I am attempting to use _C_IFS_fopen, _C_IFS_fgets and _C_IFS_fclose to read
Please see the following web page
A better way to read a file in the IFS with RPG @ RPGPGM.COM<https://www.rpgpgm.com/2016/03/a-better-way-to-read-file-in-ifs-with.html<https://www.rpgpgm.com/2016/03/a-better-way-to-read-file-in-ifs-with.html>>
I have a situation where one of the files is not read by these utilities
Does anyone know how I can determine why?
I am able to go into that file using wrklnk and edtf - so I believe its NOT an authority situation
However, the program is not able to read the rest of the files AFTER that one
I can sign off, sign back in, change the program to start AFTER that one particular file, and the rest of the files can be read
So I am assuming that something needs to be initialized after such a read, but In am unable to find anything as to what that could possibly be
Does anyone have any knowledge of such a situation and how to rectify it?
As always - all answers gratefully accepted
Alan Shore
Solutions Architect
IT Supply Chain Execution
[cid:image003.png@01D78162.E7C4C710]
60 Orville Drive
Bohemia, NY 11716
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
E-mail : ASHORE@xxxxxxxxxxxxxxxxxxxx<mailto:ASHORE@xxxxxxxxxxxxxxxxxxxx<mailto:ASHORE@xxxxxxxxxxxxxxxxxxxx%3cmailto:ASHORE@xxxxxxxxxxxxxxxxxxxx>>
'If you're going through hell, keep going.'
Winston Churchill
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx<mailto:MIDRANGE-L@xxxxxxxxxxxxxxxxxx>
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l<https://lists.midrange.com/mailman/listinfo/midrange-l>
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx<mailto:MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx>
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l<https://archive.midrange.com/midrange-l>.
Please contact support@xxxxxxxxxxxxxxxxxxxx<mailto:support@xxxxxxxxxxxxxxxxxxxx> for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com<https://amazon.midrange.com>
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.