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
 

 

What is basically QSAM file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Amb

New User


Joined: 12 Mar 2010
Posts: 64
Location: India

PostPosted: Fri Aug 13, 2010 5:05 pm    Post subject: What is basically QSAM file
Reply with quote

Hi,

can anyone let me know the following?

1) What is basically QSAM file?
(I searched the net but can anyone give me a simple answer. I am not able to understand the Queue concept)

2) Is there any advantage of using QSAM file over PS files?
Is there any advantage of using QSAM file over VSAM files?
I am not able to understand why would one go for QSAM files.

3) How to read/write a QSAM file from a COBOL program? Is it the same as we perform a read/write on a sequential file?
If it is not same can anyone provide me a sample code which read/writes in a QSAM file?

4) How to define a QSAM file in a JCL?


I know I am asking very basic questions but I am not able to find satisfactory and detailed answers for the same.
Back to top
View user's profile Send private message

superk

Moderator Team Head


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

PostPosted: Fri Aug 13, 2010 5:13 pm    Post subject: Reply to: QSAM files
Reply with quote

Let's get the terminology right. QSAM is the access method used to access sequential datasets, it's not a type of dataset.

Does that fact maybe answer all of your questions?
Back to top
View user's profile Send private message
superk

Moderator Team Head


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

PostPosted: Fri Aug 13, 2010 5:16 pm    Post subject: Reply to: QSAM files
Reply with quote

Queued Sequential Access Method from the DFSMS Using Data Sets manual:

Quote:

QSAM arranges records sequentially in the order that they are entered to form sequential data sets. The system organizes records with other records. QSAM anticipates the need for records based on their order. To improve performance, QSAM reads these records into storage before they are requested. This is called queued access. You can use QSAM with the following data types:

- sequential data sets
- extended-format data sets
- z/OS UNIX files
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Fri Aug 13, 2010 5:22 pm    Post subject:
Reply with quote

This link may help explain it for you: http://publib.boulder.ibm.com/infocenter/zos/basics/index.jsp?topic=/com.ibm.zos.zconcepts/zconcepts_150.htm

If you are creating a tape, you cannot use VSAM -- so you must use QSAM (or BSAM). There are times when sequential files make sense, just as there are times when indexed or relative record files make sense. You pick the file access based on business requirements, and the way you access the file (i.e., the access method) then follows naturally.
Back to top
View user's profile Send private message
Amb

New User


Joined: 12 Mar 2010
Posts: 64
Location: India

PostPosted: Mon Aug 16, 2010 10:02 am    Post subject: Reply to: What is basically QSAM file
Reply with quote

From the above discussion I understand that QSAM is just an access method for a sequential file.

So if I read/write a sequential file in my COBOL program then how to ensure that the access method used is QSAM

For this do we need to make any changes to the JCL step which is referring to this QSAM file?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


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

PostPosted: Mon Aug 16, 2010 3:05 pm    Post subject:
Reply with quote

By using the SELECT statement you tell COBOL what access method to use.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Mon Aug 16, 2010 4:32 pm    Post subject:
Reply with quote

QSAM is the default -- you would have to make changes to your JCL to use anything else.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
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 How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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