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

which record will be read in called program


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jyothimenon1

New User


Joined: 16 Jul 2008
Posts: 9
Location: bangalore

PostPosted: Wed Jul 30, 2008 12:29 pm
Reply with quote

here what will happen?

I have a doubt regarding open a file in one program and use it in its called program

Consider the scenario where I read 10 records from the file using the main program and if I gave a read in the called program then will I get the 11th record or the first record? (Here Im talking about the case that we are not carrying any key info from the main program to the sub program)
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Jul 30, 2008 12:34 pm
Reply with quote

batch or online.

if batch, you need two fd's, which means what you read in the second has nothing to do with the first.

if online, and you are passing keys, and you can only read vsam, you are going to have diddely in the second.
Back to top
View user's profile Send private message
sudhakar84

New User


Joined: 20 Jun 2008
Posts: 25
Location: chennai

PostPosted: Wed Jul 30, 2008 3:26 pm
Reply with quote

dbzTHEdinosauer , Thanks for the info.
Back to top
View user's profile Send private message
jyothimenon1

New User


Joined: 16 Jul 2008
Posts: 9
Location: bangalore

PostPosted: Wed Jul 30, 2008 4:49 pm
Reply with quote

hai dbzTHEdinosauer,

Thank you so much for the reply
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Jul 30, 2008 5:09 pm
Reply with quote

Is it a COBOL EXTERNAL file? Does the subprogram have a separate file definition and open? The answer will vary depending on the precise environment ....
Back to top
View user's profile Send private message
jyothimenon1

New User


Joined: 16 Jul 2008
Posts: 9
Location: bangalore

PostPosted: Wed Jul 30, 2008 5:59 pm
Reply with quote

hai Robert

The sub program have seperate FD then what will happen?

please help me if there is no seperate FD for sub program, is it possible ?


In the case of external file declared in calling program , is there need to declare FD again in called program?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Jul 30, 2008 6:40 pm
Reply with quote

I know about EXTERNAL files but haven't used one (so far). The Programming Guide has a write up with examples:http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/IGY3PG20/4.2.6.1?DT=20040220035836 of how to do the main and subprogram(s).
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Wed Jul 30, 2008 7:47 pm
Reply with quote

If the file is declared external, both programs will have an FD with "external" in it. In this case if one program reads 10 records, then the next record read by either program will be the 11th record.
If the file is not external, both programs will have an FD, but each program must open the file and they are independent. If one program reads 10 records and then the other program reads a record, it will get record 1.
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Using API Gateway from CICS program CICS 0
No new posts Error to read log with rexx CLIST & REXX 11
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top