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

What is a QSAM file?


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Fri Aug 13, 2010 5:13 pm
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

Global Moderator


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

PostPosted: Fri Aug 13, 2010 5:16 pm
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: 8570
Location: Dubuque, Iowa, USA

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

This link may help explain it for you: 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
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: 2476
Location: Netherlands, Amstelveen

PostPosted: Mon Aug 16, 2010 3:05 pm
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: 8570
Location: Dubuque, Iowa, USA

PostPosted: Mon Aug 16, 2010 4:32 pm
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
RMD

New User


Joined: 16 Feb 2017
Posts: 2
Location: US

PostPosted: Sun Feb 19, 2017 7:58 pm
Reply with quote

Processing QSAM files

www.ibm.com/support/knowledgecenter/en/SS6SG3_3.4.0/com.ibm.entcobol.doc_3.4/tpqsm01.htm
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8570
Location: Dubuque, Iowa, USA

PostPosted: Sun Feb 19, 2017 8:35 pm
Reply with quote

RMD, adding to a topic after SIX AND A HALF YEARS is not really adding anything to the previous comments.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts rexx pgm to create multiple ps file IBM Tools 7
No new posts Remove commas from specific positions... DFSORT/ICETOOL 10
No new posts Uploading from desktop, a CSV file, s... DB2 2
No new posts Get two files from one file with diff... DFSORT/ICETOOL 10
No new posts View GDG data which is copied from a ... JCL & VSAM 2
Search our Forums:

Back to Top