View previous topic :: View next topic
|
Author |
Message |
niks_jude Warnings : 1 Active User
Joined: 01 Dec 2006 Posts: 144 Location: Mumbai
|
|
|
|
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 |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 632 Location: Wisconsin
|
|
|
|
No |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
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 . |
|
Back to top |
|
|
niks_jude Warnings : 1 Active User
Joined: 01 Dec 2006 Posts: 144 Location: Mumbai
|
|
|
|
I tried this on mainframe and I got IEC161I 076-002. Seems the sequential file could not get opened as VSAM. |
|
Back to top |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 632 Location: Wisconsin
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
niks_jude Warnings : 1 Active User
Joined: 01 Dec 2006 Posts: 144 Location: Mumbai
|
|
|
|
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 |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 632 Location: Wisconsin
|
|
|
|
Move the data into a VSAM or DB table if you need random access. |
|
Back to top |
|
|
Ajay Baghel
Active User
Joined: 25 Apr 2007 Posts: 206 Location: Bangalore
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
niks_jude Warnings : 1 Active User
Joined: 01 Dec 2006 Posts: 144 Location: Mumbai
|
|
|
|
Thanks it clears my doubt. |
|
Back to top |
|
|
niks_jude Warnings : 1 Active User
Joined: 01 Dec 2006 Posts: 144 Location: Mumbai
|
|
|
|
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 |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
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 |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|