Check the existance of the data in VSAM in CICS program.

Virtual Storage Access method - ESDS, KSDS, RRDS & LDS. Basic direct access method, Basic sequential -, Queued sequential -, Basic partitioned -, Indexed sequential -, Object - access method.
Post Reply
Shuku
Registered Member
Posts: 23
Joined: Sun Jul 21, 2013 4:55 am

Check the existance of the data in VSAM in CICS program.

Post by Shuku »

Hi,

We have a VSAM file with merchant number details. On a CICS map, the user will enter a merchant number. The condition I want to check is that if the merchant number is exists in the VSAM only then the next map should be displayed on screen. What is proper way to check merchant number in the VSAM for this? Please suggest me on this.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Check the existance of the data in VSAM in CICS program.

Post by Robert Sample »

Your question, as posted, is so fuzzy as to not be answerable. 
We have a VSAM file with merchant number details.
Well, VSAM data sets (they are NEVER "files" -- files is a term on the mainframe used for Unix System Services which runs as part of z/OS) can be sequential (ESDS), indexed (KSDS), relative (RRDS), and linear.  Since you did not tell us which type of VSAM data set you are dealing with, that makes the question pretty much unanswerable as written.
If you have a VSAM KSDS (which is common), and the merchant number is the key then just use a CICS READ against the VSAM data set.  The response code will tell if you that record exists.  If the merchant number is not the key, then you'll have to build the key and read (possibly a number of records) to determine if the merchant number exists.
If the VSAM data set is not KSDS, then you'll need to work with your team lead / coworkers to determine how to tell if the merchant number exists.
There is no "proper" (I assume you meant standard) way to do this -- it all depends upon the application and how the VSAM data set is laid out.
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 826
Joined: Wed Sep 11, 2013 3:57 pm

Re: Check the existance of the data in VSAM in CICS program.

Post by enrico-sorichetti »

 
What is proper way to check merchant number in the VSAM for this? Please suggest me on this
by using the appropriate handle condition for the record not found error  

Code: Select all

EXEC CICS HANDLE CONDITION
    ...
    NOTFND(X000-NOT-FOUND-PARA)
    ...
END-EXEC.
even better, ask Your colleagues, Your support about the standards in place for error handling
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
Shuku
Registered Member
Posts: 23
Joined: Sun Jul 21, 2013 4:55 am

Re: Check the existance of the data in VSAM in CICS program.

Post by Shuku »

Robert Sample wrote:Your question, as posted, is so fuzzy as to not be answerable. 
We have a VSAM file with merchant number details.
Well, VSAM data sets (they are NEVER "files" -- files is a term on the mainframe used for Unix System Services which runs as part of z/OS) can be sequential (ESDS), indexed (KSDS), relative (RRDS), and linear.  Since you did not tell us which type of VSAM data set you are dealing with, that makes the question pretty much unanswerable as written.
If you have a VSAM KSDS (which is common), and the merchant number is the key then just use a CICS READ against the VSAM data set.  The response code will tell if you that record exists.  If the merchant number is not the key, then you'll have to build the key and read (possibly a number of records) to determine if the merchant number exists.
If the VSAM data set is not KSDS, then you'll need to work with your team lead / coworkers to determine how to tell if the merchant number exists.
There is no "proper" (I assume you meant standard) way to do this -- it all depends upon the application and how the VSAM data set is laid out.
File is KSDS. And merchant number is the key for it.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Check the existance of the data in VSAM in CICS program.

Post by Robert Sample »

Do a direct key read of the VSAM data set using the key.  You can use HANDLE or the response code to determine how to proceed, based on whether or not the merchant key is found.
Shuku
Registered Member
Posts: 23
Joined: Sun Jul 21, 2013 4:55 am

Re: Check the existance of the data in VSAM in CICS program.

Post by Shuku »

Thanks fr the suggestion.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “SMS & VSAM and BDAM, BSAM, QSAM, BPAM, ISAM, OAM.”