View previous topic :: View next topic
|
Author |
Message |
Archana_MF
New User
Joined: 21 Jul 2006 Posts: 49 Location: California
|
|
|
|
Hi All,
I need to write a routine to Read the IMS DB from Start till End, from the very first Record to the Last.
Can I use GN & GNP for this process? but how do I position the pointer at first record without giving the Key?
I have worked on DB2/Datacom but on IMS DB/DC this is the first Project.
Please Advice.
Thank You All. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
To begin - do a GU with no SSAs. Then do a GN with no SSAs - you will get every segment - parent - children - grandchildren - etc-etc. After each call, check for GB - end of database. You can determine which segment type you are on by looking at the key feedback area in your PCB - look at segment level also. |
|
Back to top |
|
|
Devzee
Active Member
Joined: 20 Jan 2007 Posts: 684 Location: Hollywood
|
|
|
|
Quote: |
To begin - do a GU with no SSAs. |
This GU call may or may not be required depending on what your program does. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
A GU with no SSAs will always position you at the beginning of the database. |
|
Back to top |
|
|
Srihari Gonugunta
Active User
Joined: 14 Sep 2007 Posts: 295 Location: Singapore
|
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
I think there's no need to discuss the positioning at the first segment of the database. TS got the answer how to access all segments. |
|
Back to top |
|
|
Archana_MF
New User
Joined: 21 Jul 2006 Posts: 49 Location: California
|
|
|
|
Thank you all.
Just one more Question.
GU followed with GN and do I need to use GNP after GN to get the Child Segments or will GN bring all?.
I programmed it as
GU with unqualified SSA follwed with GN within which GNP will be looped until 'GE' status. & The GN loop is checked for 'GB' status.
Yet to run the job, facing some PSB issues.
Thank you once again.
Archana |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
Absolutely NO SSa's. Just read with your GN and PCB and a work area large enough for all segment types. Once you have spaces in your status code - check for that before your GB - check the segment level in your PCB to determine what segment you have. You can also look at the key feedback area to see any key values - including parent segments.
What's up with the PSB? What is the purpose of this program? |
|
Back to top |
|
|
Archana_MF
New User
Joined: 21 Jul 2006 Posts: 49 Location: California
|
|
|
|
I am running it as a Batch Job as I need to write each segment to a output file in specific format.
I was getting U0476 Abend but just fixed it.
Thank You! |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
OK - when you know what segment type you have, you can move it from your "global read area" into the specific ws area and write from there. Is it variable length? |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
Sandy wrote:
Quote: |
Once you have spaces in your status code - check for that before your GB - |
In addition to that for unqualified GN- of GNP-calls..... if you are going through a hierarchy with different segment types and/or different segment types exist at a specific level or you cross the boudary of a hierarchy (i.e. the next root segment) you will receive a status-code not space but some in the Gx-category like this one |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
Yes, George!
GA
call completed successfully but higher level crossed for GN or GNP call
GB
end of database reached on GN call
GK
call completed successfully but different segment type on same level retrieved for GN |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
GK will not happen if you leave off the SSAs.....IMS reads left to right up and down |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
Sandy Zimmer wrote:
Yep, being old is not yet a handicap; the memory is still in order |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
Mostly, George - sometimes it just needs a little boost! Always remember - age is JUST a number! |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
Yep it is
Don't think I'm not at the forum whenever I don't post. I look at the reactions and as long as it's all right I don't interfere. But when it's not all right I don't hesitate and react |
|
Back to top |
|
|
Archana_MF
New User
Joined: 21 Jul 2006 Posts: 49 Location: California
|
|
|
|
Hi,
The GU with Unqualified SSA gave me AJ status.
So I directly gave GN with no SSA as suggested by Sandy Zimmer and it worked.
George,
First I didn't understand what you were saying about the hierarchy but after my program returned the GA status I understood.
Thank you ALL Guys.
GREAT HELP!!! |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
Archana,
I am so happy that this worked for you! A GU will work only if you use NO ssa's....No qualifed - No unqualified - NO ssa.....
AJ
SSA specified for the call is invalid
One more point I want to make - if you do not check for GB - with no SSAs - you will just keep going - you will start again at the beginning of the database - you will be the enigizer bunny! |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
Hi Archana,
Please read the answers you get carefully . In a previous post Sandy wrote:
Quote: |
Absolutely NO SSa's. |
Still great for you it all works |
|
Back to top |
|
|
Archana_MF
New User
Joined: 21 Jul 2006 Posts: 49 Location: California
|
|
|
|
George,
The GU with SSA did not work but the GN with No SSA Worked.
Thank You! |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
Sandy wrote no SSA's at all so also the GU should be done without any SSA. |
|
Back to top |
|
|
donateeye Warnings : 2 New User
Joined: 01 Jun 2007 Posts: 62 Location: chennai
|
|
|
|
please give me a link to download IMS DB learning material |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
donateeye wrote: |
please give me a link to download IMS DB learning material |
Check PM |
|
Back to top |
|
|
|