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

RECORD OUT OF SEQUENCE error on VSAM KSDS file..


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

Global Moderator


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

PostPosted: Wed Jul 18, 2012 8:26 pm
Reply with quote

Reserve :


MVS Programming: Authorized Assembler Services Reference, Volume 3 (LLACOPY-SDUMPX)
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Jul 18, 2012 8:33 pm
Reply with quote

If you have more than one region attempting to UPDATE and you're using ENQ/DEQ, they will only be known in the region issuing the UPDATE. In other words, REGIONA won't know about REGIONB's ENQ/DEQ's because they're not GLOBAL/SHAREABLE within an LPAR or two or more REGION's.

This is why an FOR (in the same LPAR) could centralise access and give you better file integrity.
Back to top
View user's profile Send private message
chetanambi

New User


Joined: 21 Jan 2012
Posts: 58
Location: India

PostPosted: Wed Jul 18, 2012 9:08 pm
Reply with quote

Quote:

This thread is a keeper - but, why not redefine VSAM with SHR(2 3)? If you want to do batch update processing on a VSAM file that is used by CICS, use CEMT to close it within CICS, so allowing a batch job to be the single permitted writer, no?

No we can't redefine file with SHR(2,3) because dataset should be fully shared among number of users (but the programs which are adding/updating the records in the file are not maintaing the read and write integrity and is causing the issue). Howewer we did try with SHR(2,3) sometime back and it worked for somedays but issue started occuring again after that.

Thanks,
Chetan
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jul 18, 2012 10:23 pm
Reply with quote

Hello,

Probably not what you are looking for, but maybe it is time to convert this to a database. . .

And we appear to have gone far away from the "out of sequence" icon_smile.gif

d
Back to top
View user's profile Send private message
chetanambi

New User


Joined: 21 Jan 2012
Posts: 58
Location: India

PostPosted: Thu Jul 19, 2012 12:56 pm
Reply with quote

Quote:
If you have more than one region attempting to UPDATE and you're using ENQ/DEQ, they will only be known in the region issuing the UPDATE. In other words, REGIONA won't know about REGIONB's ENQ/DEQ's because they're not GLOBAL/SHAREABLE within an LPAR or two or more REGION's

Bill, Yes. more than one regions (in our case 2 regions) may try to update the data. Since more than one regions are involved here how to make it GLOBAL/SHAREABLE?. I found some information in VSAM demystified about GSR (Global Shared Resource) but no explanation how to use. Is that what you mean by GLOBAL/SHAREABLE?. Could you please explain me how can i use it for better file integrity?

So I am gonna try by changing share-options(2,3) once more time AND/OR with GLOBAL/SHAREABLE after I get information on it.

I have noticed that CEMT command for file is showing RLSACCESS as below. How about using the file in RLS (Record Level Sharing) mode across LPAR. Will that solve the problem?
Code:
Rlsaccess( Notrls )
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Thu Jul 19, 2012 1:30 pm
Reply with quote

chetanambi wrote:
No we can't redefine file with SHR(2,3) because dataset should be fully shared among number of users (but the programs which are adding/updating the records in the file are not maintaing the read and write integrity and is causing the issue). Howewer we did try with SHR(2,3) sometime back and it worked for somedays but issue started occuring again after that.
Well, if you use SHR(3 3), the main concern is the potential for file corruption. As they say, your mileague may vary and if you don't deploy what Bill O'Boyle and Robert has told in their excellent explnations, one is entiteled to get the errors you're expericing.

As has been mentioned earlier too - if both batch and online can write to the file, you must incorporate enqueuing and dequeuing methods in your batch and online programs to guarantee read and write integrity - let alone the concept of differnt regions. If you do not, the file is quite easily corrupted and if you're lucky, file must be restored from a back up to recover. Form fhe VSAM Demystified about cross-region option 3:
Quote:
VSAM allows many OPENs to the data set for output and/or input. The user application programs must ensure both read and write integrity through their own ENQs (including Open and Close processing on them).
so you still need to care about ENQs.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Jul 19, 2012 2:07 pm
Reply with quote

be careful about saying enq/deq and batch.

one of the reasons most batch activity is performed on a VSAM file after the file has been closed and disabled in cics
is due to the fact that CICS does not always immediately update the physical file,
but instead maintains the updated CI in the buffer.
and until the file is CLOSED in CICS, the buffers are not flushed.
the file also needs to be disabled in CICS is to prohibit re-opening the file in cics
by any transaction that may attempt to read the file,
is the file is defined by the FCT to allow a read to open an closed/enabled file.


also, since enq/deq are part of the CICS API's,
the only way a Batch program could enq/deq a CICS resource
is to invoke a CICS module in an active CICS Region
(via CICS LINK - exci or any other batch to cics interface)
to perform the enq/deq
or if the interface supports the enq/deq API directly.

also, keep in mind, that the enq/deq is for a resource name,
and unless all enq/deq (for a vsam file in this case) use the same resource name (or id)
then effectively there is no enq/deq of a resource.

good post Anuj, allows for misconceptions to be addressed.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Jul 19, 2012 2:13 pm
Reply with quote

You could investigate the use of DFSMStvs at your site, although that would be a pay for addition from IBM. It allows simultaneous multiple access to the same VSAM file through both batch and online.

Another possibility may be RLS via SMS but you would need to talk to your storage management / sysprogs about it.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Jul 19, 2012 3:07 pm
Reply with quote

db2 databases are the only data repositories that allow for concurrent batch and CICS update.

even though DFSMStvs with RLS allows and protects the integrity of VSAM datasets
during concurrent multi-CICS-Region updates,
this does not include batch.
the literature states:
a batch job updating a vsam dataset
must be disabled/closed and then re-opened in CICS in a non-RLS mode.

there maybe 3rd party tools (read more bucks) that allow for concurrent batch and CICS updates,
but, personally, i doubt it. CICS controls vsam datasets in cics buffers,
even dfsmstvs functions under CICS.
and since these buffer can/will contain modified data that will not be positively written to the dataset until disable/close,
these buffers are not available to batch.

the only way around this problem,
would to have the batch update interfacing with something like exci
which means that the updating would be performed by CICS
and not a batch allocation of the file.

as with all cics vsam enhancements to allow for 24/7,
there are caveats,
the biggest hurdle being you can't update an open cics vsam file in RLS mode from a batch allocation of the file ....

the solution provided by Bill o'boyle concerning AOR/FOR allows
for the easiest method of implementing data integrity in CICS.
But, even that does not address the problem of concurrent batch/cics update.

by the time you add RLS (required for dfsmstvs) and dfsmstvs to your system
(normally, more iron required)
you are starting to enter the point where your scale of cost
approaches DB2,
which allows for concurrent batch/cics update
mainly because CICS does not control db2, as it does control VSAM.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Jul 19, 2012 3:18 pm
Reply with quote

I got out of the vsam business long ago (and migrated to db2)
because there is no growth future.
the more you add to a vsam system, especially the 24/7 requirements,
you are contantly fighting the same battles,
and the TS is plagued with a CICS/datamanagment support group
that does not even know the basics.
otherwise the TS would not have created this thread.

another reason for the direct vsam image to db2 row conversions.
they were basically trying to get around the problem inherent in vsam
with 24/7 online and batch updating
on the cheap (read direct conversion of vsam record to db2 row).
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Jul 19, 2012 5:01 pm
Reply with quote

Cheers DBZ for clearing a few things I'd forgotten about icon_redface.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Jul 19, 2012 6:02 pm
Reply with quote

one more thing. (one of those days when I am just full of stuff to say!)

The only way you will get true 24/7 vsam which now requires a batch update is to run your update via CICS.

my first CICS COBOL CALL of a non-cics module was
a modification of a batch banking system
(banks have to calculate interest (debit as well as credit) every day,
report it to GL,
as well as post transactions and adjust the balances,
in addition to the monthly/periodic statement generation.
reporting was done via ques, which the batch system could use
as well as read-only vsam.

since the code for doing all of that was already written (in batch)
we just wrote front-end (or wrapper) CICS modules,
to access the account records and present them to the batch modules
that we CALLed from the CICS modules.
Fortunately we had written the batch system to have i/o modules,
so, the i/o modules were changed to update pass-along-areas instead of vsam records.
at the end of the CALL (return to the CICS wrapper) the actual i/o was performed.
yes, it was somewhat daunting to insure that everything fell into separate 4k areas which were addressed by pointers.
but, we did not have to go to db2 vsn 2 (at that time).
As i understand it, the bank (actually, service center)
was able to wait until the late 90's before converting to db2,
by which time db2 was much better than vsn 2.

But, as an idea, get all vsam updating out-of-batch and into the online,
and the COBOL CALL of a non-cics module by a CICS module made that possible.
Back to top
View user's profile Send private message
chetanambi

New User


Joined: 21 Jan 2012
Posts: 58
Location: India

PostPosted: Thu Jul 19, 2012 6:26 pm
Reply with quote

Just an fyi.. As most of you gurus are telling BATCH job cannot access the file untill it is closed in CICS else job will go down with RC=8. Even 1st step of my job is to close the file in CICS and then it will process the file in next steps.
Code:

IKJ56241I DATA SET xxxxxx.xx.xxxx.xxxxxxxx NOT ALLOCATED
IKJ56241I DATA SET IS ALLOCATED TO ANOTHER JOB OR USER   
IDC0551I ** ENTRY xxxxx.xx.xxxx.xxxxxxxx NOT DELETED   
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 8


dbz/Bill,
Quote:
The solution provided by Bill o'boyle concerning AOR/FOR allows for the easiest method of implementing data integrity in CICS. But, even that does not address the problem of concurrent batch/cics update.

Could you please suggest the how can I use this FOR/AOR concept for better data integrity. File is defined in both the CICS regions with same properties. Note that none of our batch programs are updating the file concurrently but only 2 programs as mentioned earlier.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Jul 19, 2012 6:53 pm
Reply with quote

go back and this time read VSAM Demystified

this thread has passed the point of giving help,
what you are now asking for is something that we all get paid to do.
Your sysprogrammers/cics support people are the ones that have to implement this.
If they can not, i as well as several others are available on a per-day fee (plus costs)
to advise/train your company personel.
Back to top
View user's profile Send private message
chetanambi

New User


Joined: 21 Jan 2012
Posts: 58
Location: India

PostPosted: Thu Jul 19, 2012 7:39 pm
Reply with quote

Hmm.. Thanks a lot for your help and support...
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri Jul 20, 2012 11:42 pm
Reply with quote

I've used GSR (Global Shared Resources) in ISPF 3.4 imbedded in a "WHOHAS" or "WHOUSE" Rexx-Routine.

But, because GRS expands into an MVS/SVC, it should not be used directly in CICS, so you're back to the same dilemma; Multiple AOR's attempting to update a VSAM file concurrently.

From what I can determine (as I've said before), an FOR is your best bet.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


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

PostPosted: Sat Jul 21, 2012 12:28 am
Reply with quote

Well in the past i did some ENQ/DEQ on a vsam ksds used by zillions of ISPF users, and did it on minor name the ksds key and the major name on a predefined name and used STEP,SYSTEM,SYSTEMS as environment.
Worked perfectly, but then it was not CICS and batch jobs running concurrently.
Back to top
View user's profile Send private message
chetanambi

New User


Joined: 21 Jan 2012
Posts: 58
Location: India

PostPosted: Thu Jul 26, 2012 8:42 am
Reply with quote

Quote:
Well in the past i did some ENQ/DEQ on a vsam ksds used by zillions of ISPF users, and did it on minor name the ksds key and the major name on a predefined name and used STEP,SYSTEM,SYSTEMS as environment.
Worked perfectly, but then it was not CICS and batch jobs running concurrently.

In our system also its not batch and CICS running currently to update the file but 2 CICS regions trying to update the file concurrently. We close the file in CICS before batch the processing.

Quote:
But, because GRS expands into an MVS/SVC, it should not be used directly in CICS, so you're back to the same dilemma; Multiple AOR's attempting to update a VSAM file concurrently.
From what I can determine (as I've said before), an FOR is your best bet.

Yes. Multiple AOR's or CICS regions are attempting to update a VSAM file. I am reading bout AOR/FOR/DOR/TOR etc. I am going to try by shareoptions to (2,3) or with this FOR concept (by consulting tech personal).
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Thu Jul 26, 2012 12:20 pm
Reply with quote

dbzTHEdinosauer wrote:
good post Anuj, allows for misconceptions to be addressed.
Hope it just allows to address them and does not induce them...
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 Goto page Previous  1, 2, 3  Next

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Error to read log with rexx CLIST & REXX 11
Search our Forums:

Back to Top