MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Block one selection of record from other users

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> CICS and Middleware
View previous topic :: View next topic  
Author Message
radkrish82
Beginner


Joined: 19 Feb 2009
Posts: 50
Topics: 10

PostPosted: Fri Feb 05, 2010 5:58 am    Post subject: Block one selection of record from other users Reply with quote

Can you please help me on the below reqmt.
Transactions being worked on by a user should be locked for selection by another user.
Code:
SCREEN A                                                                 
MRQT    07/15/11              CLEARING SYSTEM               
 QUEUE ID:             01                                                       
 TRAN TYPE:             D (D-DEBIT C-CREDIT)    RECORD TYPE:  D  (D-DTA S-SEPA)
                                                                               
 SEL SENDER ACT   SENDER NAME                  TRAN AMOUNT    STATUS  PROC DATE
     RECEIVER ACT RECEIVER NAME                SEND BANK CD   RUN SEQ  TEXT KEY
     FILE REF. NO.        EXT REJ CD/DESC              REC REF. NO.   INT REJ CD
  _  12345678     SCHECKAUSSTELLER                      29,00    Y    30/06/2011
     5125001456   SCHECK-NR. 4083110000001     50010060       0000002  09-125   
     0 0912115754D        02 ACC.-NO./BANK CODE I      334490061701   01       






PF2-MRQM PF3-EXIT

Once selected the above transaction, then its XCTL to the below screen.Accordingy to the requirement the selection should not be possible for the second User.

Accordingy to the requirement the selection should not be possible for the second User.
Code:
SCREEN B
MRQD     07/15/11              CLEARING SYSTEM           
                   
SENDER ACCOUNT    12345678                         PAYMENT DETAILS             
SENDER NAME       SCHECKAUSSTELLER                                             
SENDER BANK CODE  50010060                        02AM 11.12.09 NICHT BEZAHLT 
RECEIVER ACCOUNT  5125001456                      02EU 000000029,00           
RECEIVER NAME     SCHECK-NR. 4083110000001        02ENTGELT FREMD EU 00,00     
FILE REF. NO      0 0912115754D                   02SCHECKSPERRE               
REC REF. NO       334490061701                                                 
TRANSACTION TYPE  D                                                           
TRANSACTION AMT            29,00                                               
PROCESS DATE      30/06/2011                                                   
RUN SEQ           0000002                                                     
TEXT KEY          09 - 125                                                     
QUEUE ID          01                                                           
INT REJ CD        01                                                           
EXT REJ CD/DESC   02 ACC.-NO./BANK CODE                                       
STATUS            Y  [Y-RELEASE N-REJECT]                                     
                                                                               
PF2-MRQM PF3-EXIT PF4-MRQT PF5-EDIT             


IN CICS program,
Code:
IF MRSEL1I EQUAL 'S'                           
 MOVE WS-TRAN-AMT1     TO WS-TRAN-AMT         
 MOVE WS-PROC-DATE1    TO WS-PROC-DATE         
 MOVE WS-RCV-ACCT-NO1  TO WS-RCV-ACCT-NO       
 MOVE WS-RCV-NAME     TO WS-RCV-NAME         
 MOVE WS-REF-NO1       TO WS-REF-NO           
 MOVE WS-SND-ACCT-NO1  TO WS-SND-ACCT-NO       
 MOVE WS-SND-NAME1     TO WS-SND-NAME         
 PERFORM VARYING MR-INDEX FROM 1 BY 1         

similarly moving to commarea for other 2 selections below(IF 3 rows/transaction populated in the screen).
IF MRSEL2I EQUAL 'S'                           
IF MRSEL3I EQUAL 'S'                           

After the selection, the below para is executed to move to the next screen.
PERFORM 9100-XCTL-TO-MRQD   
   THRU 9100-EXIT           

If I select any one of the 3 rows populated, then the other users should be blocked to select the same record until the previous user came out of the selection. I am not sure whether I can use ENQ to block one selection of record.

Can anyone help me how should I do this?

regards,
krish
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Feb 05, 2010 11:54 am    Post subject: Reply with quote

radkrish82,

Set up a Flag in the DB2 table and set it on when the user is selects the record and update it when he releases the record.

Now check this flag every time a user selects the record

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Fri Feb 05, 2010 4:06 pm    Post subject: Reply with quote

One way many systems solve this is allow multiple users to read the information and then to re-read with hold immediately prior to update. The re-read data is compared to the original to ensure that no one has updated it between reads. If the data has changed, a message is shown to the user along with the modified values.

If the code "marks" something as busy and the user does not free it (i.e. goes to lunch or goes home while holding the resource), severe problems occur.
_________________
All the best,

di
Back to top
View user's profile Send private message
radkrish82
Beginner


Joined: 19 Feb 2009
Posts: 50
Topics: 10

PostPosted: Sat Feb 06, 2010 12:47 am    Post subject: Reply with quote

Thanks. I am using VSAM. SO I will find a place to set up a flag over there. Each and every time when I read I will check this flag and read. Hope cics concept like ENQ doesn't work.

Thanks for your information, Kolusu.
Back to top
View user's profile Send private message
radkrish82
Beginner


Joined: 19 Feb 2009
Posts: 50
Topics: 10

PostPosted: Sat Feb 06, 2010 2:03 am    Post subject: Reply with quote

Hi Kolusu,

One more clarification. rather than setting a flag in vsam file, can we set the flag in commarea. In VSAM case, I need to rewrite the vsam to update the flag. If we set the flag in commarea, I doubt the flag will be common for all selections. How do we put it ahead in commarea.

In my project, there is no intertest and xped tool available.
I require your help on this. Thanks.
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Sun Feb 07, 2010 4:48 pm    Post subject: Reply with quote

Quote:
Hope cics concept like ENQ doesn't work.

ENQ can be used as long as you can come across a unique way to identify, like using combination of primary key and table name. But my own preference would be papadi's suggestion.
Back to top
View user's profile Send private message Send e-mail
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Sun Feb 07, 2010 11:58 pm    Post subject: Reply with quote

radkrish82, the commarea cannot be used like you think since it's common only to programs you've transferred control to or linked to. Each CICS program has its own commarea. The commarea of Program A executed by user A does not know about the commarea of program A executed by user B. Use the suggestions of kolusu or papadi.
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Feb 08, 2010 11:50 am    Post subject: Reply with quote

radkrish82,

You might wanna check out VSAM Record-Level Sharing(RLS) process which is discussed here

http://www.mvsforums.com/helpboards/viewtopic.php?t=1230

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> CICS and Middleware All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group