I used F commancd ode to insert a segment int he beginning.
The inserted segement has no keys. Already i have one segment in database. If I insert again, its showing segment already exists(status coded II)
If the segment has no key means, is it possible to insert another segment?
We can use F with segments that have either no key at all or a non unique key, and that have HERE specified on the RULES operand of the SEGM statement in the DBD. If you specify HERE in the DBD, the F command code overrides this, and IMS inserts the new segment occurrence as the first occurrence of that segment type. Using the F command code to override the RULES specification.
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
In all my years of IMS, I limited my use of command codes. There were some that I thought would solve a specific problem, but not so. Try to understand what IMS is doing behind the scenes. For instance, when you use a pathcall command code, IMS is resolving all of the things that would you would be doing if you just coded it with the qualified SSA's. Try to think of your access methods - whether HDAM or HIDAM - the most commonly used. Always - always remember that IMS is POSITIONAL. Also, remember that everything you want to know is in your PCB. You can go after all child segments in a database with an unqualifed SSA specified for that child without knowing it's parent - then find the parent key by looking at the concatenated key in the key feedback area of the SSA. IMS is driven by POINTERS - it knows where it is and who belongs to whom. Twin forward and backward pointers in your DBD definition help resolve - and quickly - issues such as these.