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
 

 

How to Merge one segment to another

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> IMS DB/DC
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    Post subject: How to Merge one segment to another
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: 1105
Location: The Netherlands at Hole 19

PostPosted: Wed Oct 17, 2007 6:55 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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: 1105
Location: The Netherlands at Hole 19

PostPosted: Thu Oct 18, 2007 4:24 am    Post subject:
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    Post subject:
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: 1105
Location: The Netherlands at Hole 19

PostPosted: Thu Oct 18, 2007 2:41 pm    Post subject:
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    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
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am
No new posts SQL Merge error -254 Robin Sulsona DB2 8 Wed Jun 01, 2016 8:28 pm
No new posts SAS MERGE to DFSORT Musab Ahmed DFSORT/ICETOOL 6 Mon Feb 01, 2016 5:44 pm
No new posts Merge two files having two trailer re... R.Manivannan DFSORT/ICETOOL 7 Wed Nov 25, 2015 9:18 pm


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