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 

Deleting a particular record in TSQ

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


Joined: 17 Feb 2006
Posts: 17
Topics: 9

PostPosted: Thu Jul 13, 2006 7:25 pm    Post subject: Deleting a particular record in TSQ Reply with quote

Hi
I am new to CICS and i am having a requirement like below,

User can enter records(ie) inputs in mulitple lines (rows) in a screen(limit upto 50 rows) and at the same time if he wish to delete a particular line or row after he inserted, he can give an option d at the side of the particular row so that the corresponding row is deleted in the screen itself.

So i planned to store the screen values in TSQ and process according to the logic, but in case if i want to delete a particular row in screen, is it possible for me to delete that particular record which is in TSQ because i am storing in TSQ.Is it possible?

If i am wrong, could you give me a better logic to follow or approach

thanks
manifrae
Back to top
View user's profile Send private message
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Fri Jul 14, 2006 12:13 am    Post subject: Reply with quote

mainfrae,

I am assuming that your are storing 50 records in a TSQ using ITEM number concept as you are having 50 lines (each record corresponding to 1 line) .You can delete a record from a TSQ using ITEM Number.Here in this case i am trying to delete 35 record in a TSQ.Hope it helps.
Code:

01 WS-ITEMNO PIC 9(02) VALUE 0.
PROCEDURE DIVISION.
   MOVE 35 TO WS-ITEMNO.
   EXEC CICS DELETEQ TS QUEUE('NAME')
      ITEM(WS-ITEMNO)
      RESP(WS-RESP-CODE)
   END-EXEC.

If you want to delete all the records from the entire queue (make empty TSQ ) try this:
Code:

EXEC CICS DELETEQ TS QUEUE('NAME') END-EXEC.

_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
PaulPeplinski
Beginner


Joined: 17 Feb 2006
Posts: 11
Topics: 3

PostPosted: Fri Jul 14, 2006 12:39 pm    Post subject: Reply with quote

deleteq ts syntax - cics/ts 2.3. item is not a parameter.

>> DELETEQ TS QUEUE(name) ><
QNAME(name) SYSID(systemname)
Conditions: INVREQ, ISCINVREQ, LOCKED, NOTAUTH, QIDERR,
SYSIDERR

This command is threadsafe.
Back to top
View user's profile Send private message
mainfrae
Beginner


Joined: 17 Feb 2006
Posts: 17
Topics: 9

PostPosted: Sun Jul 16, 2006 12:56 pm    Post subject: Reply with quote

Yes, What paul said is correct. Item is not a parameter In DELETE TSQ syntax.I think i can't use DELETE TSQ syntax for deleting a particular record in the TSQ. Still i haven't got a clear picture of how to do it?
2 Things i want to know about this:
1) Before deleting from TSQ , i will move the records into the working storage section array and continue deleting from TSQ.After that i will use the working storage array for further processing.Is it possible?
2) If the above step is ok, i want to thru back the screen after removing the deleted rows.(eg) if i have 5 rows in the screen and i deleted the 3rd row and again i want to thru 4 rows in the screen after the process. My question is if i am using the working storage array, how to do that?

Could you give some idea about it

thanks
mainfrae
Back to top
View user's profile Send private message
pratap_mf
Beginner


Joined: 17 Jul 2006
Posts: 1
Topics: 0

PostPosted: Mon Jul 17, 2006 9:32 am    Post subject: Reply with quote

mainfrae,

one solution to your problem is add a one byte FLAG field in the Record to keep track of record status.

01 ws-Record.
03 ws-data x(50).
03 ws-flag x(01).

For exapmle if user deletes a line, REWRITE this record with FLAG as 'D'(deleted). While displaying the records on screen, display the records which don't have FLAG as 'D'.

I hope this solves your problem.
Back to top
View user's profile Send private message
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