forcase statement

Discussions about editing and cleaning data
Forum rules
New release: CSPro 8.0
Post Reply
AriSilva
Posts: 591
Joined: July 22nd, 2016, 3:55 pm

forcase statement

Post by AriSilva »

Hi folks,
Is there an order in which the forcase reads the external file?
As far as I tested here, it gets the cases neither in sorted order or in sequential order.
Is there a way to force the forcase to get the cases in a specific order, say, ordered or sequential?
Best
Ari
Best
Ari
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: forcase statement

Post by Gregory Martin »

By default it should be giving you the cases in ascending sorted order. If it is not, that is a bug, and I would like to see your application.

If you want the cases in reverse sorted order, you can do this:

http://www.csprousers.org/help/CSPro/se ... ement.html
AriSilva
Posts: 591
Joined: July 22nd, 2016, 3:55 pm

Re: forcase statement

Post by AriSilva »

Thanks Greg, for your (as always) prompt answer.
The set access statement is good, but I would like to make a couple of comments on that:
1. The help in the forcase statement might have a reference to the set access statement in the "see also"
2. What I really need is another option in the set access, besides descending and ascending. I would suggest "sequential", to be able to read the file in the order the cases were created. If you can read a file in a batch file in the sequential order (the pff parameters allow that, if you do not set it to indexed), and you can also read csdb files in the dataviewer in the sequential order, why not use the sequential order to process files with forcase?

In relation to the order in which the forcase is reading the file, I´m sorry but I could not reproduce the problem, I had a very particular case using the where clause that just returned a single case. After that, using another forcase with the same file, it seemed that the forcase started reading from that case that was returned in the previous one. But as I said, unfortunately I had to change the algorithm to read the external file because I really needed the file being read in the sequential order.

If you are interested, my application has a menu and an interview program, which worked with minor problems (I´ll try to write you afterward detailing them) that I´m trying to understand. Then, I´m writing a second application to return to the field and execute a sample of interviews in the same households (1/10th) to evaluate the quality of the whole system. And to do that I had to select this sample, and prepare a file with the list of the households to be interviewed in the second pass, and give that to the second interviewer. The problem is that this has to be executed in each tract, and I must select not only the single household, but also a set of possible households as "spare", if the selected is not available, or the guy made a mistake and went to the wrong household. So, the list of the first household (the selected) and the spare ones has to processed exactly in the order I created them in the file.
Best
Ari
Best
Ari
Post Reply