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

Performance issues with GHU call


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

New User


Joined: 22 Dec 2008
Posts: 87
Location: US

PostPosted: Tue Feb 16, 2010 4:07 pm
Reply with quote

Hi All,

I would like to know if there are any known performance issues with GHU call used for DB repositioning. Take the below example -

Code:
call 'CBLTDLI' for xrst
if xrst
   call 'CBLTDLI' for GHU
end-if

read-db till end (GN) save off the key-seg

             certain conditions met, reposition using key-seg (GHU)
             delete the segment
end-read

The above operation is performed for a huge DB. Is there any performance hit that could happen in this context where we read using GN till EOF and in between use GHU to reposition back and DLET.

I have done few optimizations in Cobol-DB2 areas where we substituted the DB2 table with an unload of it treated as a GSAM and had a program read the file and make changes to DB as required. Can I use the same logic in IMS -

Code:
take an unload of the entire IMS-DB, treat it as GSAM
process the records one by one, and writing only the ones I want to retain to an output file.
Do a LOAD REPLACE (not sure how this can be done in IMS-DB)


Please let me know if this can be implemented.


Regards,
Sumesh
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Tue Feb 16, 2010 5:37 pm
Reply with quote

Once again - IMS is NOT DB2!

First of all, GSAM is only 1 level. How many levels are in your database?

Are you running this process as DLI or BMP? What determines what gets deleted?
Back to top
View user's profile Send private message
cybertaurean

New User


Joined: 22 Dec 2008
Posts: 87
Location: US

PostPosted: Tue Feb 16, 2010 6:09 pm
Reply with quote

Hi Sandy,

Thanks for the response.

The DB in context contains a single segment and the logic for deleting the records is something that is based on the date fields in fields present within the segment. There is no dependency between the data present in different segments (bottomline, segments can be processed individually).

Let me know if you think the unload-process-load would be a good option instead of direct processing.

Regards,
Sumesh
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Tue Feb 16, 2010 6:38 pm
Reply with quote

Can you post your DBD?
Back to top
View user's profile Send private message
cybertaurean

New User


Joined: 22 Dec 2008
Posts: 87
Location: US

PostPosted: Wed Feb 17, 2010 10:22 am
Reply with quote

Code:
DBD   NAME=A,ACCESS=(PHIDAM,OSAM),               
      VERSION='06/18/0309.39'                         
SEGM  NAME=SEGLA,BYTES=1000,PTR=(TB),               
      PARENT=0,RULES=(LLL),COMPRTN=(DPIEXIT,DATA,INIT),
      DSGROUP=A                                       
FIELD NAME=(AKEY,SEQ,U),BYTES=57,START=1,TYPE=C   
FIELD NAME=ITEM1,BYTES=2,START=1,TYPE=C             
FIELD NAME=ITEM2,BYTES=20,START=3,TYPE=C           
FIELD NAME=ITEM3,BYTES=8,START=23,TYPE=C           
FIELD NAME=ITEM4,BYTES=4,START=46,TYPE=C           
FIELD NAME=ITEM5,BYTES=1,START=50,TYPE=C           
FIELD NAME=ITEM6,BYTES=6,START=51,TYPE=P                   
FIELD NAME=ITEM7,BYTES=1,START=57,TYPE=C                   
FIELD NAME=ITEM8,BYTES=20,START=75,TYPE=C                   
FIELD NAME=/SX01,BYTES=8,START=1                               
LCHILD NAME=(SEGLB,LDBBX),PTR=INDX                         
XDFLD NAME=LASEC,SEGMENT=SEGLA,                               X
      SRCH=(SUBRCRTN),                                        X
      SUBSEQ=(/SX01)                                           
DBDGEN                                                         
FINISH                                                         
END                                                           
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Wed Feb 17, 2010 7:32 pm
Reply with quote

You have a logical child segment defined. What is your "delete" criteria and how will this logical child segment be affected?
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Wed Feb 17, 2010 8:25 pm
Reply with quote

I would make this as efficient as possible. The best way to do this would be to do a read only on the database. Make sure that you have an image copy or use the current database as the image copy.

You will have 2 sequential files defined - one for segments you are keeping and one for segments you are deleting.

You will write to one of the 2 files based on whether they stay or get deleted - we will call them KEEP File and DELETE File.

You will NOT do any updates to the database you are reading - make your PSB read only.

Then do a delete/define of a TEST database. You will use your KEEP File to LOAD this database. Once verified as correct, you will image copy this TEST database to PRODUCTION.

Do not throw away the DELETE file. Both of your sequential files can be used as audit trails.
Back to top
View user's profile Send private message
cybertaurean

New User


Joined: 22 Dec 2008
Posts: 87
Location: US

PostPosted: Thu Feb 18, 2010 4:17 am
Reply with quote

Hi Sandy,

The LCHILD is the secondary index for the DB. Wouldn't that be handled automatically when we delete from DB?

Say, I create two files RETAIN and DELETE from the file, how can I make use of the RETAIN file to load the DB? Is there a utility or do I have a write a PROGRAM with the RETAIN file as a GSAM since the creation of RETAIN has been done programatically?.

Could you also please explain the delete/define + IMAGECOPY part that you mentioned in the end?. This DB is already an existing one.

Appreciate your great help with this.

Regards,
Sumesh
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Thu Feb 18, 2010 4:26 am
Reply with quote

OK - first of all, any delete of a root or parent segment - as I have said many times before - deletes any child segments all the way down the chain.

You need to thorougly test any procedure before implementation. I have done many projects with the same scenario that I described to you. You must have a DBA that can help along the way - right? Anyway, when designing this system, you need to consider how the delete of your root will affect any other system. I would not use the GSAM. Since you are dealing with a large volume of data, you want your system to run as fast as possible.

The database that you use as the final result - after multiple testing - should be your image copy.

Your delete/define/init of your KEEP database is an easy task for your tech services group. Any secondary index from this new database is also an easy task for your tech services group..
Back to top
View user's profile Send private message
cybertaurean

New User


Joined: 22 Dec 2008
Posts: 87
Location: US

PostPosted: Thu Feb 18, 2010 4:52 am
Reply with quote

Hi Sandy,

In case I were to treat the file as non-GSAM, wouldn't that complicate things when it comes to implementing checkpoint restart? Say, the program abends, I would probably keep track of the number of records read and then read through till the count that was registered when the last successful checkpoint was taken and then resume processing. Please see the stub below -

Code:
?xrst
     read_DELETE_FILE process_count times
else
     read_DELETE_FILE
?end
perform main_loop until EOF

:main_loop
     delete the record from IMS
     ?OK
            process_count ++
            checkpoint
     ?end
:end

Would the above logic be better than having IMS take care of checkpointing?

Regards,
Sumesh
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Thu Feb 18, 2010 5:00 am
Reply with quote

Nope - if you are running BMP - take the current image copy of the production database.

Run against the thing offline - as a DLI. There is absolutely NO REASON to run checkpoint restart if you are doing this process as a "read only". You are not updating a thing. If the program abends - and why would it - you have not updated anything. It will run fast - believe me. You are just writing to 2 sequential non-IMS files.
Back to top
View user's profile Send private message
cybertaurean

New User


Joined: 22 Dec 2008
Posts: 87
Location: US

PostPosted: Thu Feb 18, 2010 5:05 am
Reply with quote

Great!!!!!

One final question (and I guarantee this will the last icon_biggrin.gif).

Instead of having the RETAIN file LOAD the DB, wouldn't it be better if I used the DELETE file to DLET data from DB. The reason being that, the DELETE count will be lesser compared to the RETAIN count.

Thoughts???
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Thu Feb 18, 2010 5:16 am
Reply with quote

NOPE!!! Absolutely not! What you are doing in a simple process is cleaning up the database. In addition, you are doing what we term as as "reorg" . You will be freeing up now unused space - root anchor points - forward - backward pointers and all that good stuff. Take my word - you will be accomplishing many tasks with your process. Make sure that your DBA group understands what you will be doing - they should really appreciate your innovation. Just keep us posted on how you are doing. Just do this FIRST against your test databases.

So the process should be - GN database record - either write to KEEP or DELETE file. Check out those sequential files - sequential files are fast and easy no matter how large - once you finish your audit - check with your user - then do the rest.
Back to top
View user's profile Send private message
cybertaurean

New User


Joined: 22 Dec 2008
Posts: 87
Location: US

PostPosted: Thu Feb 18, 2010 5:26 am
Reply with quote

Thanks a lot!!!!

Will keep you posted....
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Thu Feb 18, 2010 5:34 am
Reply with quote

You are very welcome! I like to keep any process simple and easy to maintain - this process won't cost anyone anything - you may need to run it "after hours", but it will work and you will accomplish many tasks with one process. Don't worry about asking for further help!
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 Call an hlasm from REXX in batch and ... CLIST & REXX 4
No new posts Two where-criteria with GT - Performa... DB2 4
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts exploiting Z16 performance PL/I & Assembler 2
No new posts Error while running web tool kit REXX... CLIST & REXX 5
Search our Forums:

Back to Top