Joined: 22 Apr 2006 Posts: 6258 Location: Mumbai, India
Shall I read each record in parent segment i.e. Segment A and intialize the newly added variable and continue this till end of the segment
What exactly do you mean by "record"? In IMS the smallest unit the program will read is a 'segment' - so you read segment/s and then all the values in that segments are available to you -- so no-records, as such, you talk about from IMS per se.
GN in a loop till you get GB/GE should work for you. Keep in mind, IMS will go down the hirerachy, front to back and left to right. If you have millions of records (which possibly a big count for you) -- you might use the concept of AREAs (but if your IMS is not designed that way, it's a moot point here), on the other hand you can break your process in multiple Jobs, let's say you want a seprate job for every 100,000 segments of type A -- that way first job would update first 100,000 segments of type-A, second will start from 100,000 to 200,000 and so on.
Per your description, your IMS must be oraganised on some key in segement-A, in Job-1 use a qualifed SSA to position the control for segment-A and read it till you get a key match for the 100,000th segment-A. in Job-2 use a qualifed SSA to position the control for segment-A at position 100,000, issue GN till you get a key match for the 200,000th segment-A...