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

Difference between PS file and ESDS file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
abdulrafi

Active User


Joined: 14 Sep 2009
Posts: 184
Location: Coimbatore

PostPosted: Thu Oct 08, 2009 8:36 am
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Oct 08, 2009 9:28 am
Reply with quote

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
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1248
Location: Richfield, MN, USA

PostPosted: Thu Oct 08, 2009 9:31 am
Reply with quote

The COBOL Language Reference Manual has the details.
Back to top
View user's profile Send private message
abdulrafi

Active User


Joined: 14 Sep 2009
Posts: 184
Location: Coimbatore

PostPosted: Thu Oct 08, 2009 11:15 am
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Thu Oct 08, 2009 11:19 am
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Thu Oct 08, 2009 11:21 am
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Thu Oct 08, 2009 11:27 am
Reply with quote

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
View user's profile Send private message
praveensinha
Warnings : 1

New User


Joined: 02 Oct 2009
Posts: 64
Location: Hyd

PostPosted: Thu Jan 21, 2010 4:54 pm
Reply with quote

FYI superk...


i have few Vsam datasets which reside on tapes in migrated state...
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Jan 21, 2010 4:57 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Thu Jan 21, 2010 5:20 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Jan 21, 2010 5:31 pm
Reply with quote

expat,
he is a Mainframe Storage Engineer,
why would not every breath that he utters be factual?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Thu Jan 21, 2010 5:47 pm
Reply with quote

dbzTHEdinosauer wrote:
he is a Mainframe Storage Engineer,

If his title was aviation engineer I'd probably never fly again icon_biggrin.gif
Back to top
View user's profile Send private message
praveensinha
Warnings : 1

New User


Joined: 02 Oct 2009
Posts: 64
Location: Hyd

PostPosted: Thu Jan 21, 2010 7:35 pm
Reply with quote

thank my friends... icon_biggrin.gif

Anyways its always a source of learning in this forum...
Back to top
View user's profile Send private message
Suresh Uthirapathy

New User


Joined: 29 Jul 2011
Posts: 4
Location: INDIA

PostPosted: Thu Aug 04, 2011 1:32 pm
Reply with quote

Thanks All..!
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Unable to interpret a hex value to De... COBOL Programming 7
No new posts Difference between joblib and steplib JCL & VSAM 2
No new posts Pull data using date difference betwe... DB2 6
No new posts how to eliminate null indicator value... DB2 7
No new posts Difference between PLT txn and schedu... CICS 3
Search our Forums:

Back to Top