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

How to Merge one segment to another


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

New User


Joined: 03 Feb 2006
Posts: 11

PostPosted: Wed Oct 17, 2007 8:26 am
Reply with quote

Hi,

I have a requirement where I need to Create 5 new sigments similar to One existing segment.

We have DB called PURDSUP where in below are segments
SUPLID -- Root -- key SUPNO
SUPITEM
SUPADR

Lets suppose there is SUPNO # 12345 exists.
I need to ISRT new segments which should have same data as 12345 but with different Key values.
i.e., 12345 existing root, ABCDE and MNOPQ should be new segments having same data as 12345 except Primary key value.

Thanks
Suresh
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


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

PostPosted: Wed Oct 17, 2007 6:55 pm
Reply with quote

Are the new segments supposed to be rootsegments too? Ever heard about the ISRT-call?
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 Oct 18, 2007 3:05 am
Reply with quote

Why? You want to ISRT new root segments with the same data but with different keys? You will be duplicating data. Many shops moved to IMS to reduce redundant data. It is always helpful to know the "why" of what you are attempting.
Back to top
View user's profile Send private message
sure116

New User


Joined: 03 Feb 2006
Posts: 11

PostPosted: Thu Oct 18, 2007 3:17 am
Reply with quote

George,

One sample occurences of segments is as below
Why asked Question is if there is any simple way to copy entire structure with another Key.
If it is only for Root, I can do GU and then ISRT with new key.
But my question is how do I retain the sequence of child segments do I need to use array to keep values in IO-AREA and resinsert in new Segment.

SUPLID --- root
SUPADR
SUPITM
SUPQUO
SUPITM
SUPQUO
SUPITM
SUPQUO
SUPITM
SUPQUO
SUPQUO
SUPQUO
SUPITM
SUPQUO
SUPITM
SUPQUO
SUPITM
SUPQUO
SUPQUO


Zimmer,

Yes this will definitely result in duplicate data. But let me clarify my requirement.

We have Oracle interface where 5 digit SUPNO is in Mainframe is mapped to 10 digit SUPNO.
And One MF SUPNO is mapped to Many SUPNO's at Oracle.

Now Oracle team wants to sync up the SUPNO value in both MF and ORACLE. So even though the data is duplicated same key value is maintained.

Please let me know if there is any simple logic so that I can logically refer to child segments of particular key.

Thx Suresh
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 Oct 18, 2007 3:36 am
Reply with quote

I need to think further, but let me offer another alternative. Think about adding a child segment with the mapping data. You would need to change the DBD, any PSBs and recompile any programs. You would save a lot of space in your database and the logic would be fairly simple. You would have the Oracle SUPNOs as the key value to the new child segments of the existing SUPNO. You can do a match on that segment without going after the parent simply by going after that segment and not down thru the parent. Then you look at the key feedback area to get the key of the existing parent. Like I said, let us think on this.
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


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

PostPosted: Thu Oct 18, 2007 4:24 am
Reply with quote

Think about a pathcall. You can insert a complete path (you call it a structure) with one single ISRT call. Use the right command code (search the first link in a sticky) and go for it.
Back to top
View user's profile Send private message
sure116

New User


Joined: 03 Feb 2006
Posts: 11

PostPosted: Thu Oct 18, 2007 7:42 am
Reply with quote

Hi George,

I have never used path call before. Please correct me where I am coding wrong.

01 QUAL-SUPLID-SSA-D.
02 FILLER PIC X(08) VALUE 'SUPLID '.
02 FILLER PIC X(01) VALUE '*'.
02 SUPLID-SSA2-COMM-CD1 PIC X(01) VALUE 'D'.
02 SUPLID-SSA2-COMM-CD2 PIC X(01) VALUE ' '.
02 FILLER PIC X VALUE '('.
02 FILLER PIC X(8) VALUE 'SUPNO '.
02 OPERAND PIC XX VALUE ' ='.
02 SUPLID-SSA-KEY1 PIC X(10).
02 FILLER PIC X VALUE ')'.

MOVE '05183' TO SUPLID-SSA-KEY1
CALL 'CBLTDLI' USING DLI-GU,
PCB4,
IO-SUPLID,
QUAL-SUPLID-SSA-D
QUAL-SUPRES-SSA-D
QUAL-SUPADR-SSA-D
QUAL-SUPITM-SSA-D
QUAL-SUPQUO-SSA-D
QUAL-SUPTXT-SSA-D
QUAL-SUITXT-SSA-D
UNQUAL-SUPTXT-SSA

Or else can u provide me any sample calls for GU and ISRT using path calls.

Thx in advance
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


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

PostPosted: Thu Oct 18, 2007 2:41 pm
Reply with quote

Replaced my previous post by this link.
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 Merge two VSAM KSDS files into third ... JCL & VSAM 6
This topic is locked: you cannot edit posts or make replies. Merge 2 input files based on the reco... JCL & VSAM 2
No new posts Merge 2 input files after sort SYNCSORT 14
No new posts Merge files with a key and insert a b... DFSORT/ICETOOL 6
No new posts Merge 2 lines based on Space from a S... DFSORT/ICETOOL 5
Search our Forums:

Back to Top