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
 

 

Loading an IMS database and building a Secondary index on it

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

New User


Joined: 27 Feb 2007
Posts: 20
Location: Chennai

PostPosted: Wed Jul 04, 2007 11:51 am    Post subject: Loading an IMS database and building a Secondary index on it
Reply with quote

Hi All,

My requirement is to load (Initial load) an IMS database through an IMB(Type - 3) program via ISRT calls (Not through utility).

The database is a HDAM database and is having a unique key with a Secondary index (on some search fields other than the unique key field). And it has only root segment with no child segments( Not sure if it is a MSDB or a DEDB).

I am using simple ISRT calls by building the segmets in the IO-Area and inserting them into the database. Before that i am using a utility to build the Secondary index on the database.

But while during runtime its abending at the first ISRT call, throwing me U0826 with status code NI. I saw the manual it says:

"Open error on work file data set during DB load with secondary
indexes. The status code is 'NI'."

I am not sure as to why is it not recognizing the Index.

Jcl execution step is given below:

Code:

//STEPNAME EXEC PGM=DFSRRC00,PARM='DLI,PGMNAME,PSBNAME,50,00'
//DFSRESLB DD DSN=IMS.RESLIB,DISP=SHR                       
//IMS      DD DSN=IMS.P.DBDLIB,DISP=SHR                     
//         DD DSN=IMS.P.PSBLIB,DISP=SHR                     
//IEFRDER  DD DUMMY                                         
//SYSUDUMP DD SYSOUT=*                                       
//DATABAS3 DD DSN=ONL.DATABASE,DISP=SHR                   
//INDEX1   DD DSN=VSAM.SECONDARYINDEXFOR.DATABASE,DISP=SHR     
//INPUTFL   DD DSN=OUTPUT.TEST.DOWNLOAD.ONE,DISP=SHR                 
//DFSVSAMP DD *                           
IOBF=(4096,10)                           
IOBF=(8192,10)                           
2048,5                                   
4096,5                                   
/*                                       
//CNTLPAGE DD SYSOUT=*                   
//SYSOUT   DD SYSOUT=*                   
//*                                       
//                 


Any help would be greatly appreciated.


Cheers,
Phoenix.
Back to top
View user's profile Send private message

Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Wed Jul 04, 2007 2:52 pm    Post subject:
Reply with quote

Could this help? You have a duplicate in your SI while your DBD specified a unique.
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 Jul 04, 2007 4:51 pm    Post subject:
Reply with quote

What option do you have coded in your PSB? An HDAM database? You must have an input file. Did you sort it first? Remember that unlike HIDAM, HDAM is not keyed sequential.
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Wed Jul 04, 2007 5:26 pm    Post subject:
Reply with quote

Sandy, as I read your post SI for HSAM would not be possible. I might have misunderstood your post so post this link anyway.

It says:
Quote:
Secondary Indexes
The following database types support secondary indexes:

HISAM
HDAM
PHDAM
HIDAM
PHIDAM
Secondary indexes are indexes that allow you to process a segment type in a sequence other than the one defined by the segment's key. A secondary index can also be used to process a segment type based on a qualification in a dependent segment.

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 Jul 04, 2007 5:37 pm    Post subject:
Reply with quote

Can you show us both database definitions along with the corresponding PSB? I may have misunderstood you.
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Thu Jul 05, 2007 12:29 am    Post subject:
Reply with quote

DBD for SI and HDAM.

It's all in the documentation icon_wink.gif
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Thu Jul 05, 2007 12:32 am    Post subject:
Reply with quote

requirements for the PCB may also be found in the documentation.
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 Jul 05, 2007 1:07 am    Post subject:
Reply with quote

I know what the DBD fields are - I wanted to see his DBD def and PSB for his particular problem?
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Thu Jul 05, 2007 1:16 am    Post subject:
Reply with quote

Sandy Zimmer wrote:
Can you show us both database definitions along with the corresponding PSB? I may have misunderstood you.


Sorry.........thought you asked me to post some stuff icon_redface.gif You're right, let the guy post his DBD and PCB so we can help further. Sorry for the misunderstanding icon_wink.gif
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 Jul 05, 2007 2:40 am    Post subject:
Reply with quote

That's OK - are these people in school or actually working? Sometimes, newcomers are so lost that you do not know the correct way to ask a question. I do agree, however, that you learn from mistakes. But, to learn from mistakes, you need the initial knowledge. When I learned IMS (seems like a million years ago), they sent me to school - for a very long time. I learned database design and could have gone into either tech or applications - I chose applications. I was 9 months pregnant with my second son in 1981 when I attended a weekend seminar with a guy that wrote a book titled "Effective Database Design". I still have that book after all of these years! icon_biggrin.gif When I say I loved IMS, I loved IMS and I feel that they will never replace it. There is nothing faster with all the builtin backup - backout capibilities.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jul 05, 2007 3:00 am    Post subject:
Reply with quote

Hello SandyZ,

At this time we have lots of folks who are students, freshers (a term i'll guess is new to you), and people who are "on the job". There is an entire new website under construction geared for students and freshers.

"Freshers" was a new term to me not so long ago. It refers to people who have started working, but are fairly unexperienced. You'll see it fairly often here.

Welcome to the forums icon_smile.gif
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 Jul 05, 2007 3:30 am    Post subject:
Reply with quote

Hi Dick,

It has been a few years since I did IMS. I miss it like hell and that is why I am here. I got married - then divorced and here I am! I want to get back into it, but many potential employers thought they I may have "
forgotten". I did not. I did not just execute "canned calls". I can still remember actual code that I did altho I do not have access to it. I never did just coding - I designed systems from inception - database design thru implementation. I worked at one of the most high tech IMS tech shops around - Corestates. The only time that the databases were down - offline - was for backup procedures for just a few minutes around 5am every morning. We were international. Corestates was the Camelot of creative thinking. Bipin Shah ran the show. If you knew him, you would know that you just did not make mistakes. I went back as a consultant a couple of times.
Back to top
View user's profile Send private message
Phoenix

New User


Joined: 27 Feb 2007
Posts: 20
Location: Chennai

PostPosted: Thu Jul 05, 2007 10:18 am    Post subject: Re: Loading an IMS database and building a Secondary index o
Reply with quote

Hi All,

Thanks for the prompt replies, but I think the problem has been solved. icon_smile.gif

Wow, i am lucky to have all the veterans helping me out, as for IMS, Sandy I share your passion for IMS too. You know what I love most about IMS, you don't do one thing right out of a million and you are in trouble and so out of those million you have to spot the loop hole, thats where all the fun is. icon_biggrin.gif

Anyways, back to business. Yes I am a little new to IMS, and would like to clarify further the problem.

It was one of the work files that I was missing in the jcl i.e. DFSURWF1 dd statement.

And the PROCOPT was "L " as i mentioned it was the initial load, and in the DBD the the search key for Secondary index was defined as unique as George said. But search key has time stamp as a field so i don't think there would be a duplicate.

And there is one more thing i was confused about, as Sandy mentioned:

Quote:

You must have an input file. Did you sort it first? Remember that unlike HIDAM, HDAM is not keyed sequential.


Why do I need to sort the file as it is a HDAM database, when the retrieval will be done by the Secondary index, once established? icon_question.gif

And the Index DBD:



Code:
DBD     NAME=NAME,                       
        ACCESS=(INDEX,VSAM)                   
DATASET DD1=DDNAME,SIZE=(4096)             
SEGM    NAME=SEGNAME,BYTES=48                 
 FIELD  NAME=(CONCATENATED FIELD,SEQ,U),BYTES=43,START=1
 LCHILD NAME=(TARGET SEGNAME,TARGET DBD),INDEX=CONCATENATED FIELD 
DBDGEN                                       



And the PSB:


Code:
    PCB     TYPE=DB,DBDNAME=TARGET DBD,PROCOPT=L,KEYLEN=200   
    SENSEG  NAME=TARGET SEGNAME,PARENT=0                           



Thanks again to all.

Cheers,
Phoenix.
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 Jul 05, 2007 10:29 am    Post subject:
Reply with quote

HDAM is not keyed sequential. If you load it with a file that is not sorted, you will run into problems - guess how I know.... HDAM is a faster access database than HIDAM - it is better for online, but not as good for reporting because it is not keyed sequential. When doing HDAM extracts, always remember that a sort will be needed. The BIG IMS place where I worked did not allow "search keys" as they were not efficient. When you do an "L" option, make sure that your database is "stopped".

Remember that the physical and logical views of a database can be different. When they differ, there are many rules that apply. I am tired - going to say goodnight!
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Thu Jul 05, 2007 3:13 pm    Post subject:
Reply with quote

I love this topic icon_razz.gif
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 Order BY AND Index Nileshkul DB2 2 Sat Dec 31, 2016 6:33 pm
No new posts IMS Database backup info ashek15 IMS DB/DC 14 Wed Nov 16, 2016 5:29 am
No new posts Getting list of tables defined under ... kishpra DB2 2 Wed Aug 24, 2016 10:36 am
No new posts Several errors during building altern... Andi1982 JCL & VSAM 11 Wed Jul 06, 2016 7:39 pm
No new posts Drop building Alternate Index for a p... bhavin.mehta JCL & VSAM 6 Mon Jul 04, 2016 3:47 pm


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