forcase statement

Discussions about editing and cleaning data
AriSilva
Posts: 162
Joined: July 22nd, 2016, 3:55 pm

forcase statement

Postby AriSilva » May 23rd, 2018, 5:31 pm

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: 1009
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: forcase statement

Postby Gregory Martin » May 24th, 2018, 9:38 am

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: 162
Joined: July 22nd, 2016, 3:55 pm

Re: forcase statement

Postby AriSilva » May 24th, 2018, 11:31 am

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


Return to “Editing”