View previous topic :: View next topic
|
Author |
Message |
AJAYREDDY
New User
Joined: 17 Feb 2007 Posts: 52 Location: USA
|
|
|
|
I am getting AM status code while Deleting record from Segment. I want to delete complete record from RR505000. I am reading RR500000 as root segment. RR500-IN-SSA is qualified and RR505-IN-SSA is unqualified. Can anyone please let me know what might be the reason ?
I have the PSB as
PCB TYPE=DB,
DBDNAME=RR5DAT,
PROCOPT=A,
KEYLEN=30
SENSEG NAME=RR500000,
PARENT=0
SENSEG NAME=RR505000,
PARENT=RR500000
And giving the Call parameters as
CALL 'CBLTDLI' USING GU
RR5-PCB
RR500000
RR500-IN-SSA.
CALL 'CBLTDLI' USING GHNP
RR5-PCB
RR505-IN-RECORD
RR505-IN-SSA.
CALL 'CBLTDLI' USING DLET
RR5-PCB
RR505-IN-RECORD.
I also tried by direct GHN as below, but still did not worked.
CALL 'CBLTDLI' USING GHN
RR5-PCB
RR505-IN-RECORD
RR500-IN-SSA
RR505-IN-SSA.
CALL 'CBLTDLI' USING DLET
RR5-PCB
RR505-IN-RECORD. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
Did you check your status code after you did the GET HOLD? Do you want to delete the root AND the child segment? Remember that all you need to do is to delete the root and ALL child segments automatically go bye-bye. If you just want to delete the child, then you can load both SSA's and do a GHN - which you did. Are you sure that the processing option in your PSB is ALL? What is in your key feedback area and segment level in your PCB? |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
I just noticed that you are not qualifying your child segment SSA? If a segment is a child, chances are that they is not just one. Take a look at your DBD and tell us the definition. |
|
Back to top |
|
|
AJAYREDDY
New User
Joined: 17 Feb 2007 Posts: 52 Location: USA
|
|
|
|
Hi Sandy, thanks for response. I forgot to tell one thing. This is Online CICS background program, which updates DB2 tables and Deletes records in above IMS DB and comes out. The Child segment RR505 should be Unqualified because there is no Key and there are multiple records for the Root SEGMENT RR500 which is having Key. So, I am reading through Root segment RR500.
I guess there is somthing related to PSB change or the way that I am getting Segments in Program.
Please let me know if you have any idea. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
Your PSB looks OK. I am going to ask some questions so we can help you solve your problem.
How are you getting the key value for the root - parent - RR500?
Are your requirements asking you to delete only the child segments - RR505? All child segments beneath the root - parent?
When you respond, we can help with your logic. |
|
Back to top |
|
|
AJAYREDDY
New User
Joined: 17 Feb 2007 Posts: 52 Location: USA
|
|
|
|
I am getting the value of the Root segment by "Program name" followed by "sequence number". Yes, I need to delete only the child segments RR505 under that Root Key (all the child segments).
I tested using TRACE commands in CICS and I am getting the correct Child segment RR505 value with GHN or GHNP. But while using DLET on the same Child segment I am getting AM status code.
After DLET statement is executed, The PCB returned values under SEGMENT LEVEL is 02 and SEGMENT NAME is RR505 and PROC OPTION is 'R'. I think this is the problem. It should show 'A' I guess. I tried changing PSB, but still same 'R' value is returning. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
OK - we are making progress! How do you know you are getting the correct child segment? There cannot be just one if it is a child segment. Is your requirement to delete ALL child segments or just the first child segment?
Was this an existing PSB? Did you recompile your PSB? You will then need to "roll" the regions where it is executing. Talk to your DBA. Maybe you should look at it in your region...../DISPLAY PSB (name of your psb) |
|
Back to top |
|
|
AJAYREDDY
New User
Joined: 17 Feb 2007 Posts: 52 Location: USA
|
|
|
|
I will talk to DBA and see. I used the output field value of RR505 to display onto the screen using TRACE command in CICS. I used before and after GHN. Before it is spaces and After it has value which I needed. So GHN is working. There can be multiple child for same Root segment. But in my logic before I read next child I am Deleting the first child segment and go on in loop until I delete ALL the child segments.
What I observed is, I am getting PROC OPTION as 'R' before and after GHN and in entire Program (Before and after DLET statement). So I think I need to talk to DBA regarding this. The Proc Option should not be 'R'.
I am Displaying PSB in Online Region and its showing Proc option as 'A'. But inside Program it is taking as 'R'. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
OK - even more progress! Are you displaying the PSB in the same region that you are executing? The recompile is very obviously correct - but it may be applied in a different region or not applied at all.
My suggestions would be.....fix the PSB and make sure that it is correct in the region. The return fields in your PCB are invaluable for tracking down problems.
OK - I would suggest a GHU on the root parent - because of all the pointers in IMS, I think you should HOLD the parent so no activity can take place and make the pointers screwy.
Then I would code a routine to go after all child segments and delete them. You need to veryify that this is what really needs to happen.
CALL 'CBLTDLI' USING GHU
RR5-PCB
RR500000
RR500-IN-SSA. (qualified)
make sure you got it - always check ims status codes after EACH CALL. Then determine what you want to do if you did not get it.
Set up a working storage switch called "ws-end-childs-sw pic x".
Move "N" to this switch.
I do not know what version of cobol you are using, so I will give you the logic.
You will perform this routine until you have retrieved all child segments and deleted them....
1000-routine.
CALL 'CBLTDLI' USING GHNP
RR5-PCB
RR505-IN-RECORD
RR505-IN-SSA. (unqualifed)
If status-code = space
next sentence
else
If status code equals "GE" or "GB"
move "y' to ws-end-childs-sw
go to 1999-exit
else
you have a problem - so determine what you want to do.
CALL 'CBLTDLI' USING DLET
RR5-PCB
RR505-IN-RECORD.
If status-code = space
next sentence
else
you have a problem - so determine what you want to do.
1999-exit.
exit. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
Oh - you do not need to set parentage for the way I suggested to code this. If you want to set parentage, adjust the code. So, you would just do a GHN - qualified root, unqualifed child. |
|
Back to top |
|
|
AJAYREDDY
New User
Joined: 17 Feb 2007 Posts: 52 Location: USA
|
|
|
|
Actually I was doing the same thing as you suggested but it was not working. Now I figured it out by going into CICS debugging statements using TRACE commands coded inside program. The problem is with the Program taking the wrong PSB name while scheduling. I corrected inside the program and now it is working.
THANKS for all your help on this issue. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
Great news! |
|
Back to top |
|
|
|