Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Read File In PL1

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: Read File In PL1
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

Site Director


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

PostPosted: Wed Oct 13, 2010 8:01 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Wed Oct 13, 2010 8:54 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Wed Oct 13, 2010 9:35 am    Post subject: Reply to: Read File In PL1
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    Post subject: Another approach
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: 6968
Location: porcelain throne

PostPosted: Tue Nov 09, 2010 3:03 pm    Post subject: Re: Another approach
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: 1027
Location: Oostende, Belgium

PostPosted: Tue Nov 09, 2010 4:57 pm    Post subject:
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: 2435
Location: Netherlands, Amstelveen

PostPosted: Tue Nov 09, 2010 6:25 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us