View previous topic :: View next topic
|
Author |
Message |
anjani shanker
New User
Joined: 26 Jan 2007 Posts: 37 Location: USA
|
|
|
|
Hi All!!
Here is a scenario I am stuck with -
AAAA is my main module reading file XXXX. I call BBBB from AAAA and i want it to read same file XXXX from next row which AAAA has already read..Please let me know if I can implement this?
Thanks!
Anjani |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
There may be some more elegant way in pl/i, but in other languages one way to do what you want is to add a 3rd module that does all of the file reads. Both AAAA and BBBB would call this new file module (FFFF) and FFFF would do all of the file access. |
|
Back to top |
|
|
anjani shanker
New User
Joined: 26 Jan 2007 Posts: 37 Location: USA
|
|
|
|
So do I just need to pass the pointers amongst the modules calling FFFF(Read File Module) and keep calling it to make sure next encountered READ stmt reads the next record in the file. Right?
Or is there any special File declaration I need to make in my modules.
Thanks for your help!! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
The only module that would have file information would be the FFFF module. The other modules would call this one and would not directly refer to the file.
If i understand correctly, yes.
When calling the FFFF module, i'd suggest passing a function (OPEN/READ/CLOSE), an End-of-File indicator to be set by the FFFF module, and a data area to receive the record read by FFFF. |
|
Back to top |
|
|
anjani shanker
New User
Joined: 26 Jan 2007 Posts: 37 Location: USA
|
|
|
|
Thanks so much DC. you were of great help!!
Appreciate your quick replies! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome - good luck
d |
|
Back to top |
|
|
udaybarath
New User
Joined: 10 May 2005 Posts: 7
|
|
|
|
HI,
Question
-----------
AAAA is my main module reading file XXXX. I call BBBB from AAAA and i want it to read same file XXXX from next row which AAAA has already read..Please let me know if I can implement this?
Answer
---------
While reading the file from AAAA module, increase the counter for your read. Pass the counter value to BBBB wile calling.
In BBBB module, read the same file with IGNORE(counter), this will ignore the records already read in AAAAA. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
udaybarath wrote: |
HI,
Question
-----------
AAAA is my main module reading file XXXX. I call BBBB from AAAA and i want it to read same file XXXX from next row which AAAA has already read..Please let me know if I can implement this?
Answer
---------
While reading the file from AAAA module, increase the counter for your read. Pass the counter value to BBBB wile calling.
In BBBB module, read the same file with IGNORE(counter), this will ignore the records already read in AAAAA. |
good example of
If you can't wedge it in with a crowbar
try using a hammer! |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
And these are the skilled people coming into the US on H1B visa. Sheesh... |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
prino wrote: |
And these are the skilled people coming into the US on H1B visa. Sheesh... |
|
|
Back to top |
|
|
|