IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Doubt in using command code D and N together ( IMS DB )


IBM Mainframe Forums -> IMS DB/DC
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Appu

New User


Joined: 26 Apr 2010
Posts: 73
Location: India

PostPosted: Mon Dec 29, 2014 5:52 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2572
Location: NYC,USA

PostPosted: Tue Dec 30, 2014 3:40 am
Reply with quote

Where have you populated SSA, show us the structure?
Back to top
View user's profile Send private message
Appu

New User


Joined: 26 Apr 2010
Posts: 73
Location: India

PostPosted: Tue Dec 30, 2014 9:50 am
Reply with quote

Hello Rohit,

The SSA is in the quotes shown above :

SSA1 : 'PARENT11*N(PARENID EQabcde)'
SSA2 : 'CHILD111(CHILDID EQghi)'
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Tue Dec 30, 2014 8:29 pm
Reply with quote

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
View user's profile Send private message
Appu

New User


Joined: 26 Apr 2010
Posts: 73
Location: India

PostPosted: Fri Jan 02, 2015 5:23 pm
Reply with quote

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
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Fri Jan 02, 2015 11:43 pm
Reply with quote

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
View user's profile Send private message
Appu

New User


Joined: 26 Apr 2010
Posts: 73
Location: India

PostPosted: Mon Jan 05, 2015 11:16 am
Reply with quote

Hi Ed Goodman,

thanks .. now it is clear . I missed that point while reading manual.
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Tue Jan 06, 2015 1:10 am
Reply with quote

Awesome. Just for readability, I would always include an SSA.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> IMS DB/DC

 


Similar Topics
Topic Forum Replies
No new posts Command line placement in DB2I panels TSO/ISPF 2
No new posts Execute step regardless of previous s... JCL & VSAM 2
No new posts Error 0C1 Reason Code 1 with branch i... PL/I & Assembler 3
No new posts A command to change LRECL of an exist... JCL & VSAM 7
No new posts JCL for replacing code in Cobol JCL & VSAM 7
Search our Forums:

Back to Top