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
 

 

Find all segments in file-aid

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

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Wed Dec 08, 2010 1:00 pm    Post subject: Find all segments in file-aid
Reply with quote

Hi,

I have a child ONE of root SER. I want to select through file-aid all roots having at least one occurence of the child ONE. Is that possible.

I am also writing program for the same, which one would be more efficient -

GN (with UNQUAL SSA for SER, UNQUAL SSA for ONE)

or

GN (with UNQUAL SSA for SER) in outer loop, followed in inner loop with GNP of UNQUAL SSA for ONE.

Thanks in advance.
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Dec 08, 2010 9:15 pm    Post subject:
Reply with quote

I'm not sure if I got your questions correctly, however using file-aid if you choose the option for Dynamic-PSB (0 Parameters/1 System Parameters/Dynamic or Static PSB ===> D) - then you've the liberty to de-select the segments you don't want to display in the end-result:

Code:
 File-AID for IMS ------------  System Parameters  -----------------------------
 COMMAND ===>                                                                   
                                                                               
 Installation data:                                                             
        Release - 07.03.00                                                     
         CPU ID - XXXXXX                                                       
                                                                               
 Specify general options:                                                       
   Language mode         ===> C      (C = COBOL; P = PL/I)                     
   Data format           ===> E      (E = EBCDIC; M = MIXED; D = DBCS)         
   Dynamic or Static PSB ===> D      (D = Dynamic; S = Static)                 
   CAPS mode             ===> ON     (ON or OFF)                               
   Codepage              ===> 0697   ( ENGLISH )                               
Then select only the parent and child-segment-of-your-interest - from there, it's easy to see which parent does not have the child-segment-of-your-interest.
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Wed Dec 08, 2010 9:22 pm    Post subject:
Reply with quote

Thanks,Let me try as I do not have MF now. But I guess it might give me everything, one which do not have that child also. I want only those parents which have that particular child.

Any idea on the second one - I was thinking of writing two such programs and comparing the CPU.
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Thu Dec 09, 2010 4:15 pm    Post subject:
Reply with quote

I tried u meant exclude segment menu right? But it selected everything.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Dec 09, 2010 4:20 pm    Post subject:
Reply with quote

Well, it's tough to teach a tool using a Forum. Okay, I'll try if I get an idea to put some example to use it.

For what you asked for - idea is to "keep" all the parent-segments and the child-segment-of-interest and exclude all other segments.
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Thu Dec 09, 2010 4:49 pm    Post subject:
Reply with quote

Suppose I have 1000 roots in a database. Only 100 have child niks. I want to see only those 100 having child niks. Since child alone is not enough, I want to see both the 100 roots and 100 child's.
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


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

PostPosted: Fri Dec 10, 2010 6:02 pm    Post subject:
Reply with quote

If you were writing this in COBOL, you would use an unqualified SSA - without a parent SSA - to read the specific child segment. You would then interogate the key feedback area for the key to the root. If you just need the keys, you've got them. If you actually need to retrieve the root segment, I would use multiple positioning.
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Sat Dec 11, 2010 11:14 am    Post subject:
Reply with quote

Yes thanks I needed the key only.

Multi positioning - you mean GN call for both separately? Cannot we use path calls with unqual SSA for both - would not that fetch both in the same 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: Sat Dec 11, 2010 5:30 pm    Post subject:
Reply with quote

You would lose your position on the child that you just got. I would maintain that position by setting up 2 PCBs for that database within your PSB - one for the GN on the child and the other for the GU with the key that you got from your key feedback area. I like the KISS method icon_smile.gif
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Mon Dec 13, 2010 12:39 pm    Post subject:
Reply with quote

I am not sure how would we lose position with a GN path call (of parent and child).
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


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

PostPosted: Mon Dec 13, 2010 5:17 pm    Post subject:
Reply with quote

You aren't doing a path call. You are initially reading ONLY the child segment. You will then be positioned on that segment. Why would you want to do a path call?
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Mon Dec 13, 2010 6:02 pm    Post subject:
Reply with quote

So that I can read the root/child in one 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: Mon Dec 13, 2010 6:09 pm    Post subject:
Reply with quote

That's not an efficient way to do it. You want to determine what root segments have a certain child - correct? It's much better programming to go after that child with an unqualified SSA - when you get a hit, then look at the key feedback area in the PCB to find the concatenated keys for all segments above.
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Mon Dec 13, 2010 7:55 pm    Post subject:
Reply with quote

Ok now I got the reason for not going for the path call..I though path call and GN call for the child would take up the same resources ..Thanks a ton !!!!!
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 Dec 14, 2010 5:05 am    Post subject:
Reply with quote

Well.......it would not work. Remember that a parent child is a 1 to many relationship. You have 1 parent and maybe 2,000,000 children. How would you do it?
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Tue Dec 14, 2010 10:27 am    Post subject:
Reply with quote

But for this child we have 1-to-1 relationship, parent has exactly one occurence of this child.

Code:

DLI USING GN
                 PCB-PASK
                 IO_AREA
                 UNQUAL-SSA-PARENT (PARENT  )
                 UNQUAL-SSA-CHILD   (CHILD    )



I was thinking of something like this, not getting time to try. I hope I have got your question.
Back to top
View user's profile Send private message
hchinnam

New User


Joined: 18 Oct 2006
Posts: 73

PostPosted: Tue Dec 14, 2010 2:41 pm    Post subject:
Reply with quote

Here is a way to do it...

Declare a temp variable with low values and use that in your in SSA (get the segment that is greater than this variable).

Issue a GN call with root partly qualified(as said above) and child as un qualified.

Take the root key from KFB (If you need the data from root you can change the call to a path call).

Move the key you just got back in to your temp variable and loop.
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 Dec 14, 2010 5:23 pm    Post subject:
Reply with quote

If you had a 1 to 1 relationship, then there would be no logical reason for a parent-child relationship. That would be bad database design.
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Tue Dec 14, 2010 10:02 pm    Post subject:
Reply with quote

Hchinnan,

Thanks, looks better.

Sandy,

Some other team added the new segment....They are telling me this segment would be present only for some parents that is why they did so.
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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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