LOOK-UP FILE not working properly

Discussions about CSEntry
Post Reply
dbrals1
Posts: 1
Joined: February 8th, 2016, 7:04 pm

LOOK-UP FILE not working properly

Post by dbrals1 »

Dear CSPro users,

I have a question regarding the look up file. I emailed this question to csprousers@gmail.com too, so sorry for any potential "cross-posting".

In my program I have a Rwand_DICT (main follow_up program) and a BASELINEDATA_DICT (baseline data look up data). This BASELINEDATA_DICT is identical to my baseline.dat file (which I created from an Excel file with help of the BASELINEDATA_DICT and the Excel to Cspro tool). In my case there are no spaces between the 3 baseline variables, but there lenght and position match the BASELINEDATA_DICT. I browsed this BASELINEDATA_DICT in notepad and made sure that it indeed looks the same as the dictionary in my program.

In BASELINEDATA_DICT I have one Id item (HHID_OLD) and two record items (IDCX_OLD and NAME_OLD).

Now what I want and what doesn't work is the following:

The first question in the program is the HHID (located in "master" Rwand_DICT, called HHID, also an Id item). After the interviewer enters this HHID I want either one of the following:
i) an error message saying that this household did not exist in the baseline survey (if HHID does not exist in BASELINEDATA_DICT)
ii) a pop up with the names of the individuals within this household at baseline (if HHID does exist in BASELINEDATA_DICT)

I only got till part i) where I run into the following problem: it doesn't matter whether I fill in a correct or an incorrect HHID; in all cases it says that this HHID didn't exist in the baseline survey.

I used the following logic @ HHID:

PROC HHID

postproc
HHID_OLD=HHID;
OLD_CASE=loadcase(BASELINEDATA_DICT,HHID_OLD);
if not OLD_CASE then
errmsg("INTERVIEWER: HHID DID NOT EXIST IN 2014 SURVEY");
reenter;
endif;


Where OLD_CASE was declared earlier as numeric.

Would you be able and willing to help me? Of course I would be happy to sent you my program or any other files.

Either way, thank you very much!

Greetings,

Daniella
Gregory Martin
Posts: 1796
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: LOOK-UP FILE not working properly

Post by Gregory Martin »

We responded to this by email, but for anyone else reading this, the problem wasn't the logic, but was instead that the lookup file wasn't being attached to the data entry program at runtime.

When running your data entry program from the CSPro Designer, you get a screen where you have to associate files with each of your dictionaries. In this case, Daniella had to specify the file that was created from Excel to CSPro was linked with the BASELINEDATA_DICT dictionary. If you don't do this, CSEntry will still run, but you'll have no cases associated with your dictionary, and so then all loadcase calls will fail.
Post Reply