Original Message:
Sent: 05-24-2023 17:38
From: M Arcus1
Subject: Reading a file without a SELECT list?
It might me more accurate to say that when selecting a file variable, the file itself *is* the list, and it's processed in logical order (the order in which the records are 'physically' laid out on the disk) , whereas, when a TCL select is executed, a separate list must be generated, usually in a hidden, temporary file. But not all flavors retain the entire list in RAM. In fact, I doubt any do. UniData, for example, splits big lists up into 32K chunks, and loads/processes them individually so as to save RAM. You can see this by saving the list and editing the resulting items in the savedlists file.
This is why the preferred method for reading host OS files sequentially (at least on Pick) used to be to select them as as savedlists, and then get the list. No way would it load the entire file into RAM. It would just take the next item, just like a readseq does now.
An interesting experiment would be to build a dynamic list in a program, and then process that list, deleting the top attribute after each loop. Then compare this to using the TCL select, and then the BASIC select.
------------------------------
Marcus Rhodes
marcus1@thinqware.com
Original Message:
Sent: 05-24-2023 12:30
From: Jonathan Smith
Subject: Reading a file without a SELECT list?
Scott,
A SELECT statement against a file variable does not create a SELECT list, where a SELECT file at TCL / ECL does. It process the file group by group (aka hash order) and starts straight away without any delay, there are other limitations around doing this around but that's anthoer discussion.
OPEN "CUSTOMER" TO F.CUSTOMER ELSE ...
SELECT F.CUSTOMER TO 5
EOF = @FALSE
LOOP
READNEXT K.CUSTOMER FROM 5 ELSE EOF = @TRUE
UNTIL EOF DO
...
REPEAT
------------------------------
Jonathan Smith
UniData ATS
Rocket Support
Original Message:
Sent: 05-24-2023 09:47
From: Scott Johnston
Subject: Reading a file without a SELECT list?
I finished my contract last week, so back on the market. I landed an interview with a "recognizable company" and went straight to the final round.
During the interview one of the panel asked me, "How do you read a file without a select list?" I paused for a moment wondering why anyone would need to do that? I thought for a moment and came to the conclusion, it may be possible, but I cannot think of how it could be done. I responded to him, "In the twenty years I've worked in multivalue, I have never seen any code that would do that. But I don't ever recall ever having the need".
Is it possible? Does anyone have an example?
------------------------------
Scott Johnston
Sr Software Engineer, Architect & Developer
Dover DE US
------------------------------