Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Random access on sequential file
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Interview Questions
Author Message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 81
Location: Mumbai

PostPosted: Tue Jan 08, 2008 9:56 pm    Post subject: Random access on sequential file
Reply with quote

If we have a file defined earlier as sequential file. Suppose I want to use for dynamic access. Assuming the file is sorted in the key positions. And I define it as organisation is indexed. Can random access be done on it ?
Back to top
View user's profile Send private message
References
PostPosted: Tue Jan 08, 2008 9:56 pm    Post subject: Re: Random access on sequential file Reply with quote

stodolas

Senior Member


Joined: 13 Jun 2007
Posts: 646
Location: Wisconsin

PostPosted: Wed Jan 09, 2008 1:08 am    Post subject:
Reply with quote

No
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1482
Location: Bangalore,India

PostPosted: Wed Jan 09, 2008 7:58 am    Post subject:
Reply with quote

Quote:
And I define it as organisation is indexed

Go thru the manuals, when do you define organization as INDEXED? MF (as a matter of fact any system) doesn't work as your wish.... its the otherway icon_cry.gif icon_cry.gif .
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 81
Location: Mumbai

PostPosted: Wed Jan 09, 2008 6:59 pm    Post subject:
Reply with quote

I tried this on mainframe and I got IEC161I 076-002. Seems the sequential file could not get opened as VSAM.
Back to top
View user's profile Send private message
stodolas

Senior Member


Joined: 13 Jun 2007
Posts: 646
Location: Wisconsin

PostPosted: Wed Jan 09, 2008 7:18 pm    Post subject:
Reply with quote

Of course it can't get opened as a VSAM. It isn't a VSAM. Just like you can't open a database like a VSAM because it isn't a VSAM
Back to top
View user's profile Send private message
Anuj D.

Senior Member


Joined: 22 Apr 2006
Posts: 1706
Location: Mumbai, India

PostPosted: Wed Jan 09, 2008 9:23 pm    Post subject:
Reply with quote

niks_jude wrote:
Seems the sequential file could not get opened as VSAM.

Was bit curious to know..what's the origin of this idea, to read a Sequential file as VSAM? what clciked you?
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 81
Location: Mumbai

PostPosted: Thu Jan 10, 2008 11:33 am    Post subject:
Reply with quote

My idea was if a sequential file is sorted in key positions. then can be random access be done on it. Basically whether physical organisation has anything to do with what we define logically in a COBOL program. Just like we can use VSAM sequentially, is the other way round possible ?
Back to top
View user's profile Send private message
stodolas

Senior Member


Joined: 13 Jun 2007
Posts: 646
Location: Wisconsin

PostPosted: Thu Jan 10, 2008 6:29 pm    Post subject:
Reply with quote

Move the data into a VSAM or DB table if you need random access.
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 115
Location: Bangalore

PostPosted: Thu Jan 10, 2008 6:59 pm    Post subject: Reply to: Random access on sequential file
Reply with quote

The organisation of the file sequential file has the characteristic that allows the records to be accessed in the order in which they are stored in the file. Here I am talking about the PS (physical sequential) file. The random and dynamic accesses are not allowed. Also START and DELETE operations can not be performed on it.

But an ESDS VSAM file can be accessed randomly using RBA in CICS.

Thanks,
Ajay
Back to top
View user's profile Send private message
Anuj D.

Senior Member


Joined: 22 Apr 2006
Posts: 1706
Location: Mumbai, India

PostPosted: Thu Jan 10, 2008 7:01 pm    Post subject:
Reply with quote

niks_jude wrote:
Just like we can use VSAM sequentially, is the other way round possible ?

In Mainframes (MF) we can't & this is one of the probable reason why VSAM in use.
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 81
Location: Mumbai

PostPosted: Fri Jan 11, 2008 11:24 am    Post subject:
Reply with quote

Thanks it clears my doubt.
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 81
Location: Mumbai

PostPosted: Fri Jan 11, 2008 12:06 pm    Post subject:
Reply with quote

One more thing to add which should clear everyone on this topic -----

The main reason is that for random access an index is required. The index is the displacement corresponding to each key. This is not part of the sequential file organization that is why random access cannot be done on the sequential file.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1481

PostPosted: Tue Jan 15, 2008 8:36 pm    Post subject:
Reply with quote

Hi niks_jude,

The main reason is that seq files were never designed for random access. That's why they call them PS (Physical Sequential) files.

You can define them as "indexed", but that doesn't make it so.
Back to top
View user's profile Send private message
Douglas Wilder

Active User


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

PostPosted: Tue Jan 15, 2008 8:57 pm    Post subject:
Reply with quote

It is too bad that on the mainframe this cannot be done. Some languages on PCs allow random access of sequential file by positioning to a record or byte position within the file and then doing a read. But if it cannot be done, there is not anything we can do about it. (or is there?)
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 7517
Location: 221 B Baker St

PostPosted: Wed Jan 16, 2008 3:55 am    Post subject:
Reply with quote

Hello,

This goes back a long, long time and i have no reference material, but i seem to recall that one could issue a BDAM read against a PS (QSAM) file.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Interview Questions All times are GMT + 6 HoursGoto page 1, 2  Next
Page 1 of 2