IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Read File In PL1


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
anjani shanker

New User


Joined: 26 Jan 2007
Posts: 37
Location: USA

PostPosted: Wed Oct 13, 2010 7:18 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Oct 13, 2010 8:01 am
Reply with quote

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
View user's profile Send private message
anjani shanker

New User


Joined: 26 Jan 2007
Posts: 37
Location: USA

PostPosted: Wed Oct 13, 2010 8:17 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Oct 13, 2010 8:54 am
Reply with quote

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.

Quote:
Right?
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
View user's profile Send private message
anjani shanker

New User


Joined: 26 Jan 2007
Posts: 37
Location: USA

PostPosted: Wed Oct 13, 2010 9:01 am
Reply with quote

Thanks so much DC. you were of great help!!

Appreciate your quick replies!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Oct 13, 2010 9:35 am
Reply with quote

You're welcome - good luck icon_smile.gif

d
Back to top
View user's profile Send private message
udaybarath

New User


Joined: 10 May 2005
Posts: 7

PostPosted: Tue Nov 09, 2010 1:44 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Nov 09, 2010 3:03 pm
Reply with quote

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
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Tue Nov 09, 2010 4:57 pm
Reply with quote

And these are the skilled people coming into the US on H1B visa. Sheesh...
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Nov 09, 2010 6:25 pm
Reply with quote

prino wrote:
And these are the skilled people coming into the US on H1B visa. Sheesh...



36_2_18.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 0
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Error to read log with rexx CLIST & REXX 11
Search our Forums:

Back to Top