Re: A deep question about VSAM SHR(4) - can you help?

2012-04-10 Thread Hal Merritt
Um, be careful about drawing any conclusions from a simple test other than the 
syntax is close. Data sharing is a very complex issue with gotcha's aplenty.  
You cannot possibly test every variation of access, update, and timings.  The 
VSAM folks have, IMHO, done a fine job of preventing you from screwing up too 
bad. But VSAM is still not a DBMS and doesn't claim to be. 

If the philosophy cannot change, then maybe neither can the solution.  Yes, it 
can be really that simple. 

Now, this is not to say that one couldn't forge right on and things would seem 
to work just fine, maybe for years. Or maybe not. 'Unpredictable results' 
include seemingly successful tests.  

Imagine corruption slowly creeping in and not discovered until the last good 
backup has rolled off and the tape reused. 

I believe what you want to do is doable. But you just gotta follow the rules. 
If you do, then CICS and VSAM can work together to avoid corruption and enhance 
performance. 

 

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@bama.ua.edu] On Behalf Of 
Mike Kovach
Sent: Thursday, April 05, 2012 3:23 PM
To: IBM-MAIN@bama.ua.edu
Subject: Re: A deep question about VSAM SHR(4) - can you help?

Thanks Robert. That is exactly what I was thinking. Will be running a test 
early next week.
 
Regards,
 
Mike Kovach
 
 



From: Robert A. Rosenberg hal9...@panix.com
To: IBM-MAIN@bama.ua.edu
Sent: Thursday, April 5, 2012 4:03 PM
Subject: Re: A deep question about VSAM SHR(4) - can you help?

At 07:16 -0700 on 04/05/2012, Mike Kovach wrote about A deep question about 
VSAM SHR(4) - can you help?:

 I have a VSAM KSDS CLUSTER which is written to by ONLY ONE PROGRAM in ONLY 
 ONE CICS REGION. Currently, this file is defined in CICS with STRNO(1).  The 
 file is defined with SHR(4,3) because while being written ONLY in CICS, it is 
 being read by a non-reentrent ASSEMBLER program running in BATCH.  SHR 4 
 forces VSAM to harden each I/O (yeah, I know!) so the BATCH gets the current 
 information. Please spare me all the comments about how poor this solution is 
 as it stands. It has been in place for decades and due to a myriad of 
 reasons, the philosophy CANNOT change.  My specific question is this:  I want 
 to introduce multi tasking so that 5 copies of the program can update the 
 file concurrently. If we change STRNO(1) to STRNO(5) on the CICS FCT 
 Definition, will VSAM be smart enough to manage the writes to the file so we 
 don't break it and the BATCH still gets the current information?

So long as you are still using one CICS Region, I do not think you will run 
into problems. The STRNO(5) will allow you to have 5 CIs being updated at a 
time (one CI per copy of the program). If more than one copy attempts to access 
records from the same CI, it should cause the subsequent requesters to wait for 
the owning copy to finish its update and release/write the CI (just make sure 
that all your VSAM is being done by SubTasks which I think CICS does 
automatically). You should increase the number of buffers so there are enough 
for all the copies.

  I am interested in any discussion you might share, but I am most 
interested in a specific reference to a reliable document.  Please 
help.    Thanks  Mike Kovach
 
 --
 For IBM-MAIN subscribe / signoff / archive access instructions, send 
 email to lists...@bama.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
lists...@bama.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
lists...@bama.ua.edu with the message: INFO IBM-MAIN
NOTICE: This electronic mail message and any files transmitted with it are 
intended
exclusively for the individual or entity to which it is addressed. The message, 
together with any attachment, may contain confidential and/or privileged 
information.
Any unauthorized review, use, printing, saving, copying, disclosure or 
distribution 
is strictly prohibited. If you have received this message in error, please 
immediately advise the sender by reply email and delete all copies.

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN


Re: A deep question about VSAM SHR(4) - can you help?

2012-04-06 Thread McKown, John
CICS moderates access to a VSAM file by doing internal CICS-level ENQs. For a 
KSDS, the ENQ is on the key value. A VSAM dataset in a single CICS region can 
be used and updated safely my multiple transactions running in that region (or 
in multiple regions if the file request is sent to a file owning region). Of 
course, this can lead to a dead lock situation if the transactions try to 
update multiple records in the same dataset, unless something is done to 
exclude it. 

If the VSAM file is local to multiple regions, or between CICS and batch, 
then you can corrupt the data. If you need concurrent access via batch and 
CICS, I suggest HW's SYSB product. We use it and it works with no real 
problems. Basically, SYSB extends CICS' support for Multi Region Option (MRO) 
access to a dataset to batch. The actual I/O is done in the CICS region.

Another post mentioned that two records in the same CI could not undergo update 
processing at the same time. This is true. However, the current CICS versions 
use VSAM options such that VSAM returns a indicator on the second request to 
CICS. And CICS moderates this.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/dfhp3c00/4.2.6.1
quote
If you do not use VSAM record-level sharing, CICS serializes update requests by 
base cluster record key. The complete VSAM control interval (CI) containing the 
requested record is held for exclusive use while an individual command (for 
example, a READ command with the UPDATE option) is being executed on the 
record. Once each command is complete, the control interval is released, and 
only the requested record remains locked. For nonrecoverable data sets, both 
the VSAM exclusive use and the CICS exclusive use of the record end when the 
update request is complete in VSAM terms; for example, when the REWRITE command 
has completed. For recoverable data sets, however, the CICS exclusive use does 
not end until the task ends or issues a SYNCPOINT command. Recoverability is 
specified in the data set resource definition. See FILE definition attributes 
in the CICS Resource Definition Guide for more information about the FILE 
resource definitions. 
/quote

--
John McKown 
Systems Engineer IV
IT

Administrative Services Group

HealthMarkets®

9151 Boulevard 26 . N. Richland Hills . TX 76010
(817) 255-3225 phone . 
john.mck...@healthmarkets.com . www.HealthMarkets.com

Confidentiality Notice: This e-mail message may contain confidential or 
proprietary information. If you are not the intended recipient, please contact 
the sender by reply e-mail and destroy all copies of the original message. 
HealthMarkets® is the brand name for products underwritten and issued by the 
insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance 
Company®, Mid-West National Life Insurance Company of TennesseeSM and The MEGA 
Life and Health Insurance Company.SM

 

 -Original Message-
 From: IBM Mainframe Discussion List 
 [mailto:IBM-MAIN@bama.ua.edu] On Behalf Of Walt Farrell
 Sent: Thursday, April 05, 2012 6:16 PM
 To: IBM-MAIN@bama.ua.edu
 Subject: Re: A deep question about VSAM SHR(4) - can you help?
 
 On Thu, 5 Apr 2012 07:16:15 -0700, Mike Kovach 
 mrmach...@yahoo.com wrote:
 
 My specific question is this:
  
 I want to introduce multi tasking so that 5 copies of the 
 program can update the file concurrently. If we change STRNO(1) to 
 STRNO(5) on the CICS FCT Definition, will VSAM be smart 
 enough to manage the writes to the file so we don't break it and 
 the BATCH still gets the current information?
 
 I am not a VSAM expert, nor a CICS expert (nor am I sure 
 whether your program is using CICS functions to write to the 
 data set, or using VSAM macros directly), but I would be 
 concerned about serialization. 
 
 From DFSMS Using Data Sets at 
 http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/dgt
 2d4a0/2.7.2.1?SHELF=EZ2ZO213DT=20110606092005 or 
 http://preview.tinyurl.com/76joxao you can read that for 
 SHAREOPTIONS 4 you have the same serialization requirements 
 as for SHAREOPTIONS 3, and for SHAREOPTIONS 3 the book says
 quote
 This option requires that the user's program use ENQ/DEQ to 
 maintain data integrity while sharing the data set, including 
 the OPEN and CLOSE processing. User programs that ignore the 
 write integrity guidelines can cause VSAM program checks, 
 lost or inaccessible records, uncorrectable data set 
 failures, and other unpredictable results. This option places 
 responsibility on each user sharing the data set. 
 /quote
 
 So unless there's something in CICS issuing appropriate 
 ENQ/DEQ macros, I think you'll need to make some program changes.
 
 -- 
 Walt
 
 --
 For IBM-MAIN subscribe / signoff / archive access instructions,
 send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN
 
 

--
For IBM-MAIN subscribe

Re: A deep question about VSAM SHR(4) - can you help?

2012-04-05 Thread Robert A. Rosenberg
At 07:16 -0700 on 04/05/2012, Mike Kovach wrote about A deep question 
about VSAM SHR(4) - can you help?:


I have a VSAM KSDS CLUSTER which is written to by ONLY ONE PROGRAM 
in ONLY ONE CICS REGION. Currently, this file is defined in 
CICS with STRNO(1).  The file is defined with SHR(4,3) because while 
being written ONLY in CICS, it is being read by a non-reentrent 
ASSEMBLER program running in BATCH.  SHR 4 forces VSAM to harden 
each I/O (yeah, I know!) so the BATCH gets the current information. 
Please spare me all the comments about how poor this solution is as 
it stands. It has been in place for decades and due to a myriad of 
reasons, the philosophy CANNOT change.   My specific question is 
this:   I want to introduce multi tasking so that 5 copies of the 
program can update the file concurrently. If we change STRNO(1) to 
STRNO(5) on the CICS FCT Definition, will VSAM be smart enough to 
manage the writes to the file so we don't break it and the BATCH 
still gets the current information?


So long as you are still using one CICS Region, I do not think you 
will run into problems. The STRNO(5) will allow you to have 5 CIs 
being updated at a time (one CI per copy of the program). If more 
than one copy attempts to access records from the same CI, it should 
cause the subsequent requesters to wait for the owning copy to finish 
its update and release/write the CI (just make sure that all your 
VSAM is being done by SubTasks which I think CICS does 
automatically). You should increase the number of buffers so there 
are enough for all the copies.


  I am interested in any discussion you might share, but I am most 
interested in a specific reference to a reliable document.   Please 
help. Thanks   Mike Kovach


--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN


--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN


Re: A deep question about VSAM SHR(4) - can you help?

2012-04-05 Thread Mike Kovach
Thanks Robert. That is exactly what I was thinking. Will be running a test 
early next week.
 
Regards,
 
Mike Kovach
 
 



From: Robert A. Rosenberg hal9...@panix.com
To: IBM-MAIN@bama.ua.edu 
Sent: Thursday, April 5, 2012 4:03 PM
Subject: Re: A deep question about VSAM SHR(4) - can you help?

At 07:16 -0700 on 04/05/2012, Mike Kovach wrote about A deep question about 
VSAM SHR(4) - can you help?:

 I have a VSAM KSDS CLUSTER which is written to by ONLY ONE PROGRAM in ONLY 
 ONE CICS REGION. Currently, this file is defined in CICS with STRNO(1).  The 
 file is defined with SHR(4,3) because while being written ONLY in CICS, it is 
 being read by a non-reentrent ASSEMBLER program running in BATCH.  SHR 4 
 forces VSAM to harden each I/O (yeah, I know!) so the BATCH gets the current 
 information. Please spare me all the comments about how poor this solution is 
 as it stands. It has been in place for decades and due to a myriad of 
 reasons, the philosophy CANNOT change.  My specific question is this:  I want 
 to introduce multi tasking so that 5 copies of the program can update the 
 file concurrently. If we change STRNO(1) to STRNO(5) on the CICS FCT 
 Definition, will VSAM be smart enough to manage the writes to the file so we 
 don't break it and the BATCH still gets the current information?

So long as you are still using one CICS Region, I do not think you will run 
into problems. The STRNO(5) will allow you to have 5 CIs being updated at a 
time (one CI per copy of the program). If more than one copy attempts to access 
records from the same CI, it should cause the subsequent requesters to wait for 
the owning copy to finish its update and release/write the CI (just make sure 
that all your VSAM is being done by SubTasks which I think CICS does 
automatically). You should increase the number of buffers so there are enough 
for all the copies.

  I am interested in any discussion you might share, but I am most interested 
in a specific reference to a reliable document.  Please help.    Thanks  Mike 
Kovach
 
 --
 For IBM-MAIN subscribe / signoff / archive access instructions,
 send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN


Re: A deep question about VSAM SHR(4) - can you help?

2012-04-05 Thread Walt Farrell
On Thu, 5 Apr 2012 07:16:15 -0700, Mike Kovach mrmach...@yahoo.com wrote:

My specific question is this:
 
I want to introduce multi tasking so that 5 copies of the program can update 
the file concurrently. If we change STRNO(1) to 
STRNO(5) on the CICS FCT Definition, will VSAM be smart enough to manage the 
writes to the file so we don't break it and 
the BATCH still gets the current information?

I am not a VSAM expert, nor a CICS expert (nor am I sure whether your program 
is using CICS functions to write to the data set, or using VSAM macros 
directly), but I would be concerned about serialization. 

From DFSMS Using Data Sets at 
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/dgt2d4a0/2.7.2.1?SHELF=EZ2ZO213DT=20110606092005
 or http://preview.tinyurl.com/76joxao you can read that for SHAREOPTIONS 4 
you have the same serialization requirements as for SHAREOPTIONS 3, and for 
SHAREOPTIONS 3 the book says
quote
This option requires that the user's program use ENQ/DEQ to maintain data 
integrity while sharing the data set, including the OPEN and CLOSE processing. 
User programs that ignore the write integrity guidelines can cause VSAM program 
checks, lost or inaccessible records, uncorrectable data set failures, and 
other unpredictable results. This option places responsibility on each user 
sharing the data set. 
/quote

So unless there's something in CICS issuing appropriate ENQ/DEQ macros, I think 
you'll need to make some program changes.

-- 
Walt

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN


Re: A deep question about VSAM SHR(4) - can you help?

2012-04-05 Thread Doug
Another question to ponder;
Is the file NONLSR or LSR in CICS?

Another question;
Does the BATCH program run in the same LPAR as the CICS? always?

Another question;
Are you using BLSR in the batch program? or any other buffer tuning software?

Another question;
Does the BATCH program open the file for input only?
Regards, 
Doug 

Sent from my iPhone

On Apr 5, 2012, at 16:23, Mike Kovach mrmach...@yahoo.com wrote:

 Thanks Robert. That is exactly what I was thinking. Will be running a test 
 early next week.
  
 Regards,
  
 Mike Kovach
  
  
 
 
 
 From: Robert A. Rosenberg hal9...@panix.com
 To: IBM-MAIN@bama.ua.edu 
 Sent: Thursday, April 5, 2012 4:03 PM
 Subject: Re: A deep question about VSAM SHR(4) - can you help?
 
 At 07:16 -0700 on 04/05/2012, Mike Kovach wrote about A deep question about 
 VSAM SHR(4) - can you help?:
 
 I have a VSAM KSDS CLUSTER which is written to by ONLY ONE PROGRAM in ONLY 
 ONE CICS REGION. Currently, this file is defined in CICS with STRNO(1).  The 
 file is defined with SHR(4,3) because while being written ONLY in CICS, it 
 is being read by a non-reentrent ASSEMBLER program running in BATCH.  SHR 4 
 forces VSAM to harden each I/O (yeah, I know!) so the BATCH gets the current 
 information. Please spare me all the comments about how poor this solution 
 is as it stands. It has been in place for decades and due to a myriad of 
 reasons, the philosophy CANNOT change.  My specific question is this:  I 
 want to introduce multi tasking so that 5 copies of the program can update 
 the file concurrently. If we change STRNO(1) to STRNO(5) on the CICS FCT 
 Definition, will VSAM be smart enough to manage the writes to the file so we 
 don't break it and the BATCH still gets the current information?
 
 So long as you are still using one CICS Region, I do not think you will run 
 into problems. The STRNO(5) will allow you to have 5 CIs being updated at a 
 time (one CI per copy of the program). If more than one copy attempts to 
 access records from the same CI, it should cause the subsequent requesters to 
 wait for the owning copy to finish its update and release/write the CI (just 
 make sure that all your VSAM is being done by SubTasks which I think CICS 
 does automatically). You should increase the number of buffers so there are 
 enough for all the copies.
 
   I am interested in any discussion you might share, but I am most 
 interested in a specific reference to a reliable document.  Please help.
 Thanks  Mike Kovach
 
 --
 For IBM-MAIN subscribe / signoff / archive access instructions,
 send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN
 
 --
 For IBM-MAIN subscribe / signoff / archive access instructions,
 send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN
 
 --
 For IBM-MAIN subscribe / signoff / archive access instructions,
 send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN


Re: A deep question about VSAM SHR(4) - can you help?

2012-04-05 Thread Robert A. Rosenberg
At 18:16 -0500 on 04/05/2012, Walt Farrell wrote about Re: A deep 
question about VSAM SHR(4) - can you help?:


This option requires that the user's program use ENQ/DEQ to maintain 
data integrity while sharing the data set, including the OPEN and 
CLOSE processing. User programs that ignore the write integrity 
guidelines can cause VSAM program checks, lost or inaccessible 
records, uncorrectable data set failures, and other unpredictable 
results. This option places responsibility on each user sharing the 
data set.

/quote

So unless there's something in CICS issuing appropriate ENQ/DEQ 
macros, I think you'll need to make some program changes.


You are misreading the restrictions. This has to do with sharing the 
VSAM Cluster between multiple programs NOT sharing the Cluster 
between multiple tasks of the same program (as would be the case with 
CICS). You are using ONE ACB so there is no interlock issue. I am not 
sure what QNAME/RNAME is supposed to be used for the interlock. VSAM 
itself does the ENQ/DEQ (I think) via using the CI number (it can not 
be the key of the record because while that would prevent multiple 
updates to that record, you can mess up the CI if there are two 
records in the CI being updated) as part of the RNAME (it has been a 
while).


--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN