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
 

 

Random access on sequential file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
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

stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
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: 1439
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: 144
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

Active Member


Joined: 13 Jun 2007
Posts: 632
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 Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
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: 144
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

Active Member


Joined: 13 Jun 2007
Posts: 632
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: 205
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 Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
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: 144
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: 144
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: 1592

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: 305
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

Site Director


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

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
Douglas Wilder

Active User


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

PostPosted: Wed Jan 16, 2008 4:51 am    Post subject:
Reply with quote

I found this on the WEB, is it correct?
Quote:
BDAM file handling
Enterprise COBOL does not support the processing of BDAM files. Convert any BDAM files to virtual storage access method/relative record data set (VSAM/RRDS) files.
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 Jan 16, 2008 9:08 pm    Post subject:
Reply with quote

Hello,

I believe that is correct.

If one was so iniclined, i believe it could still be done in assembler.

As suggested in the quote, i'd recommend defining a vsam file and using that for random access.
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts IMS DC screen Access sivasaras IMS DB/DC 3 Fri Nov 18, 2016 6:38 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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