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
 

 

Read IMS DB from Start to End.
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> IMS DB/DC
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    Post subject: Read IMS DB from Start to End.
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
Reply with quote

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

http://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: 1105
Location: The Netherlands at Hole 19

PostPosted: Wed Oct 31, 2007 7:04 pm    Post subject:
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    Post subject: Reply to: Read IMS DB from Start to End.
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    Post subject:
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    Post subject:
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    Post subject:
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: 1105
Location: The Netherlands at Hole 19

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

PostPosted: Thu Nov 01, 2007 3:51 am    Post subject:
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    Post subject:
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: 1105
Location: The Netherlands at Hole 19

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

PostPosted: Fri Nov 02, 2007 3:41 pm    Post subject:
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    Post subject:
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
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
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts CICS START AND CANCEL blayek CICS 1 Wed Dec 07, 2016 3:27 am
No new posts CICS VSAM RLS READ akodakka CICS 3 Tue Oct 04, 2016 3:09 pm
No new posts Multi row fetch - "for read only... Nileshkul DB2 3 Sun Aug 14, 2016 12:52 am
No new posts Event-driven programming (BTS) VS (ST... Rohit Umarjikar CICS 2 Sat Jun 11, 2016 2:05 am
No new posts START Command in CICS amitc23 CICS 17 Fri Jun 03, 2016 3:49 pm


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