Title: | *OLD* ALL-IN-1 (tm) Support Conference |
Notice: | Closed - See Note 4331.l to move to IOSG::ALL-IN-1 |
Moderator: | IOSG::PYE |
Created: | Thu Jan 30 1992 |
Last Modified: | Tue Jan 23 1996 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 4343 |
Total number of notes: | 18308 |
Help ... I've got a weird situation ... Almost as good as #user:H My student has got a file, which has two keys. The alternate key will allow duplicates. Let's say that there are 4 records with the same duplicate key value, "A" The code to access the records one right after the other doesn't work right. DATASET:ALT.%NEXT[""] Will get the first record with alternate value A, the second time this is accessed will return the second record with "A". The third call will return the second record with "A" and all subsequent calls will only return the second record. But this student was trying all kinds of things and tried a DSR that looked like this. DATASET:ALT.%NEXT["0"] ... AND IT WORKS! {twilight zone music} I don't understand it. Can anyone explain it? His concern is that this is exactly what he wants and is this supposed to work like this, or isn't it. Thanks, Mia Ruddy Santa Clara Training Center
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
379.1 | Try .%SEQ_NEXT | SHALOT::WARFORD | Richard Warford @OPA DTN 393-7495 | Wed Apr 01 1992 04:53 | 14 |
I don't know why this would work, but I would suspect what he really wants to use is .%SEQ_NEXT instead of .%NEXT. .%NEXT returns the next record from the key specified in the DSR. .%SEQ_NEXT returns the next record from the CURRENT pointer in the file. I would suspect that what he is seeing is a 'bug' in ALL-IN-1. Failing to find the key specified "0", the record position didn't get changed, and then the next record was read. So it behaved like .%SEQ_NEXT. If this is the case, then if/when the bug got fixed, his code would break. Using .%SEQ_NEXT would give a higher future compatibility! Rick | |||||
379.2 | More clairification on .SEQ_NEXT | MELKOR::RUDDY | Home is where overhead is | Wed Apr 01 1992 20:29 | 13 |
Rick, Thanks for the info, but could I get some clarification on .%SEQ_NEXT. I must have misunderstood the documentation. But from what I understand won't seq_next give me the next sequential record in order of the primary key. What I want is the record in seq order of a duplicate primary key. If so then that solves my problem, but could you explain .SEQ_NEXT a little more for me, I'd appreciate it. Mia |