View previous topic :: View next topic
|
Author |
Message |
Appu
New User
Joined: 26 Apr 2010 Posts: 73 Location: India
|
|
|
|
Hello Team,
I am a beginner in IMS DB and I was trying to delete a child segment.
Suppose PARENT11 is the parent segment and CHILD111 is the child segment.
I issued the below call :
Code: |
DLI_FUNC = 'GHU';
DLI_CNT = 5;
CALL PLITDLI(DLI_CNT,
DLI_FUNC,
DBPCB ,
IOAREA,
'PARENT11*DN(PARENID EQabcde)',
'CHILD111(CHILDID EQghi)'
);
|
This has resulted in IMS status code blank and I got the full data. Now I want to delete only the child segment and issued the below call :
Code: |
DLI_FUNC = 'DLET';
DLI_CNT = 5;
CALL PLITDLI(DLI_CNT,
DLI_FUNC,
DBPCB ,
IOAREA,
'PARENT11*N(PARENID EQabcde)',
'CHILD111(CHILDID EQghi)'
);
|
But I am getting status code AJ ( SSA not valid ) . Could you please help how the SSA needs to be written if I want only the child to be deleted.
Thanks. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Where have you populated SSA, show us the structure? |
|
Back to top |
|
|
Appu
New User
Joined: 26 Apr 2010 Posts: 73 Location: India
|
|
|
|
Hello Rohit,
The SSA is in the quotes shown above :
SSA1 : 'PARENT11*N(PARENID EQabcde)'
SSA2 : 'CHILD111(CHILDID EQghi)' |
|
Back to top |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
I went back to check, since I haven't coded enough IMS to be sure...
DLTE calls don't use either multiple or qualified SSAs.
So your delete call should be
SSA1 : 'CHILD111 '
Don't forget to reduce the parm count too. |
|
Back to top |
|
|
Appu
New User
Joined: 26 Apr 2010 Posts: 73 Location: India
|
|
|
|
Hi,
Yes the below SSA worked :
Code: |
DLI_FUNC = 'GHU';
DLI_CNT = 5;
CALL PLITDLI(DLI_CNT,
DLI_FUNC,
DBPCB,
IOAREA,
'PARENT11*DN(PARENID EQabcde)' ,
'CHILD111(CHILDID EQghi)');
DLI_FUNC = 'DLET';
DLI_CNT = 4;
CALL PLITDLI(DLI_CNT,
DLI_FUNC,
DBPCB,
IOAREA,
'CHILD111 ' );
|
But was surprised to see that the below SSA deleted the parent segment as well eventhough I have coded N command code for the parent segment. Please advise.
Code: |
DLI_FUNC = 'GHU';
DLI_CNT = 5;
CALL PLITDLI(DLI_CNT,
DLI_FUNC,
DBPCB,
IOAREA,
'PARENT11*DN(PARENID EQabcde)' ,
'CHILD111(CHILDID EQghi)');
DLI_FUNC = 'DLET';
DLI_CNT = 3;
CALL PLITDLI(DLI_CNT,
DLI_FUNC,
DBPCB,
IOAREA);
|
|
|
Back to top |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
When I look in my manual for the 'N' command code, it reads:
N command code
The N command code prevents you from replacing a segment on a path call. In
conjunction with the D command code, it lets the application program to process
multiple segments using one call. Alone, the D command code retrieves a path of
segments in your I/O area. With the N command code, the D command code lets
you distinguish which segments you want to replace.
It also reads: The N command code applies only to REPL calls, and IMS ignores it if you include the code in any other call.
There is nothing in there about it affecting the behavior of the DLET command.
So, I think what happened is that you pulled a full path with your GHU, then you use the IOAREA as the target for your delete call. That storage is the parent and child segment together, so IMS starts with the parent when deleting. |
|
Back to top |
|
|
Appu
New User
Joined: 26 Apr 2010 Posts: 73 Location: India
|
|
|
|
Hi Ed Goodman,
thanks .. now it is clear . I missed that point while reading manual. |
|
Back to top |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
Awesome. Just for readability, I would always include an SSA. |
|
Back to top |
|
|
|