Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> IMS DB/DC
View previous topic :: :: View next topic  
Author Message
Appu

New User


Joined: 26 Apr 2010
Posts: 74
Location: India

PostPosted: Mon Dec 29, 2014 5:52 pm    Post subject: Doubt in using command code D and N together ( IMS DB )
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

Senior Member


Joined: 21 Sep 2010
Posts: 1742
Location: NY,USA

PostPosted: Tue Dec 30, 2014 3:40 am    Post subject:
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: 74
Location: India

PostPosted: Tue Dec 30, 2014 9:50 am    Post subject:
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    Post subject:
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: 74
Location: India

PostPosted: Fri Jan 02, 2015 5:23 pm    Post subject:
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    Post subject:
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: 74
Location: India

PostPosted: Mon Jan 05, 2015 11:16 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> IMS DB/DC All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Command to find TMEMBER name for a TPIPE Siva NKK Kothamasu IMS DB/DC 0 Wed Aug 16, 2017 6:08 pm
This topic is locked: you cannot edit posts or make replies. how to code for GDG in Rexx cvnlynn CLIST & REXX 13 Wed Aug 09, 2017 9:13 pm
This topic is locked: you cannot edit posts or make replies. rexx to create a tso command Bharath Vikraman CLIST & REXX 1 Tue Aug 08, 2017 3:32 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts I want to retire TRX and use only Rex... Abhinav Sharma CLIST & REXX 6 Sat Jul 29, 2017 2:53 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us