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

Read IMS DB from Start to End.


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

New User


Joined: 21 Jul 2006
Posts: 49
Location: California

PostPosted: Tue Oct 30, 2007 10:40 pm
Reply with quote

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
View user's profile Send private message
Sandy Zimmer

Active Member


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

PostPosted: Wed Oct 31, 2007 2:55 am
Reply with quote

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
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Wed Oct 31, 2007 9:01 am
Reply with quote

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
View user's profile Send private message
Sandy Zimmer

Active Member


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

PostPosted: Wed Oct 31, 2007 4:42 pm
Reply with quote

A GU with no SSAs will always position you at the beginning of the database.
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Wed Oct 31, 2007 6:52 pm
Reply with quote

Even a direct GN call without SSAs will position at the beginning of the DB.

publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.ims9.doc.apdb/p3hgnp.htm

First GN or GU
and in the loop GN will serve the requirement, I suppose. Please correct me if I am wrong.
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 31, 2007 7:04 pm
Reply with quote

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
View user's profile Send private message
Archana_MF

New User


Joined: 21 Jul 2006
Posts: 49
Location: California

PostPosted: Wed Oct 31, 2007 10:32 pm
Reply with quote

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
View user's profile Send private message
Sandy Zimmer

Active Member


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

PostPosted: Wed Oct 31, 2007 10:37 pm
Reply with quote

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
View user's profile Send private message
Archana_MF

New User


Joined: 21 Jul 2006
Posts: 49
Location: California

PostPosted: Wed Oct 31, 2007 10:40 pm
Reply with quote

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
View user's profile Send private message
Sandy Zimmer

Active Member


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

PostPosted: Wed Oct 31, 2007 10:42 pm
Reply with quote

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
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 31, 2007 11:43 pm
Reply with quote

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
View user's profile Send private message
Sandy Zimmer

Active Member


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

PostPosted: Wed Oct 31, 2007 11:53 pm
Reply with quote

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
View user's profile Send private message
Sandy Zimmer

Active Member


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

PostPosted: Wed Oct 31, 2007 11:58 pm
Reply with quote

GK will not happen if you leave off the SSAs.....IMS reads left to right up and down
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 Nov 01, 2007 3:51 am
Reply with quote

Sandy Zimmer wrote:

Quote:
Yes, George!


Yep, being old is not yet a handicap; the memory is still in order 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 Nov 01, 2007 4:05 am
Reply with quote

Mostly, George - sometimes it just needs a little boost! Always remember - age is JUST a number!
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 Nov 01, 2007 4:11 am
Reply with quote

Yep it is icon_wink.gif

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 36_2_51.gif
Back to top
View user's profile Send private message
Archana_MF

New User


Joined: 21 Jul 2006
Posts: 49
Location: California

PostPosted: Fri Nov 02, 2007 4:27 am
Reply with quote

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
View user's profile Send private message
Sandy Zimmer

Active Member


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

PostPosted: Fri Nov 02, 2007 4:53 am
Reply with quote

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! icon_smile.gif
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: Fri Nov 02, 2007 3:41 pm
Reply with quote

Hi Archana,

Please read the answers you get carefully icon_idea.gif. In a previous post Sandy wrote:
Quote:
Absolutely NO SSa's.


Still great for you it all works icon_wink.gif
Back to top
View user's profile Send private message
Archana_MF

New User


Joined: 21 Jul 2006
Posts: 49
Location: California

PostPosted: Fri Nov 02, 2007 9:50 pm
Reply with quote

George,
The GU with SSA did not work but the GN with No SSA Worked.

Thank You!
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: Fri Nov 02, 2007 10:41 pm
Reply with quote

Sandy wrote no SSA's at all so also the GU should be done without any SSA.
Back to top
View user's profile Send private message
donateeye
Warnings : 2

New User


Joined: 01 Jun 2007
Posts: 62
Location: chennai

PostPosted: Tue Nov 27, 2007 7:14 pm
Reply with quote

please give me a link to download IMS DB learning material
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: Tue Nov 27, 2007 10:30 pm
Reply with quote

donateeye wrote:
please give me a link to download IMS DB learning material


Check PM
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 Error to read log with rexx CLIST & REXX 11
No new posts Random read in ESDS file by using RBA JCL & VSAM 6
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts ICETOOL to Read records SMF CEF it is... DFSORT/ICETOOL 4
No new posts Start CICS transaction every day at 2AM CICS 4
Search our Forums:

Back to Top