View previous topic :: View next topic |
Author |
Message |
mainfrae Beginner
Joined: 17 Feb 2006 Posts: 17 Topics: 9
|
Posted: Thu Jul 13, 2006 7:25 pm Post subject: Deleting a particular record in TSQ |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
shekar123 Advanced
Joined: 22 Jul 2005 Posts: 528 Topics: 90 Location: Bangalore India
|
Posted: Fri Jul 14, 2006 12:13 am Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
PaulPeplinski Beginner
Joined: 17 Feb 2006 Posts: 11 Topics: 3
|
Posted: Fri Jul 14, 2006 12:39 pm Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
mainfrae Beginner
Joined: 17 Feb 2006 Posts: 17 Topics: 9
|
Posted: Sun Jul 16, 2006 12:56 pm Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
pratap_mf Beginner
Joined: 17 Jul 2006 Posts: 1 Topics: 0
|
Posted: Mon Jul 17, 2006 9:32 am Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
|
|