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 

How to delete specific child segment records under a parent.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> IMS
View previous topic :: View next topic  
Author Message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Fri Sep 22, 2006 5:48 pm    Post subject: How to delete specific child segment records under a parent. Reply with quote

Hi,

I like to know how to delete specific records in the child segment. In the below dataset, the parent is FN01QKEF and the CHILD SEGMENTS are FN01CQPF and CN01PICZ.


[code:1:7e0a252fc2]
CFN01QKEF....................Nk2683160132099 42683160132 01
TFN01CQPF...................R..T...T 88300RS20050821 ...AAAA.5.
TFN01CQPF...................R..T...T 588300RS20050821 ...BBBB.5.
TFN01CQPF...................R
Back to top
View user's profile Send private message
sunkusiva
Beginner


Joined: 04 Apr 2006
Posts: 8
Topics: 1

PostPosted: Sat Sep 23, 2006 1:59 am    Post subject: Reply with quote

Hi Vak255,
You should establish a Parentage at FN01QKEF.
Then you should issue a GHU call for FN01CQPF with qualified SSA (To meet the condition 'BBBB'). If this GHU call is successful, then you need to Issue a DLET call without any SSA. This process you need to repeat till you get 'GE'.

Reason I could predict for its infinite loop, might be because it failed to establish parentage at FN01QKEF.

Thanks
Siva.
Back to top
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Sat Sep 23, 2006 8:44 am    Post subject: Reply with quote

HI sunkusiva,

GHU call was successful, then I Issued a DLET call without any SSA. Its successfully deleting the
TFN01CQPF...................R..T...T 588300RS20050821 ...BBBB.5

As I want to delete all the 'BBBB' records, I changed the code and used Perform until 'GE', now its going in the loop as the call is not getting 'GE'.



Quote:

You should establish a Parentage at FN01QKEF.


Could you please tel me how to do this.
Back to top
View user's profile Send private message
sunkusiva
Beginner


Joined: 04 Apr 2006
Posts: 8
Topics: 1

PostPosted: Sat Sep 23, 2006 12:56 pm    Post subject: Reply with quote

Hi Vak255,
Use Command Code P for FN01QKEF with GU/GN to reach the segment under which you need to delete 'BBBB' records.

SSA for establishing Parentage
Code:

FN01QKEF*P(FN01KEYBEQXXXX) ---> If it is Keyed Segment.
FN01QKEF*P ----> For Non-keyed one.


Use GHNP calls while calling FN01CQPF and delete them. Loop this (GHNP & Delete) till you get 'GE'.
You should be doing in this way,
Code:

Step1: Establish the Parentage at FN01QKEF
Step2: Use GHNP call to read 'BBBB' record of FN01CQPF .
Step3:
Perform Untill Return-code = 'GE'
    Delete the Record.
    Use GHNP call to read the next 'BBBB' of FN01CQPF
End-Perform.


I hope you are not doing the perform following way (Which case it may go infinite).
Code:

Perform Untill Return-code = 'GE'
    Use GHNP call to read the next 'BBBB' of FN01CQPF
    Delete the Record.
End-Perform.



Thanks
Siva.
Back to top
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Sat Sep 23, 2006 11:02 pm    Post subject: Reply with quote

Thanks Siva, I will try and will let you know.

I have a doubt here, I used GHU initially... do you say that I have to use GHNP instead.
I believe You are right as I don't have unique condition..i got to use GHNP.
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 -> IMS 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