View previous topic :: View next topic
|
Author |
Message |
abdulrafi
Active User
Joined: 14 Sep 2009 Posts: 184 Location: Coimbatore
|
|
|
|
Could you please give me a clear idea on what is the difference between PS file and ESDS file. As both are sequential file and not indexed (if not please correct me) how can we differentiate both in a COBOL program. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Hmm.
Well, an ESDS dataset is a VSAM dataset and can only exist on DASD. A sequential dataset can exist on any supported media (DASD, Tape, SYSOUT, etc.).
A COBOL program differentiates between the two by the options you specify in the FILE-CONTROL paragraph. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1248 Location: Richfield, MN, USA
|
|
|
|
The COBOL Language Reference Manual has the details. |
|
Back to top |
|
|
abdulrafi
Active User
Joined: 14 Sep 2009 Posts: 184 Location: Coimbatore
|
|
|
|
Thanks for your reply. Ya i would like to know how to give it in COBOL program only. Could you please pass me the link on so that i can find it or else please pass me the FILE SECTION(to differentiate between both). |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
A non-VSAM sequential file is simply a sequential file somewhere; could be disk, tape, cards, printer (or spooler) for example as Kevin has said. On a z-OS(MVS) system, these files are normally accessed via QSAM IO modules. A VSAM ESDS is a file located on disk in VSAM-managed space (i.e. is listed in the VSAM catalog) and is accessed via VSAM IO modules. As far as COBOL is concerned, either type of file is OK for use as a SEQUENTIAL file with no program changes needed.
An ESDS is essentially a sequential dataset where new records are always inserted at the end. You cannot access records directly with a key. However, you may access specific records with a relative byte address (RBA), if you have or can calculate it. In fact, it's fairly common to see CICS application use an ESDS as a log file to write records in sequential order while retrieving the new record's RBA from the RIDFLD operand of the EXEC CICS WRITE command. If the application squirrels away the RBA it can later retrieve the log record directly. Also note that you cannot physically delete a record from an ESDS. Instead, most applications utilize a "logical delete" scheme where a field in the ESDS record is set to a value indicating the record is no longer valid. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
1. In physical sequential file records are stored in terms of blocks,where as in VSAM files records are stored in ControlInterval(C.I).
2. PS files can be created on tapes while the VSAM files cannot. And (probably that's why) VSAM files can have ALTINDX(alternate index) while no such facility exists for PS files. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Please have a look on the link Kevin has provided and keep in mind, if the file is a VSAM ESDS, your COBOL SELECT statement must be in the form
Code: |
ASSIGN TO <comment>-AS-<ddname> |
|
|
Back to top |
|
|
praveensinha Warnings : 1 New User
Joined: 02 Oct 2009 Posts: 64 Location: Hyd
|
|
|
|
FYI superk...
i have few Vsam datasets which reside on tapes in migrated state... |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
praveensinha wrote: |
FYI superk...
i have few Vsam datasets which reside on tapes in migrated state... |
Well I have a lot of punched cards on dasd and probably also migrated. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
praveensinha wrote: |
i have few Vsam datasets which reside on tapes in migrated state... |
I think that you will find that although the original structure of the file was VSAM, but when the file is migrated to tape it becomes a straight ol' PS file and NOT a VSAM file.
Please make sure that your statements are factual rather than fancifull. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
expat,
he is a Mainframe Storage Engineer,
why would not every breath that he utters be factual? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
dbzTHEdinosauer wrote: |
he is a Mainframe Storage Engineer,
|
If his title was aviation engineer I'd probably never fly again |
|
Back to top |
|
|
praveensinha Warnings : 1 New User
Joined: 02 Oct 2009 Posts: 64 Location: Hyd
|
|
|
|
thank my friends...
Anyways its always a source of learning in this forum... |
|
Back to top |
|
|
Suresh Uthirapathy
New User
Joined: 29 Jul 2011 Posts: 4 Location: INDIA
|
|
|
|
Thanks All..! |
|
Back to top |
|
|
|